diff --git a/Minecraft.Client/Level/DemoLevel.cpp b/Minecraft.Client/Level/DemoLevel.cpp index 6549de08d..257e4d9c7 100644 --- a/Minecraft.Client/Level/DemoLevel.cpp +++ b/Minecraft.Client/Level/DemoLevel.cpp @@ -10,9 +10,6 @@ DemoLevel::DemoLevel(std::shared_ptr levelStorage, const std::wstring& levelName) : Level(levelStorage, levelName, &DEMO_LEVEL_SETTINGS) {} -DemoLevel::DemoLevel(Level* level, Dimension* dimension) - : Level(level, dimension) {} - void DemoLevel::setInitialSpawn() { levelData->setSpawn(DEMO_SPAWN_X, DEMO_SPAWN_Y, DEMO_SPAWN_Z); } \ No newline at end of file diff --git a/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Render.h b/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Render.h index 737caa98b..79c2420a5 100644 --- a/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Render.h @@ -1,209 +1,223 @@ #pragma once -class ImageFileBuffer -{ +class ImageFileBuffer { public: - enum EImageType - { - e_typePNG, - e_typeJPG - }; + enum EImageType { e_typePNG, e_typeJPG }; - EImageType m_type; - void* m_pBuffer; - int m_bufferSize; + EImageType m_type; + void* m_pBuffer; + int m_bufferSize; - int GetType() { return m_type; } - void *GetBufferPointer() { return m_pBuffer; } - int GetBufferSize() { return m_bufferSize; } - void Release() { free(m_pBuffer); m_pBuffer = NULL; } - bool Allocated() { return m_pBuffer != NULL; } + int GetType() { return m_type; } + void* GetBufferPointer() { return m_pBuffer; } + int GetBufferSize() { return m_bufferSize; } + void Release() { + free(m_pBuffer); + m_pBuffer = NULL; + } + bool Allocated() { return m_pBuffer != NULL; } }; -typedef struct -{ - int Width; - int Height; -}D3DXIMAGE_INFO; +typedef struct { + int Width; + int Height; +} D3DXIMAGE_INFO; typedef struct _XSOCIAL_PREVIEWIMAGE { - BYTE *pBytes; + BYTE* pBytes; DWORD Pitch; DWORD Width; DWORD Height; -// D3DFORMAT Format; + // D3DFORMAT Format; } XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE; -class C4JRender -{ +class C4JRender { public: - void Tick(); - void UpdateGamma(unsigned short usGamma); + void Tick(); + void UpdateGamma(unsigned short usGamma); - // Matrix stack - void MatrixMode(int type); - void MatrixSetIdentity(); - void MatrixTranslate(float x,float y,float z); - void MatrixRotate(float angle, float x, float y, float z); - void MatrixScale(float x, float y, float z); - void MatrixPerspective(float fovy, float aspect, float zNear, float zFar); - void MatrixOrthogonal(float left,float right,float bottom,float top,float zNear,float zFar); - void MatrixPop(); - void MatrixPush(); - void MatrixMult(float *mat); - const float *MatrixGet(int type); - void Set_matrixDirty(); + // Matrix stack + void MatrixMode(int type); + void MatrixSetIdentity(); + void MatrixTranslate(float x, float y, float z); + void MatrixRotate(float angle, float x, float y, float z); + void MatrixScale(float x, float y, float z); + void MatrixPerspective(float fovy, float aspect, float zNear, float zFar); + void MatrixOrthogonal(float left, float right, float bottom, float top, + float zNear, float zFar); + void MatrixPop(); + void MatrixPush(); + void MatrixMult(float* mat); + const float* MatrixGet(int type); + void Set_matrixDirty(); - // Core - void Initialise(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain); - void InitialiseContext(); - void StartFrame(); - void DoScreenGrabOnNextPresent(); - void Present(); - void Clear(int flags, D3D11_RECT *pRect = NULL); - void SetClearColour(const float colourRGBA[4]); - bool IsWidescreen(); - bool IsHiDef(); - void CaptureThumbnail(ImageFileBuffer *pngOut); - void CaptureScreen(ImageFileBuffer *jpgOut, XSOCIAL_PREVIEWIMAGE *previewOut); - void BeginConditionalSurvey(int identifier); - void EndConditionalSurvey(); - void BeginConditionalRendering(int identifier); - void EndConditionalRendering(); + // Core + void Initialise(ID3D11Device* pDevice, IDXGISwapChain* pSwapChain); + void InitialiseContext(); + void StartFrame(); + void DoScreenGrabOnNextPresent(); + void Present(); + void Clear(int flags, D3D11_RECT* pRect = NULL); + void SetClearColour(const float colourRGBA[4]); + bool IsWidescreen(); + bool IsHiDef(); + void CaptureThumbnail(ImageFileBuffer* pngOut); + void CaptureScreen(ImageFileBuffer* jpgOut, + XSOCIAL_PREVIEWIMAGE* previewOut); + void BeginConditionalSurvey(int identifier); + void EndConditionalSurvey(); + void BeginConditionalRendering(int identifier); + void EndConditionalRendering(); - // Vertex data handling - typedef enum - { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD - VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen - VERTEX_TYPE_COUNT - } eVertexType; + // Vertex data handling + typedef enum { + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x + // float, colour 4 x byte, normal 4 x + // byte, padding 1 DWORD + VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of + // VS_PS3_TS2_CS1.hlsl for description of + // layout + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as + // VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 + // with lighting applied, + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as + // VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 + // with tex gen + VERTEX_TYPE_COUNT + } eVertexType; - // Pixel shader - typedef enum - { - PIXEL_SHADER_TYPE_STANDARD, - PIXEL_SHADER_TYPE_PROJECTION, - PIXEL_SHADER_TYPE_FORCELOD, - PIXEL_SHADER_COUNT - } ePixelShaderType; + // Pixel shader + typedef enum { + PIXEL_SHADER_TYPE_STANDARD, + PIXEL_SHADER_TYPE_PROJECTION, + PIXEL_SHADER_TYPE_FORCELOD, + PIXEL_SHADER_COUNT + } ePixelShaderType; - typedef enum - { - VIEWPORT_TYPE_FULLSCREEN, - VIEWPORT_TYPE_SPLIT_TOP, - VIEWPORT_TYPE_SPLIT_BOTTOM, - VIEWPORT_TYPE_SPLIT_LEFT, - VIEWPORT_TYPE_SPLIT_RIGHT, - VIEWPORT_TYPE_QUADRANT_TOP_LEFT, - VIEWPORT_TYPE_QUADRANT_TOP_RIGHT, - VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT, - VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT, - } eViewportType; + typedef enum { + VIEWPORT_TYPE_FULLSCREEN, + VIEWPORT_TYPE_SPLIT_TOP, + VIEWPORT_TYPE_SPLIT_BOTTOM, + VIEWPORT_TYPE_SPLIT_LEFT, + VIEWPORT_TYPE_SPLIT_RIGHT, + VIEWPORT_TYPE_QUADRANT_TOP_LEFT, + VIEWPORT_TYPE_QUADRANT_TOP_RIGHT, + VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT, + VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT, + } eViewportType; - typedef enum - { - PRIMITIVE_TYPE_TRIANGLE_LIST, - PRIMITIVE_TYPE_TRIANGLE_STRIP, - PRIMITIVE_TYPE_TRIANGLE_FAN, - PRIMITIVE_TYPE_QUAD_LIST, - PRIMITIVE_TYPE_LINE_LIST, - PRIMITIVE_TYPE_LINE_STRIP, - PRIMITIVE_TYPE_COUNT - } ePrimitiveType; + typedef enum { + PRIMITIVE_TYPE_TRIANGLE_LIST, + PRIMITIVE_TYPE_TRIANGLE_STRIP, + PRIMITIVE_TYPE_TRIANGLE_FAN, + PRIMITIVE_TYPE_QUAD_LIST, + PRIMITIVE_TYPE_LINE_LIST, + PRIMITIVE_TYPE_LINE_STRIP, + PRIMITIVE_TYPE_COUNT + } ePrimitiveType; - void DrawVertices(ePrimitiveType PrimitiveType, int count, void *dataIn, eVertexType vType, C4JRender::ePixelShaderType psType); - void DrawVertexBuffer(ePrimitiveType PrimitiveType, int count, ID3D11Buffer *buffer, C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType); + void DrawVertices(ePrimitiveType PrimitiveType, int count, void* dataIn, + eVertexType vType, C4JRender::ePixelShaderType psType); + void DrawVertexBuffer(ePrimitiveType PrimitiveType, int count, + ID3D11Buffer* buffer, C4JRender::eVertexType vType, + C4JRender::ePixelShaderType psType); - // Command buffers - void CBuffLockStaticCreations(); - int CBuffCreate(int count); - void CBuffDelete(int first, int count); - void CBuffStart(int index, bool full = false); - void CBuffClear(int index); - int CBuffSize(int index); - void CBuffEnd(); - bool CBuffCall(int index, bool full = true); - void CBuffTick(); - void CBuffDeferredModeStart(); - void CBuffDeferredModeEnd(); + // Command buffers + void CBuffLockStaticCreations(); + int CBuffCreate(int count); + void CBuffDelete(int first, int count); + void CBuffStart(int index, bool full = false); + void CBuffClear(int index); + int CBuffSize(int index); + void CBuffEnd(); + bool CBuffCall(int index, bool full = true); + void CBuffTick(); + void CBuffDeferredModeStart(); + void CBuffDeferredModeEnd(); - typedef enum - { - TEXTURE_FORMAT_RxGyBzAw, // Normal 32-bit RGBA texture, 8 bits per component - /* Don't think these are all directly available on D3D 11 - leaving for now - TEXTURE_FORMAT_R0G0B0Ax, // One 8-bit component mapped to alpha channel, R=G=B=0 - TEXTURE_FORMAT_R1G1B1Ax, // One 8-bit component mapped to alpha channel, R=G=B=1 - TEXTURE_FORMAT_RxGxBxAx, // One 8-bit component mapped to all channels - */ - MAX_TEXTURE_FORMATS - } eTextureFormat; + typedef enum { + TEXTURE_FORMAT_RxGyBzAw, // Normal 32-bit RGBA texture, 8 bits per + // component + /* Don't think these are all directly available on D3D 11 - leaving for + now TEXTURE_FORMAT_R0G0B0Ax, // One 8-bit component mapped to + alpha channel, R=G=B=0 TEXTURE_FORMAT_R1G1B1Ax, // One 8-bit + component mapped to alpha channel, R=G=B=1 TEXTURE_FORMAT_RxGxBxAx, + // One 8-bit component mapped to all channels + */ + MAX_TEXTURE_FORMATS + } eTextureFormat; - // Textures - int TextureCreate(); - void TextureFree(int idx); - void TextureBind(int idx); - void TextureBindVertex(int idx); - void TextureSetTextureLevels(int levels); - int TextureGetTextureLevels(); - void TextureData(int width, int height, void *data, int level, eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw); - void TextureDataUpdate(int xoffset, int yoffset, int width, int height, void *data, int level); - void TextureSetParam(int param, int value); - void TextureDynamicUpdateStart(); - void TextureDynamicUpdateEnd(); - HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); - HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); - HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut); - HRESULT SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn); - void TextureGetStats(); - ID3D11ShaderResourceView *TextureGetTexture(int idx); + // Textures + int TextureCreate(); + void TextureFree(int idx); + void TextureBind(int idx); + void TextureBindVertex(int idx); + void TextureSetTextureLevels(int levels); + int TextureGetTextureLevels(); + void TextureData(int width, int height, void* data, int level, + eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw); + void TextureDataUpdate(int xoffset, int yoffset, int width, int height, + void* data, int level); + void TextureSetParam(int param, int value); + void TextureDynamicUpdateStart(); + void TextureDynamicUpdateEnd(); + HRESULT LoadTextureData(const char* szFilename, D3DXIMAGE_INFO* pSrcInfo, + int** ppDataOut); + HRESULT LoadTextureData(BYTE* pbData, DWORD dwBytes, + D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut); + HRESULT SaveTextureData(const char* szFilename, D3DXIMAGE_INFO* pSrcInfo, + int* ppDataOut); + HRESULT SaveTextureDataToMemory(void* pOutput, int outputCapacity, + int* outputLength, int width, int height, + int* ppDataIn); + void TextureGetStats(); + ID3D11ShaderResourceView* TextureGetTexture(int idx); - // State control - void StateSetColour(float r, float g, float b, float a); - void StateSetDepthMask(bool enable); - void StateSetBlendEnable(bool enable); - void StateSetBlendFunc(int src, int dst); - void StateSetBlendFactor(unsigned int colour); - void StateSetAlphaFunc(int func, float param); - void StateSetDepthFunc(int func); - void StateSetFaceCull(bool enable); - void StateSetFaceCullCW(bool enable); - void StateSetLineWidth(float width); - void StateSetWriteEnable(bool red, bool green, bool blue, bool alpha); - void StateSetDepthTestEnable(bool enable); - void StateSetAlphaTestEnable(bool enable); - void StateSetDepthSlopeAndBias(float slope, float bias); - void StateSetFogEnable(bool enable); - void StateSetFogMode(int mode); - void StateSetFogNearDistance(float dist); - void StateSetFogFarDistance(float dist); - void StateSetFogDensity(float density); - void StateSetFogColour(float red, float green, float blue); - void StateSetLightingEnable(bool enable); - void StateSetVertexTextureUV( float u, float v); - void StateSetLightColour(int light, float red, float green, float blue); - void StateSetLightAmbientColour(float red, float green, float blue); - void StateSetLightDirection(int light, float x, float y, float z); - void StateSetLightEnable(int light, bool enable); - void StateSetViewport(eViewportType viewportType); - void StateSetEnableViewportClipPlanes(bool enable); - void StateSetTexGenCol(int col, float x, float y, float z, float w, bool eyeSpace); - void StateSetStencil(int Function, uint8_t stencil_ref, uint8_t stencil_func_mask, uint8_t stencil_write_mask); - void StateSetForceLOD(int LOD); + // State control + void StateSetColour(float r, float g, float b, float a); + void StateSetDepthMask(bool enable); + void StateSetBlendEnable(bool enable); + void StateSetBlendFunc(int src, int dst); + void StateSetBlendFactor(unsigned int colour); + void StateSetAlphaFunc(int func, float param); + void StateSetDepthFunc(int func); + void StateSetFaceCull(bool enable); + void StateSetFaceCullCW(bool enable); + void StateSetLineWidth(float width); + void StateSetWriteEnable(bool red, bool green, bool blue, bool alpha); + void StateSetDepthTestEnable(bool enable); + void StateSetAlphaTestEnable(bool enable); + void StateSetDepthSlopeAndBias(float slope, float bias); + void StateSetFogEnable(bool enable); + void StateSetFogMode(int mode); + void StateSetFogNearDistance(float dist); + void StateSetFogFarDistance(float dist); + void StateSetFogDensity(float density); + void StateSetFogColour(float red, float green, float blue); + void StateSetLightingEnable(bool enable); + void StateSetVertexTextureUV(float u, float v); + void StateSetLightColour(int light, float red, float green, float blue); + void StateSetLightAmbientColour(float red, float green, float blue); + void StateSetLightDirection(int light, float x, float y, float z); + void StateSetLightEnable(int light, bool enable); + void StateSetViewport(eViewportType viewportType); + void StateSetEnableViewportClipPlanes(bool enable); + void StateSetTexGenCol(int col, float x, float y, float z, float w, + bool eyeSpace); + void StateSetStencil(int Function, uint8_t stencil_ref, + uint8_t stencil_func_mask, uint8_t stencil_write_mask); + void StateSetForceLOD(int LOD); - // Event tracking - void BeginEvent(LPCWSTR eventName); - void EndEvent(); + // Event tracking + void BeginEvent(LPCWSTR eventName); + void EndEvent(); - // PLM event handling - void Suspend(); - bool Suspended(); - void Resume(); + // PLM event handling + void Suspend(); + bool Suspended(); + void Resume(); }; - const int GL_MODELVIEW_MATRIX = 0; const int GL_PROJECTION_MATRIX = 1; const int GL_MODELVIEW = 0; @@ -228,8 +242,8 @@ const int GL_EYE_LINEAR = 1; const int GL_OBJECT_PLANE = 0; const int GL_EYE_PLANE = 1; - -// These things are used by glEnable/glDisable so must be different and non-zero (zero is used by things we haven't assigned yet) +// These things are used by glEnable/glDisable so must be different and non-zero +// (zero is used by things we haven't assigned yet) const int GL_TEXTURE_2D = 1; const int GL_BLEND = 2; const int GL_CULL_FACE = 3; @@ -272,7 +286,7 @@ const int GL_TEXTURE_WRAP_T = 4; const int GL_NEAREST = 0; const int GL_LINEAR = 1; const int GL_EXP = 2; -const int GL_NEAREST_MIPMAP_LINEAR = 0; // TODO - mipmapping bit of this +const int GL_NEAREST_MIPMAP_LINEAR = 0; // TODO - mipmapping bit of this const int GL_CLAMP = 0; const int GL_REPEAT = 1; @@ -298,5 +312,3 @@ const int GL_TRIANGLE_STRIP = C4JRender::PRIMITIVE_TYPE_TRIANGLE_STRIP; // Singleton extern C4JRender RenderManager; - - diff --git a/Minecraft.Client/Rendering/EntityRenderers/PistonPieceRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/PistonPieceRenderer.cpp index 1bc927694..77fe5f46a 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/PistonPieceRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/PistonPieceRenderer.cpp @@ -5,7 +5,7 @@ #include "../../Textures/TextureAtlas.h" #include "TileRenderer.h" #include "../../../Minecraft.World/Headers/net.minecraft.world.level.h" -#include "../Minecraft.World/PistonPieceTileEntity.h" +#include "../../../Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.h" #include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h" ResourceLocation PistonPieceRenderer::SIGN_LOCATION = diff --git a/Minecraft.Client/Textures/Packs/TexturePack.h b/Minecraft.Client/Textures/Packs/TexturePack.h index cbd7f649b..dc18576ee 100644 --- a/Minecraft.Client/Textures/Packs/TexturePack.h +++ b/Minecraft.Client/Textures/Packs/TexturePack.h @@ -43,7 +43,8 @@ return TexturePack.class.getResourceAsStream(name); virtual DLCPack* getDLCPack() { return NULL; } // 4J Added - virtual std::wstring getPath(bool bTitleUpdateTexture = false); + virtual std::wstring getPath(bool bTitleUpdateTexture = false, + const char* pchBDPatchFilename = NULL); virtual std::wstring getAnimationString(const std::wstring& textureName, const std::wstring& path, bool allowFallback) = 0; diff --git a/Minecraft.Client/Textures/Textures.cpp b/Minecraft.Client/Textures/Textures.cpp index 44a240962..0470caac5 100644 --- a/Minecraft.Client/Textures/Textures.cpp +++ b/Minecraft.Client/Textures/Textures.cpp @@ -8,7 +8,7 @@ #include "../../Minecraft.World/IO/Streams/ByteBuffer.h" #include "Packs/TexturePack.h" #include "../GameState/Options.h" -#include "../Minecraft.Client/MemTextureProcessor.h" +#include "../../Minecraft.Client/Textures/MemTextureProcessor.h" #include "MobSkinMemTextureProcessor.h" #include "Stitching/PreStitchedTextureMap.h" #include "Stitching/StitchedTexture.h" @@ -409,9 +409,9 @@ void Textures::bindTexture(const std::wstring& resourceName) { // 4J Added void Textures::bindTexture(ResourceLocation* resource) { if (resource->isPreloaded()) { - std::bind(loadTexture(resource->getTexture())); + bind(loadTexture(resource->getTexture())); } else { - std::bind(loadTexture(TN_COUNT, resource->getPath())); + bind(loadTexture(TN_COUNT, resource->getPath())); } } @@ -421,6 +421,7 @@ void Textures::bindTextureLayers(ResourceLocation* resource) { int layers = resource->getTextureCount(); for (int i = 0; i < layers; i++) { + assert(0 && "todo: implement 2-argument TextureBind"); RenderManager.TextureBind(i, loadTexture(resource->getTexture(i))); } } diff --git a/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp b/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp index a0eb22ed0..c942f3e2a 100644 --- a/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp +++ b/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp @@ -49,9 +49,9 @@ void AbstractContainerScreen::render(int xm, int ym, float a) { Slot* hoveredSlot = NULL; - AUTO_VAR(itEnd, menu->slots->end()); - for (AUTO_VAR(it, menu->slots->begin()); it != itEnd; it++) { - Slot* slot = *it; // menu->slots->at(i); + AUTO_VAR(itEnd, menu->slots.end()); + for (AUTO_VAR(it, menu->slots.begin()); it != itEnd; it++) { + Slot* slot = *it; // menu->slots.at(i); renderSlot(slot); @@ -266,9 +266,9 @@ void AbstractContainerScreen::renderSlot(Slot* slot) { } Slot* AbstractContainerScreen::findSlot(int x, int y) { - AUTO_VAR(itEnd, menu->slots->end()); - for (AUTO_VAR(it, menu->slots->begin()); it != itEnd; it++) { - Slot* slot = *it; // menu->slots->at(i); + AUTO_VAR(itEnd, menu->slots.end()); + for (AUTO_VAR(it, menu->slots.begin()); it != itEnd; it++) { + Slot* slot = *it; // menu->slots.at(i); if (isHovering(slot, x, y)) return slot; } return NULL; @@ -298,11 +298,11 @@ void AbstractContainerScreen::mouseClicked(int x, int y, int buttonNum) { if (slot != NULL) slotId = slot->index; if (clickedOutside) { - slotId = AbstractContainerMenu::CLICKED_OUTSIDE; + slotId = AbstractContainerMenu::SLOT_CLICKED_OUTSIDE; } if (slotId != -1) { - bool quickKey = slotId != AbstractContainerMenu::CLICKED_OUTSIDE && + bool quickKey = slotId != AbstractContainerMenu::SLOT_CLICKED_OUTSIDE && (Keyboard::isKeyDown(Keyboard::KEY_LSHIFT) || Keyboard::isKeyDown(Keyboard::KEY_RSHIFT)); minecraft->gameMode->handleInventoryMouseClick( diff --git a/Minecraft.Client/UI/Screens/CreativeInventoryScreen.cpp b/Minecraft.Client/UI/Screens/CreativeInventoryScreen.cpp index f3da3066c..5e431ed2b 100644 --- a/Minecraft.Client/UI/Screens/CreativeInventoryScreen.cpp +++ b/Minecraft.Client/UI/Screens/CreativeInventoryScreen.cpp @@ -52,7 +52,7 @@ std::shared_ptr CreativeInventoryScreen::ContainerCreative::clicke std::shared_ptr carried = inventory->getCarried(); // Handle clicks outside the GUI - if (slotIndex == CLICKED_OUTSIDE) + if (slotIndex == SLOT_CLICKED_OUTSIDE) { // Drop the carried item if (carried != NULL) diff --git a/Minecraft.Client/meson.build b/Minecraft.Client/meson.build index e7f1b559e..eacb6fd20 100644 --- a/Minecraft.Client/meson.build +++ b/Minecraft.Client/meson.build @@ -1,9 +1,18 @@ +exclude_sources = [ + ' ! -path "*/Platform/*"', # added by platform_sources + ' ! -name "SurvivalMode.cpp"', + ' ! -name "CreativeMode.cpp"', + ' ! -name "GameMode.cpp"', + ' ! -name "PreStitchedTextureMap.cpp"' +] + # all sources except ./Platform/* client_sources = run_command( 'sh', '-c', 'find "' + meson.current_source_dir() - + '" \\( -name "*.cpp" -o -name "*.c" \\) ! -path "*/Platform/*"', + + '" \\( -name "*.cpp" -o -name "*.c" \\)' + + ' '.join(exclude_sources), check : true, ).stdout().strip().split('\n') @@ -22,9 +31,6 @@ exclude_platform_common_sources = [ ' ! -path "*/XUI/*"', # we use system zlib instead, since this one is old as hell and isn't configured for linux correctly ' ! -path "*/zlib/*"', - ' ! -name "SurvivalMode.cpp"', - ' ! -name "CreativeMode.cpp"', - ' ! -name "GameMode.cpp"', ] # all sources in in ./Platform/Common