This commit is contained in:
parent
ae3e0482ea
commit
48a884f3f0
@ -83,7 +83,7 @@ void CPauseMenu::init()
|
||||
m_guiFrame->setOt(OT_POS);
|
||||
m_guiFrame->setFlags(CGUIObject::FLAG_DRAWBORDER);
|
||||
|
||||
int xpos=TEXT_SPACING;
|
||||
int xpos=TEXT_SPACING/2;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__PAUSE_MENU__CONTINUE,
|
||||
@ -93,7 +93,9 @@ void CPauseMenu::init()
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__PAUSE_MENU__QUIT,
|
||||
&m_quitGameFlag,true);
|
||||
xpos+=TEXT_SPACING*2;
|
||||
|
||||
|
||||
xpos+=TEXT_SPACING+(TEXT_SPACING/2);
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__BASICUNARMED_MODE,
|
||||
@ -105,11 +107,6 @@ void CPauseMenu::init()
|
||||
&newmode,PLAYER_MODE_FULLUNARMED);
|
||||
xpos+=TEXT_SPACING;
|
||||
#if defined(__USER_paul__) || defined(__USER_charles__)
|
||||
// CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
// STR__DEBUG__NET_MODE,
|
||||
// &newmode,PLAYER_MODE_NET);
|
||||
// xpos+=TEXT_SPACING;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__BALLOON_MODE,
|
||||
@ -120,6 +117,11 @@ void CPauseMenu::init()
|
||||
STR__DEBUG__BUBBLEMIXTURE_MODE,
|
||||
&newmode,PLAYER_MODE_BUBBLE_MIXTURE);
|
||||
xpos+=TEXT_SPACING;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__NET_MODE,
|
||||
&newmode,PLAYER_MODE_NET);
|
||||
xpos+=TEXT_SPACING;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__CORALBLOWER_MODE,
|
||||
@ -135,7 +137,6 @@ void CPauseMenu::init()
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__FLY_MODE,
|
||||
&newmode,PLAYER_MODE_FLY);
|
||||
xpos+=TEXT_SPACING;
|
||||
|
||||
m_active=false;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@
|
||||
---------------------------------------------------------------------- */
|
||||
void CNetPickup::collect(class CPlayer *_player)
|
||||
{
|
||||
// _player->setMode(PLAYER_MODE_NET);
|
||||
_player->setMode(PLAYER_MODE_NET);
|
||||
CBasePickup::collect(_player);
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,10 @@
|
||||
#include "player\pmbubble.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMNET_H__
|
||||
#include "player\pmnet.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMCHOP_H__
|
||||
#include "player\pmchop.h"
|
||||
#endif
|
||||
@ -57,6 +61,14 @@
|
||||
#include "player\pmfly.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GFX_FONT_H__
|
||||
#include "gfx\font.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GFX_SPRBANK_H__
|
||||
#include "gfx\sprbank.h"
|
||||
#endif
|
||||
|
||||
// to be removed
|
||||
#include "gfx\tpage.h"
|
||||
|
||||
@ -149,12 +161,11 @@ static const char *s_modeText[NUM_PLAYERMODES]=
|
||||
"FULLUNARMED",
|
||||
"BALLOON",
|
||||
"BUBBLE MIXTURE",
|
||||
"NET",
|
||||
"CORALBLOWER",
|
||||
"DEAD",
|
||||
"FLY",
|
||||
};
|
||||
#include "gfx\font.h"
|
||||
FontBank s_debugFont;
|
||||
#endif
|
||||
|
||||
|
||||
@ -183,6 +194,7 @@ CPlayerModeBase PLAYERMODE;
|
||||
CPlayerModeChop PLAYERMODECHOP;
|
||||
CPlayerModeBalloon PLAYERMODEBALLOON;
|
||||
CPlayerModeBubbleMixture PLAYERMODEBUBBLEMIXTURE;
|
||||
CPlayerModeNet PLAYERMODENET;
|
||||
CPlayerModeCoralBlower PLAYERMODECORALBLOWER;
|
||||
CPlayerModeDead PLAYERMODEDEAD;
|
||||
CPlayerModeFly PLAYERMODEFLY;
|
||||
@ -193,6 +205,7 @@ CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]=
|
||||
&PLAYERMODECHOP, // PLAYER_MODE_FULLUNARMED
|
||||
&PLAYERMODEBALLOON, // PLAYER_MODE_BALLOON
|
||||
&PLAYERMODEBUBBLEMIXTURE, // PLAYER_MODE_BUBBLE_MIXTURE
|
||||
&PLAYERMODENET, // PLAYER_MODE_NET
|
||||
&PLAYERMODECORALBLOWER, // PLAYER_MODE_CORALBLOWER
|
||||
&PLAYERMODEDEAD, // PLAYER_MODE_DEAD
|
||||
&PLAYERMODEFLY, // PLAYER_MODE_FLY
|
||||
@ -209,6 +222,13 @@ void CPlayer::init()
|
||||
{
|
||||
CPlayerThing::init();
|
||||
|
||||
m_fontBank=new ("PlayerFont") FontBank();
|
||||
m_fontBank->initialise(&standardFont);
|
||||
m_fontBank->setOt(5);
|
||||
|
||||
m_spriteBank=new ("PlayerSprites") SpriteBank();
|
||||
m_spriteBank->load(INGAMEFX_INGAMEFX_SPR);
|
||||
|
||||
m_layerCollision=NULL;
|
||||
|
||||
// m_onPlatform = false;
|
||||
@ -242,11 +262,6 @@ m_animFrame=0;
|
||||
m_skel.setAng(512);
|
||||
//m_skel.setAngInc(678);
|
||||
|
||||
#ifdef _STATE_DEBUG_
|
||||
s_debugFont.initialise(&standardFont);
|
||||
s_debugFont.setJustification(FontBank::JUST_LEFT);
|
||||
#endif
|
||||
|
||||
setCollisionSize(25,50);
|
||||
setCollisionCentreOffset(0,-25);
|
||||
|
||||
@ -266,9 +281,9 @@ void CPlayer::shutdown()
|
||||
s_playerModes[i]->shutdown();
|
||||
}
|
||||
|
||||
#ifdef _STATE_DEBUG_
|
||||
s_debugFont.dump();
|
||||
#endif
|
||||
m_spriteBank->dump(); delete m_spriteBank;
|
||||
m_fontBank->dump(); delete m_fontBank;
|
||||
|
||||
CPlayerThing::shutdown();
|
||||
}
|
||||
|
||||
@ -433,7 +448,7 @@ void CPlayer::render()
|
||||
|
||||
#ifdef _STATE_DEBUG_
|
||||
sprintf(posBuf,"%03d (%02d) ,%03d (%02d) = dfg:%+02d",Pos.vx,Pos.vx&0x0f,Pos.vy,Pos.vy&0x0f,getHeightFromGround(Pos.vx,Pos.vy));
|
||||
s_debugFont.print(40,40,posBuf);
|
||||
m_fontBank->print(40,40,posBuf);
|
||||
#endif
|
||||
|
||||
// Render
|
||||
@ -466,14 +481,13 @@ if(eyes!=-1)
|
||||
m_skel.Render(this);
|
||||
m_currentPlayerModeClass->render();
|
||||
SetGeomOffset(SCREEN_GEOM_CENTRE_X,SCREEN_GEOM_CENTRE_Y);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef _STATE_DEBUG_
|
||||
char buf[128];
|
||||
sprintf(buf,"MODE: %s",s_modeText[m_currentMode]);
|
||||
s_debugFont.print(40,210,buf);
|
||||
m_fontBank->print(40,210,buf);
|
||||
#endif
|
||||
|
||||
|
||||
@ -507,8 +521,11 @@ if(eyes!=-1)
|
||||
}
|
||||
char lifebuf[5];
|
||||
sprintf(lifebuf,"x%d",m_lives);
|
||||
s_debugFont.print(livesx,livesy,lifebuf);
|
||||
m_fontBank->print(livesx,livesy,lifebuf);
|
||||
#endif
|
||||
|
||||
// Mode specific ui
|
||||
m_currentPlayerModeClass->renderModeUi();
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ typedef enum
|
||||
PLAYER_MODE_FULLUNARMED,
|
||||
PLAYER_MODE_BALLOON,
|
||||
PLAYER_MODE_BUBBLE_MIXTURE,
|
||||
// PLAYER_MODE_NET,
|
||||
PLAYER_MODE_NET,
|
||||
PLAYER_MODE_CORALBLOWER,
|
||||
//PLAYER_MODE_JELLY_LAUNCHER,
|
||||
|
||||
@ -247,7 +247,7 @@ public:
|
||||
void giveInvinvibilityRing() {m_invinvibilityRingTimer=INVINCIBILITY_RING_TIME;}
|
||||
void giveDivingHelmet() {m_divingHelmet=true;}
|
||||
|
||||
void giveBubbleAmmo() {m_bubbleAmmo+=10;}
|
||||
void giveBubbleAmmo() {m_bubbleAmmo+=10;if(m_bubbleAmmo>99)m_bubbleAmmo=99;}
|
||||
void useOneBubble() {m_bubbleAmmo--;}
|
||||
int getBubbleAmmo() {return m_bubbleAmmo;}
|
||||
private:
|
||||
@ -275,6 +275,26 @@ private:
|
||||
|
||||
private:
|
||||
bool m_hasPlatformCollided;
|
||||
|
||||
|
||||
// Graphical resources
|
||||
public:
|
||||
class FontBank *getFontBank() {return m_fontBank;}
|
||||
class SpriteBank *getSpriteBank() {return m_spriteBank;}
|
||||
|
||||
enum
|
||||
{
|
||||
POWERUPUI_ICONX=40,
|
||||
POWERUPUI_ICONY=200,
|
||||
POWERUPUI_TEXTX=60,
|
||||
POWERUPUI_TEXTY=200,
|
||||
POWERUPUI_OT=5,
|
||||
};
|
||||
|
||||
private:
|
||||
class FontBank *m_fontBank;
|
||||
class SpriteBank *m_spriteBank;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -16,7 +16,14 @@
|
||||
-------- */
|
||||
|
||||
#include "player\pmbubble.h"
|
||||
|
||||
#ifndef __ENEMY_NPLATFRM_H__
|
||||
#include "enemy\nplatfrm.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GFX_FONT_H__
|
||||
#include "gfx\font.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
@ -29,6 +36,10 @@
|
||||
#include <ACTOR_SPONGEBOB_ANIM.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SPR_INGAMEFX_H__
|
||||
#include <ingamefx.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Tyepdefs && Defines
|
||||
@ -144,6 +155,28 @@ void CPlayerModeBubbleMixture::setAnimFrame(int _animFrame)
|
||||
m_savedAnimFrame=_animFrame;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayerModeBubbleMixture::renderModeUi()
|
||||
{
|
||||
SpriteBank *sb;
|
||||
sFrameHdr *fh;
|
||||
char buf[4];
|
||||
FontBank *fb;
|
||||
|
||||
sb=m_player->getSpriteBank();
|
||||
fh=sb->getFrameHeader(FRM__BUBBLEWAND);
|
||||
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT);
|
||||
|
||||
fb=m_player->getFontBank();
|
||||
sprintf(buf,"x%d",m_player->getBubbleAmmo());
|
||||
fb->print(CPlayer::POWERUPUI_TEXTX,CPlayer::POWERUPUI_TEXTY-(fb->getCharHeight()/2),buf);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
|
@ -39,6 +39,7 @@ class CPlayerModeBubbleMixture : public CPlayerModeBase
|
||||
public:
|
||||
virtual void enter();
|
||||
virtual void think();
|
||||
virtual void renderModeUi();
|
||||
|
||||
virtual void setAnimNo(int _animNo);
|
||||
virtual void setAnimFrame(int _animFrame);
|
||||
|
@ -17,6 +17,10 @@
|
||||
|
||||
#include "player\pmcoral.h"
|
||||
|
||||
#ifndef __GFX_SPRBANK_H__
|
||||
#include "gfx\sprbank.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
@ -28,6 +32,10 @@
|
||||
#include <ACTOR_SPONGEBOB_ANIM.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SPR_INGAMEFX_H__
|
||||
#include <ingamefx.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Tyepdefs && Defines
|
||||
@ -103,9 +111,9 @@ void CPlayerModeCoralBlower::think()
|
||||
}
|
||||
break;
|
||||
case BLOWER_STATE__AIMING:
|
||||
if(getState()==STATE_IDLE)
|
||||
if(getState()!=STATE_IDLE)
|
||||
{
|
||||
m_blowerState=BLOWER_STATE__EMPTY;
|
||||
m_blowerState=BLOWER_STATE__FULL;
|
||||
}
|
||||
if(!getPadInputHeld()&PI_ACTION)
|
||||
{
|
||||
@ -117,6 +125,30 @@ void CPlayerModeCoralBlower::think()
|
||||
cbstate=m_blowerState;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayerModeCoralBlower::renderModeUi()
|
||||
{
|
||||
SpriteBank *sb;
|
||||
sFrameHdr *fh;
|
||||
|
||||
sb=m_player->getSpriteBank();
|
||||
fh=sb->getFrameHeader(FRM__BLOWER);
|
||||
if(m_blowerState==BLOWER_STATE__FULL||m_blowerState==BLOWER_STATE__AIMING)
|
||||
{
|
||||
// Blower has a creature/object inside
|
||||
sb->printFT4Scaled(FRM__BLOWER,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT,256+128);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT);
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
|
@ -39,6 +39,7 @@ class CPlayerModeCoralBlower : public CPlayerModeBase
|
||||
public:
|
||||
virtual void enter();
|
||||
virtual void think();
|
||||
virtual void renderModeUi();
|
||||
|
||||
virtual const struct PlayerMetrics *getPlayerMetrics();
|
||||
|
||||
|
@ -17,6 +17,10 @@
|
||||
|
||||
#include "player\pmnet.h"
|
||||
|
||||
#ifndef __GFX_SPRBANK_H__
|
||||
#include "gfx\sprbank.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
@ -28,6 +32,10 @@
|
||||
#include <ACTOR_SPONGEBOB_ANIM.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SPR_INGAMEFX_H__
|
||||
#include <ingamefx.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Tyepdefs && Defines
|
||||
@ -108,6 +116,30 @@ void CPlayerModeNet::think()
|
||||
netstate=m_netState;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayerModeNet::renderModeUi()
|
||||
{
|
||||
SpriteBank *sb;
|
||||
sFrameHdr *fh;
|
||||
|
||||
sb=m_player->getSpriteBank();
|
||||
fh=sb->getFrameHeader(FRM__NET);
|
||||
if(m_netState==NET_STATE__FULL)
|
||||
{
|
||||
// Net has a jellyfish inside
|
||||
sb->printFT4Scaled(fh,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT,256+128);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT);
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
|
@ -39,6 +39,7 @@ class CPlayerModeNet : public CPlayerModeBase
|
||||
public:
|
||||
virtual void enter();
|
||||
virtual void think();
|
||||
virtual void renderModeUi();
|
||||
|
||||
virtual void setAnimNo(int _animNo);
|
||||
virtual void setAnimFrame(int _animFrame);
|
||||
|
@ -81,6 +81,7 @@ public:
|
||||
virtual void enter() {;}
|
||||
virtual void think() {;}
|
||||
virtual void render() {;}
|
||||
virtual void renderModeUi() {;} // Ui specific to this mode (eg: ammo)
|
||||
|
||||
int getPadInputHeld();
|
||||
int getPadInputDown();
|
||||
|
@ -888,6 +888,14 @@ SOURCE=..\..\..\source\player\pmfly.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\player\pmnet.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\player\pmnet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\player\pmodes.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
Loading…
Reference in New Issue
Block a user