Fixed some warnings
Moved global width/height
This commit is contained in:
@@ -26,9 +26,6 @@
|
|||||||
#include "game/impl/bandit.c"
|
#include "game/impl/bandit.c"
|
||||||
#include "game/testnavmesh.h"
|
#include "game/testnavmesh.h"
|
||||||
|
|
||||||
const int width = 1280;
|
|
||||||
const int height = 720;
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
(void) argc;
|
(void) argc;
|
||||||
@@ -150,6 +147,9 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
printf("%zu size in bytes\n", sizeof(TestNavMesh));
|
printf("%zu size in bytes\n", sizeof(TestNavMesh));
|
||||||
|
|
||||||
|
const int width = 1280;
|
||||||
|
const int height = 720;
|
||||||
|
|
||||||
while (running)
|
while (running)
|
||||||
{
|
{
|
||||||
SDL_Event e;
|
SDL_Event e;
|
||||||
@@ -161,7 +161,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
V3f projection = G_CameraUnproject(&game->camera, V2f_Clip(
|
V3f projection = G_CameraUnproject(&game->camera, V2f_Clip(
|
||||||
V2F(e.button.x, e.button.y),
|
V2F(e.button.x, e.button.y),
|
||||||
V2F(width, height)
|
V2F((F32) width, (F32) height)
|
||||||
));
|
));
|
||||||
game->world->mouseProjected = V2F(projection.x, projection.y);
|
game->world->mouseProjected = V2F(projection.x, projection.y);
|
||||||
ProcessEvents(&e, game->world);
|
ProcessEvents(&e, game->world);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ void RenderWorld(World *world, D_Context *draw) {
|
|||||||
World_Tile tileTypes[] = {dirt, middlePath, middlePathEdgeTop, middlePathEdgeRight, middlePathEdgeBottom, middlePathEdgeLeft, middlePathCornerTopLeft, middlePathCornerTopRight, middlePathCornerBottomRight, middlePathCornerTurnBottomLeft};
|
World_Tile tileTypes[] = {dirt, middlePath, middlePathEdgeTop, middlePathEdgeRight, middlePathEdgeBottom, middlePathEdgeLeft, middlePathCornerTopLeft, middlePathCornerTopRight, middlePathCornerBottomRight, middlePathCornerTurnBottomLeft};
|
||||||
for (int i = 0; i < 4800; i++)
|
for (int i = 0; i < 4800; i++)
|
||||||
{
|
{
|
||||||
D_Rect(draw, (i % 96), __floor(i / 96), .texture = tileTypes[map[i]].tile, .angle = tileTypes[map[i]].rotation);
|
D_Rect(draw, (F32) (i % 96), (F32) (i / 96), .texture = tileTypes[map[i]].tile, .angle = (F32) tileTypes[map[i]].rotation);
|
||||||
}
|
}
|
||||||
for(U32 i = 0; i < world->npcCount; i++) {
|
for(U32 i = 0; i < world->npcCount; i++) {
|
||||||
NPC npc = world->npcs[i];
|
NPC npc = world->npcs[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user