From da0eac7a3da8b736021c3848ca11ba1f393aff88 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 13 Nov 2000 17:03:20 +0000 Subject: [PATCH] --- Graphics/UI/font.anm | Bin 15793 -> 16031 bytes data/DataCache.scr | 1 + makefile.gaz | 2 + makefile.gfx | 41 +++++++-- source/frontend/scrollbg.cpp | 35 +++++++ source/frontend/scrollbg.h | 18 +++- source/game/game.cpp | 48 ---------- source/gfx/fdata.cpp | 38 ++++++++ source/gfx/fdata.h | 3 +- source/gui/gui.cpp | 2 +- source/paul/paul.cpp | 86 +++++++++++++++++- .../spongebob project/spongebob project.dsp | 16 ++++ 12 files changed, 231 insertions(+), 59 deletions(-) diff --git a/Graphics/UI/font.anm b/Graphics/UI/font.anm index b558a881effd284aae980ce1f669fc8fb2393480..7d6b780e61842ffa614a2d4d8e02cde784ae3364 100644 GIT binary patch delta 848 zcmcgp%W4!s6g|~l-Cfo7ayBsmA+rk_NHW3kF;PeS0LAgK&r)58k}O1|%kEKeDJ8gY z;ZksAX#IfxkntPhTA{4UFzPyjR8e)$;oiFEo;rB?;n`=JCA-^gFZ-Uo*%I_UcDG$F zHpDx;#uGda>wz1KwRDI*cTeo36Wnqi#Xjv}NZP(+Wr`ebeQ8B;Ff9vkEs??9T)I>F z%1*z*0@pxb4MbqZm@hiDtz^~LQ>SEv^(KJ zDwJV%)FJl(46p5lW5%KVsSZ)X!`W{$zD$sD(*9iD%h&C=1M%^+&y#pj4=L>>5^k;S zWs)cp%dgMi-mcy+vFaln%+QklS3U~y%RfUry32x@M~*hp3g)A^VK+xc zogS>U;>;&q9geK`u)S*WTZf}4iTtOd8WZlBR9Y(;{wGYXWKpMuPywXgh-p%qIWHn# d&Uq$5brLF82(EbBKepVf|2FH5s@=HQ&|kY2>x}>a delta 549 zcmbVI%Ss$U6g{`Ay1TmTMG_bl!MF$rF$^;d6Ca66TnUO0NnGUvbRY|rEJVbjC)s3` zP|GZ`3lK;Y9+h?*V zf8aazv5Ovheo0QTCO-RZ`G&1x-T#qa_#9SHPbyI|!Z$zN7}FBMs2qh+K;OS_eDo)c zk)s4~O$wg21yEQezJf=oh*DWvJrr6bq7W$hv7tk$x@B3!;=XrisYro19M*S;3vJ3O z3yRUg0m~q`vkhjnUmm&269G3viJu+)u=QY4UQrp>%@LQ{iU?;Y1z?LRUj29yuHyC0 zXg_-q_bgJZ=WK`>lyYy04`7U2phR1L{Jh7K!JwX){8y~q-M6zTLRPnd_2XcNLb6tc zcb85Us10$aa9zrV7Qz?0RNfDwo_<*y^LN87UZ9G_y(8b&W4<-load(FRONTEND_FRONTEND_SPR); + m_xOff=m_yOff=0; + + setSpeed(DEFAULT_X_SPEED,DEFAULT_Y_SPEED); + setSpeedScale(DEFAULT_SPEED_SCALE); + setOt(DEFAULT_OT); } @@ -73,6 +80,7 @@ void CScrollyBackground::init() ---------------------------------------------------------------------- */ void CScrollyBackground::shutdown() { + m_sprites->dump(); delete m_sprites; m_sprites=NULL; } @@ -84,6 +92,27 @@ void CScrollyBackground::shutdown() ---------------------------------------------------------------------- */ void CScrollyBackground::render() { + POLY_FT4 *ft4; + sFrameHdr *fh; + int x,y,w,h; + + fh=m_sprites->getFrameHeader(FRM__BG1); + w=fh->W; + h=fh->H; + y=(m_yOff>>m_speedScale)-h; + do + { + x=(m_xOff>>m_speedScale)-w; + do + { + ft4=m_sprites->printFT4(fh,x,y,0,0,m_ot); + setSemiTrans(ft4,true); + x+=w; + } + while(x<512); + y+=h; + } + while(y<256); } @@ -95,6 +124,12 @@ void CScrollyBackground::render() ---------------------------------------------------------------------- */ void CScrollyBackground::think(int _frames) { + sFrameHdr *fh; + + fh=m_sprites->getFrameHeader(FRM__BG1); + + m_xOff=(m_xOff+(_frames*m_xSpeed))%(fh->W<H<setColour( 255, 255 , 0 ); VidSetClearScreen(1); - CBubicleFactory::init(); - testBub=CBubicleFactory::spawnEmitter(&bubData); - - s_sprites=new ("bg sprite") SpriteBank(); - s_sprites->load(INGAMEFX_INGAMEFX_SPR); } /*****************************************************************************/ @@ -83,8 +47,6 @@ void CGameScene::init() void CGameScene::shutdown() { s_genericFont->dump(); delete s_genericFont; - s_sprites->dump(); delete s_sprites; - CBubicleFactory::shutdown(); } /*****************************************************************************/ @@ -98,12 +60,6 @@ void CGameScene::render() char *Str="Sponge\nBob\nSquare\nPants"; s_genericFont->print(X,Y,Str); - - CBubicleFactory::render(); - - POLY_FT4 *ft4=s_sprites->printFT4(FRM_BACKGROUND,0,0,0,0,1023); - setXYWH(ft4,20,20,512-40,256-40); - setRGB0(ft4,64,64,64); } /*****************************************************************************/ @@ -117,10 +73,6 @@ void CGameScene::think(int _frames) if (Y<+4) {Y=0+4; Dy=getRndRange(5)+1;} if (Y>256-64) {Y=256-64; Dy=-(getRndRange(5)+1);} } - - testBub->setPos(X,Y); - - CBubicleFactory::think(); } /*****************************************************************************/ diff --git a/source/gfx/fdata.cpp b/source/gfx/fdata.cpp index b4cd94fad..25d85ef35 100644 --- a/source/gfx/fdata.cpp +++ b/source/gfx/fdata.cpp @@ -86,6 +86,44 @@ s16 standardFontTab[]= }; FontData standardFont( UI_UIGFX_SPR, standardFontTab, 9, 1,1, 4 ); +s16 largeFontTab[]= +{ + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + /* ! " # $ % & ' */ -1,FRM_SBFONTAN_0037,FRM_SBFONTAN_0038, -1,FRM_SBFONTAN_0052,FRM_SBFONTAN_0039,FRM_SBFONTAN_0040,FRM_SBFONTAN_0036, + /* ( ) * + , - . / */ FRM_SBFONTAN_0042,FRM_SBFONTAN_0043,FRM_SBFONTAN_0041, -1,FRM_SBFONTAN_0047,FRM_SBFONTAN_0044,FRM_SBFONTAN_0053,FRM_SBFONTAN_0050, + /* 0 1 2 3 4 5 6 7 */ FRM_SBFONTAN_0026,FRM_SBFONTAN_0027,FRM_SBFONTAN_0028,FRM_SBFONTAN_0029,FRM_SBFONTAN_0030,FRM_SBFONTAN_0031,FRM_SBFONTAN_0032,FRM_SBFONTAN_0033, + /* 8 9 : ; < = > ? */ FRM_SBFONTAN_0034,FRM_SBFONTAN_0035,FRM_SBFONTAN_0045,FRM_SBFONTAN_0046, -1, -1, -1,FRM_SBFONTAN_0048, + /* @ A B C D E F G */ -1,FRM_SBFONTAN_0000,FRM_SBFONTAN_0001,FRM_SBFONTAN_0002,FRM_SBFONTAN_0003,FRM_SBFONTAN_0004,FRM_SBFONTAN_0005,FRM_SBFONTAN_0006, + /* H I J K L M N O */ FRM_SBFONTAN_0007,FRM_SBFONTAN_0008,FRM_SBFONTAN_0009,FRM_SBFONTAN_0010,FRM_SBFONTAN_0011,FRM_SBFONTAN_0012,FRM_SBFONTAN_0013,FRM_SBFONTAN_0014, + /* P Q R S T U V W */ FRM_SBFONTAN_0015,FRM_SBFONTAN_0016,FRM_SBFONTAN_0017,FRM_SBFONTAN_0018,FRM_SBFONTAN_0019,FRM_SBFONTAN_0020,FRM_SBFONTAN_0021,FRM_SBFONTAN_0022, + /* X Y Z [ \ ] ^ _ */ FRM_SBFONTAN_0023,FRM_SBFONTAN_0024,FRM_SBFONTAN_0025,FRM_SBFONTAN_0054,FRM_SBFONTAN_0049,FRM_SBFONTAN_0055, -1, -1, + /* ` a b c d e f g */ -1,FRM_SBFONTAN_0056,FRM_SBFONTAN_0057,FRM_SBFONTAN_0058,FRM_SBFONTAN_0059,FRM_SBFONTAN_0060,FRM_SBFONTAN_0061,FRM_SBFONTAN_0062, + /* h i j k l m n o */ FRM_SBFONTAN_0063,FRM_SBFONTAN_0064,FRM_SBFONTAN_0065,FRM_SBFONTAN_0066,FRM_SBFONTAN_0067,FRM_SBFONTAN_0068,FRM_SBFONTAN_0069,FRM_SBFONTAN_0070, + /* p q r s t u v w */ FRM_SBFONTAN_0071,FRM_SBFONTAN_0072,FRM_SBFONTAN_0073,FRM_SBFONTAN_0074,FRM_SBFONTAN_0075,FRM_SBFONTAN_0076,FRM_SBFONTAN_0077,FRM_SBFONTAN_0078, + /* x y z { | } ~ . */ FRM_SBFONTAN_0079,FRM_SBFONTAN_0080,FRM_SBFONTAN_0081, -1, -1, -1, -1, -1, + /* */ -1, -1, -1, -1, -1, -1, -1, -1, + /* */ -1, -1, -1, -1, -1, -1, -1, -1, + /* */ -1, -1, -1, -1, -1, -1, -1, -1, + /* */ -1, -1, -1, -1, -1, -1, -1, -1 + /* */ -1, -1, -1, -1, -1, -1, -1, -1, + /* */ -1, -1, -1, -1, -1, -1, -1, -1, + /* */ -1, -1, -1, -1, -1, -1, -1, -1, + /* */ -1, -1, -1, -1, -1, -1, -1, -1, + -1,-1, + /* */ FRM_SBFONTAN_0084,FRM_SBFONTAN_0085,FRM_SBFONTAN_0086,FRM_SBFONTAN_0087,FRM_SBFONTAN_0088,FRM_SBFONTAN_0089,FRM_SBFONTAN_0090,FRM_SBFONTAN_0091, + /* */ FRM_SBFONTAN_0092,FRM_SBFONTAN_0093,FRM_SBFONTAN_0094,FRM_SBFONTAN_0095,FRM_SBFONTAN_0096,FRM_SBFONTAN_0097,FRM_SBFONTAN_0098,FRM_SBFONTAN_0099, + /* */ FRM_SBFONTAN_0100,FRM_SBFONTAN_0101,FRM_SBFONTAN_0102,FRM_SBFONTAN_0103,FRM_SBFONTAN_0104,FRM_SBFONTAN_0105,FRM_SBFONTAN_0106,FRM_SBFONTAN_0107, + /* */ FRM_SBFONTAN_0108,FRM_SBFONTAN_0109,FRM_SBFONTAN_0110,FRM_SBFONTAN_0111,FRM_SBFONTAN_0112,FRM_SBFONTAN_0113,FRM_SBFONTAN_0114,FRM_SBFONTAN_0115, + /* */ FRM_SBFONTAN_0116,FRM_SBFONTAN_0117,FRM_SBFONTAN_0118,FRM_SBFONTAN_0119,FRM_SBFONTAN_0120,FRM_SBFONTAN_0121,FRM_SBFONTAN_0122,FRM_SBFONTAN_0123, + /* */ FRM_SBFONTAN_0124,FRM_SBFONTAN_0125,FRM_SBFONTAN_0126,FRM_SBFONTAN_0127,FRM_SBFONTAN_0128,FRM_SBFONTAN_0129,FRM_SBFONTAN_0130,FRM_SBFONTAN_0131, + /* */ FRM_SBFONTAN_0132,FRM_SBFONTAN_0133, -1, -1, -1, -1, -1, -1, + /* */ -1, -1, -1, -1, -1, -1, -1, -1, +}; +FontData largeFont( UI_UIGFX_SPR, largeFontTab, 19, 1,1, 6 ); + /*---------------------------------------------------------------------- Function: diff --git a/source/gfx/fdata.h b/source/gfx/fdata.h index f5572607d..7ddc88dc1 100644 --- a/source/gfx/fdata.h +++ b/source/gfx/fdata.h @@ -58,7 +58,8 @@ public: ---- */ // Available fonts -extern FontData standardFont; +extern FontData standardFont; // Crappy old PR font +extern FontData largeFont; // Large SB font /* Data ---- */ diff --git a/source/gui/gui.cpp b/source/gui/gui.cpp index 102d687a5..cf2b3e878 100644 --- a/source/gui/gui.cpp +++ b/source/gui/gui.cpp @@ -278,7 +278,7 @@ void CGUIObjectWithFont::init(CGUIObject *_parent,GUIId _id) { CGUIObject::init(_parent,_id); m_fontBank=new ("GUIObjectWithFont:fontBank") FontBank(); - m_fontBank->initialise(&standardFont); + m_fontBank->initialise(&largeFont); m_fontBank->setJustification(FontBank::JUST_CENTRE); m_fontBank->setOt(getOt()); m_fontBank->setColour(DEFAULT_FONT_R,DEFAULT_FONT_G,DEFAULT_FONT_B); diff --git a/source/paul/paul.cpp b/source/paul/paul.cpp index 7a5d8252b..9cf475f44 100644 --- a/source/paul/paul.cpp +++ b/source/paul/paul.cpp @@ -74,6 +74,10 @@ #include "locale\textdbase.h" #endif +#ifndef __FRONTEND_SCROLLBG_H__ +#include "frontend\scrollbg.h" +#endif + /* Std Lib ------- */ @@ -102,6 +106,9 @@ Vars ---- */ static FontBank s_fontBank; +static CScrollyBackground *s_bg1; +static CScrollyBackground *s_bg2; +static CScrollyBackground *s_bg3; /*---------------------------------------------------------------------- @@ -229,9 +236,25 @@ PAUL_DBGMSG("initial mem free=%d",mem); // baseGUIObject=0; PAUL_DBGMSG("change=%d",mem-(MainRam.TotalRam-MainRam.RamUsed)); + + + s_bg1=new ("scrolly background") CScrollyBackground(); + s_bg1->init(); + s_bg1->setSpeed(+2,+2); + + s_bg2=new ("scrolly background") CScrollyBackground(); + s_bg2->init(); + s_bg2->setSpeed(-2,0); + s_bg2->setOt(1001); + + s_bg3=new ("scrolly background") CScrollyBackground(); + s_bg3->init(); + s_bg3->setSpeed(0,-2); + s_bg3->setOt(1002); } + /*---------------------------------------------------------------------- Function: Purpose: @@ -240,6 +263,9 @@ PAUL_DBGMSG("change=%d",mem-(MainRam.TotalRam-MainRam.RamUsed)); ---------------------------------------------------------------------- */ void CPaulScene::shutdown() { + s_bg3->shutdown(); + s_bg2->shutdown(); + s_bg1->shutdown(); s_fontBank.dump(); } @@ -253,7 +279,7 @@ void CPaulScene::shutdown() int showDebugLog=false; void CPaulScene::render() { - +/* if(showDebugLog) { int logCount; @@ -270,6 +296,11 @@ void CPaulScene::render() if(baseGUIObject) baseGUIObject->render(); + + s_bg1->render(); + s_bg2->render(); + s_bg3->render(); +*/ } @@ -291,8 +322,59 @@ void CPaulScene::think(int _frames) if(baseGUIObject) baseGUIObject->think(_frames); + + s_bg1->think(_frames); + s_bg2->think(_frames); + s_bg3->think(_frames); } /*=========================================================================== - end */ \ No newline at end of file + end */ + + + +/* +BubicleEmitterData bubData= +{ + 206,200,60,60, // m_x,m_y,m_w,m_h + 10,1, // m_birthRate,m_birthAmount + -1, // m_life + { // m_bubicleBase + 100, // m_life + 0,0,0, // m_vx,m_vdx,m_vxmax + -40,-15,-100, // m_vy,m_vdy,m_vymax + 13,10, // m_w,m_h + 10, // m_dvSizeChange + 0,100, // m_theta,m_vtheta + 100,2,0, // m_wobbleWidth,m_vwobbleWidth,m_vdwobbleWidth + 40, // m_ot + { 128,128,128, } // m_colour + }, + { // m_bubicleRange + 100, // m_life + 0,0,0, // m_vx,m_vdx,m_vxmax + 20,10,0, // m_vy,m_vdy,m_vymax + 5,5, // m_w,m_h + 10, // m_dvSizeChange + 4095,50, // m_theta,m_vtheta + 100,5,0, // m_wobbleWidth,m_vwobbleWidth,m_vdwobbleWidth + 0, // m_ot + { 0, 64,127, } // m_colour + } +}; +CBubicleEmitter *testBub; + + + CBubicleFactory::init(); + testBub=CBubicleFactory::spawnEmitter(&bubData); + + CBubicleFactory::shutdown(); + + testBub->setPos(X,Y); + + CBubicleFactory::render(); + CBubicleFactory::think(); + + +*/ \ No newline at end of file diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index f67f0ef2e..07fb19d9d 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -480,6 +480,18 @@ SOURCE=..\..\..\source\utils\utils.cpp SOURCE=..\..\..\source\utils\utils.h # End Source File # End Group +# Begin Group "frontend" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\source\frontend\scrollbg.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\frontend\scrollbg.h +# End Source File +# End Group # End Group # Begin Group "makefiles" @@ -524,6 +536,10 @@ SOURCE=..\..\..\out\USA\include\BigLump.h # End Source File # Begin Source File +SOURCE=..\..\..\out\USA\include\frontend.h +# End Source File +# Begin Source File + SOURCE=..\..\..\out\USA\include\ingamefx.h # End Source File # Begin Source File