mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 19:15:14 -04:00
fix held block being messed up in C client when it spanned more than 1 1D atlases for all faces
This commit is contained in:
parent
0191d02126
commit
aeb146441d
@ -1108,10 +1108,14 @@ static void BlockModel_Flush(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define BlockModel_FlushIfNotSame if (BlockModel_lastTexIndex != BlockModel_texIndex) { BlockModel_Flush(); }
|
#define BlockModel_FlushIfNotSame if (BlockModel_lastTexIndex != BlockModel_texIndex) { BlockModel_Flush(); }
|
||||||
static TextureLoc BlockModel_GetTex(Face face) {
|
static TextureLoc BlockModel_GetTex(Face face, VertexP3fT2fC4b** ptr) {
|
||||||
TextureLoc texLoc = Block_GetTexLoc(BlockModel_block, face);
|
TextureLoc texLoc = Block_GetTexLoc(BlockModel_block, face);
|
||||||
BlockModel_texIndex = Atlas1D_Index(texLoc);
|
BlockModel_texIndex = Atlas1D_Index(texLoc);
|
||||||
BlockModel_FlushIfNotSame;
|
BlockModel_FlushIfNotSame;
|
||||||
|
|
||||||
|
/* Need to reload ptr, in case was flushed */
|
||||||
|
*ptr = &ModelCache_Vertices[BlockModel.index];
|
||||||
|
BlockModel.index += 4;
|
||||||
return texLoc;
|
return texLoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1199,15 +1203,15 @@ static void BlockModel_DrawParts(bool sprite) {
|
|||||||
|
|
||||||
Drawer_Tinted = Block_Tinted[BlockModel_block];
|
Drawer_Tinted = Block_Tinted[BlockModel_block];
|
||||||
Drawer_TintColour = Block_FogCol[BlockModel_block];
|
Drawer_TintColour = Block_FogCol[BlockModel_block];
|
||||||
|
VertexP3fT2fC4b* ptr = NULL;
|
||||||
|
TextureLoc loc;
|
||||||
|
|
||||||
VertexP3fT2fC4b* ptr = &ModelCache_Vertices[BlockModel.index];
|
loc = BlockModel_GetTex(FACE_YMIN, &ptr); Drawer_YMin(1, IModel_Cols[1], loc, &ptr);
|
||||||
Drawer_YMin(1, IModel_Cols[1], BlockModel_GetTex(FACE_YMIN), &ptr);
|
loc = BlockModel_GetTex(FACE_ZMIN, &ptr); Drawer_ZMin(1, IModel_Cols[3], loc, &ptr);
|
||||||
Drawer_ZMin(1, IModel_Cols[3], BlockModel_GetTex(FACE_ZMIN), &ptr);
|
loc = BlockModel_GetTex(FACE_XMAX, &ptr); Drawer_XMax(1, IModel_Cols[5], loc, &ptr);
|
||||||
Drawer_XMax(1, IModel_Cols[5], BlockModel_GetTex(FACE_XMAX), &ptr);
|
loc = BlockModel_GetTex(FACE_ZMAX, &ptr); Drawer_ZMax(1, IModel_Cols[2], loc, &ptr);
|
||||||
Drawer_ZMax(1, IModel_Cols[2], BlockModel_GetTex(FACE_ZMAX), &ptr);
|
loc = BlockModel_GetTex(FACE_XMIN, &ptr); Drawer_XMin(1, IModel_Cols[4], loc, &ptr);
|
||||||
Drawer_XMin(1, IModel_Cols[4], BlockModel_GetTex(FACE_XMIN), &ptr);
|
loc = BlockModel_GetTex(FACE_YMAX, &ptr); Drawer_YMax(1, IModel_Cols[0], loc, &ptr);
|
||||||
Drawer_YMax(1, IModel_Cols[0], BlockModel_GetTex(FACE_YMAX), &ptr);
|
|
||||||
BlockModel.index += 4 * FACE_COUNT;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user