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