SpaceCadetPinball/SpaceCadetPinball/loader.h

79 lines
1.9 KiB
C
Raw Normal View History

2020-10-25 15:17:26 +01:00
#pragma once
2020-11-08 16:37:59 +01:00
#include "gdrv.h"
2021-01-23 11:33:30 +01:00
#include "maths.h"
2021-01-23 17:28:29 +01:00
#include "WaveMix.h"
2020-11-08 16:37:59 +01:00
#include "zdrv.h"
2020-10-25 15:17:26 +01:00
struct datFileStruct;
struct errorMsg
{
int Code;
const char* Message;
};
struct soundListStruct
{
2021-01-23 17:28:29 +01:00
MIXWAVE* WavePtr;
2020-10-25 15:17:26 +01:00
int GroupIndex;
int Loaded;
2020-12-25 14:46:06 +01:00
float Duration;
2020-10-25 15:17:26 +01:00
char* PtrToSmth;
};
struct visualKickerStruct
2020-10-30 13:26:00 +01:00
{
2021-01-23 11:33:30 +01:00
float Threshold;
float Boost;
float ThrowBallMult;
vector_type ThrowBallAcceleration;
2021-01-23 11:33:30 +01:00
float ThrowBallAngleMult;
int HardHitSoundId;
2020-10-30 13:26:00 +01:00
};
struct visualStruct
2020-10-30 13:26:00 +01:00
{
2021-01-23 11:33:30 +01:00
float Smoothness;
float Elasticity;
2020-12-20 12:13:12 +01:00
int FloatArrCount;
2020-10-30 13:26:00 +01:00
float* FloatArr;
2021-01-23 11:33:30 +01:00
int SoftHitSoundId;
2020-10-30 13:26:00 +01:00
visualKickerStruct Kicker;
2021-01-28 16:01:26 +01:00
int CollisionGroup;
2020-10-30 13:26:00 +01:00
int SoundIndex4;
int SoundIndex3;
2020-11-08 16:37:59 +01:00
gdrv_bitmap8* Bitmap;
zmap_header_type* ZMap;
2020-10-30 13:26:00 +01:00
};
2020-10-25 15:17:26 +01:00
class loader
{
public:
static int error(int errorCode, int captionCode);
2020-10-30 13:26:00 +01:00
static void default_vsi(visualStruct* visual);
2020-10-25 15:17:26 +01:00
static int get_sound_id(int groupIndex);
2020-10-30 13:26:00 +01:00
static void unload();
static void loadfrom(datFileStruct* datFile);
2020-10-25 15:17:26 +01:00
static int query_handle(LPCSTR lpString);
static short query_visual_states(int groupIndex);
2020-10-30 13:26:00 +01:00
static int material(int groupIndex, visualStruct* visual);
static int kicker(int groupIndex, visualKickerStruct* kicker);
static int state_id(int groupIndex, int groupIndexOffset);
static int query_visual(int groupIndex, int groupIndexOffset, visualStruct* visual);
2020-10-25 15:17:26 +01:00
static char* query_name(int groupIndex);
static float* query_float_attribute(int groupIndex, int groupIndexOffset, int firstValue);
static float query_float_attribute(int groupIndex, int groupIndexOffset, int firstValue, float defVal);
2020-10-30 13:26:00 +01:00
static __int16* query_iattribute(int groupIndex, int firstValue, int* arraySize);
2020-12-25 14:46:06 +01:00
static float play_sound(int soundIndex);
2020-10-25 15:17:26 +01:00
static datFileStruct* loader_table;
private:
static errorMsg loader_errors[];
2020-10-25 15:17:26 +01:00
static datFileStruct* sound_record_table;
static int sound_count;
static int loader_sound_count;
static soundListStruct sound_list[65];
};