spidey-decomp/bit.h

356 lines
7.2 KiB
C
Raw Normal View History

#pragma once
#ifndef BIT_H
#define BIT_H
2024-08-02 14:16:33 +00:00
#include "main.h"
#include "vector.h"
#include "texture.h"
#include "ps2funcs.h"
2024-07-22 16:59:50 +00:00
#define FLATBIT_VELOCITIES_SIZE (4096)
#define FLATBIT_VELOCITIES_MAX_INDEX (FLATBIT_VELOCITIES_SIZE-1)
2024-07-29 16:59:40 +00:00
struct SRibbonPoint {
// offset: 0000 (12 bytes)
CVector Pos;
// offset: 000C
u8 r;
// offset: 000D
u8 g;
// offset: 000E
u8 b;
// offset: 0010
u16 Width;
// offset: 0012
u16 WidthB;
// offset: 0014
u8 rB;
// offset: 0015
u8 gB;
// offset: 0016
u8 bB;
// offset: 0018
i32 Last1Scr;
// offset: 001C
i32 Last2Scr;
// offset: 0020
i32 Last3Scr;
};
2024-07-22 16:59:50 +00:00
struct SFlatBitVelocity
{
i16 vxVel;
i16 vzVel;
};
class CBit
{
public:
CBit* mPrevious;
CBit* mNext;
2024-03-11 16:20:46 +00:00
__int16 field_C;
2024-07-30 16:22:28 +00:00
u16 field_E;
CVector mPos;
CVector mVel;
CVector mAcc;
CFriction mFric;
2023-07-04 16:44:55 +00:00
unsigned char mDead;
2024-03-03 19:00:31 +00:00
unsigned __int16 mFrigDeltaZ;
2023-07-04 16:44:55 +00:00
unsigned char mProtected;
u8 mType;
2023-07-04 16:44:55 +00:00
EXPORT CBit();
2024-05-21 18:09:54 +00:00
EXPORT virtual ~CBit();
2024-05-21 18:22:11 +00:00
EXPORT virtual void Move(void);
EXPORT void* operator new(size_t size);
2024-05-21 18:09:54 +00:00
EXPORT void operator delete(void*);
2023-07-04 16:44:55 +00:00
EXPORT void Die();
2023-07-05 15:22:05 +00:00
EXPORT CBit* AttachTo(CBit** to);
2024-02-25 16:15:05 +00:00
EXPORT void SetPos(const CVector &pos);
EXPORT void DeleteFrom(CBit **lst);
};
2024-02-25 16:15:05 +00:00
class CQuadBit : public CBit {
public:
2024-02-25 22:01:11 +00:00
CVector mPosB;
CVector mPosC;
CVector mPosD;
2024-07-21 16:13:12 +00:00
Texture* mpTexture;
u32 mCodeBGR;
2024-02-25 16:15:05 +00:00
unsigned pad;
2024-07-21 16:13:12 +00:00
u32 mTint;
u8 padAfter6C[4];
u32 field_74;
u32 field_78;
u32 field_7C;
u32 field_80;
2024-02-25 16:15:05 +00:00
EXPORT void SetTint(unsigned char a2, unsigned char a3, unsigned char a4);
2024-02-25 22:01:11 +00:00
EXPORT void SetSemiTransparent();
EXPORT void SetOpaque();
EXPORT void SetSubtractiveTransparency();
EXPORT void SetCorners(const CVector &a2, const CVector &a3, const CVector &a4, const CVector &a5);
2024-03-03 18:26:01 +00:00
EXPORT void SetTransparency(unsigned char a2);
2024-07-30 15:00:16 +00:00
EXPORT void OrientUsing(CVector *, SVECTOR *, i32, i32);
EXPORT void OrientUsing(CVector *, SVECTOR *, i32, i32, i32);
2024-03-03 19:00:31 +00:00
EXPORT void SetTexture(int, int);
EXPORT void SetTexture(u32);
2024-02-25 16:15:05 +00:00
};
struct SCFT4BitTexture
{
unsigned char field_0;
unsigned char field_1;
unsigned char field_2;
unsigned char field_3;
2024-06-03 16:53:12 +00:00
Texture *field_4;
};
2024-05-27 17:31:10 +00:00
class CFT4Bit : public CBit
{
public:
EXPORT CFT4Bit(void);
EXPORT virtual ~CFT4Bit();
EXPORT void SetAnimSpeed(short);
EXPORT void SetScale(unsigned short);
EXPORT void SetSemiTransparent();
EXPORT void SetTransparency(unsigned char t);
EXPORT void SetAnim(int);
2024-05-27 17:38:19 +00:00
EXPORT void IncFrameWithWrap(void);
2024-06-03 16:11:57 +00:00
EXPORT void SetFrame(int);
EXPORT void SetTint(unsigned char, unsigned char, unsigned char);
EXPORT void SetTexture(Texture*);
2024-06-03 16:53:12 +00:00
EXPORT void SetTexture(unsigned int);
2024-06-03 17:20:37 +00:00
EXPORT int Fade(int);
2024-06-03 17:27:23 +00:00
EXPORT void SetTransDecay(int);
2024-05-27 17:31:10 +00:00
u16 mTransDecay;
u16 field_3E;
2024-05-27 17:31:10 +00:00
unsigned int mCodeBGR;
unsigned char mDeleteAnimOnDestruction;
unsigned char padAfterDeleteAnim[0x3];
SCFT4BitTexture *mPSXAnim;
SCFT4BitTexture *field_4C;
2024-05-27 17:31:10 +00:00
unsigned char padAfteranimRelated5[0x1];
2024-06-03 16:11:57 +00:00
unsigned char field_51;
i8 field_52;
2024-06-03 16:11:57 +00:00
unsigned char field_53;
2024-05-27 17:31:10 +00:00
short mAnimSpeed;
short mScale;
2024-02-25 22:24:57 +00:00
};
2024-02-25 22:38:37 +00:00
class CFlatBit : public CFT4Bit {
2024-02-25 22:24:57 +00:00
2024-02-25 22:38:37 +00:00
public:
2024-06-03 17:41:44 +00:00
EXPORT CFlatBit(void);
EXPORT ~CFlatBit(void);
2024-07-22 16:59:50 +00:00
i16 field_58;
i16 field_5A;
2024-03-11 16:09:59 +00:00
unsigned char padAfter5A[0x2];
2024-06-03 17:41:44 +00:00
unsigned short field_5E;
2024-02-25 22:38:37 +00:00
unsigned int mPostScale;
unsigned char pad1;
2024-07-30 16:08:04 +00:00
unsigned char mAngFric;
2024-02-25 22:38:37 +00:00
};
class CNonRenderedBit : public CBit {
2024-07-12 15:06:11 +00:00
public:
};
2024-07-23 15:17:45 +00:00
class CRibbon : public CNonRenderedBit
{
public:
EXPORT CRibbon(CVector*, i32, i32, i32, i32, i32, i32);
EXPORT void SetScale(i32);
};
class CSmokeTrail : public CRibbon
2024-05-12 16:43:59 +00:00
{
public:
unsigned char pad[28];
2024-07-23 15:17:45 +00:00
EXPORT CSmokeTrail(CVector*, i32, i32, i32, i32);
2024-05-12 16:43:59 +00:00
};
class CSpecialDisplay : public CBit
{
public:
2024-05-26 14:42:52 +00:00
EXPORT CSpecialDisplay(void);
};
class CSimpleTexturedRibbon : public CSpecialDisplay
{
public:
2024-05-31 16:52:08 +00:00
EXPORT void SetRGB(unsigned char, unsigned char, unsigned char);
2024-05-31 16:43:25 +00:00
u16 field_3C;
u8 padAfter3C[0x48-0x3C-2];
i32* field_48;
};
class CGlow : public CBit
{
public:
2024-07-21 16:29:33 +00:00
EXPORT CGlow(u32, u32);
2024-07-20 15:11:14 +00:00
EXPORT CGlow(CVector*, i32, i32, u8, u8, u8, u8, u8, u8);
2024-08-02 14:40:15 +00:00
EXPORT virtual ~CGlow(void);
2024-07-20 15:11:14 +00:00
EXPORT void SetCentreRGB(u8, u8, u8);
EXPORT void SetRadius(i32);
EXPORT void SetRGB(u8, u8, u8);
2024-05-29 16:37:14 +00:00
2024-07-29 17:34:55 +00:00
EXPORT void SetFringeWidth(u32, u32);
EXPORT void SetFringeRGB(u32, u8, u8, u8);
2024-05-29 16:37:14 +00:00
int* field_3C;
unsigned char padAfter3C[0x44-0x3C-4];
unsigned int field_44;
unsigned char padAfter44[0x4C-0x44-4];
int field_4C;
unsigned char padAfter4C[0x54-0x4C-4];
unsigned __int16 field_54;
unsigned char padBottom[0x5C-0x54-2];
};
2024-05-27 17:31:10 +00:00
class CLinked2EndedBit : public CFT4Bit
{
public:
EXPORT CLinked2EndedBit(void);
CVector field_58;
CVector field_64;
};
2024-05-27 17:38:19 +00:00
class CRibbonBit : public CLinked2EndedBit
{
public:
EXPORT virtual void Move(void);
};
2024-08-04 16:32:34 +00:00
/*
class CTexturedRibbon : public CSpecialDisplay
{
public:
EXPORT void SetOuterRGBi(int, unsigned char, unsigned char, unsigned char);
u8 topPad[0x60-0x3C];
i32* field_60;
};
2024-08-04 16:32:34 +00:00
*/
class CSimpleAnim : public CFlatBit
{
public:
2024-07-24 16:25:11 +00:00
EXPORT CSimpleAnim(CVector*, i32, u16, i32, i32, i32);
};
class CMotionBlur : public CFlatBit
{
public:
EXPORT CMotionBlur(CVector*, CVector*, i32,i32,i32,i32);
EXPORT virtual void Move(void);
};
2024-07-25 15:48:52 +00:00
class CCombatImpactRing : public CFlatBit
{
public:
EXPORT CCombatImpactRing(CVector*, u8, u8, u8, i32, i32, i32);
2024-08-02 14:48:43 +00:00
EXPORT virtual ~CCombatImpactRing(void);
2024-07-25 16:05:44 +00:00
u8 padBottom[0xC];
2024-07-25 15:48:52 +00:00
};
2024-07-30 16:52:37 +00:00
class CFrag : public CFlatBit
{
public:
EXPORT CFrag(CVector*, u8, u8, u8, i32, u16, i32, i32, i32, i32);
};
2024-07-31 13:44:23 +00:00
class CPixel : public CBit
{
public:
EXPORT CPixel(void);
2024-07-31 13:46:11 +00:00
EXPORT virtual ~CPixel(void);
2024-07-31 13:44:23 +00:00
};
2024-08-02 14:16:33 +00:00
class CBitServer : public CClass
{
public:
EXPORT CBitServer(void);
EXPORT virtual ~CBitServer(void);
u8 padBottom[0x104];
};
2024-08-02 14:36:29 +00:00
class CChunkBit : public CBit
{
public:
EXPORT CChunkBit(CSVector*, CSVector*, CSVector*);
EXPORT virtual ~CChunkBit(void);
};
2024-08-02 14:45:50 +00:00
class CTextBox : public CBit
{
public:
EXPORT CTextBox(i32, i32, i32, i32, u32, CVECTOR*);
EXPORT virtual ~CTextBox(void);
u8 padBottom[8];
};
2024-08-02 16:00:35 +00:00
class CFireyExplosion : public CNonRenderedBit
{
public:
EXPORT CFireyExplosion(CVector*);
EXPORT virtual ~CFireyExplosion(void);
};
EXPORT int Bit_MakeSpriteRing(CVector*, int, int, int, int, int, int, int);
2024-05-21 18:22:11 +00:00
EXPORT void MoveList(CBit *);
EXPORT void Bit_SetSparkRGB(unsigned char, unsigned char, unsigned char);
EXPORT void Bit_SetSparkFadeRGB(unsigned char, unsigned char, unsigned char);
2024-05-27 17:04:40 +00:00
EXPORT void Bit_SetSparkTrajectory(const CSVector *);
EXPORT void Bit_SetSparkTrajectoryCone(const CSVector *);
EXPORT void Bit_ReduceRGB(unsigned int*, int);
2024-02-25 22:38:37 +00:00
void validate_CFlatBit(void);
2024-02-25 22:24:57 +00:00
void validate_CFT4Bit(void);
2024-02-25 16:15:05 +00:00
void validate_CQuadBit(void);
2024-03-11 17:44:47 +00:00
void validate_CBit(void);
void validate_CNonRenderedBit(void);
2024-05-12 16:43:59 +00:00
void validate_CSmokeTrail(void);
void validate_CGlow(void);
2024-05-27 17:31:10 +00:00
void validate_CLinked2EndedBit(void);
2024-05-27 17:38:19 +00:00
void validate_CRibbonBit(void);
2024-08-04 16:32:34 +00:00
//void validate_CTexturedRibbon(void);
2024-05-31 16:43:25 +00:00
void validate_CSimpleTexturedRibbon(void);
void validate_CSimpleAnim(void);
void validate_SCFT4BitTexture(void);
void validate_CMotionBlur(void);
void validate_CSpecialDisplay(void);
2024-07-22 16:59:50 +00:00
void validate_SFlatBitVelocity(void);
2024-07-23 15:17:45 +00:00
void validate_CRibbon(void);
2024-07-25 15:48:52 +00:00
void validate_CCombatImpactRing(void);
2024-07-29 16:59:40 +00:00
void validate_SRibbonPoint(void);
2024-07-30 16:52:37 +00:00
void validate_CFrag(void);
2024-07-31 13:44:23 +00:00
void validate_CPixel(void);
2024-08-02 14:16:33 +00:00
void validate_CBitServer(void);
2024-08-02 14:36:29 +00:00
void validate_CChunkBit(void);
2024-08-02 14:45:50 +00:00
void validate_CTextBox(void);
2024-08-02 16:00:35 +00:00
void validate_CFireyExplosion(void);
#endif