Skip to content
Permalink
Browse files

move Atlas/Atlas1D vars to exported api

  • Loading branch information...
UnknownShadow200 committed Mar 13, 2019
1 parent 97a3d1b commit c706fc161e46796d8ea14a6e94579bd0150b29d5
Showing with 141 additions and 140 deletions.
  1. +7 −7 src/Block.c
  2. +20 −20 src/Builder.c
  3. +18 −18 src/Drawer.c
  4. +1 −1 src/EnvRenderer.c
  5. +15 −1 src/Http.c
  6. +3 −0 src/Http.h
  7. +1 −1 src/IsometricDrawer.c
  8. +4 −4 src/MapRenderer.c
  9. +6 −6 src/Menus.c
  10. +1 −1 src/Model.c
  11. +4 −4 src/Particle.c
  12. +1 −1 src/Screens.c
  13. +34 −38 src/TexturePack.c
  14. +26 −21 src/TexturePack.h
  15. +0 −14 src/Utils.c
  16. +0 −1 src/Utils.h
  17. +0 −2 src/World.h
@@ -355,7 +355,7 @@ void Block_RecalculateAllSpriteBB(void) {
}
}

static float Block_GetSpriteBB_MinX(int size, int tileX, int tileY, Bitmap* bmp) {
static float Block_GetSpriteBB_MinX(int size, int tileX, int tileY, const Bitmap* bmp) {
BitmapCol* row;
int x, y;

@@ -368,7 +368,7 @@ static float Block_GetSpriteBB_MinX(int size, int tileX, int tileY, Bitmap* bmp)
return 1.0f;
}

static float Block_GetSpriteBB_MinY(int size, int tileX, int tileY, Bitmap* bmp) {
static float Block_GetSpriteBB_MinY(int size, int tileX, int tileY, const Bitmap* bmp) {
BitmapCol* row;
int x, y;

@@ -381,7 +381,7 @@ static float Block_GetSpriteBB_MinY(int size, int tileX, int tileY, Bitmap* bmp)
return 1.0f;
}

static float Block_GetSpriteBB_MaxX(int size, int tileX, int tileY, Bitmap* bmp) {
static float Block_GetSpriteBB_MaxX(int size, int tileX, int tileY, const Bitmap* bmp) {
BitmapCol* row;
int x, y;

@@ -394,7 +394,7 @@ static float Block_GetSpriteBB_MaxX(int size, int tileX, int tileY, Bitmap* bmp)
return 0.0f;
}

static float Block_GetSpriteBB_MaxY(int size, int tileX, int tileY, Bitmap* bmp) {
static float Block_GetSpriteBB_MaxY(int size, int tileX, int tileY, const Bitmap* bmp) {
BitmapCol* row;
int x, y;

@@ -408,16 +408,16 @@ static float Block_GetSpriteBB_MaxY(int size, int tileX, int tileY, Bitmap* bmp)
}

void Block_RecalculateBB(BlockID block) {
Bitmap* bmp = &Atlas_Bitmap;
int tileSize = Atlas_TileSize;
Bitmap* bmp = &Atlas2D.Bitmap;
int tileSize = Atlas2D.TileSize;
TextureLoc texLoc = Block_Tex(block, FACE_XMAX);
int x = Atlas2D_TileX(texLoc), y = Atlas2D_TileY(texLoc);

Vector3 centre = { 0.5f, 0.0f, 0.5f };
float minX = 0, minY = 0, maxX = 1, maxY = 1;
Vector3 minRaw, maxRaw;

if (y < Atlas_RowsCount) {
if (y < Atlas2D.RowsCount) {
minX = Block_GetSpriteBB_MinX(tileSize, x, y, bmp);
minY = Block_GetSpriteBB_MinY(tileSize, x, y, bmp);
maxX = Block_GetSpriteBB_MaxX(tileSize, x, y, bmp);
@@ -478,8 +478,8 @@ static void Builder_DrawSprite(int count) {
#define s_u1 0.0f
#define s_u2 UV2_Scale
loc = Block_Tex(Builder_Block, FACE_XMAX);
v1 = Atlas1D_RowId(loc) * Atlas1D_InvTileSize;
v2 = v1 + Atlas1D_InvTileSize * UV2_Scale;
v1 = Atlas1D_RowId(loc) * Atlas1D.InvTileSize;
v2 = v1 + Atlas1D.InvTileSize * UV2_Scale;

offsetType = Blocks.SpriteOffset[Builder_Block];
if (offsetType >= 6 && offsetType <= 7) {
@@ -926,11 +926,11 @@ static int Adv_StretchZ(int countIndex, int x, int y, int z, int chunkIndex, Blo

static void Adv_DrawXMin(int count) {
TextureLoc texLoc = Block_Tex(Builder_Block, FACE_XMIN);
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = adv_minBB.Z, u2 = (count - 1) + adv_maxBB.Z * UV2_Scale;
float v1 = vOrigin + adv_maxBB.Y * Atlas1D_InvTileSize;
float v2 = vOrigin + adv_minBB.Y * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + adv_maxBB.Y * Atlas1D.InvTileSize;
float v2 = vOrigin + adv_minBB.Y * Atlas1D.InvTileSize * UV2_Scale;
struct Builder1DPart* part = &Builder_Parts[adv_baseOffset + Atlas1D_Index(texLoc)];

int F = adv_bitFlags[Builder_ChunkIndex];
@@ -967,11 +967,11 @@ static void Adv_DrawXMin(int count) {

static void Adv_DrawXMax(int count) {
TextureLoc texLoc = Block_Tex(Builder_Block, FACE_XMAX);
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = (count - adv_minBB.Z), u2 = (1 - adv_maxBB.Z) * UV2_Scale;
float v1 = vOrigin + adv_maxBB.Y * Atlas1D_InvTileSize;
float v2 = vOrigin + adv_minBB.Y * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + adv_maxBB.Y * Atlas1D.InvTileSize;
float v2 = vOrigin + adv_minBB.Y * Atlas1D.InvTileSize * UV2_Scale;
struct Builder1DPart* part = &Builder_Parts[adv_baseOffset + Atlas1D_Index(texLoc)];

int F = adv_bitFlags[Builder_ChunkIndex];
@@ -1008,11 +1008,11 @@ static void Adv_DrawXMax(int count) {

static void Adv_DrawZMin(int count) {
TextureLoc texLoc = Block_Tex(Builder_Block, FACE_ZMIN);
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = (count - adv_minBB.X), u2 = (1 - adv_maxBB.X) * UV2_Scale;
float v1 = vOrigin + adv_maxBB.Y * Atlas1D_InvTileSize;
float v2 = vOrigin + adv_minBB.Y * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + adv_maxBB.Y * Atlas1D.InvTileSize;
float v2 = vOrigin + adv_minBB.Y * Atlas1D.InvTileSize * UV2_Scale;
struct Builder1DPart* part = &Builder_Parts[adv_baseOffset + Atlas1D_Index(texLoc)];

int F = adv_bitFlags[Builder_ChunkIndex];
@@ -1049,11 +1049,11 @@ static void Adv_DrawZMin(int count) {

static void Adv_DrawZMax(int count) {
TextureLoc texLoc = Block_Tex(Builder_Block, FACE_ZMAX);
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = adv_minBB.X, u2 = (count - 1) + adv_maxBB.X * UV2_Scale;
float v1 = vOrigin + adv_maxBB.Y * Atlas1D_InvTileSize;
float v2 = vOrigin + adv_minBB.Y * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + adv_maxBB.Y * Atlas1D.InvTileSize;
float v2 = vOrigin + adv_minBB.Y * Atlas1D.InvTileSize * UV2_Scale;
struct Builder1DPart* part = &Builder_Parts[adv_baseOffset + Atlas1D_Index(texLoc)];

int F = adv_bitFlags[Builder_ChunkIndex];
@@ -1090,11 +1090,11 @@ static void Adv_DrawZMax(int count) {

static void Adv_DrawYMin(int count) {
TextureLoc texLoc = Block_Tex(Builder_Block, FACE_YMIN);
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = adv_minBB.X, u2 = (count - 1) + adv_maxBB.X * UV2_Scale;
float v1 = vOrigin + adv_minBB.Z * Atlas1D_InvTileSize;
float v2 = vOrigin + adv_maxBB.Z * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + adv_minBB.Z * Atlas1D.InvTileSize;
float v2 = vOrigin + adv_maxBB.Z * Atlas1D.InvTileSize * UV2_Scale;
struct Builder1DPart* part = &Builder_Parts[adv_baseOffset + Atlas1D_Index(texLoc)];

int F = adv_bitFlags[Builder_ChunkIndex];
@@ -1131,11 +1131,11 @@ static void Adv_DrawYMin(int count) {

static void Adv_DrawYMax(int count) {
TextureLoc texLoc = Block_Tex(Builder_Block, FACE_YMAX);
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = adv_minBB.X, u2 = (count - 1) + adv_maxBB.X * UV2_Scale;
float v1 = vOrigin + adv_minBB.Z * Atlas1D_InvTileSize;
float v2 = vOrigin + adv_maxBB.Z * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + adv_minBB.Z * Atlas1D.InvTileSize;
float v2 = vOrigin + adv_maxBB.Z * Atlas1D.InvTileSize * UV2_Scale;
struct Builder1DPart* part = &Builder_Parts[adv_baseOffset + Atlas1D_Index(texLoc)];

int F = adv_bitFlags[Builder_ChunkIndex];
@@ -15,12 +15,12 @@ col.B = (uint8_t)(col.B * Drawer.TintCol.B / 255);\

void Drawer_XMin(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b** vertices) {
VertexP3fT2fC4b* ptr = *vertices; VertexP3fT2fC4b v;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = Drawer.MinBB.Z;
float u2 = (count - 1) + Drawer.MaxBB.Z * UV2_Scale;
float v1 = vOrigin + Drawer.MaxBB.Y * Atlas1D_InvTileSize;
float v2 = vOrigin + Drawer.MinBB.Y * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + Drawer.MaxBB.Y * Atlas1D.InvTileSize;
float v2 = vOrigin + Drawer.MinBB.Y * Atlas1D.InvTileSize * UV2_Scale;

ApplyTint;
v.X = Drawer.X1; v.Col = col;
@@ -34,12 +34,12 @@ void Drawer_XMin(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b**

void Drawer_XMax(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b** vertices) {
VertexP3fT2fC4b* ptr = *vertices; VertexP3fT2fC4b v;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = (count - Drawer.MinBB.Z);
float u2 = (1 - Drawer.MaxBB.Z) * UV2_Scale;
float v1 = vOrigin + Drawer.MaxBB.Y * Atlas1D_InvTileSize;
float v2 = vOrigin + Drawer.MinBB.Y * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + Drawer.MaxBB.Y * Atlas1D.InvTileSize;
float v2 = vOrigin + Drawer.MinBB.Y * Atlas1D.InvTileSize * UV2_Scale;

ApplyTint;
v.X = Drawer.X2; v.Col = col;
@@ -53,12 +53,12 @@ void Drawer_XMax(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b**

void Drawer_ZMin(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b** vertices) {
VertexP3fT2fC4b* ptr = *vertices; VertexP3fT2fC4b v;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = (count - Drawer.MinBB.X);
float u2 = (1 - Drawer.MaxBB.X) * UV2_Scale;
float v1 = vOrigin + Drawer.MaxBB.Y * Atlas1D_InvTileSize;
float v2 = vOrigin + Drawer.MinBB.Y * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + Drawer.MaxBB.Y * Atlas1D.InvTileSize;
float v2 = vOrigin + Drawer.MinBB.Y * Atlas1D.InvTileSize * UV2_Scale;

ApplyTint;
v.Z = Drawer.Z1; v.Col = col;
@@ -72,12 +72,12 @@ void Drawer_ZMin(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b**

void Drawer_ZMax(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b** vertices) {
VertexP3fT2fC4b* ptr = *vertices; VertexP3fT2fC4b v;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = Drawer.MinBB.X;
float u2 = (count - 1) + Drawer.MaxBB.X * UV2_Scale;
float v1 = vOrigin + Drawer.MaxBB.Y * Atlas1D_InvTileSize;
float v2 = vOrigin + Drawer.MinBB.Y * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + Drawer.MaxBB.Y * Atlas1D.InvTileSize;
float v2 = vOrigin + Drawer.MinBB.Y * Atlas1D.InvTileSize * UV2_Scale;

ApplyTint;
v.Z = Drawer.Z2; v.Col = col;
@@ -92,11 +92,11 @@ void Drawer_ZMax(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b**
void Drawer_YMin(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b** vertices) {
VertexP3fT2fC4b* ptr = *vertices; VertexP3fT2fC4b v;

float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;
float u1 = Drawer.MinBB.X;
float u2 = (count - 1) + Drawer.MaxBB.X * UV2_Scale;
float v1 = vOrigin + Drawer.MinBB.Z * Atlas1D_InvTileSize;
float v2 = vOrigin + Drawer.MaxBB.Z * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + Drawer.MinBB.Z * Atlas1D.InvTileSize;
float v2 = vOrigin + Drawer.MaxBB.Z * Atlas1D.InvTileSize * UV2_Scale;

ApplyTint;
v.Y = Drawer.Y1; v.Col = col;
@@ -110,12 +110,12 @@ void Drawer_YMin(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b**

void Drawer_YMax(int count, PackedCol col, TextureLoc texLoc, VertexP3fT2fC4b** vertices) {
VertexP3fT2fC4b* ptr = *vertices; VertexP3fT2fC4b v;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D_InvTileSize;
float vOrigin = Atlas1D_RowId(texLoc) * Atlas1D.InvTileSize;

float u1 = Drawer.MinBB.X;
float u2 = (count - 1) + Drawer.MaxBB.X * UV2_Scale;
float v1 = vOrigin + Drawer.MinBB.Z * Atlas1D_InvTileSize;
float v2 = vOrigin + Drawer.MaxBB.Z * Atlas1D_InvTileSize * UV2_Scale;
float v1 = vOrigin + Drawer.MinBB.Z * Atlas1D.InvTileSize;
float v2 = vOrigin + Drawer.MaxBB.Z * Atlas1D.InvTileSize * UV2_Scale;

ApplyTint;
v.Y = Drawer.Y2; v.Col = col;
@@ -579,7 +579,7 @@ static void EnvRenderer_MakeBorderTex(GfxResourceID* texId, BlockID block) {
if (Gfx.LostContext) return;

Gfx_DeleteTexture(texId);
*texId = Atlas_LoadTile(loc);
*texId = Atlas2D_LoadTile(loc);
}

static Rect2D EnvRenderer_Rect(int x, int y, int width, int height) {
@@ -396,7 +396,7 @@ static void Http_MakeHeaders(String* headers, struct HttpRequest* req) {

if (req->LastModified) {
String_AppendConst(headers, "If-Modified-Since: ");
DateTime_HttpDate(req->LastModified, headers);
Http_FormatDate(req->LastModified, headers);
String_AppendConst(headers, "\r\n");
}

@@ -854,6 +854,20 @@ void Http_UrlEncodeUtf8(String* dst, const String* src) {
}
}

void Http_FormatDate(TimeMS ms, String* str) {
static const char* days_of_week[7] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
static const char* month_names[13] = { NULL, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
struct DateTime t;
int days;

DateTime_FromTotalMs(&t, ms);
days = DateTime_TotalDays(&t);

String_Format2(str, "%c, %p2 ", days_of_week[days % 7], &t.Day);
String_Format2(str, "%c %p4 ", month_names[t.Month], &t.Year);
String_Format3(str, "%p2:%p2:%p2 GMT", &t.Hour, &t.Minute, &t.Second);
}


/*########################################################################################################################*
*-----------------------------------------------------Http component------------------------------------------------------*
@@ -59,6 +59,9 @@ void Http_AsyncGetDataEx(const String* url, bool priority, const String* id, Tim
void Http_UrlEncode(String* dst, const uint8_t* data, int len);
/* Converts characters to UTF8, then calls Http_URlEncode on them. */
void Http_UrlEncodeUtf8(String* dst, const String* src);
/* Formats a date for inclusion in HTTP headers. */
/* NOTE: Time is always assumed as being UTC. */
void Http_FormatDate(TimeMS ms, String* str);

/* Attempts to retrieve a fully completed request. */
/* NOTE: You MUST also check Result/StatusCode, and check Size is > 0. */
@@ -52,7 +52,7 @@ static void IsometricDrawer_InitCache(void) {
static void IsometricDrawer_Flush(void) {
int count;
if (iso_lastTexIndex != -1) {
Gfx_BindTexture(Atlas1D_TexIds[iso_lastTexIndex]);
Gfx_BindTexture(Atlas1D.TexIds[iso_lastTexIndex]);
count = (int)(iso_vertices - iso_vertices_base);
Gfx_UpdateDynamicVb_IndexedTris(iso_vb, iso_vertices_base, count);
}
@@ -185,7 +185,7 @@ void MapRenderer_RenderNormal(double delta) {
for (batch = 0; batch < MapRenderer_1DUsedCount; batch++) {
if (normPartsCount[batch] <= 0) continue;
if (hasNormParts[batch] || checkNormParts[batch]) {
Gfx_BindTexture(Atlas1D_TexIds[batch]);
Gfx_BindTexture(Atlas1D.TexIds[batch]);
MapRenderer_RenderNormalBatch(batch);
checkNormParts[batch] = false;
}
@@ -280,7 +280,7 @@ void MapRenderer_RenderTranslucent(double delta) {
for (batch = 0; batch < MapRenderer_1DUsedCount; batch++) {
if (tranPartsCount[batch] <= 0) continue;
if (!hasTranParts[batch]) continue;
Gfx_BindTexture(Atlas1D_TexIds[batch]);
Gfx_BindTexture(Atlas1D.TexIds[batch]);
MapRenderer_RenderTranslucentBatch(batch);
}
Gfx_DisableMipmaps();
@@ -700,12 +700,12 @@ static void MapRenderer_EnvVariableChanged(void* obj, int envVar) {

static void MapRenderer_TerrainAtlasChanged(void* obj) {
if (MapRenderer_1DUsedCount) {
bool refreshRequired = elementsPerBitmap != Atlas1D_TilesPerAtlas;
bool refreshRequired = elementsPerBitmap != Atlas1D.TilesPerAtlas;
if (refreshRequired) MapRenderer_Refresh();
}

MapRenderer_1DUsedCount = MapRenderer_UsedAtlases();
elementsPerBitmap = Atlas1D_TilesPerAtlas;
elementsPerBitmap = Atlas1D.TilesPerAtlas;
MapRenderer_ResetPartFlags();
}

@@ -2955,7 +2955,7 @@ static void TexIdsOverlay_ContextRecreated(void* screen) {
s->DynamicVb = Gfx_CreateDynamicVb(VERTEX_FORMAT_P3FT2FC4B, TEXID_OVERLAY_VERTICES_COUNT);
TextAtlas_Make(&s->IdAtlas, &chars, &s->TextFont, &prefix);

s->XOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * Atlas_RowsCount, Game.Width);
s->XOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * Atlas2D.RowsCount, Game.Width);
s->YOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * ATLAS2D_TILES_PER_ROW, Game.Height);
s->TileSize = size;

@@ -2978,19 +2978,19 @@ static void TexIdsOverlay_RenderTerrain(struct TexIdsOverlay* s) {
for (i = 0; i < ATLAS2D_TILES_PER_ROW * ATLAS2D_TILES_PER_ROW;) {
ptr = vertices;
idx = Atlas1D_Index(i + s->BaseTexLoc);
end = i + Atlas1D_TilesPerAtlas;
end = i + Atlas1D.TilesPerAtlas;

for (; i < end; i++) {
tex.X = s->XOffset + Atlas2D_TileX(i) * size;
tex.Y = s->YOffset + Atlas2D_TileY(i) * size;

tex.uv.V1 = Atlas1D_RowId(i + s->BaseTexLoc) * Atlas1D_InvTileSize;
tex.uv.V2 = tex.uv.V1 + UV2_Scale * Atlas1D_InvTileSize;
tex.uv.V1 = Atlas1D_RowId(i + s->BaseTexLoc) * Atlas1D.InvTileSize;
tex.uv.V2 = tex.uv.V1 + UV2_Scale * Atlas1D.InvTileSize;

Gfx_Make2DQuad(&tex, col, &ptr);
}

Gfx_BindTexture(Atlas1D_TexIds[idx]);
Gfx_BindTexture(Atlas1D.TexIds[idx]);
count = (int)(ptr - vertices);
Gfx_UpdateDynamicVb_IndexedTris(s->DynamicVb, vertices, count);
}
@@ -3042,7 +3042,7 @@ static void TexIdsOverlay_Render(void* screen, double delta) {
origXOffset = s->XOffset;
s->BaseTexLoc = 0;

for (rows = Atlas_RowsCount; rows > 0; rows -= ATLAS2D_TILES_PER_ROW) {
for (rows = Atlas2D.RowsCount; rows > 0; rows -= ATLAS2D_TILES_PER_ROW) {
TexIdsOverlay_RenderTerrain(s);
TexIdsOverlay_RenderTextOverlay(s);

@@ -1494,7 +1494,7 @@ static void BlockModel_GetBounds(struct Entity* e) {

static void BlockModel_Flush(void) {
if (bModel_lastTexIndex != -1) {
Gfx_BindTexture(Atlas1D_TexIds[bModel_lastTexIndex]);
Gfx_BindTexture(Atlas1D.TexIds[bModel_lastTexIndex]);
Models.Active->index = bModel_index;
Model_UpdateVB();
}
Oops, something went wrong.

0 comments on commit c706fc1

Please sign in to comment.
You can’t perform that action at this time.