diff --git a/makefile.gaz b/makefile.gaz index 70339f6ce..59eebf3f1 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -302,6 +302,7 @@ thing_src := thing triggers_src := trigger \ tcamlock \ + tlevexit \ tlook \ trestart \ tteleprt \ diff --git a/source/backend/party.cpp b/source/backend/party.cpp index eb50d7657..decfe2d79 100644 --- a/source/backend/party.cpp +++ b/source/backend/party.cpp @@ -26,6 +26,10 @@ #include "game\game.h" #endif +#ifndef __GAME_GAMESLOT_H__ +#include "game\gameslot.h" +#endif + #ifndef __FRONTEND_FRONTEND_H__ #include "frontend\frontend.h" #endif @@ -125,6 +129,7 @@ void CPartyScene::init() m_actorPatrick=CActorPool::GetActor(ACTORS_PATRICK_SBK); m_actorPatrick->SetOtPos(5); CActorPool::SetUpCache(); + CActorPool::CleanUpCache(); } @@ -189,37 +194,28 @@ static PARTY_IMAGE images[]= }; static const int numimages=sizeof(images)/sizeof(PARTY_IMAGE); -static int itemsHeld[CShopScene::NUM_SHOP_ITEM_IDS]= -{ - true, // SHOPITEM_BLOWER - true, // SHOPITEM_CAKE - true, // SHOPITEM_CUPCAKE - true, // SHOPITEM_JELLY2 - true, // SHOPITEM_PARTYHAT - true, // SHOPITEM_PREZZIE - true, // SHOPITEM_SARNIE - true, // SHOPITEM_TEDDY -}; -DVECTOR sbpos={200,195}; -int sbanim=1,sbfrm=0; -DVECTOR patpos={250,195}; +DVECTOR sbpos={220,195}; +int sbanim=5,sbfrm=0; +DVECTOR patpos={300,200}; int patanim=0,patfrm=0; void CPartyScene::render() { - int i; - int drawn[FRM_TOYCHEST+1]; - PARTY_IMAGE *pimage; + int i; + int drawn[FRM_TOYCHEST+1]; + PARTY_IMAGE *pimage; + CGameSlotManager::GameSlot *gameSlot; for(i=0;im_fh<=FRM_TOYCHEST); - if(itemsHeld[pimage->m_itemId]&&!drawn[pimage->m_fh]) + if(gameSlot->isPartyItemHeld(pimage->m_itemId)&&!drawn[pimage->m_fh]) { m_sprites->printFT4(pimage->m_fh,pimage->m_xOffsetBroken*256,pimage->m_yOffsetBroken*256,0,0,pimage->m_ot); drawn[pimage->m_fh]=true; @@ -228,8 +224,9 @@ void CPartyScene::render() } // Actors -// m_actorSpongebob->Render(sbpos,sbanim,sbfrm,0,0); -// m_actorPatrick->Render(patpos,patanim,patfrm,0,0); + m_actorSpongebob->Render(sbpos,sbanim,sbfrm,0,0); + sbanim|=1; + m_actorPatrick->Render(patpos,patanim,patfrm,0,0); CActorPool::CleanUpCache(); diff --git a/source/game/game.cpp b/source/game/game.cpp index b317fcbc0..607a0ca5d 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -79,6 +79,10 @@ #include "map\map.h" #endif +#ifndef __SHOP_SHOP_H__ +#include "shop\shop.h" +#endif + #ifndef __FMA_FMA_H__ #include "fma\fma.h" #endif @@ -258,6 +262,14 @@ void CGameScene::think(int _frames) { GameState::setNextScene(&FmaScene); } + else if(getLevelNumber()==5) + { + if(getChapterNumber()==5) + { + ShopScene.setGotoPartyScreen(); + } + GameState::setNextScene(&ShopScene); + } else { GameState::setNextScene(&MapScene); diff --git a/source/gfx/animtex.cpp b/source/gfx/animtex.cpp index 114af25e3..c3163dbeb 100644 --- a/source/gfx/animtex.cpp +++ b/source/gfx/animtex.cpp @@ -83,7 +83,7 @@ CAnimTex *ThisTex=new ("CAnimTex::AddAnimTex") CAnimTex; ThisTex->TexData=(u32*)MemAlloc(Size*sizeof(u16), "AnTx"); DrawSync(0); StoreImage(&ThisTex->Rect,(u32*)ThisTex->TexData); - +PAUL_DBGMSG("1 added"); } /*****************************************************************************/ @@ -103,6 +103,7 @@ CAnimTex *PrevTex, *ThisTex, *NextTex; if (PrevTex) PrevTex->NextTex=NextTex; if (ThisTex==AnimTexList) AnimTexList=NextTex; delete ThisTex; +PAUL_DBGMSG("1 removed"); } else { diff --git a/source/gfx/tpage.cpp b/source/gfx/tpage.cpp index 34be39d11..39821ad6d 100644 --- a/source/gfx/tpage.cpp +++ b/source/gfx/tpage.cpp @@ -288,6 +288,7 @@ int ReadLeft; Cache->TPageName=Filename; Cache->XOfs=0; Cache->YOfs=0; + Cache->AnimTexCount=0; s_TPCache[TPage].Info[1].RefCount=-1; } diff --git a/source/level/level.cpp b/source/level/level.cpp index f684cae2e..e262249d3 100644 --- a/source/level/level.cpp +++ b/source/level/level.cpp @@ -407,8 +407,7 @@ void CLevel::initThings(int _respawningLevel) TriggerList=(sThingTrigger*)MakePtr(Hdr,sizeof(sThingHdr)); for(int i=0;ithink(_frames); @@ -423,6 +437,19 @@ int CShopScene::readyToShutdown() } +/*---------------------------------------------------------------------- + Function: + Purpose: Makes the game go to the party scene rather than the map + scene after the shop has been exited + Params: + Returns: + ---------------------------------------------------------------------- */ +void CShopScene::setGotoPartyScreen() +{ + s_gotoPartyScreen=true; +} + + /*---------------------------------------------------------------------- Function: Purpose: Ugh... I *really* hope this works ok with all languages, otherwise diff --git a/source/shop/shop.h b/source/shop/shop.h index 4c08b7a04..cacd8b657 100644 --- a/source/shop/shop.h +++ b/source/shop/shop.h @@ -44,6 +44,8 @@ public: int readyToShutdown(); char *getSceneName() {return"Shop";} + static void setGotoPartyScreen(); + typedef enum { SHOPITEM_BLOWER, diff --git a/source/triggers/tlevexit.cpp b/source/triggers/tlevexit.cpp index 1227cf0c4..2ac09082d 100644 --- a/source/triggers/tlevexit.cpp +++ b/source/triggers/tlevexit.cpp @@ -1,7 +1,3 @@ -NO LONGER USED BUT LEFT IN VSS INCASE ANYONE CHANGES THEIR MIND... (PKG) - - - /*========================================================================= tlevexit.cpp diff --git a/source/triggers/tlevexit.h b/source/triggers/tlevexit.h index 7c7c918b8..790e54411 100644 --- a/source/triggers/tlevexit.h +++ b/source/triggers/tlevexit.h @@ -1,7 +1,3 @@ -NO LONGER USED BUT LEFT IN VSS INCASE ANYONE CHANGES THEIR MIND... (PKG) - - - /*========================================================================= tlevexit.h diff --git a/source/triggers/trigger.cpp b/source/triggers/trigger.cpp index fa47ccd8e..8b3058929 100644 --- a/source/triggers/trigger.cpp +++ b/source/triggers/trigger.cpp @@ -15,6 +15,10 @@ #include "triggers\trigger.h" #endif +#ifndef __TRIGGERS_TLEVEXIT_H__ +#include "triggers\tlevexit.h" +#endif + #ifndef __TRIGGERS_TRESTART_H__ #include "triggers\trestart.h" #endif @@ -143,7 +147,7 @@ CTrigger *trigger; { // Exit trigger case TRIGGER_EXIT: - ASSERT("EXIT TRIGGERS HAVE BEEN REMOVED - HOW DID YOU GET HERE ANYWAY!?"); + trigger=(CTrigger*)new ("LevelExitTrigger") CLevelExitTrigger(); break; // Level respawn trigger