Changeset 958
- Timestamp:
- Sep 18, 2011, 11:01:26 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r954 r958 233 233 234 234 235 dnl Use Cocoa? 236 ac_cv_my_have_cocoa="no" 237 LIBS_save="$LIBS" 238 LIBS="$LIBS -Wl,-framework -Wl,Cocoa" 239 AC_MSG_CHECKING(for -framework Cocoa) 240 AC_TRY_LINK([], [], 241 [ac_cv_my_have_cocoa="yes" 242 AC_MSG_RESULT(yes) 243 CXXFLAGS="${CXXFLAGS} -ObjC++"], 244 [AC_MSG_RESULT(no)]) 245 LIBS="$LIBS_save" 246 AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" != "no") 247 248 235 249 dnl Use EGL? 236 250 ac_cv_my_have_egl="no" -
trunk/deushax/deushax.cpp
r865 r958 21 21 #include "platform/sdl/sdlinput.h" 22 22 #include "debugsprite.h" 23 24 #if USE_SDL 25 # include <SDL_main.h> 26 #endif 23 27 24 28 #if defined _WIN32 -
trunk/monsterz/monsterz.cpp
r865 r958 35 35 #include "interface.h" 36 36 37 #if USE_SDL 38 # include <SDL_main.h> 39 #endif 40 37 41 #if defined _WIN32 38 42 # undef main /* FIXME: still needed? */ -
trunk/monsterz/piece.cpp
r866 r958 39 39 Piece *above, *below; 40 40 ivec2 size, cell, pos, pos_src, pos_dst, off, off_src; 41 int id;41 int pieceid; 42 42 float speed, timer; 43 43 … … 74 74 */ 75 75 76 Piece::Piece(piece_t piece, Emitter *emitter, ivec2 cell, int id)76 Piece::Piece(piece_t piece, Emitter *emitter, ivec2 cell, int pieceid) 77 77 : data(new PieceData()) 78 78 { … … 95 95 data->size = 48; 96 96 data->tileset = Tiler::Register(PNG_TILES, data->size, 0, 1.0f); 97 data-> id = 80 + 20 *id;97 data->pieceid = 80 + 20 * pieceid; 98 98 break; 99 99 } … … 309 309 { 310 310 vec3 pos(data->pos.x + 24, data->pos.y + 72, 5); 311 int start = data-> id + 12;312 int stop = data-> id + 15;313 for (int id = start; id < stop;id++)311 int start = data->pieceid + 12; 312 int stop = data->pieceid + 15; 313 for (int pieceid = start; pieceid < stop; pieceid++) 314 314 { 315 315 float angle = RandF(-1.2f, 1.2f); 316 316 float speed = RandF(0.3f, 0.5f); 317 317 vec3 vel(speed * sinf(angle), speed * cosf(angle), 0.0f); 318 data->emitter->AddParticle( id, pos, vel);318 data->emitter->AddParticle(pieceid, pos, vel); 319 319 } 320 320 … … 333 333 Entity::TickDraw(deltams); 334 334 335 int id = data->id, off = 0;335 int pieceid = data->pieceid, off = 0; 336 336 int x = data->pos.x + data->off.x + 24; 337 337 int y = data->pos.y + data->off.y + 72; … … 378 378 { 379 379 case PIECE_HUNT: 380 id += off;380 pieceid += off; 381 381 break; 382 382 } 383 383 384 384 if (data->state != PieceData::DEAD) 385 Scene::GetDefault()->AddTile(data->tileset, id, ivec3(x, y, z), 0);385 Scene::GetDefault()->AddTile(data->tileset, pieceid, ivec3(x, y, z), 0); 386 386 387 387 if (data->state == PieceData::GRAB && Platform::GetMouseCount()) -
trunk/monsterz/title.cpp
r866 r958 353 353 /* Maybe an animation? */ 354 354 TileSet *tiler = NULL; 355 int id = 0;355 int tileid = 0; 356 356 ivec2 pos = 0; 357 357 … … 364 364 pos = animpos[data->animid]; 365 365 pos.y = 384 - animsize[data->animid].y - pos.y; // Hack 366 id = (data->length - data->timer) * data->nframes / data->length;367 if ( id < 0)id = 0;368 if ( id > data->nframes - 1)id = data->nframes - 1;366 tileid = (data->length - data->timer) * data->nframes / data->length; 367 if (tileid < 0) tileid = 0; 368 if (tileid > data->nframes - 1) tileid = data->nframes - 1; 369 369 break; 370 370 case TitleData::EVENT: … … 372 372 pos = eventpos[data->animid]; 373 373 pos.y = 384 - eventsize[data->animid].y - pos.y; // Hack 374 id = (data->length - data->timer) * data->nframes / data->length;375 if ( id < 0)id = 0;376 if ( id > data->nframes - 1)id = data->nframes - 1;374 tileid = (data->length - data->timer) * data->nframes / data->length; 375 if (tileid < 0) tileid = 0; 376 if (tileid > data->nframes - 1) tileid = data->nframes - 1; 377 377 break; 378 378 } 379 379 if (tiler) 380 Scene::GetDefault()->AddTile(tiler, id,380 Scene::GetDefault()->AddTile(tiler, tileid, 381 381 ivec3(data->ground_pos.x + pos.x, 382 382 data->ground_pos.y + pos.y, 1), 0); -
trunk/src/Makefile.am
r957 r958 27 27 image/image.cpp image/image.h image/image-private.h \ 28 28 image/codec/android-image.cpp \ 29 image/codec/ios-image. mm\29 image/codec/ios-image.cpp \ 30 30 image/codec/sdl-image.cpp \ 31 31 image/codec/ps3-image.cpp \ -
trunk/src/dict.cpp
r789 r958 74 74 int Dict::MakeSlot(char const *name) 75 75 { 76 int id, empty = -1;76 int slotid, empty = -1; 77 77 78 78 /* If the entry is already registered, remember its ID. Look for an 79 79 * empty slot at the same time. */ 80 for ( id = 0; id < data->maxid;id++)80 for (slotid = 0; slotid < data->maxid; slotid++) 81 81 { 82 Entity *e = data->entities[ id];82 Entity *e = data->entities[slotid]; 83 83 if (!e) 84 84 { 85 empty = id;85 empty = slotid; 86 86 break; 87 87 } … … 105 105 106 106 /* If this is a new entry, create a new slot for it. */ 107 if ( id == data->maxid || !data->entities[id])107 if (slotid == data->maxid || !data->entities[slotid]) 108 108 { 109 if ( id == data->maxid)109 if (slotid == data->maxid) 110 110 { 111 111 empty = data->maxid++; … … 115 115 116 116 data->entities[empty] = NULL; 117 id = empty;117 slotid = empty; 118 118 data->nentities++; 119 119 } 120 120 else 121 121 { 122 Ticker::Ref(data->entities[ id]);122 Ticker::Ref(data->entities[slotid]); 123 123 } 124 124 125 return id;125 return slotid; 126 126 } 127 127 128 void Dict::RemoveSlot(int id)128 void Dict::RemoveSlot(int slotid) 129 129 { 130 if (Ticker::Unref(data->entities[ id]) == 0)130 if (Ticker::Unref(data->entities[slotid]) == 0) 131 131 { 132 data->entities[ id] = NULL;132 data->entities[slotid] = NULL; 133 133 data->nentities--; 134 134 } … … 137 137 void Dict::RemoveSlot(Entity *entity) 138 138 { 139 for (int id = 0; id < data->maxid;id++)140 if (data->entities[ id] == entity)139 for (int slotid = 0; slotid < data->maxid; slotid++) 140 if (data->entities[slotid] == entity) 141 141 { 142 RemoveSlot( id);142 RemoveSlot(slotid); 143 143 return; 144 144 } … … 149 149 } 150 150 151 void Dict::SetEntity(int id, Entity *entity)151 void Dict::SetEntity(int slotid, Entity *entity) 152 152 { 153 153 Ticker::Ref(entity); 154 data->entities[ id] = entity;154 data->entities[slotid] = entity; 155 155 } 156 156 157 Entity *Dict::GetEntity(int id)157 Entity *Dict::GetEntity(int slotid) 158 158 { 159 return data->entities[ id];159 return data->entities[slotid]; 160 160 } 161 161 -
trunk/src/dict.h
r789 r958 31 31 32 32 int MakeSlot(char const *name); 33 void RemoveSlot(int id);33 void RemoveSlot(int slotid); 34 34 void RemoveSlot(Entity *entity); 35 35 36 void SetEntity(int id, Entity *entity);37 Entity *GetEntity(int id);36 void SetEntity(int slotid, Entity *entity); 37 Entity *GetEntity(int slotid); 38 38 39 39 private: -
trunk/src/image/codec/ios-image.cpp
r957 r958 13 13 #endif 14 14 15 #if defined __APPLE__ && defined __MACH__ 15 #if defined __APPLE__ && defined __MACH__ && defined __arm__ 16 16 17 17 #include <cmath> … … 98 98 } /* namespace lol */ 99 99 100 #endif /* defined __APPLE__ && defined __MACH__ */100 #endif /* defined __APPLE__ && defined __MACH__ && defined __arm__ */ 101 101 -
trunk/src/image/image.cpp
r955 r958 29 29 #endif 30 30 REGISTER_IMAGE_LOADER(DummyImageData) 31 #if defined __APPLE__ && defined __MACH__ 31 #if defined __APPLE__ && defined __MACH__ && defined __arm__ 32 32 REGISTER_IMAGE_LOADER(IosImageData) 33 33 #endif -
trunk/test/benchsuite.cpp
r942 r958 14 14 15 15 #include <cstdio> 16 17 #if USE_SDL 18 # include <SDL_main.h> 19 #endif 16 20 17 21 #include "core.h" -
trunk/test/debug/quad.cpp
r903 r958 29 29 #endif 30 30 31 #if USE_SDL 32 # include <SDL_main.h> 33 #endif 34 31 35 #if defined _WIN32 32 36 # undef main /* FIXME: still needed? */ -
trunk/test/debug/sandbox.cpp
r893 r958 13 13 #endif 14 14 15 #if USE_SDL 16 # include <SDL_main.h> 17 #endif 18 15 19 #include "core.h" 16 20 -
trunk/test/testsuite.cpp
r942 r958 16 16 #include <cstdlib> 17 17 18 #if USE_SDL 19 # include <SDL_main.h> 20 #endif 21 18 22 #include <lol/unit.h> 19 23 20 int main( void)24 int main(int argc, char **argv) 21 25 { 22 26 lol::TextTestRunner runner;
Note: See TracChangeset
for help on using the changeset viewer.