From 6cb69637f82854b2c6585890d24b02407ce42170 Mon Sep 17 00:00:00 2001 From: Daveo Date: Mon, 9 Jul 2001 22:13:44 +0000 Subject: [PATCH] --- source/game/game.cpp | 36 ++++++++++++++++++++++++++++++++++++ source/gfx/actor.cpp | 3 ++- source/level/layertile.cpp | 4 +++- source/level/layertile3d.cpp | 4 +++- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/source/game/game.cpp b/source/game/game.cpp index 191908dcc..c2249912f 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -103,6 +103,15 @@ #include "gfx\actor.h" int RenderZ=378;//256; Increased to make depth less, and SB more visible +// Horrible evil bodge 4 Petro, via Gary :o( +#define USE_GLOBAL_RGB +#ifdef USE_GLOBAL_RGB +u8 GlobalRGB[4]={127,127,127,127}; +int GlobalRGBSel=0; +char *GlobalRGBName[4]={"Sprites","Action","Mid","Other"}; +int GlobalRGBX=200; +int GlobalRGBY=28; +#endif /*****************************************************************************/ @@ -333,7 +342,24 @@ void CGameScene::render_showing_lives() void CGameScene::render_playing() { // CamMtx.t[2]=ZPos; // Temp +#ifdef USE_GLOBAL_RGB + + s_genericFont->setTrans(0); + s_genericFont->setSMode(0); + for (int i=0; i<3; i++) + { + char Buf[32]; + if (i==GlobalRGBSel) + s_genericFont->setColour(255,255,255); + else + s_genericFont->setColour(64,64,64); + + sprintf(Buf,"%s: %i",GlobalRGBName[i],GlobalRGB[i]); + s_genericFont->print(GlobalRGBX,GlobalRGBY+(i*16),Buf); + } + +#endif if(m_levelHasTimer) { int timerValue; @@ -509,6 +535,16 @@ void CGameScene::think_showing_lives(int _frames) /*****************************************************************************/ void CGameScene::think_playing(int _frames) { +#ifdef USE_GLOBAL_RGB + if (PadGetDown(1) & PAD_UP) GlobalRGBSel--; + if (PadGetDown(1) & PAD_DOWN) GlobalRGBSel++; + GlobalRGBSel&=3; + + if(PadGetHeld(1)&PAD_LEFT ) GlobalRGB[GlobalRGBSel]--; + if(PadGetHeld(1)&PAD_RIGHT ) GlobalRGB[GlobalRGBSel]++; + GlobalRGB[GlobalRGBSel]&=255; +#endif + if(s_readyToExit) { return; diff --git a/source/gfx/actor.cpp b/source/gfx/actor.cpp index 29651f8fb..2f0e54e4c 100644 --- a/source/gfx/actor.cpp +++ b/source/gfx/actor.cpp @@ -605,7 +605,8 @@ sSpriteAnim *ThisAnim=SpriteBank->AnimList+Anim; Ft4=GetPrimFT4(); SetUpFT4(Ft4,ThisNode,Pos.vx,Pos.vy,XFlip,YFlip); - setRGB0(Ft4,128,128,128); +extern u8 GlobalRGB[]; + setRGB0(Ft4,GlobalRGB[0],GlobalRGB[0],GlobalRGB[0]); Ft4->tpage=ThisNode->TPage; Ft4->clut=PoolEntry->ActorGfx->Clut; addPrim(OtPtr+OtPos,Ft4); diff --git a/source/level/layertile.cpp b/source/level/layertile.cpp index 0f0b10da1..200e9570f 100644 --- a/source/level/layertile.cpp +++ b/source/level/layertile.cpp @@ -41,7 +41,7 @@ TSPRT *PrimPtr=PrimBank; for (int i=0; iw=TILE2D_WIDTH; PrimPtr->h=TILE2D_HEIGHT; PrimPtr++; @@ -125,6 +125,8 @@ TSPRT *PrimPtr=PrimBank; PrimPtr->y0=TileY; setTSprtTPage(PrimPtr,Tile->TPage); *(u32*)&PrimPtr->u0=*(u32*)&Tile->u0; // copy uv AND clut +extern u8 GlobalRGB[]; + setRGB0(PrimPtr,GlobalRGB[2],GlobalRGB[2],GlobalRGB[2]); addPrim(ThisOT,PrimPtr); PrimPtr++; } diff --git a/source/level/layertile3d.cpp b/source/level/layertile3d.cpp index 2c72072c1..0be007b86 100644 --- a/source/level/layertile3d.cpp +++ b/source/level/layertile3d.cpp @@ -159,7 +159,7 @@ VECTOR BlkPos; setlen(TPrimPtr, GPU_PolyFT3Tag); TPrimPtr->code=TList->PolyCode; gte_rtpt_b(); - setShadeTex(TPrimPtr,1); +// setShadeTex(TPrimPtr,1); T0=*(u32*)&TList->uv0; // Get UV0 & TPage T1=*(u32*)&TList->uv1; // Get UV1 & Clut @@ -167,6 +167,8 @@ VECTOR BlkPos; *(u32*)&TPrimPtr->u0=T0; // Set UV0 *(u32*)&TPrimPtr->u1=T1; // Set UV1 *(u16*)&TPrimPtr->u2=T2; // Set UV2 +extern u8 GlobalRGB[]; + setRGB0(TPrimPtr,GlobalRGB[1],GlobalRGB[1],GlobalRGB[1]); ThisOT=OtPtr+TList->OTOfs; TList++;