diff --git a/Graphics/frontend/+bg1.bmp b/Graphics/frontend/+bg1.bmp index 1367c3867..0c452c023 100644 Binary files a/Graphics/frontend/+bg1.bmp and b/Graphics/frontend/+bg1.bmp differ diff --git a/data/DataCache.scr b/data/DataCache.scr index 464bcecb8..c32233619 100644 --- a/data/DataCache.scr +++ b/data/DataCache.scr @@ -17,6 +17,7 @@ sfx/ingame.pxm sfx/ingame.vb sfx/ingame.vh backdrop/credits.gfx +backdrop/sky.gfx { SYSTEM_CACHE 4 } ui/uigfx.spr diff --git a/makefile.gfx b/makefile.gfx index bd31173bf..90dffa0ca 100644 --- a/makefile.gfx +++ b/makefile.gfx @@ -123,7 +123,7 @@ INGAMEFX_GFX_OUT_DIR := $(DATA_OUT)/ingamefx INGAMEFX_GFX_NONTRANS := INGAMEFX_GFX_NONTRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_NONTRANS),$(INGAMEFX_NONTRANS_DIR)/$(FILE)) -INGAMEFX_GFX_TRANS := +bubble_small.bmp +bubble_flower.bmp +INGAMEFX_GFX_TRANS := +bubble_1.bmp +bubble_2.bmp +bubble_3.bmp INGAMEFX_GFX_TRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_TRANS),$(INGAMEFX_GFX_DIR)/$(FILE)) INGAMEFX_GFX_TEX_IN := ${INGAMEFX_GFX_NONTRANS_IN} ${INGAMEFX_GFX_TRANS_IN} @@ -181,7 +181,7 @@ GFX_DATA_OUT += $(FRONTEND_GFX_TEX_OUT) # Big TGA backdrops #---------------------------------------------------------------------------- BACKDROPS_IN_DIR := $(GRAF_DIR)/backdrop -BACKDROPS_IN := credits +BACKDROPS_IN := credits sky BACKDROPS_OUT_DIR := $(DATA_OUT)/backdrop BACKDROPS_OUT := $(foreach SCREEN,$(BACKDROPS_IN),$(BACKDROPS_OUT_DIR)/$(SCREEN).gfx) diff --git a/source/frontend/credits.cpp b/source/frontend/credits.cpp index 02947cf68..094f8c836 100644 --- a/source/frontend/credits.cpp +++ b/source/frontend/credits.cpp @@ -96,7 +96,7 @@ void CFrontEndCredits::shutdown() Params: Returns: ---------------------------------------------------------------------- */ -u8 *s_image; +static u8 *s_image; void CFrontEndCredits::select() { m_shuttingDown=false; diff --git a/source/frontend/demomode.cpp b/source/frontend/demomode.cpp index 130b6143a..8b0e631d4 100644 --- a/source/frontend/demomode.cpp +++ b/source/frontend/demomode.cpp @@ -83,9 +83,6 @@ static int count; ---------------------------------------------------------------------- */ void CFrontEndDemoMode::init() { - m_sprites=new ("Demomode Sprites") SpriteBank(); - m_sprites->load(FRONTEND_FRONTEND_SPR); - m_smallFont=new ("Demomode SmallFont") FontBank(); m_smallFont->initialise(&standardFont); m_smallFont->setJustification(FontBank::JUST_CENTRE); @@ -101,7 +98,6 @@ void CFrontEndDemoMode::init() void CFrontEndDemoMode::shutdown() { m_smallFont->dump(); delete m_smallFont; - m_sprites->dump(); delete m_sprites; } /*---------------------------------------------------------------------- @@ -140,12 +136,7 @@ void CFrontEndDemoMode::render() sFrameHdr *fh; // Game logo/title - fh=m_sprites->getFrameHeader(FRM__SBLOGO); - m_sprites->printFT4(fh,256-(fh->W/2),LOGO_CENTRE_Y-(fh->H/2),0,0,220); - m_smallFont->setColour(GAME_TITLE_TEXT_R,GAME_TITLE_TEXT_G,GAME_TITLE_TEXT_B); - m_smallFont->print(256,GAME_TITLE_TEXT_CENTRE_Y,STR__FRONTEND__GAME_TITLE); - m_smallFont->setColour(0,0,0); - m_smallFont->print(256+1,GAME_TITLE_TEXT_CENTRE_Y+1,STR__FRONTEND__GAME_TITLE); + CFrontEndScene::renderLogo(); if(!CFader::isFading()) { diff --git a/source/frontend/demomode.h b/source/frontend/demomode.h index 18e775ed3..2598e6fc6 100644 --- a/source/frontend/demomode.h +++ b/source/frontend/demomode.h @@ -64,7 +64,6 @@ private: }; class FontBank *m_smallFont; - class SpriteBank *m_sprites; int m_shuttingDown; }; diff --git a/source/frontend/frontend.cpp b/source/frontend/frontend.cpp index 9d19f3bd0..b75ad2cb4 100644 --- a/source/frontend/frontend.cpp +++ b/source/frontend/frontend.cpp @@ -42,6 +42,18 @@ #include "frontend\credits.h" #endif +#ifndef __GFX_SPRBANK_H__ +#include "gfx\sprbank.h" +#endif + +#ifndef __GFX_FONT_H__ +#include "gfx\font.h" +#endif + +#ifndef __LOCALE_TEXTDBASE_H__ +#include "locale\textdbase.h" +#endif + /* Std Lib ------- */ @@ -49,6 +61,11 @@ /* Data ---- */ +#ifndef __SPR_FRONTEND_H__ +#include +#endif + + /*---------------------------------------------------------------------- Tyepdefs && Defines ------------------- */ @@ -87,6 +104,14 @@ CFrontEndMode *CFrontEndScene::s_modeCodes[]= CFrontEndScene FrontEndScene; +int rsx=4096; +int rsy=4096; +int rsr=0; +int rspeed=0; +SpriteBank *m_sprites; +FontBank *m_font; + + /*---------------------------------------------------------------------- Function: Purpose: @@ -103,6 +128,13 @@ void CFrontEndScene::init() m_exitToGame=false; m_mode=MODE__NONE; setMode(MODE__MAIN_TITLES); + + m_sprites=new ("MainTitle Sprites") SpriteBank(); + m_sprites->load(FRONTEND_FRONTEND_SPR); + + m_font=new ("frontendfont") FontBank(); + m_font->initialise(&standardFont); + m_font->setJustification(FontBank::JUST_CENTRE); } @@ -114,6 +146,9 @@ void CFrontEndScene::init() ---------------------------------------------------------------------- */ void CFrontEndScene::shutdown() { + m_font->dump(); delete m_font; + m_sprites->dump(); delete m_sprites; + for(int i=0;ishutdown(); @@ -143,6 +178,8 @@ void CFrontEndScene::think(int _frames) { CFrontEndMode *mode; + thinkLogo(_frames); + mode=s_modeCodes[m_mode]; mode->think(_frames); if(mode->isReadyToExit()) @@ -164,6 +201,37 @@ int CFrontEndScene::readyToShutdown() } +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CFrontEndScene::renderLogo() +{ + sFrameHdr *fh; + + fh=m_sprites->getFrameHeader(FRM__SBLOGO); + m_sprites->printRotatedScaledSprite(fh,256,LOGO_CENTRE_Y,rsx,rsy,rsr,220); + m_font->setColour(GAME_TITLE_TEXT_R,GAME_TITLE_TEXT_G,GAME_TITLE_TEXT_B); + m_font->print(256,GAME_TITLE_TEXT_CENTRE_Y,STR__FRONTEND__GAME_TITLE); + m_font->setColour(0,0,0); + m_font->print(256+1,GAME_TITLE_TEXT_CENTRE_Y+1,STR__FRONTEND__GAME_TITLE); +} + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CFrontEndScene::thinkLogo(int _frames) +{ + rsr=(rsr+(_frames*rspeed))&4095; +} + + /*---------------------------------------------------------------------- Function: Purpose: diff --git a/source/frontend/frontend.h b/source/frontend/frontend.h index 686683da2..5961ed1f7 100644 --- a/source/frontend/frontend.h +++ b/source/frontend/frontend.h @@ -50,6 +50,15 @@ public: MODE__EXIT_TO_GAME, } FrontEndMode; + enum + { + LOGO_CENTRE_Y=74, + GAME_TITLE_TEXT_CENTRE_Y=100, + GAME_TITLE_TEXT_R=128, + GAME_TITLE_TEXT_G=128, + GAME_TITLE_TEXT_B=128, + }; + void init(); void shutdown(); void render(); @@ -57,8 +66,11 @@ public: int readyToShutdown(); char *getSceneName() {return"FrontEnd";} + static void renderLogo(); private: + void thinkLogo(int _frames); + void setMode(FrontEndMode _newMode); int m_exitToGame; diff --git a/source/frontend/maintitl.cpp b/source/frontend/maintitl.cpp index 71646f561..802eaaa04 100644 --- a/source/frontend/maintitl.cpp +++ b/source/frontend/maintitl.cpp @@ -50,6 +50,14 @@ #include "gui\gframe.h" #endif +#ifndef _FILEIO_HEADER_ +#include "fileio\fileio.h" +#endif + +#ifndef __VID_HEADER_ +#include "system\vid.h" +#endif + /* Std Lib ------- */ @@ -147,6 +155,7 @@ void CFrontEndMainTitles::shutdown() Params: Returns: ---------------------------------------------------------------------- */ +static u8 *s_image; void CFrontEndMainTitles::select() { m_mode=MODE__PRESS_START; @@ -159,6 +168,10 @@ void CFrontEndMainTitles::select() m_demoTimeout=0; + s_image=CFileIO::loadFile(BACKDROP_SKY_GFX); + ASSERT(s_image); + SetScreenImage(s_image); + CFader::setFadingIn(); } @@ -170,6 +183,9 @@ void CFrontEndMainTitles::select() ---------------------------------------------------------------------- */ void CFrontEndMainTitles::unselect() { + ClearScreenImage(); + MemFree(s_image); s_image=NULL; + m_mainMenu->unselect(); } @@ -192,31 +208,58 @@ int isy=3; int isw=100; int ish=56; -int rsx=4096; -int rsy=4096; -int rsr=0; -int rspeed=0; - void CFrontEndMainTitles::render() { sFrameHdr *fh; POLY_FT4 *ft4; // Game logo/title - fh=m_sprites->getFrameHeader(FRM__SBLOGO); -// m_sprites->printFT4(fh,256-(fh->W/2),LOGO_CENTRE_Y-(fh->H/2),0,0,220); - m_sprites->printRotatedScaledSprite(fh,256,LOGO_CENTRE_Y,rsx,rsy,rsr,220); - m_smallFont->setColour(GAME_TITLE_TEXT_R,GAME_TITLE_TEXT_G,GAME_TITLE_TEXT_B); - m_smallFont->print(256,GAME_TITLE_TEXT_CENTRE_Y,STR__FRONTEND__GAME_TITLE); - m_smallFont->setColour(0,0,0); - m_smallFont->print(256+1,GAME_TITLE_TEXT_CENTRE_Y+1,STR__FRONTEND__GAME_TITLE); - + CFrontEndScene::renderLogo(); // The island fh=m_sprites->getFrameHeader(FRM__ISLAND); m_sprites->printFT4(fh,ISLAND_LEFT_X,ISLAND_BOTTOM_Y-(fh->H),0,0,221); // Sky +/* +// POLY_FT4 *CFrontEndMainTitles::prepareSeaPortionFT4(sFrameHdr *_fh,int _x,int _y,int _w,int _h,int _rgb) +if(xstep&&ystep) +{ + int x,y,f; + sFrameHdr *fh; + POLY_FT4 *ft4; + + fh=m_sprites->getFrameHeader(FRM_SKY); + for(x=0;x<512;x+=xstep) + { + for(y=0;y<128;y+=ystep) + { + for(f=0;f>2,y<<1,xstep>>2,ystep<<1,128); + setXYWH(ft4,x+pos[f].x,y+pos[f].y,xstep,ystep); + if(f) + { + setSemiTrans(ft4,true); + } + AddPrimToList(ft4,1000-f); + } + } + } +} +else +{ + POLY_G4 *g4; + g4=GetPrimG4(); + setXYWH(g4,0,0,512,256); + setRGB0(g4,99,50,50); + setRGB1(g4,50,50,99); + setRGB2(g4,50,99,50); + setRGB3(g4,99,50,99); + AddPrimToList(g4,1001); +} +*/ + /* fh=m_sprites->getFrameHeader(FRM_SKY); for(int i=0;igetFrameHeader(FRM__ISLAND),isx,HORIZON_LEVEL+isy,isw,ish); renderSeaSection(m_sprites->getFrameHeader(FRM_SKY),0,HORIZON_LEVEL,512,256-HORIZON_LEVEL+SEA_OVERLAP); @@ -253,7 +297,6 @@ void CFrontEndMainTitles::render() ---------------------------------------------------------------------- */ void CFrontEndMainTitles::think(int _frames) { -rsr=(rsr+(_frames*rspeed))&4095; sval=(sval+(seaspeed*_frames))&4095; switch(m_mode) @@ -430,7 +473,7 @@ void CFrontEndMainTitles::renderSeaSection(sFrameHdr *_fh,int _x,int _y,int _w,i { grid[xloop][yloop].x=(x>>8)+0; grid[xloop][yloop].y=(y>>8)+(msin(waveval)/scale); - grid[xloop][yloop].colour=colourbase+((msin(waveval)/colourscale)*colourpostscale); +// grid[xloop][yloop].colour=colourbase+((msin(waveval)/colourscale)*colourpostscale); x+=xstep; } y+=ystep; diff --git a/source/frontend/maintitl.h b/source/frontend/maintitl.h index be88e7b8e..52fe8089e 100644 --- a/source/frontend/maintitl.h +++ b/source/frontend/maintitl.h @@ -55,12 +55,6 @@ public: private: enum { - LOGO_CENTRE_Y=74, - GAME_TITLE_TEXT_CENTRE_Y=100, - GAME_TITLE_TEXT_R=128, - GAME_TITLE_TEXT_G=128, - GAME_TITLE_TEXT_B=128, - PRESS_START_TEXT_Y=180, PRESS_START_TEXT_R=150, PRESS_START_TEXT_G=100, diff --git a/source/gfx/bubicles.cpp b/source/gfx/bubicles.cpp index 961c5827d..47e66f8c4 100644 --- a/source/gfx/bubicles.cpp +++ b/source/gfx/bubicles.cpp @@ -69,8 +69,19 @@ int CBubicleFactory::s_initialised=false; CBubicleEmitter *CBubicleFactory::s_emitters; CBubicle *CBubicleFactory::s_bubicles; + SpriteBank *CBubicleFactory::s_sprites; +int CBubicleFactory::s_frameTypeCounter=0; +const int CBubicleFactory::s_frameTabSize=8; +const int CBubicleFactory::s_frameTabSizeMask=0x07; +sFrameHdr *CBubicleFactory::s_frameTab[s_frameTabSize]; +const int CBubicleFactory::s_frameTabSrc[s_frameTabSize]= +{ + FRM__BUBBLE_1,FRM__BUBBLE_2,FRM__BUBBLE_2,FRM__BUBBLE_1, + FRM__BUBBLE_2,FRM__BUBBLE_1,FRM__BUBBLE_2,FRM__BUBBLE_3, +}; + int s_numLiveBubicleEmitters=0; int s_numLiveBubicles=0; @@ -217,8 +228,6 @@ void CBubicle::create() ---------------------------------------------------------------------- */ void CBubicle::init(BubicleData *_init,int _x,int _y) { - static int frameType=0; - m_data=*_init; m_x=(_x-(m_data.m_w>>1))<getFrameHeader((frameType++)&0x31?FRM__BUBBLE_SMALL:FRM__BUBBLE_FLOWER); + m_fhBub=CBubicleFactory::getBubbleFrameHeader(); m_active=true; } @@ -365,6 +374,11 @@ void CBubicleFactory::init() s_sprites=new ("Bubble Sprites") SpriteBank(); s_sprites->load(INGAMEFX_INGAMEFX_SPR); + for(i=0;igetFrameHeader(s_frameTabSrc[i]); + } + emt=s_emitters=(CBubicleEmitter*)MemAlloc(sizeof(CBubicleEmitter)*NUM_EMITTERS,"BubicleEmitters"); for(i=0;icreate(); @@ -554,5 +568,19 @@ CBubicle *CBubicleFactory::spawnParticle(BubicleEmitterData *_init) } +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +sFrameHdr *CBubicleFactory::getBubbleFrameHeader() +{ + s_frameTypeCounter=(s_frameTypeCounter+1)&s_frameTabSizeMask; + + return s_frameTab[s_frameTypeCounter]; +} + + /*=========================================================================== end */ \ No newline at end of file diff --git a/source/gfx/bubicles.h b/source/gfx/bubicles.h index 5f5b0af60..05199e1d1 100644 --- a/source/gfx/bubicles.h +++ b/source/gfx/bubicles.h @@ -161,7 +161,7 @@ public: static CBubicleEmitter *spawnEmitter(BubicleEmitterData *_init); static CBubicle *spawnParticle(BubicleEmitterData *_init); - + static sFrameHdr *getBubbleFrameHeader(); static SpriteBank *getSprites() {return s_sprites;} @@ -179,6 +179,12 @@ private: static CBubicle *s_bubicles; static SpriteBank *s_sprites; + static int s_frameTypeCounter; + static const int s_frameTabSize; + static const int s_frameTabSizeMask; + static sFrameHdr *s_frameTab[]; + static const int s_frameTabSrc[]; + }; diff --git a/source/gfx/fader.cpp b/source/gfx/fader.cpp index 437b8433e..adbc38be5 100644 --- a/source/gfx/fader.cpp +++ b/source/gfx/fader.cpp @@ -75,7 +75,7 @@ BubicleEmitterData s_fadeBubicleSpawner= 0,0, // m_theta,m_vtheta 0,0,0, // m_wobbleWidth,m_vwobbleWidth,m_vdwobbleWidth 0, // m_ot - {220,220,220} // m_colour + {20,20,20} // m_colour }, // m_bubicleRange; {