mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-22 17:12:25 -05:00
more minor style tidyup
This commit is contained in:
parent
dc8381d76b
commit
18b09bcfad
7 changed files with 30 additions and 43 deletions
|
@ -28,7 +28,6 @@ static int Builder_X, Builder_Y, Builder_Z;
|
||||||
static BlockID Builder_Block;
|
static BlockID Builder_Block;
|
||||||
static int Builder_ChunkIndex;
|
static int Builder_ChunkIndex;
|
||||||
static cc_bool Builder_FullBright;
|
static cc_bool Builder_FullBright;
|
||||||
static cc_bool Builder_Tinted;
|
|
||||||
static int Builder_ChunkEndX, Builder_ChunkEndZ;
|
static int Builder_ChunkEndX, Builder_ChunkEndZ;
|
||||||
static int Builder_Offsets[FACE_COUNT] = { -1,1, -EXTCHUNK_SIZE,EXTCHUNK_SIZE, -EXTCHUNK_SIZE_2,EXTCHUNK_SIZE_2 };
|
static int Builder_Offsets[FACE_COUNT] = { -1,1, -EXTCHUNK_SIZE,EXTCHUNK_SIZE, -EXTCHUNK_SIZE_2,EXTCHUNK_SIZE_2 };
|
||||||
|
|
||||||
|
@ -468,9 +467,8 @@ static RNGState spriteRng;
|
||||||
static void Builder_DrawSprite(int x, int y, int z) {
|
static void Builder_DrawSprite(int x, int y, int z) {
|
||||||
struct Builder1DPart* part;
|
struct Builder1DPart* part;
|
||||||
struct VertexTextured v;
|
struct VertexTextured v;
|
||||||
PackedCol white = PACKEDCOL_WHITE;
|
|
||||||
|
|
||||||
cc_uint8 offsetType;
|
cc_uint8 offsetType;
|
||||||
|
cc_bool bright;
|
||||||
TextureLoc loc;
|
TextureLoc loc;
|
||||||
float v1, v2;
|
float v1, v2;
|
||||||
int index;
|
int index;
|
||||||
|
@ -501,8 +499,9 @@ static void Builder_DrawSprite(int x, int y, int z) {
|
||||||
if (offsetType == 7) { y1 -= valY; y2 -= valY; }
|
if (offsetType == 7) { y1 -= valY; y2 -= valY; }
|
||||||
}
|
}
|
||||||
|
|
||||||
part = &Builder_Parts[Atlas1D_Index(loc)];
|
bright = Blocks.FullBright[Builder_Block];
|
||||||
v.Col = Builder_FullBright ? white : Lighting_Col_Sprite_Fast(x, y, z);
|
part = &Builder_Parts[Atlas1D_Index(loc)];
|
||||||
|
v.Col = bright ? PACKEDCOL_WHITE : Lighting_Col_Sprite_Fast(x, y, z);
|
||||||
Block_Tint(v.Col, Builder_Block);
|
Block_Tint(v.Col, Builder_Block);
|
||||||
|
|
||||||
/* Draw Z axis */
|
/* Draw Z axis */
|
||||||
|
@ -631,7 +630,6 @@ static void NormalBuilder_RenderBlock(int index, int x, int y, int z) {
|
||||||
int count_ZMax, count_YMin, count_YMax;
|
int count_ZMax, count_YMin, count_YMax;
|
||||||
|
|
||||||
/* block state */
|
/* block state */
|
||||||
PackedCol white = PACKEDCOL_WHITE;
|
|
||||||
Vec3 min, max;
|
Vec3 min, max;
|
||||||
int baseOffset, lightFlags;
|
int baseOffset, lightFlags;
|
||||||
cc_bool fullBright;
|
cc_bool fullBright;
|
||||||
|
@ -643,10 +641,7 @@ static void NormalBuilder_RenderBlock(int index, int x, int y, int z) {
|
||||||
int offset;
|
int offset;
|
||||||
|
|
||||||
if (Blocks.Draw[Builder_Block] == DRAW_SPRITE) {
|
if (Blocks.Draw[Builder_Block] == DRAW_SPRITE) {
|
||||||
Builder_FullBright = Blocks.FullBright[Builder_Block];
|
Builder_DrawSprite(x, y, z); return;
|
||||||
Builder_Tinted = Blocks.Tinted[Builder_Block];
|
|
||||||
Builder_DrawSprite(x, y, z);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
count_XMin = Builder_Counts[index + FACE_XMIN];
|
count_XMin = Builder_Counts[index + FACE_XMIN];
|
||||||
|
@ -678,7 +673,7 @@ static void NormalBuilder_RenderBlock(int index, int x, int y, int z) {
|
||||||
offset = (lightFlags >> FACE_XMIN) & 1;
|
offset = (lightFlags >> FACE_XMIN) & 1;
|
||||||
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
||||||
|
|
||||||
col = fullBright ? white :
|
col = fullBright ? PACKEDCOL_WHITE :
|
||||||
x >= offset ? Lighting_Col_XSide_Fast(x - offset, y, z) : Env.SunXSide;
|
x >= offset ? Lighting_Col_XSide_Fast(x - offset, y, z) : Env.SunXSide;
|
||||||
Drawer_XMin(count_XMin, col, loc, &part->fVertices[FACE_XMIN]);
|
Drawer_XMin(count_XMin, col, loc, &part->fVertices[FACE_XMIN]);
|
||||||
}
|
}
|
||||||
|
@ -688,7 +683,7 @@ static void NormalBuilder_RenderBlock(int index, int x, int y, int z) {
|
||||||
offset = (lightFlags >> FACE_XMAX) & 1;
|
offset = (lightFlags >> FACE_XMAX) & 1;
|
||||||
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
||||||
|
|
||||||
col = fullBright ? white :
|
col = fullBright ? PACKEDCOL_WHITE :
|
||||||
x <= (World.MaxX - offset) ? Lighting_Col_XSide_Fast(x + offset, y, z) : Env.SunXSide;
|
x <= (World.MaxX - offset) ? Lighting_Col_XSide_Fast(x + offset, y, z) : Env.SunXSide;
|
||||||
Drawer_XMax(count_XMax, col, loc, &part->fVertices[FACE_XMAX]);
|
Drawer_XMax(count_XMax, col, loc, &part->fVertices[FACE_XMAX]);
|
||||||
}
|
}
|
||||||
|
@ -698,7 +693,7 @@ static void NormalBuilder_RenderBlock(int index, int x, int y, int z) {
|
||||||
offset = (lightFlags >> FACE_ZMIN) & 1;
|
offset = (lightFlags >> FACE_ZMIN) & 1;
|
||||||
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
||||||
|
|
||||||
col = fullBright ? white :
|
col = fullBright ? PACKEDCOL_WHITE :
|
||||||
z >= offset ? Lighting_Col_ZSide_Fast(x, y, z - offset) : Env.SunZSide;
|
z >= offset ? Lighting_Col_ZSide_Fast(x, y, z - offset) : Env.SunZSide;
|
||||||
Drawer_ZMin(count_ZMin, col, loc, &part->fVertices[FACE_ZMIN]);
|
Drawer_ZMin(count_ZMin, col, loc, &part->fVertices[FACE_ZMIN]);
|
||||||
}
|
}
|
||||||
|
@ -708,7 +703,7 @@ static void NormalBuilder_RenderBlock(int index, int x, int y, int z) {
|
||||||
offset = (lightFlags >> FACE_ZMAX) & 1;
|
offset = (lightFlags >> FACE_ZMAX) & 1;
|
||||||
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
||||||
|
|
||||||
col = fullBright ? white :
|
col = fullBright ? PACKEDCOL_WHITE :
|
||||||
z <= (World.MaxZ - offset) ? Lighting_Col_ZSide_Fast(x, y, z + offset) : Env.SunZSide;
|
z <= (World.MaxZ - offset) ? Lighting_Col_ZSide_Fast(x, y, z + offset) : Env.SunZSide;
|
||||||
Drawer_ZMax(count_ZMax, col, loc, &part->fVertices[FACE_ZMAX]);
|
Drawer_ZMax(count_ZMax, col, loc, &part->fVertices[FACE_ZMAX]);
|
||||||
}
|
}
|
||||||
|
@ -718,7 +713,7 @@ static void NormalBuilder_RenderBlock(int index, int x, int y, int z) {
|
||||||
offset = (lightFlags >> FACE_YMIN) & 1;
|
offset = (lightFlags >> FACE_YMIN) & 1;
|
||||||
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
||||||
|
|
||||||
col = fullBright ? white : Lighting_Col_YMin_Fast(x, y - offset, z);
|
col = fullBright ? PACKEDCOL_WHITE : Lighting_Col_YMin_Fast(x, y - offset, z);
|
||||||
Drawer_YMin(count_YMin, col, loc, &part->fVertices[FACE_YMIN]);
|
Drawer_YMin(count_YMin, col, loc, &part->fVertices[FACE_YMIN]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,7 +722,7 @@ static void NormalBuilder_RenderBlock(int index, int x, int y, int z) {
|
||||||
offset = (lightFlags >> FACE_YMAX) & 1;
|
offset = (lightFlags >> FACE_YMAX) & 1;
|
||||||
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
part = &Builder_Parts[baseOffset + Atlas1D_Index(loc)];
|
||||||
|
|
||||||
col = fullBright ? white : Lighting_Col_YMax_Fast(x, (y + 1) - offset, z);
|
col = fullBright ? PACKEDCOL_WHITE : Lighting_Col_YMax_Fast(x, (y + 1) - offset, z);
|
||||||
Drawer_YMax(count_YMax, col, loc, &part->fVertices[FACE_YMAX]);
|
Drawer_YMax(count_YMax, col, loc, &part->fVertices[FACE_YMAX]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -760,6 +755,7 @@ static int adv_initBitFlags, adv_lightFlags, adv_baseOffset;
|
||||||
static int* adv_bitFlags;
|
static int* adv_bitFlags;
|
||||||
static float adv_x1, adv_y1, adv_z1, adv_x2, adv_y2, adv_z2;
|
static float adv_x1, adv_y1, adv_z1, adv_x2, adv_y2, adv_z2;
|
||||||
static PackedCol adv_lerp[5], adv_lerpX[5], adv_lerpZ[5], adv_lerpY[5];
|
static PackedCol adv_lerp[5], adv_lerpX[5], adv_lerpZ[5], adv_lerpY[5];
|
||||||
|
static cc_bool adv_tinted;
|
||||||
|
|
||||||
enum ADV_MASK {
|
enum ADV_MASK {
|
||||||
/* z-1 cube points */
|
/* z-1 cube points */
|
||||||
|
@ -950,7 +946,7 @@ static void Adv_DrawXMin(int count) {
|
||||||
PackedCol col1_1 = Builder_FullBright ? white : adv_lerpX[aY1_Z1], col0_1 = Builder_FullBright ? white : adv_lerpX[aY0_Z1];
|
PackedCol col1_1 = Builder_FullBright ? white : adv_lerpX[aY1_Z1], col0_1 = Builder_FullBright ? white : adv_lerpX[aY0_Z1];
|
||||||
struct VertexTextured* vertices, v;
|
struct VertexTextured* vertices, v;
|
||||||
|
|
||||||
if (Builder_Tinted) {
|
if (adv_tinted) {
|
||||||
tint = Blocks.FogCol[Builder_Block];
|
tint = Blocks.FogCol[Builder_Block];
|
||||||
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
||||||
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
||||||
|
@ -992,7 +988,7 @@ static void Adv_DrawXMax(int count) {
|
||||||
PackedCol col1_1 = Builder_FullBright ? white : adv_lerpX[aY1_Z1], col0_1 = Builder_FullBright ? white : adv_lerpX[aY0_Z1];
|
PackedCol col1_1 = Builder_FullBright ? white : adv_lerpX[aY1_Z1], col0_1 = Builder_FullBright ? white : adv_lerpX[aY0_Z1];
|
||||||
struct VertexTextured* vertices, v;
|
struct VertexTextured* vertices, v;
|
||||||
|
|
||||||
if (Builder_Tinted) {
|
if (adv_tinted) {
|
||||||
tint = Blocks.FogCol[Builder_Block];
|
tint = Blocks.FogCol[Builder_Block];
|
||||||
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
||||||
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
||||||
|
@ -1034,7 +1030,7 @@ static void Adv_DrawZMin(int count) {
|
||||||
PackedCol col1_1 = Builder_FullBright ? white : adv_lerpZ[aX1_Y1], col0_1 = Builder_FullBright ? white : adv_lerpZ[aX0_Y1];
|
PackedCol col1_1 = Builder_FullBright ? white : adv_lerpZ[aX1_Y1], col0_1 = Builder_FullBright ? white : adv_lerpZ[aX0_Y1];
|
||||||
struct VertexTextured* vertices, v;
|
struct VertexTextured* vertices, v;
|
||||||
|
|
||||||
if (Builder_Tinted) {
|
if (adv_tinted) {
|
||||||
tint = Blocks.FogCol[Builder_Block];
|
tint = Blocks.FogCol[Builder_Block];
|
||||||
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
||||||
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
||||||
|
@ -1076,7 +1072,7 @@ static void Adv_DrawZMax(int count) {
|
||||||
PackedCol col0_0 = Builder_FullBright ? white : adv_lerpZ[aX0_Y0], col0_1 = Builder_FullBright ? white : adv_lerpZ[aX0_Y1];
|
PackedCol col0_0 = Builder_FullBright ? white : adv_lerpZ[aX0_Y0], col0_1 = Builder_FullBright ? white : adv_lerpZ[aX0_Y1];
|
||||||
struct VertexTextured* vertices, v;
|
struct VertexTextured* vertices, v;
|
||||||
|
|
||||||
if (Builder_Tinted) {
|
if (adv_tinted) {
|
||||||
tint = Blocks.FogCol[Builder_Block];
|
tint = Blocks.FogCol[Builder_Block];
|
||||||
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
||||||
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
||||||
|
@ -1118,7 +1114,7 @@ static void Adv_DrawYMin(int count) {
|
||||||
PackedCol col1_0 = Builder_FullBright ? white : adv_lerpY[aX1_Z0], col0_0 = Builder_FullBright ? white : adv_lerpY[aX0_Z0];
|
PackedCol col1_0 = Builder_FullBright ? white : adv_lerpY[aX1_Z0], col0_0 = Builder_FullBright ? white : adv_lerpY[aX0_Z0];
|
||||||
struct VertexTextured* vertices, v;
|
struct VertexTextured* vertices, v;
|
||||||
|
|
||||||
if (Builder_Tinted) {
|
if (adv_tinted) {
|
||||||
tint = Blocks.FogCol[Builder_Block];
|
tint = Blocks.FogCol[Builder_Block];
|
||||||
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
||||||
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
||||||
|
@ -1160,7 +1156,7 @@ static void Adv_DrawYMax(int count) {
|
||||||
PackedCol col1_1 = Builder_FullBright ? white : adv_lerp[aX1_Z1], col0_1 = Builder_FullBright ? white : adv_lerp[aX0_Z1];
|
PackedCol col1_1 = Builder_FullBright ? white : adv_lerp[aX1_Z1], col0_1 = Builder_FullBright ? white : adv_lerp[aX0_Z1];
|
||||||
struct VertexTextured* vertices, v;
|
struct VertexTextured* vertices, v;
|
||||||
|
|
||||||
if (Builder_Tinted) {
|
if (adv_tinted) {
|
||||||
tint = Blocks.FogCol[Builder_Block];
|
tint = Blocks.FogCol[Builder_Block];
|
||||||
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
col0_0 = PackedCol_Tint(col0_0, tint); col1_0 = PackedCol_Tint(col1_0, tint);
|
||||||
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
col1_1 = PackedCol_Tint(col1_1, tint); col0_1 = PackedCol_Tint(col0_1, tint);
|
||||||
|
@ -1188,10 +1184,7 @@ static void Adv_RenderBlock(int index, int x, int y, int z) {
|
||||||
int count_ZMax, count_YMin, count_YMax;
|
int count_ZMax, count_YMin, count_YMax;
|
||||||
|
|
||||||
if (Blocks.Draw[Builder_Block] == DRAW_SPRITE) {
|
if (Blocks.Draw[Builder_Block] == DRAW_SPRITE) {
|
||||||
Builder_FullBright = Blocks.FullBright[Builder_Block];
|
Builder_DrawSprite(x, y, z); return;
|
||||||
Builder_Tinted = Blocks.Tinted[Builder_Block];
|
|
||||||
Builder_DrawSprite(x, y, z);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
count_XMin = Builder_Counts[index + FACE_XMIN];
|
count_XMin = Builder_Counts[index + FACE_XMIN];
|
||||||
|
@ -1207,7 +1200,7 @@ static void Adv_RenderBlock(int index, int x, int y, int z) {
|
||||||
Builder_FullBright = Blocks.FullBright[Builder_Block];
|
Builder_FullBright = Blocks.FullBright[Builder_Block];
|
||||||
adv_baseOffset = (Blocks.Draw[Builder_Block] == DRAW_TRANSLUCENT) * ATLAS1D_MAX_ATLASES;
|
adv_baseOffset = (Blocks.Draw[Builder_Block] == DRAW_TRANSLUCENT) * ATLAS1D_MAX_ATLASES;
|
||||||
adv_lightFlags = Blocks.LightOffset[Builder_Block];
|
adv_lightFlags = Blocks.LightOffset[Builder_Block];
|
||||||
Builder_Tinted = Blocks.Tinted[Builder_Block];
|
adv_tinted = Blocks.Tinted[Builder_Block];
|
||||||
|
|
||||||
min = Blocks.RenderMinBB[Builder_Block]; max = Blocks.RenderMaxBB[Builder_Block];
|
min = Blocks.RenderMinBB[Builder_Block]; max = Blocks.RenderMaxBB[Builder_Block];
|
||||||
adv_x1 = x + min.X; adv_y1 = y + min.Y; adv_z1 = z + min.Z;
|
adv_x1 = x + min.X; adv_y1 = y + min.Y; adv_z1 = z + min.Z;
|
||||||
|
|
|
@ -272,8 +272,6 @@ static void MakeNameTexture(struct Entity* e) {
|
||||||
|
|
||||||
static void DrawName(struct Entity* e) {
|
static void DrawName(struct Entity* e) {
|
||||||
struct VertexTextured vertices[4];
|
struct VertexTextured vertices[4];
|
||||||
PackedCol col = PACKEDCOL_WHITE;
|
|
||||||
|
|
||||||
struct Model* model;
|
struct Model* model;
|
||||||
struct Matrix mat;
|
struct Matrix mat;
|
||||||
Vec3 pos;
|
Vec3 pos;
|
||||||
|
@ -298,7 +296,7 @@ static void DrawName(struct Entity* e) {
|
||||||
size.X *= scale * 0.2f; size.Y *= scale * 0.2f;
|
size.X *= scale * 0.2f; size.Y *= scale * 0.2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
Particle_DoRender(&size, &pos, &e->NameTex.uv, col, vertices);
|
Particle_DoRender(&size, &pos, &e->NameTex.uv, PACKEDCOL_WHITE, vertices);
|
||||||
Gfx_SetVertexFormat(VERTEX_FORMAT_TEXTURED);
|
Gfx_SetVertexFormat(VERTEX_FORMAT_TEXTURED);
|
||||||
Gfx_UpdateDynamicVb_IndexedTris(Gfx_texVb, vertices, 4);
|
Gfx_UpdateDynamicVb_IndexedTris(Gfx_texVb, vertices, 4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -664,7 +664,7 @@ static void DrawBorderY(int x1, int z1, int x2, int z2, float y, PackedCol col,
|
||||||
static void UpdateMapSides(void) {
|
static void UpdateMapSides(void) {
|
||||||
Rect2D rects[4], r;
|
Rect2D rects[4], r;
|
||||||
BlockID block;
|
BlockID block;
|
||||||
PackedCol col, white = PACKEDCOL_WHITE;
|
PackedCol col;
|
||||||
int y, y1, y2;
|
int y, y1, y2;
|
||||||
int i;
|
int i;
|
||||||
struct VertexTextured* data;
|
struct VertexTextured* data;
|
||||||
|
@ -690,7 +690,7 @@ static void UpdateMapSides(void) {
|
||||||
VERTEX_FORMAT_TEXTURED, sides_vertices);
|
VERTEX_FORMAT_TEXTURED, sides_vertices);
|
||||||
|
|
||||||
sides_fullBright = Blocks.FullBright[block];
|
sides_fullBright = Blocks.FullBright[block];
|
||||||
col = sides_fullBright ? white : Env.ShadowCol;
|
col = sides_fullBright ? PACKEDCOL_WHITE : Env.ShadowCol;
|
||||||
Block_Tint(col, block)
|
Block_Tint(col, block)
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
|
@ -715,7 +715,7 @@ static void UpdateMapSides(void) {
|
||||||
static void UpdateMapEdges(void) {
|
static void UpdateMapEdges(void) {
|
||||||
Rect2D rects[4], r;
|
Rect2D rects[4], r;
|
||||||
BlockID block;
|
BlockID block;
|
||||||
PackedCol col, white = PACKEDCOL_WHITE;
|
PackedCol col;
|
||||||
float y;
|
float y;
|
||||||
int i;
|
int i;
|
||||||
struct VertexTextured* data;
|
struct VertexTextured* data;
|
||||||
|
@ -736,7 +736,7 @@ static void UpdateMapEdges(void) {
|
||||||
VERTEX_FORMAT_TEXTURED, edges_vertices);
|
VERTEX_FORMAT_TEXTURED, edges_vertices);
|
||||||
|
|
||||||
edges_fullBright = Blocks.FullBright[block];
|
edges_fullBright = Blocks.FullBright[block];
|
||||||
col = edges_fullBright ? white : Env.SunCol;
|
col = edges_fullBright ? PACKEDCOL_WHITE : Env.SunCol;
|
||||||
Block_Tint(col, block)
|
Block_Tint(col, block)
|
||||||
|
|
||||||
y = (float)Env.EdgeHeight;
|
y = (float)Env.EdgeHeight;
|
||||||
|
|
|
@ -298,9 +298,8 @@ static CC_NOINLINE int CalcMipmapsLevels(int width, int height) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Texture_Render(const struct Texture* tex) {
|
void Texture_Render(const struct Texture* tex) {
|
||||||
PackedCol white = PACKEDCOL_WHITE;
|
|
||||||
Gfx_BindTexture(tex->ID);
|
Gfx_BindTexture(tex->ID);
|
||||||
Gfx_Draw2DTexture(tex, white);
|
Gfx_Draw2DTexture(tex, PACKEDCOL_WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Texture_RenderShaded(const struct Texture* tex, PackedCol shadeCol) {
|
void Texture_RenderShaded(const struct Texture* tex, PackedCol shadeCol) {
|
||||||
|
|
|
@ -322,15 +322,14 @@ void TextAtlas_Free(struct TextAtlas* atlas) { Gfx_DeleteTexture(&atlas->tex.ID)
|
||||||
|
|
||||||
void TextAtlas_Add(struct TextAtlas* atlas, int charI, struct VertexTextured** vertices) {
|
void TextAtlas_Add(struct TextAtlas* atlas, int charI, struct VertexTextured** vertices) {
|
||||||
struct Texture part = atlas->tex;
|
struct Texture part = atlas->tex;
|
||||||
int width = atlas->widths[charI];
|
int width = atlas->widths[charI];
|
||||||
PackedCol white = PACKEDCOL_WHITE;
|
|
||||||
|
|
||||||
part.X = atlas->curX; part.Width = width;
|
part.X = atlas->curX; part.Width = width;
|
||||||
part.uv.U1 = atlas->offsets[charI] * atlas->uScale;
|
part.uv.U1 = atlas->offsets[charI] * atlas->uScale;
|
||||||
part.uv.U2 = part.uv.U1 + width * atlas->uScale;
|
part.uv.U2 = part.uv.U1 + width * atlas->uScale;
|
||||||
|
|
||||||
atlas->curX += width;
|
atlas->curX += width;
|
||||||
Gfx_Make2DQuad(&part, white, vertices);
|
Gfx_Make2DQuad(&part, PACKEDCOL_WHITE, vertices);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextAtlas_AddInt(struct TextAtlas* atlas, int value, struct VertexTextured** vertices) {
|
void TextAtlas_AddInt(struct TextAtlas* atlas, int value, struct VertexTextured** vertices) {
|
||||||
|
|
|
@ -105,7 +105,6 @@ static void HUDScreen_UpdateLine1(struct HUDScreen* s) {
|
||||||
static void HUDScreen_DrawPosition(struct HUDScreen* s) {
|
static void HUDScreen_DrawPosition(struct HUDScreen* s) {
|
||||||
struct VertexTextured vertices[4 * 64];
|
struct VertexTextured vertices[4 * 64];
|
||||||
struct VertexTextured* ptr = vertices;
|
struct VertexTextured* ptr = vertices;
|
||||||
PackedCol col = PACKEDCOL_WHITE;
|
|
||||||
|
|
||||||
struct TextAtlas* atlas = &s->posAtlas;
|
struct TextAtlas* atlas = &s->posAtlas;
|
||||||
struct Texture tex;
|
struct Texture tex;
|
||||||
|
@ -115,7 +114,7 @@ static void HUDScreen_DrawPosition(struct HUDScreen* s) {
|
||||||
/* Make "Position: " prefix */
|
/* Make "Position: " prefix */
|
||||||
tex = atlas->tex;
|
tex = atlas->tex;
|
||||||
tex.X = 2; tex.Width = atlas->offset;
|
tex.X = 2; tex.Width = atlas->offset;
|
||||||
Gfx_Make2DQuad(&tex, col, &ptr);
|
Gfx_Make2DQuad(&tex, PACKEDCOL_WHITE, &ptr);
|
||||||
|
|
||||||
IVec3_Floor(&pos, &LocalPlayer_Instance.Base.Position);
|
IVec3_Floor(&pos, &LocalPlayer_Instance.Base.Position);
|
||||||
atlas->curX = atlas->offset + 2;
|
atlas->curX = atlas->offset + 2;
|
||||||
|
|
|
@ -392,7 +392,6 @@ void ScrollbarWidget_Create(struct ScrollbarWidget* w) {
|
||||||
#define HotbarWidget_TileX(w, idx) (int)(w->x + w->slotXOffset + w->slotWidth * (idx))
|
#define HotbarWidget_TileX(w, idx) (int)(w->x + w->slotXOffset + w->slotWidth * (idx))
|
||||||
|
|
||||||
static void HotbarWidget_RenderHotbarOutline(struct HotbarWidget* w) {
|
static void HotbarWidget_RenderHotbarOutline(struct HotbarWidget* w) {
|
||||||
PackedCol white = PACKEDCOL_WHITE;
|
|
||||||
GfxResourceID tex;
|
GfxResourceID tex;
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
|
@ -403,7 +402,7 @@ static void HotbarWidget_RenderHotbarOutline(struct HotbarWidget* w) {
|
||||||
x = HotbarWidget_TileX(w, Inventory.SelectedIndex);
|
x = HotbarWidget_TileX(w, Inventory.SelectedIndex);
|
||||||
w->selTex.ID = tex;
|
w->selTex.ID = tex;
|
||||||
w->selTex.X = (int)(x - w->selWidth / 2);
|
w->selTex.X = (int)(x - w->selWidth / 2);
|
||||||
Gfx_Draw2DTexture(&w->selTex, white);
|
Gfx_Draw2DTexture(&w->selTex, PACKEDCOL_WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void HotbarWidget_RenderHotbarBlocks(struct HotbarWidget* w) {
|
static void HotbarWidget_RenderHotbarBlocks(struct HotbarWidget* w) {
|
||||||
|
|
Loading…
Reference in a new issue