diff --git a/src/fileio/CTileLoader.cpp b/src/fileio/CTileLoader.cpp index 08bf4cb13..e5f8fd775 100644 --- a/src/fileio/CTileLoader.cpp +++ b/src/fileio/CTileLoader.cpp @@ -125,34 +125,38 @@ bool CTileLoader::load() } int value; - - for( j=0 ; j < numtiles ; j++ ) + for( j=0 ; j < numtiles ;) { value = TileProperty[j][0]; // stuff for animated tiles if(value == 1) { - tiles[j].animOffset = 0; // starting offset from the base frame + tiles[j++].animOffset = 0; // starting offset from the base frame } else if( value == 2 ) { tiles[j++].animOffset = 0; // starting offset from the base frame - tiles[j].animOffset = 1; // starting offset from the base frame + tiles[j++].animOffset = 1; // starting offset from the base frame } else { tiles[j++].animOffset = 0; // starting offset from the base frame tiles[j++].animOffset = 1; // starting offset from the base frame tiles[j++].animOffset = 2; // starting offset from the base frame - tiles[j].animOffset = 3; // starting offset from the base frame + tiles[j++].animOffset = 3; // starting offset from the base frame } } + for(i=0 ; iControl.levelcontrol.curlevel; @@ -143,7 +137,7 @@ void gameloop(stCloneKeenPlus *pCKP) } } - gamedo_AnimatedTiles(); + gamedo_AnimatedTiles(!pCKP->Control.levelcontrol.usedhintmb); gamedo_enemyai(pCKP); gamedo_HandleFKeys(pCKP); @@ -1315,7 +1309,11 @@ void procgoodie(int t, int mpx, int mpy, int theplayer, stCloneKeenPlus *pCKP) break; case 22: // Game info block (Youseein your mind or vorticon elder...) - showGameHint(mpx, mpy, pCKP->Control.levelcontrol.episode, pCKP->Control.levelcontrol.curlevel); + if(!pCKP->Control.levelcontrol.usedhintmb) + { + showGameHint(mpx, mpy, pCKP->Control.levelcontrol.episode, pCKP->Control.levelcontrol.curlevel); + pCKP->Control.levelcontrol.usedhintmb = true; + } break; case 27: diff --git a/src/gamedo.cpp b/src/gamedo.cpp index 8c14e3d9d..91924075d 100644 --- a/src/gamedo.cpp +++ b/src/gamedo.cpp @@ -186,21 +186,25 @@ int scrollchanged; } // animates animated tiles -void gamedo_AnimatedTiles(void) +void gamedo_AnimatedTiles(bool animate_hinttiles) { int i; /* animate animated tiles */ if (animtiletimer>ANIM_TILE_TIME) { /* advance to next frame */ - curanimtileframe = (curanimtileframe+1)&7; - /* re-draw all animated tiles */ + curanimtileframe = (curanimtileframe+1)&7; + + /* re-draw all animated tiles */ for(i=1;idrawTile(animtiles[i].x, animtiles[i].y, animtiles[i].baseframe+((animtiles[i].offset+curanimtileframe)%TileProperty[animtiles[i].baseframe][ANIMATION])); - } + if (animtiles[i].slotinuse) + { + if( TileProperty[animtiles[i].baseframe][BEHAVIOR] != 22 || animate_hinttiles ) // If the tile is a hint mb, then, only animate if it hasn't been triggered yet! + { + g_pGraphics->drawTile(animtiles[i].x, animtiles[i].y, animtiles[i].baseframe+((animtiles[i].offset+curanimtileframe)%TileProperty[animtiles[i].baseframe][ANIMATION])); + } + } } animtiletimer = 0; } diff --git a/src/include/declarations.h b/src/include/declarations.h index 770ecbca4..210c430c3 100644 --- a/src/include/declarations.h +++ b/src/include/declarations.h @@ -50,6 +50,7 @@ struct stLevelControl int episode; // which episode we're playing (1-3) bool hardmode; + bool usedhintmb; // Has the message box been used? // array of which levels have been completed (have "Done" tiles over them // on the world map) diff --git a/src/main.cpp b/src/main.cpp index 3c445615f..f15bd68ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -378,6 +378,7 @@ void playgame_levelmanager(stCloneKeenPlus *pCKP) p_levelcontrol->command = LVLC_NOCOMMAND; p_levelcontrol->dark = 0; + p_levelcontrol->usedhintmb = false; if (loadinggame) { sprintf(SaveGameFileName, "ep%csave%c.dat", p_levelcontrol->episode+'0', loadslot+'0'); diff --git a/src/map.cpp b/src/map.cpp index c79613d33..a7c2dc81f 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -238,7 +238,7 @@ int i; px = ((mapxstripepos+((x-mapx)<<4))&511); py = ((mapystripepos+((y-mapy)<<4))&511); - TileProperty[map.mapdata[x][y]][ANIMATION] = 1; + //TileProperty[map.mapdata[x][y]][ANIMATION] = 1; // find it! for(i=1;i= 435 && map.mapdata[mpx][mpy] <= 438) @@ -189,9 +185,6 @@ void showGameHint(int mpx, int mpy, int episode, int level) break; } } - map_deanimate(mpx, mpy+(episode==2)); - - // In Episode 2 the floor must be deanimated, instead of the player, the player is at.? CWindow *InfoTextWindow = new CWindow(0.2, 0.2, 0.6, 0.6); InfoTextWindow->addTextBox(0.0f, 0.0f, 1.0f, 0.8f, getstring(strname), true); @@ -209,80 +202,6 @@ void showGameHint(int mpx, int mpy, int episode, int level) delete InfoTextWindow; } -void VorticonElder(int mpx, int mpy, stCloneKeenPlus *pCKP) -{ - CWindow *ElderTextWindow; - - /* - int twirlframe, twirltimer; - int dlgX,dlgY,dlgW,dlgH,twirlX,twirlY; - const int twirl_speed = 100;*/ - const char *strName=""; - - // TODO: Pause the game, because CWindow won't do that - - g_pInput->flushAll(); - - g_pSound->pauseSound(); - - ElderTextWindow = new CWindow(0.2, 0.2, 0.6, 0.6); - - switch(pCKP->Control.levelcontrol.curlevel) - { - case 8: - strName = "EP2_VE_NOJUMPINDARK"; - break; - case 10: - strName = "EP2_VE_EVILBELTS"; - break; - - default: - crashflag = 1; - why_term_ptr = "VE box: Illegal level #."; - break; - } - - /*dlgX = GetStringAttribute(strName, "LEFT"); - dlgY = GetStringAttribute(strName, "TOP"); - dlgW = GetStringAttribute(strName, "WIDTH"); - dlgH = GetStringAttribute(strName, "HEIGHT"); - twirlX = GetStringAttribute(strName, "TWIRLX"); - twirlY = GetStringAttribute(strName, "TWIRLY");*/ - - //dialogbox(dlgX, dlgY, dlgW, dlgH); - //g_pGraphics->drawFont( getstring(strName), (dlgX+1)<<3, (dlgY+1)<<3,0); - // For what was pGraphics->drawFont - - //twirlframe = 0; - //twirltimer = twirl_speed+1; - // wait for enter - do - { - /*if (twirltimer>twirl_speed) - { - g_pGraphics->drawCharacter((dlgX+twirlX)<<3, (dlgY+twirlY)<<3, 9+twirlframe); - g_pVideoDriver->update_screen(); - twirlframe++; - if (twirlframe>5) twirlframe=0; - twirltimer=0; - } else twirltimer++;*/ - - g_pInput->pollEvents(); - g_pTimer->SpeedThrottle(); - ElderTextWindow->render(); - g_pVideoDriver->update_screen(); - } while(!g_pInput->getPressedKey(KENTER) ); - - // make the switch stop glowing - // There may be a bug. Be careful - map_chgtile(mpx, mpy+1, 432); - - map_deanimate(mpx, mpy+1); - - g_pSound->resumeSounds(); -} - - void inventory_draw_ep1(int p) { int x,t,i,j;