re3/src/render/WaterCreatures.h

48 lines
1.3 KiB
C
Raw Normal View History

2020-10-08 01:43:50 +00:00
#pragma once
#include "Object.h"
2020-10-09 12:53:22 +00:00
enum eFishSlotState {
2020-10-31 13:33:49 +00:00
WATER_CREATURE_INIT = 0,
2020-10-08 01:43:50 +00:00
WATER_CREATURE_ACTIVE,
2020-10-31 13:33:49 +00:00
WATER_CREATURE_FADE_OUT,
WATER_CREATURE_REMOVE,
2020-10-08 01:43:50 +00:00
WATER_CREATURE_DISABLED
};
class CWaterCreature {
public:
CObject *m_pObj;
2020-10-31 13:33:49 +00:00
float m_fFwdSpeed;
2020-10-08 01:43:50 +00:00
float m_fZTurnSpeed;
int32 m_alpha;
float m_fWaterDepth;
int32 m_state;
CWaterCreature();
2020-10-31 13:33:49 +00:00
void Allocate(CObject *pObj, float fFwdSpeed, float fZTurnSpeed, float fWaterDepth, uint32 alpha, eFishSlotState state);
2020-10-08 01:43:50 +00:00
void Free();
2020-10-31 13:33:49 +00:00
void Initialise(CObject *pObj, float fFwdSpeed, float fZTurnSpeed, float fWaterDepth, uint32 alpha, eFishSlotState state);
2020-10-08 01:43:50 +00:00
};
class CWaterCreatures {
public:
static CWaterCreature aWaterCreatures[NUM_WATER_CREATURES];
static int32 nNumActiveSeaLifeForms;
2020-10-09 12:53:22 +00:00
static CObject *CreateSeaLifeForm(CVector const& pos, int16 modelID, int32 zRotAngle);
static void CreateOne(CVector const& pos, int32 modelID);
2020-10-08 01:43:50 +00:00
static void UpdateAll();
static void FreeFishStructSlot(CWaterCreature *wc);
static bool IsSpaceForMoreWaterCreatures();
static float CalculateFishHeading(CVector const& pos1, CVector const& pos2);
static void RemoveAll();
static CWaterCreature* GetFishStructSlot();
};
struct WaterCreatureProperties {
int16 *modelID;
2020-10-31 13:33:49 +00:00
float fFwdSpeed;
2020-10-08 01:43:50 +00:00
float fLevel;
2020-10-09 12:53:22 +00:00
float fUnknown; //unused
2020-10-08 01:43:50 +00:00
float fWaterDepth;
};