From ce99219bd9afbca8fd7345b56dcafcb2bcbe9116 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 30 Apr 2020 17:59:09 +1000 Subject: [PATCH] remove some unused code --- src/Drawer2D.c | 5 ----- src/Model.c | 8 +++----- src/Particle.c | 5 ----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Drawer2D.c b/src/Drawer2D.c index 7d84e8f53..636dcbe1b 100644 --- a/src/Drawer2D.c +++ b/src/Drawer2D.c @@ -562,11 +562,6 @@ static int MeasureBitmappedWidth(const struct DrawTextArgs* args) { } void Drawer2D_DrawText(Bitmap* bmp, struct DrawTextArgs* args, int x, int y) { - BitmapCol col, backCol; - String value = args->text; - char colCode, nextCol = 'f'; - int i, partWidth; - if (Drawer2D_IsEmptyText(&args->text)) return; if (Drawer2D_BitmappedText) { DrawBitmappedText(bmp, args, x, y); return; } diff --git a/src/Model.c b/src/Model.c index 6a531fac1..c844c65ed 100644 --- a/src/Model.c +++ b/src/Model.c @@ -1592,10 +1592,8 @@ static void BlockModel_DrawParts(void) { Gfx_SetDynamicVbData(Models.Vb, Models.Vertices, bModel_index * 4); lastTexIndex = bModel_texIndices[0]; - for (i = 0; i < bModel_index; i++) { - if (bModel_texIndices[i] == lastTexIndex) { - count += 4; continue; - } + for (i = 0; i < bModel_index; i++, count += 4) { + if (bModel_texIndices[i] == lastTexIndex) continue; /* Different 1D flush texture, flush current vertices */ Gfx_BindTexture(Atlas1D.TexIds[lastTexIndex]); @@ -1603,7 +1601,7 @@ static void BlockModel_DrawParts(void) { lastTexIndex = bModel_texIndices[i]; offset += count; - count = 4; + count = 0; } /* Leftover vertices */ diff --git a/src/Particle.c b/src/Particle.c index 949d780b0..59a455a95 100644 --- a/src/Particle.c +++ b/src/Particle.c @@ -40,11 +40,6 @@ void Particle_DoRender(const Vec2* size, const Vec3* pos, const TextureRec* rec, v->X = centre.X + aX - bX; v->Y = centre.Y + aY - bY; v->Z = centre.Z + aZ - bZ; v->Col = col; v->U = rec->U2; v->V = rec->V2; v++; } -static cc_bool Particle_CanPass(BlockID block, cc_bool throughLiquids) { - cc_uint8 draw = Blocks.Draw[block]; - return draw == DRAW_GAS || draw == DRAW_SPRITE || (throughLiquids && Blocks.IsLiquid[block]); -} - static cc_bool Particle_CollideHor(Vec3* nextPos, BlockID block) { Vec3 horPos = Vec3_Create3((float)Math_Floor(nextPos->X), 0.0f, (float)Math_Floor(nextPos->Z)); Vec3 min, max;