This commit is contained in:
Paul 2000-10-18 20:00:31 +00:00
parent e8208db83f
commit fd06495937
2 changed files with 22 additions and 23 deletions

View File

@ -113,12 +113,12 @@ void CBubicleEmitter::think(int _frames)
if(m_spawnFrameCount>=m_data.m_birthRate) if(m_spawnFrameCount>=m_data.m_birthRate)
{ {
m_spawnFrameCount=0;
for(int i=0;i<m_data.m_birthAmount;i++) for(int i=0;i<m_data.m_birthAmount;i++)
{ {
if(CBubicleFactory::spawnParticle(&m_data)==NULL) if(CBubicleFactory::spawnParticle(&m_data)==NULL)
break; break; // Ran out of bubicles :(
} }
m_spawnFrameCount=0;
} }
if(m_data.m_life!=-1&&m_frameCount>m_data.m_life) if(m_data.m_life!=-1&&m_frameCount>m_data.m_life)

View File

@ -48,20 +48,20 @@
typedef struct RGBPack typedef struct RGBPack
{ {
unsigned char m_r,m_g,m_b; u8 m_r,m_g,m_b;
}; };
typedef struct typedef struct
{ {
int m_life; s16 m_life; // Frames to live for
int m_vx,m_vdx,m_vxmax; s16 m_vx,m_vdx,m_vxmax; // Velocity, velocitydelta, max velocity
int m_vy,m_vdy,m_vymax; s16 m_vy,m_vdy,m_vymax;
int m_w,m_h; int m_w,m_h; // Size of bubicle
int m_dvSizeChange; s16 m_dvSizeChange; // Speed at which bubbles changes height/width
int m_theta,m_vtheta; s16 m_theta,m_vtheta;
int m_wobbleWidth,m_vwobbleWidth,m_vdwobbleWidth; s16 m_wobbleWidth,m_vwobbleWidth,m_vdwobbleWidth;
int m_ot; s16 m_ot; // ot
RGBPack m_colour; RGBPack m_colour; // Colour
} BubicleData; } BubicleData;
class CBubicle class CBubicle
@ -84,13 +84,12 @@ private:
int isActive() {return m_active;} int isActive() {return m_active;}
int m_active; u8 m_active;
int m_x; int m_x;
int m_y; int m_y;
int m_typeSizeChange; // 0=Width, 1=Height s16 m_typeSizeChange; // 0=Width, 1=Height
int m_vSizeChange; s16 m_vSizeChange;
int m_frameCount; s16 m_frameCount;
sFrameHdr *m_fhBub; sFrameHdr *m_fhBub;
BubicleData m_data; BubicleData m_data;
@ -107,9 +106,9 @@ friend class CBubicleEmitter;
typedef struct typedef struct
{ {
int m_x,m_y,m_w,m_h; int m_x,m_y,m_w,m_h; // Size and position of emitter
int m_birthRate,m_birthAmount; s16 m_birthRate,m_birthAmount; // birthAmount bubicles born every birthRate frames
int m_life; // -1 for infinite life s16 m_life; // -1 for infinite life
BubicleData m_bubicleBase; BubicleData m_bubicleBase;
BubicleData m_bubicleRange; BubicleData m_bubicleRange;
@ -138,10 +137,10 @@ private:
#endif #endif
int m_active; u8 m_active;
BubicleEmitterData m_data; BubicleEmitterData m_data;
int m_frameCount; int m_frameCount;
int m_spawnFrameCount; s16 m_spawnFrameCount;
friend class CBubicleFactory; friend class CBubicleFactory;
}; };
@ -170,7 +169,7 @@ private:
enum enum
{ {
NUM_EMITTERS=10, NUM_EMITTERS=10,
NUM_BUBICLES=200, NUM_BUBICLES=100,
}; };
CBubicleFactory() {;} CBubicleFactory() {;}