This commit is contained in:
parent
0b2fe9ef7b
commit
acf969998b
7 changed files with 72 additions and 143 deletions
Binary file not shown.
Before Width: | Height: | Size: 614 B After Width: | Height: | Size: 2 KiB |
|
@ -141,7 +141,9 @@ hazard_src := hazard \
|
|||
|
||||
fx_src := fx \
|
||||
fxfallingtile \
|
||||
fxjfish
|
||||
fxcloud \
|
||||
fxsteam
|
||||
|
||||
|
||||
projectl_src := projectl \
|
||||
prnpc \
|
||||
|
|
|
@ -164,7 +164,7 @@ SFX_GFX_IN := $(foreach FILE,$(SFX_GFX),$(SFX_GFX_DIR)/$(FILE))
|
|||
|
||||
SFXGFX_SPR_DEP := $(SFX_GFX_IN)
|
||||
|
||||
SFXGFX_SPR_IN := -z- $(SFX_GFX_IN)
|
||||
SFXGFX_SPR_IN := -z- -c+ $(SFX_GFX_IN) -z+ -c-
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Ingame graphics and UI
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "FX\FX.h"
|
||||
#include "FX\FXjfish.h"
|
||||
#include "FX\FXfallingTile.h"
|
||||
#include "FX\FXCloud.h"
|
||||
#include "FX\FXSteam.h"
|
||||
/* FX
|
||||
|
||||
Jellyfish legs
|
||||
|
@ -69,12 +71,19 @@ CFX *NewFX;
|
|||
|
||||
switch(Type)
|
||||
{
|
||||
case FX_TYPE_JELLYFISH_LEGS:
|
||||
NewFX=new ("JellyFish Legs") CFXJellyFishLegs();
|
||||
break;
|
||||
case FX_TYPE_FALLINGTILE:
|
||||
NewFX=new ("Falling Tile") CFXFallingTile();
|
||||
break;
|
||||
case FX_TYPE_CLOUD:
|
||||
NewFX=new ("Cloud ") CFXCloud();
|
||||
break;
|
||||
case FX_TYPE_STEAM:
|
||||
NewFX=new ("Steam") CFXSteam();
|
||||
break;
|
||||
|
||||
case FX_TYPE_JELLYFISH_LEGS:
|
||||
// NewFX=new ("JellyFish Legs") CFXJellyFishLegs();
|
||||
ASSERT(!"FISH LEGS OUT OF STOCK\n");
|
||||
case FX_TYPE_BUBBLE:
|
||||
case FX_TYPE_BUBBLE_WATER:
|
||||
case FX_TYPE_BUBBLE_ACID:
|
||||
|
@ -100,8 +109,6 @@ CFX *NewFX;
|
|||
case FX_TYPE_CASCADE:
|
||||
case FX_TYPE_CASCADE_SPLASH:
|
||||
case FX_TYPE_FIREBALL:
|
||||
case FX_TYPE_CLOUD:
|
||||
case FX_TYPE_CLOUD_STEAN:
|
||||
case FX_TYPE_CLOUD_SMOKE:
|
||||
case FX_TYPE_CLOUD_GAS:
|
||||
case FX_TYPE_FLAMES:
|
||||
|
@ -121,12 +128,10 @@ CFX *CFX::Create(const FX_TYPE Type,CThing *Parent)
|
|||
{
|
||||
CFX *NewFX=CFX::Create(Type);
|
||||
|
||||
if (Parent)
|
||||
{
|
||||
Parent->addChild(NewFX);
|
||||
}
|
||||
ASSERT(Parent);
|
||||
|
||||
NewFX->init();
|
||||
NewFX->init(Parent->getPos());
|
||||
Parent->addChild(NewFX);
|
||||
|
||||
return NewFX;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
FX_TYPE_CASCADE_SPLASH,
|
||||
FX_TYPE_FIREBALL,
|
||||
FX_TYPE_CLOUD,
|
||||
FX_TYPE_CLOUD_STEAN,
|
||||
FX_TYPE_STEAM,
|
||||
FX_TYPE_CLOUD_SMOKE,
|
||||
FX_TYPE_CLOUD_GAS,
|
||||
FX_TYPE_FLAMES,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/************************/
|
||||
/*** Cloud Base Class ***/
|
||||
/************************/
|
||||
/*************/
|
||||
/*** Steam ***/
|
||||
/*************/
|
||||
|
||||
#include "system\global.h"
|
||||
#include <DStructs.h>
|
||||
|
@ -10,133 +10,65 @@
|
|||
#include <sprites.h>
|
||||
#include "level\level.h"
|
||||
|
||||
#include "FX\FXcloud.h"
|
||||
#include "FX\FXSteam.h"
|
||||
|
||||
static s16 SteamSize=1;
|
||||
const s16 SteamAngleInc=1111;
|
||||
|
||||
DVECTOR SmokeVel;
|
||||
u16 AngleInc=16;
|
||||
|
||||
u8 StartR=255;
|
||||
u8 StartG=255;
|
||||
u8 StartB=255;
|
||||
s8 RInc=-8;
|
||||
s8 BInc=-8;
|
||||
s8 GInc=-8;
|
||||
s16 StartScaleX=256;
|
||||
s16 ScaleXInc=256;
|
||||
s16 StartScaleY=256;
|
||||
s16 ScaleYInc=256;
|
||||
|
||||
int SLife=64;
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CFXCloud::init(DVECTOR const &_Pos)
|
||||
void CFXSteam::init(DVECTOR const &_Pos)
|
||||
{
|
||||
CFX::init();
|
||||
Pos=_Pos;
|
||||
HeadIdx=0;
|
||||
ListCount=1;
|
||||
Angle=0;
|
||||
CFXCloud::init(_Pos);
|
||||
Life=SLife;
|
||||
|
||||
RBase=255;
|
||||
GBase=255;
|
||||
BBase=255;
|
||||
RInc=-8;
|
||||
GInc=-8;
|
||||
BInc=-8;
|
||||
|
||||
Trans=3;
|
||||
|
||||
SetSize(SteamSize);
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CFXCloud::shutdown()
|
||||
void CFXSteam::shutdown()
|
||||
{
|
||||
CFX::shutdown();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CFXSteam::SetSize(int Size)
|
||||
{
|
||||
ScaleInc=(4096/LIST_SIZE)*Size;
|
||||
AngleInc=SteamAngleInc;
|
||||
Vel.vx=0;
|
||||
Vel.vy=-Size;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Think *******************************************************************/
|
||||
/*****************************************************************************/
|
||||
int SS=4;
|
||||
void CFXCloud::think(int _frames)
|
||||
int LifeStart=32;
|
||||
|
||||
void CFXSteam::think(int _frames)
|
||||
{
|
||||
int ThisIdx=HeadIdx;
|
||||
DVECTOR Vel=SmokeVel;
|
||||
if (Parent)
|
||||
SetSize(SteamSize);
|
||||
CFXCloud::think(_frames);
|
||||
|
||||
if (!DieOut)
|
||||
{
|
||||
this->setPos(Parent->getPos());
|
||||
setHead(Vel,Vel,LifeStart);
|
||||
}
|
||||
|
||||
CFX::think(_frames);
|
||||
|
||||
HeadIdx--;
|
||||
if (HeadIdx<0) HeadIdx+=ListCount;
|
||||
|
||||
if (Parent)
|
||||
{
|
||||
setPos(Parent->getPos());
|
||||
}
|
||||
List[HeadIdx].Ofs=getPos();
|
||||
|
||||
|
||||
for (int i=0; i<ListCount-1; i++)
|
||||
{
|
||||
sList &ThisElem=List[ThisIdx++];
|
||||
ThisIdx&=MAX_TRAIL-1;
|
||||
ThisElem.Ofs.vx+=Vel.vx>>SS;
|
||||
ThisElem.Ofs.vy+=Vel.vy>>SS;
|
||||
Vel.vx+=SmokeVel.vx;
|
||||
Vel.vy+=SmokeVel.vy;
|
||||
}
|
||||
ListCount++;
|
||||
if (ListCount>MAX_TRAIL)
|
||||
{
|
||||
ListCount=MAX_TRAIL;
|
||||
}
|
||||
Life--;
|
||||
if (!Life) DieOut=true;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Render ******************************************************************/
|
||||
/*****************************************************************************/
|
||||
int ST=3;
|
||||
|
||||
void CFXCloud::render()
|
||||
{
|
||||
CFX::render();
|
||||
|
||||
if (canRender())
|
||||
{
|
||||
DVECTOR const &MapOfs=CLevel::getCameraPos();
|
||||
DVECTOR RenderPos;
|
||||
int ThisIdx=HeadIdx;
|
||||
|
||||
int ThisAngle=Angle;
|
||||
int ThisScaleX=StartScaleX;
|
||||
int ThisScaleY=StartScaleY;
|
||||
u8 ThisR=StartR;
|
||||
u8 ThisG=StartG;
|
||||
u8 ThisB=StartB;
|
||||
|
||||
for (int i=0; i<ListCount; i++)
|
||||
{
|
||||
sList &ThisOfs=List[ThisIdx];
|
||||
POLY_FT4 *Ft4;
|
||||
|
||||
RenderPos.vx=ThisOfs.Ofs.vx-MapOfs.vx;
|
||||
RenderPos.vy=ThisOfs.Ofs.vy-MapOfs.vy;
|
||||
|
||||
Ft4=m_spriteBank->printRotatedScaledSprite(FRM__SMOKE,RenderPos.vx,RenderPos.vy,ThisScaleX,ThisScaleY,ThisAngle,OtPos*0);
|
||||
setShadeTex(Ft4,0);
|
||||
setSemiTrans(Ft4,1);
|
||||
setRGB0(Ft4,ThisR,ThisB,ThisB);
|
||||
Ft4->tpage|=ST<<5;
|
||||
|
||||
ThisR+=RInc;
|
||||
ThisG+=GInc;
|
||||
ThisB+=BInc;
|
||||
|
||||
ThisAngle+=AngleInc;
|
||||
ThisAngle&=4095;
|
||||
ThisScaleX+=ScaleXInc;
|
||||
ThisScaleY+=ScaleYInc;
|
||||
|
||||
ThisIdx++;
|
||||
ThisIdx&=MAX_TRAIL-1;
|
||||
}
|
||||
Angle+=AngleInc/2;
|
||||
Angle&=4095;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,25 @@
|
|||
/**********************/
|
||||
/*** JellyFish Legs ***/
|
||||
/**********************/
|
||||
/*************/
|
||||
/*** Steam ***/
|
||||
/*************/
|
||||
|
||||
#ifndef __FX_FX_CLOUD_HEADER__
|
||||
#define __FX_FX_CLOUD_HEADER__
|
||||
#ifndef __FX_FX_STEAM_HEADER__
|
||||
#define __FX_FX_STEAM_HEADER__
|
||||
|
||||
#include "fx/fx.h"
|
||||
#include "fx/fxcloud.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
class CFXCloud : public CFX
|
||||
class CFXSteam : public CFXCloud
|
||||
{
|
||||
public:
|
||||
struct sList
|
||||
{
|
||||
DVECTOR Ofs;
|
||||
};
|
||||
enum
|
||||
{
|
||||
MAX_TRAIL = 16
|
||||
};
|
||||
|
||||
virtual void init(DVECTOR const &Pos);
|
||||
virtual void shutdown();
|
||||
virtual void think(int _frames);
|
||||
virtual void render();
|
||||
|
||||
void SetSize(int Size);
|
||||
protected:
|
||||
sList List[MAX_TRAIL];
|
||||
int ListCount;
|
||||
int HeadIdx;
|
||||
int Angle;
|
||||
int Life;
|
||||
DVECTOR Vel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue