Changeset 340 for trunk/monsterz
- Timestamp:
- Feb 3, 2011, 2:28:47 AM (11 years ago)
- Location:
- trunk/monsterz
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/monsterz/Makefile.am
r339 r340 4 4 monsterz_SOURCES = \ 5 5 monsterz.cpp monsterz.h title.cpp title.h interface.cpp interface.h \ 6 fusion.cpp fusion.h board.cpp board.h piece.cpp piece.h mash.cpp mash.h 6 fusion.cpp fusion.h board.cpp board.h piece.cpp piece.h mash.cpp mash.h \ 7 thumbs.cpp thumbs.h 7 8 monsterz_CXXFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ 8 9 monsterz_LDADD = $(top_builddir)/src/liblol.a -
trunk/monsterz/board.cpp
r331 r340 21 21 #include "board.h" 22 22 #include "piece.h" 23 #include "thumbs.h" 23 24 #include "mash.h" 24 25 #include "monsterz.h" … … 35 36 int2 dim; 36 37 int npieces; 37 int board, tiles , icons;38 int board, tiles; 38 39 int click, whip; 39 40 … … 46 47 int nmoves; 47 48 48 Text *counticons[MAX_PIECES];49 int counts[MAX_PIECES];50 51 49 Text *scoretext; 52 50 int score; … … 54 52 Mash *mashes; 55 53 Emitter *emitter; 54 Thumbs *thumbs; 56 55 int2 src_cell, dst_cell; 57 56 … … 80 79 data->board = Tiler::Register(PNG_BOARD, 384, 384, 1.0f); 81 80 data->tiles = Tiler::Register(PNG_TILES, 48, 48, 1.0f); 82 data->icons = Tiler::Register(PNG_ICONS, 24, 24, 1.0f);83 81 data->click = Sampler::Register(WAV_CLICK); 84 82 data->whip = Sampler::Register(WAV_WHIP); … … 94 92 data->state = BoardData::IDLE; 95 93 96 for (int n = 0; n < MAX_PIECES; n++) 97 { 98 data->counts[n] = 0; 99 data->counticons[n] = new Text(NULL, "monsterz/gfx/font1.png"); 100 Ticker::Ref(data->counticons[n]); 101 int3 p = int3(476, 383 - 28 * n, 1); 102 data->counticons[n]->SetPos(p); 103 } 94 data->thumbs = new Thumbs(MAX_PIECES); 95 Ticker::Ref(data->thumbs); 104 96 105 97 data->scoretext = new Text(NULL, "monsterz/gfx/font2.png"); … … 145 137 } 146 138 147 /* Update s tatistics and score */139 /* Update score */ 148 140 data->scoretext->SetInt(data->score); 149 for (int n = 0; n < MAX_PIECES; n++)150 data->counticons[n]->SetInt(data->counts[n]);151 141 152 142 switch (data->state) … … 225 215 Scene::GetDefault()->AddTile((data->board << 16) | 0, 226 216 position.x, position.y, 1, 0); 227 228 /* Mini monsterz */229 for (int n = 0; n < MAX_PIECES; n++)230 {231 int2 p = int2(444, 380 - 28 * n);232 Scene::GetDefault()->AddTile((data->icons << 16) | n, p.x, p.y, 11, 0);233 }234 217 } 235 218 … … 334 317 /* The mash becomes the new owner of the disappearing piece */ 335 318 mash->AddPiece(data->pairs[i][j].piece); 336 data-> counts[data->pairs[i][j].id - 1]++;319 data->thumbs->AddCount(data->pairs[i][j].id - 1, 1); 337 320 338 321 #if 0 // Test for piece creation … … 529 512 Ticker::Unref(data->pairs[i][j].piece); 530 513 } 531 for (int n = 0; n < MAX_PIECES; n++) 532 Ticker::Unref(data->counticons[n]); 514 Ticker::Unref(data->thumbs); 533 515 Ticker::Unref(data->scoretext); 534 516 while (data->mashes) … … 543 525 Tiler::Deregister(data->board); 544 526 Tiler::Deregister(data->tiles); 545 Tiler::Deregister(data->icons);546 527 Sampler::Deregister(data->click); 547 528 Sampler::Deregister(data->whip);
Note: See TracChangeset
for help on using the changeset viewer.