Changeset 866
- Timestamp:
- Aug 28, 2011, 4:26:37 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/deushax/debugsprite.cpp
r840 r866 57 57 Entity::TickDraw(deltams); 58 58 59 vec3i pos = (vec3i)data->pos;59 ivec3 pos = (ivec3)data->pos; 60 60 61 Scene::GetDefault()->AddTile(data->tileset, 31, pos + vec3i(-16, 0, 0), 1);62 Scene::GetDefault()->AddTile(data->tileset, 15, pos + vec3i(-16, 0, 32), 1);61 Scene::GetDefault()->AddTile(data->tileset, 31, pos + ivec3(-16, 0, 0), 1); 62 Scene::GetDefault()->AddTile(data->tileset, 15, pos + ivec3(-16, 0, 32), 1); 63 63 } 64 64 -
trunk/monsterz/board.cpp
r863 r866 70 70 71 71 ivec2 oldmouse; 72 vec3ioldbuttons;72 ivec3 oldbuttons; 73 73 float whipdelay; 74 74 … … 128 128 129 129 data->score = new Score(0); 130 data->score->SetPos( vec3i(624, 432, 20));130 data->score->SetPos(ivec3(624, 432, 20)); 131 131 Ticker::Ref(data->score); 132 132 133 position = vec3i(24, 72, 1);133 position = ivec3(24, 72, 1); 134 134 bbox[0] = position; 135 bbox[1] = bbox[0] + vec3i(384, 384, 0);135 bbox[1] = bbox[0] + ivec3(384, 384, 0); 136 136 137 137 Input::TrackMouse(this); … … 142 142 Entity::TickGame(deltams); 143 143 144 vec3ibuttons = Input::GetMouseButtons();144 ivec3 buttons = Input::GetMouseButtons(); 145 145 146 146 /* Do not whip too often, the sound may become annoying */ … … 255 255 256 256 Scene::GetDefault()->AddTile(data->board, 0, position, 0); 257 Scene::GetDefault()->AddTile(data->screen, 0, vec3i(0, 0, 10), 0);257 Scene::GetDefault()->AddTile(data->screen, 0, ivec3(0, 0, 10), 0); 258 258 259 259 switch (data->game) -
trunk/monsterz/interface.cpp
r863 r866 60 60 data->state = InterfaceData::INIT; 61 61 62 position = vec3i(0, 0, 1);62 position = ivec3(0, 0, 1); 63 63 bbox[0] = position; 64 bbox[1] = bbox[0] + vec3i(640, 480, 0);64 bbox[1] = bbox[0] + ivec3(640, 480, 0); 65 65 } 66 66 … … 95 95 WorldEntity::TickDraw(deltams); 96 96 97 vec3imouse(Input::GetMousePos());97 ivec3 mouse(Input::GetMousePos()); 98 98 99 99 if (Platform::GetMouseCount() && mouse.x >= 0 && mouse.y >= 0) 100 100 { 101 mouse += vec3i(-6, 6 - 48, 30);101 mouse += ivec3(-6, 6 - 48, 30); 102 102 Scene::GetDefault()->AddTile(data->tiles, 22, mouse, 0); 103 103 } -
trunk/monsterz/piece.cpp
r863 r866 383 383 384 384 if (data->state != PieceData::DEAD) 385 Scene::GetDefault()->AddTile(data->tileset, id, vec3i(x, y, z), 0);385 Scene::GetDefault()->AddTile(data->tileset, id, ivec3(x, y, z), 0); 386 386 387 387 if (data->state == PieceData::GRAB && Platform::GetMouseCount()) 388 Scene::GetDefault()->AddTile(data->tileset, 0, vec3i(x, y, 9), 0);388 Scene::GetDefault()->AddTile(data->tileset, 0, ivec3(x, y, 9), 0); 389 389 } 390 390 -
trunk/monsterz/thumbs.cpp
r792 r866 53 53 54 54 #if 0 55 position = vec3i(24, 72, 1);55 position = ivec3(24, 72, 1); 56 56 bbox[0] = position; 57 bbox[1] = bbox[0] + vec3i(384, 384, 0);57 bbox[1] = bbox[0] + ivec3(384, 384, 0); 58 58 #endif 59 59 } … … 73 73 for (int n = 0; n < data->npieces; n++) 74 74 { 75 vec3i p = vec3i(459, 372 - 27 * n, 11);75 ivec3 p = ivec3(459, 372 - 27 * n, 11); 76 76 Scene::GetDefault()->AddTile(data->icons, n, p, 0); 77 77 } … … 88 88 data->text[n] = new Text(NULL, "monsterz/gfx/font1.png"); 89 89 Ticker::Ref(data->text[n]); 90 vec3i p = vec3i(492, 374 - 27 * n, 20);90 ivec3 p = ivec3(492, 374 - 27 * n, 20); 91 91 data->text[n]->SetPos(p); 92 92 } -
trunk/monsterz/title.cpp
r863 r866 133 133 { 134 134 /* FIXME: this should not be hardcoded */ 135 position = vec3i(0, 0, 1);135 position = ivec3(0, 0, 1); 136 136 bbox[0] = position; 137 bbox[1] = bbox[0] + vec3i(640, 480, 0);137 bbox[1] = bbox[0] + ivec3(640, 480, 0); 138 138 139 139 srand(rand() ^ time(NULL)); … … 305 305 int backid = (int)data->period; 306 306 Scene::GetDefault()->AddTile(data->title, backid, 307 vec3i(data->ground_pos.x, data->ground_pos.y, 1), 0);307 ivec3(data->ground_pos.x, data->ground_pos.y, 1), 0); 308 308 309 309 /* The stars */ … … 311 311 { 312 312 Scene::GetDefault()->AddTile(data->stars, 0, 313 vec3i(24 + 0, 72 + 240, 2), 0);313 ivec3(24 + 0, 72 + 240, 2), 0); 314 314 } 315 315 … … 322 322 int cloudid = (n % 5) * 4 + cloudoff; 323 323 Scene::GetDefault()->AddTile(data->clouds, cloudid, 324 vec3i(data->cloudpos[n].x,324 ivec3(data->cloudpos[n].x, 325 325 data->cloudpos[n].y, 2), 0); 326 326 Scene::GetDefault()->AddTile(data->clouds, cloudid, 327 vec3i(data->cloudpos[n].x - bbox[1].x327 ivec3(data->cloudpos[n].x - bbox[1].x 328 328 + bbox[0].x, 329 329 data->cloudpos[n].y, 2), 0); … … 340 340 int y = data->eagle.y + 5.0f * sinf(phase); 341 341 Scene::GetDefault()->AddTile(data->eagle.tiles, eagleid, 342 vec3i(24 + x, 72 + y, 3), 0);342 ivec3(24 + x, 72 + y, 3), 0); 343 343 } 344 344 … … 348 348 { 349 349 Scene::GetDefault()->AddTile(data->ground, 0, 350 vec3i(x, data->ground_pos.y, 0), 0);350 ivec3(x, data->ground_pos.y, 0), 0); 351 351 } 352 352 … … 379 379 if (tiler) 380 380 Scene::GetDefault()->AddTile(tiler, id, 381 vec3i(data->ground_pos.x + pos.x,381 ivec3(data->ground_pos.x + pos.x, 382 382 data->ground_pos.y + pos.y, 1), 0); 383 383 } -
trunk/src/debug/fps.cpp
r783 r866 46 46 { 47 47 data->lines[i] = new Text(NULL, "gfx/font/ascii.png"); 48 data->lines[i]->SetPos( vec3i(x, y + (i ? 8 : 0) + 16 * i, 0));48 data->lines[i]->SetPos(ivec3(x, y + (i ? 8 : 0) + 16 * i, 0)); 49 49 Ticker::Ref(data->lines[i]); 50 50 } 51 51 #else 52 52 data->lines[0] = new Text(NULL, "gfx/font/ascii.png"); 53 data->lines[0]->SetPos( vec3i(x, y, 100));53 data->lines[0]->SetPos(ivec3(x, y, 100)); 54 54 Ticker::Ref(data->lines[0]); 55 55 #endif -
trunk/src/font.cpp
r863 r866 70 70 } 71 71 72 void Font::Print(vec3 ipos, char const *str)72 void Font::Print(vec3 pos, char const *str) 73 73 { 74 74 Scene *scene = Scene::GetDefault(); -
trunk/src/font.h
r863 r866 37 37 public: 38 38 /* New methods */ 39 void Print(vec3 ipos, char const *str);39 void Print(vec3 pos, char const *str); 40 40 ivec2 GetSize() const; 41 41 -
trunk/src/input.cpp
r863 r866 43 43 private: 44 44 ivec2 mouse; 45 vec3ibuttons;45 ivec3 buttons; 46 46 47 47 static int const MAX_ENTITIES = 100; … … 83 83 } 84 84 85 vec3iInput::GetMouseButtons()85 ivec3 Input::GetMouseButtons() 86 86 { 87 87 return data->buttons; … … 131 131 if (data->entities[n] == top) 132 132 { 133 data->entities[n]->mousepos = (ivec2)(( vec3i)coord - top->bbox[0]);133 data->entities[n]->mousepos = (ivec2)((ivec3)coord - top->bbox[0]); 134 134 if (top != data->lastfocus) 135 135 data->entities[n]->pressed = data->buttons; -
trunk/src/input.h
r863 r866 30 30 static vec2 GetAxis(int axis); 31 31 static ivec2 GetMousePos(); 32 static vec3iGetMouseButtons();32 static ivec3 GetMouseButtons(); 33 33 34 34 /* Entities can subscribe to events */ -
trunk/src/layer.cpp
r810 r866 57 57 if (data[j * width + i]) 58 58 scene->AddTile(data[j * width + i], 59 vec3 i(x + i * 32,59 vec3(x + i * 32, 60 60 y + j * 32 - altitude, 61 61 altitude + z), -
trunk/src/matrix.h
r863 r866 161 161 162 162 typedef Vec3<float> vec3; 163 typedef Vec3<int> vec3i;163 typedef Vec3<int> ivec3; 164 164 165 165 template <typename T> struct Vec4 … … 178 178 179 179 typedef Vec4<float> vec4; 180 typedef Vec4<int> vec4i;180 typedef Vec4<int> ivec4; 181 181 182 182 #define SCALAR_GLOBAL(elems, op, U) \ … … 297 297 298 298 typedef Mat4<float> mat4; 299 typedef Mat4<int> mat4i;299 typedef Mat4<int> imat4; 300 300 301 301 } /* namespace lol */ -
trunk/src/platform/ps3/ps3input.cpp
r865 r866 41 41 #if defined __CELLOS_LV2__ 42 42 vec2 mousepos; 43 vec3imousebuttons;43 ivec3 mousebuttons; 44 44 45 45 CellPadData pad_data[NUM_PADS]; … … 76 76 77 77 data->mousepos = vec2(320.0f, 240.0f); 78 data->mousebuttons = vec3i(0, 0, 0);78 data->mousebuttons = ivec3(0, 0, 0); 79 79 80 80 gamegroup = GAMEGROUP_BEFORE; -
trunk/src/scene.cpp
r854 r866 31 31 TileSet *tileset; 32 32 uint32_t prio; 33 vec3 ipos;33 vec3 pos; 34 34 int id, o; 35 35 }; … … 118 118 } 119 119 120 void Scene::AddTile(TileSet *tileset, int id, vec3 ipos, int o)120 void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o) 121 121 { 122 122 if ((data->ntiles % 1024) == 0) -
trunk/src/scene.h
r792 r866 35 35 static void Reset(); 36 36 37 void AddTile(TileSet *tileset, int id, vec3 ipos, int o);37 void AddTile(TileSet *tileset, int id, vec3 pos, int o); 38 38 void Render(); 39 39 -
trunk/src/sprite.cpp
r862 r866 53 53 Entity::TickDraw(deltams); 54 54 55 vec3i pos = (vec3i)data->pos; 56 57 Scene::GetDefault()->AddTile(data->tileset, data->id, pos, 0); 55 Scene::GetDefault()->AddTile(data->tileset, data->id, data->pos, 0); 58 56 } 59 57 -
trunk/src/text.cpp
r758 r866 35 35 int font, align, length; 36 36 char *text; 37 vec3 ipos;37 vec3 pos; 38 38 }; 39 39 … … 48 48 data->text = text ? strdup(text) : NULL; 49 49 data->length = text ? strlen(text) : 0; 50 data->pos = vec3 i(0, 0, 0);50 data->pos = vec3(0, 0, 0); 51 51 52 52 drawgroup = DRAWGROUP_HUD; … … 71 71 } 72 72 73 void Text::SetPos(vec3 ipos)73 void Text::SetPos(vec3 pos) 74 74 { 75 75 data->pos = pos; … … 88 88 { 89 89 Font *font = Forge::GetFont(data->font); 90 vec3 idelta = 0;90 vec3 delta = 0; 91 91 if (data->align == ALIGN_RIGHT) 92 92 delta.x -= data->length * font->GetSize().x; -
trunk/src/text.h
r748 r866 32 32 void SetText(char const *text); 33 33 void SetInt(int val); 34 void SetPos(vec3 ipos);34 void SetPos(vec3 pos); 35 35 void SetAlign(int align); 36 36 -
trunk/src/tileset.cpp
r863 r866 179 179 } 180 180 181 void TileSet::BlitTile(uint32_t id, vec3 ipos, int o,181 void TileSet::BlitTile(uint32_t id, vec3 pos, int o, 182 182 float *vertex, float *texture) 183 183 { -
trunk/src/tileset.h
r863 r866 45 45 ivec2 GetSize(int tileid) const; 46 46 void Bind(); 47 void BlitTile(uint32_t id, vec3 ipos, int o,47 void BlitTile(uint32_t id, vec3 pos, int o, 48 48 float *vertex, float *texture); 49 49 -
trunk/src/worldentity.h
r863 r866 31 31 32 32 ivec2 mousepos; 33 vec3imousebuttons;34 vec3ipressed, clicked, released;33 ivec3 mousebuttons; 34 ivec3 pressed, clicked, released; 35 35 36 36 protected:
Note: See TracChangeset
for help on using the changeset viewer.