Move rendering of tiles into rendering of entities

Downgraded background rendering to each tile individually (no batching)
temporarily such that we can render all entities in one function.
This commit is contained in:
2016-07-08 16:09:18 +10:00
parent 4b74bb9474
commit c9fc34aee1
5 changed files with 110 additions and 103 deletions
+4
View File
@@ -28,4 +28,8 @@ typedef double f64;
i32 common_strlen(const char *const string);
#ifdef WT_DEBUG
#define INVALID_CODE_PATH TRUE
#endif
#endif
+8 -12
View File
@@ -6,7 +6,7 @@
#include "Dengine/Renderer.h"
#define NUM_KEYS 1024
#define METERS_TO_PIXEL 100
#define METERS_TO_PIXEL 64
enum State
{
@@ -15,15 +15,16 @@ enum State
state_win,
};
typedef struct Tile
{
v2 pos;
} Tile;
typedef struct World
{
Tile tiles[2048];
Entity *entities;
i32 maxEntities;
enum TexList texType;
i32 heroIndex;
i32 freeEntityIndex;
} World;
typedef struct GameState
@@ -32,16 +33,11 @@ typedef struct GameState
b32 keys[NUM_KEYS];
Renderer renderer;
i32 heroIndex;
World world[4];
i32 currWorldIndex;
i32 tileSize;
// TODO(doyle): Make size of list dynamic
Entity entityList[256];
i32 freeEntityIndex;
AssetManager assetManager;
} GameState;