diff --git a/src/debug/fps.cpp b/src/debug/fps.cpp index 5380f94a..ffd27ffd 100644 --- a/src/debug/fps.cpp +++ b/src/debug/fps.cpp @@ -45,12 +45,12 @@ DebugFps::DebugFps(int x, int y) for (int i = 0; i < 5; i ++) { data->lines[i] = new Text(NULL, "gfx/font/ascii.png"); - data->lines[i]->SetPos(vec3i(x, y + (i ? 8 : 0) + 16 * i, 0)); + data->lines[i]->SetPos(ivec3(x, y + (i ? 8 : 0) + 16 * i, 0)); Ticker::Ref(data->lines[i]); } #else data->lines[0] = new Text(NULL, "gfx/font/ascii.png"); - data->lines[0]->SetPos(vec3i(x, y, 100)); + data->lines[0]->SetPos(ivec3(x, y, 100)); Ticker::Ref(data->lines[0]); #endif } diff --git a/src/font.cpp b/src/font.cpp index a54f4c2e..4cfc82a1 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -69,7 +69,7 @@ char const *Font::GetName() return data->name; } -void Font::Print(vec3i pos, char const *str) +void Font::Print(vec3 pos, char const *str) { Scene *scene = Scene::GetDefault(); diff --git a/src/font.h b/src/font.h index 730dd7de..800a2637 100644 --- a/src/font.h +++ b/src/font.h @@ -36,7 +36,7 @@ protected: public: /* New methods */ - void Print(vec3i pos, char const *str); + void Print(vec3 pos, char const *str); ivec2 GetSize() const; private: diff --git a/src/input.cpp b/src/input.cpp index 82457d24..9276c830 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -42,7 +42,7 @@ public: private: ivec2 mouse; - vec3i buttons; + ivec3 buttons; static int const MAX_ENTITIES = 100; WorldEntity *entities[MAX_ENTITIES]; @@ -82,7 +82,7 @@ ivec2 Input::GetMousePos() return data->mouse; } -vec3i Input::GetMouseButtons() +ivec3 Input::GetMouseButtons() { return data->buttons; } @@ -130,7 +130,7 @@ void Input::SetMousePos(ivec2 coord) { if (data->entities[n] == top) { - data->entities[n]->mousepos = (ivec2)((vec3i)coord - top->bbox[0]); + data->entities[n]->mousepos = (ivec2)((ivec3)coord - top->bbox[0]); if (top != data->lastfocus) data->entities[n]->pressed = data->buttons; else diff --git a/src/input.h b/src/input.h index a6142522..39df90ca 100644 --- a/src/input.h +++ b/src/input.h @@ -29,7 +29,7 @@ public: /* These methods are general queries */ static vec2 GetAxis(int axis); static ivec2 GetMousePos(); - static vec3i GetMouseButtons(); + static ivec3 GetMouseButtons(); /* Entities can subscribe to events */ static void TrackMouse(WorldEntity *e); diff --git a/src/layer.cpp b/src/layer.cpp index 885a8010..67828f04 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -56,7 +56,7 @@ void Layer::Render(int x, int y, int z) for (int i = 0; i < width; i++) if (data[j * width + i]) scene->AddTile(data[j * width + i], - vec3i(x + i * 32, + vec3(x + i * 32, y + j * 32 - altitude, altitude + z), orientation); diff --git a/src/matrix.h b/src/matrix.h index 7bd46ff6..c5159bf1 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -160,7 +160,7 @@ template struct Vec3 }; typedef Vec3 vec3; -typedef Vec3 vec3i; +typedef Vec3 ivec3; template struct Vec4 { @@ -177,7 +177,7 @@ template struct Vec4 }; typedef Vec4 vec4; -typedef Vec4 vec4i; +typedef Vec4 ivec4; #define SCALAR_GLOBAL(elems, op, U) \ template \ @@ -296,7 +296,7 @@ template struct Mat4 }; typedef Mat4 mat4; -typedef Mat4 mat4i; +typedef Mat4 imat4; } /* namespace lol */ diff --git a/src/platform/ps3/ps3input.cpp b/src/platform/ps3/ps3input.cpp index 8a1ea132..f5ed8d7e 100644 --- a/src/platform/ps3/ps3input.cpp +++ b/src/platform/ps3/ps3input.cpp @@ -40,7 +40,7 @@ class Ps3InputData #if defined __CELLOS_LV2__ vec2 mousepos; - vec3i mousebuttons; + ivec3 mousebuttons; CellPadData pad_data[NUM_PADS]; CellPadFilterIIRSos filter_sos[NUM_PADS][4]; @@ -75,7 +75,7 @@ Ps3Input::Ps3Input() CELL_PADFILTER_IIR_CUTOFF_2ND_LPF_BT_010); data->mousepos = vec2(320.0f, 240.0f); - data->mousebuttons = vec3i(0, 0, 0); + data->mousebuttons = ivec3(0, 0, 0); gamegroup = GAMEGROUP_BEFORE; #endif diff --git a/src/scene.cpp b/src/scene.cpp index 24a23a10..77674db1 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -30,7 +30,7 @@ struct Tile { TileSet *tileset; uint32_t prio; - vec3i pos; + vec3 pos; int id, o; }; @@ -117,7 +117,7 @@ void Scene::Reset() SceneData::scene = NULL; } -void Scene::AddTile(TileSet *tileset, int id, vec3i pos, int o) +void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o) { if ((data->ntiles % 1024) == 0) data->tiles = (Tile *)realloc(data->tiles, diff --git a/src/scene.h b/src/scene.h index 638b91f1..21c3618b 100644 --- a/src/scene.h +++ b/src/scene.h @@ -34,7 +34,7 @@ public: static Scene *GetDefault(); static void Reset(); - void AddTile(TileSet *tileset, int id, vec3i pos, int o); + void AddTile(TileSet *tileset, int id, vec3 pos, int o); void Render(); private: diff --git a/src/sprite.cpp b/src/sprite.cpp index a25ab5b5..1ec76b30 100644 --- a/src/sprite.cpp +++ b/src/sprite.cpp @@ -52,9 +52,7 @@ void Sprite::TickDraw(float deltams) { Entity::TickDraw(deltams); - vec3i pos = (vec3i)data->pos; - - Scene::GetDefault()->AddTile(data->tileset, data->id, pos, 0); + Scene::GetDefault()->AddTile(data->tileset, data->id, data->pos, 0); } Sprite::~Sprite() diff --git a/src/text.cpp b/src/text.cpp index e99b270c..e118830b 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -34,7 +34,7 @@ class TextData private: int font, align, length; char *text; - vec3i pos; + vec3 pos; }; /* @@ -47,7 +47,7 @@ Text::Text(char const *text, char const *font) data->font = Forge::Register(font); data->text = text ? strdup(text) : NULL; data->length = text ? strlen(text) : 0; - data->pos = vec3i(0, 0, 0); + data->pos = vec3(0, 0, 0); drawgroup = DRAWGROUP_HUD; } @@ -70,7 +70,7 @@ void Text::SetInt(int val) data->length = strlen(text); } -void Text::SetPos(vec3i pos) +void Text::SetPos(vec3 pos) { data->pos = pos; } @@ -87,7 +87,7 @@ void Text::TickDraw(float deltams) if (data->text) { Font *font = Forge::GetFont(data->font); - vec3i delta = 0; + vec3 delta = 0; if (data->align == ALIGN_RIGHT) delta.x -= data->length * font->GetSize().x; else if (data->align == ALIGN_CENTER) diff --git a/src/text.h b/src/text.h index fc700cc0..10e8c237 100644 --- a/src/text.h +++ b/src/text.h @@ -31,7 +31,7 @@ public: void SetText(char const *text); void SetInt(int val); - void SetPos(vec3i pos); + void SetPos(vec3 pos); void SetAlign(int align); enum diff --git a/src/tileset.cpp b/src/tileset.cpp index 7d327880..f36ef61e 100644 --- a/src/tileset.cpp +++ b/src/tileset.cpp @@ -178,7 +178,7 @@ void TileSet::Bind() } } -void TileSet::BlitTile(uint32_t id, vec3i pos, int o, +void TileSet::BlitTile(uint32_t id, vec3 pos, int o, float *vertex, float *texture) { float tx = data->tx * ((id & 0xffff) % data->count.i); diff --git a/src/tileset.h b/src/tileset.h index e839e6ca..368bcfdc 100644 --- a/src/tileset.h +++ b/src/tileset.h @@ -44,7 +44,7 @@ public: ivec2 GetCount() const; ivec2 GetSize(int tileid) const; void Bind(); - void BlitTile(uint32_t id, vec3i pos, int o, + void BlitTile(uint32_t id, vec3 pos, int o, float *vertex, float *texture); private: diff --git a/src/worldentity.h b/src/worldentity.h index fca7c039..85938d7c 100644 --- a/src/worldentity.h +++ b/src/worldentity.h @@ -30,8 +30,8 @@ public: vec3 bbox[2]; ivec2 mousepos; - vec3i mousebuttons; - vec3i pressed, clicked, released; + ivec3 mousebuttons; + ivec3 pressed, clicked, released; protected: WorldEntity();