mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-26 05:01:36 +00:00
- most WORD and SWORD are gone.
This commit is contained in:
parent
8ab562ef13
commit
ba0f5a3f94
84 changed files with 471 additions and 469 deletions
|
@ -755,6 +755,8 @@ file( GLOB HEADER_FILES
|
||||||
scripting/decorate/*.h
|
scripting/decorate/*.h
|
||||||
scripting/zscript/*.h
|
scripting/zscript/*.h
|
||||||
scripting/vm/*.h
|
scripting/vm/*.h
|
||||||
|
timidity/*.h
|
||||||
|
wildmidi/*.h
|
||||||
xlat/*.h
|
xlat/*.h
|
||||||
gl/*.h
|
gl/*.h
|
||||||
gl/api/*.h
|
gl/api/*.h
|
||||||
|
|
30
src/actor.h
30
src/actor.h
|
@ -511,7 +511,7 @@ typedef TFlags<ActorFlag5> ActorFlags5;
|
||||||
typedef TFlags<ActorFlag6> ActorFlags6;
|
typedef TFlags<ActorFlag6> ActorFlags6;
|
||||||
typedef TFlags<ActorFlag7> ActorFlags7;
|
typedef TFlags<ActorFlag7> ActorFlags7;
|
||||||
typedef TFlags<ActorRenderFlag> ActorRenderFlags;
|
typedef TFlags<ActorRenderFlag> ActorRenderFlags;
|
||||||
typedef TFlags<ActorBounceFlag, WORD> ActorBounceFlags;
|
typedef TFlags<ActorBounceFlag, uint16_t> ActorBounceFlags;
|
||||||
DEFINE_TFLAGS_OPERATORS (ActorFlags)
|
DEFINE_TFLAGS_OPERATORS (ActorFlags)
|
||||||
DEFINE_TFLAGS_OPERATORS (ActorFlags2)
|
DEFINE_TFLAGS_OPERATORS (ActorFlags2)
|
||||||
DEFINE_TFLAGS_OPERATORS (ActorFlags3)
|
DEFINE_TFLAGS_OPERATORS (ActorFlags3)
|
||||||
|
@ -746,7 +746,7 @@ public:
|
||||||
void DestroyAllInventory ();
|
void DestroyAllInventory ();
|
||||||
|
|
||||||
// Set the alphacolor field properly
|
// Set the alphacolor field properly
|
||||||
void SetShade (DWORD rgb);
|
void SetShade (uint32_t rgb);
|
||||||
void SetShade (int r, int g, int b);
|
void SetShade (int r, int g, int b);
|
||||||
|
|
||||||
// Plays a conversation animation
|
// Plays a conversation animation
|
||||||
|
@ -991,8 +991,8 @@ public:
|
||||||
uint8_t fountaincolor; // Split out of 'effect' to have easier access.
|
uint8_t fountaincolor; // Split out of 'effect' to have easier access.
|
||||||
FRenderStyle RenderStyle; // Style to draw this actor with
|
FRenderStyle RenderStyle; // Style to draw this actor with
|
||||||
FTextureID picnum; // Draw this instead of sprite if valid
|
FTextureID picnum; // Draw this instead of sprite if valid
|
||||||
DWORD fillcolor; // Color to draw when STYLE_Shaded
|
uint32_t fillcolor; // Color to draw when STYLE_Shaded
|
||||||
DWORD Translation;
|
uint32_t Translation;
|
||||||
|
|
||||||
ActorRenderFlags renderflags; // Different rendering flags
|
ActorRenderFlags renderflags; // Different rendering flags
|
||||||
ActorFlags flags;
|
ActorFlags flags;
|
||||||
|
@ -1045,7 +1045,7 @@ public:
|
||||||
int projectileKickback;
|
int projectileKickback;
|
||||||
|
|
||||||
// [BB] If 0, everybody can see the actor, if > 0, only members of team (VisibleToTeam-1) can see it.
|
// [BB] If 0, everybody can see the actor, if > 0, only members of team (VisibleToTeam-1) can see it.
|
||||||
DWORD VisibleToTeam;
|
uint32_t VisibleToTeam;
|
||||||
|
|
||||||
int special1; // Special info
|
int special1; // Special info
|
||||||
int special2; // Special info
|
int special2; // Special info
|
||||||
|
@ -1055,9 +1055,9 @@ public:
|
||||||
int weaponspecial; // Special info for weapons.
|
int weaponspecial; // Special info for weapons.
|
||||||
int health;
|
int health;
|
||||||
uint8_t movedir; // 0-7
|
uint8_t movedir; // 0-7
|
||||||
SBYTE visdir;
|
int8_t visdir;
|
||||||
SWORD movecount; // when 0, select a new dir
|
int16_t movecount; // when 0, select a new dir
|
||||||
SWORD strafecount; // for MF3_AVOIDMELEE
|
int16_t strafecount; // for MF3_AVOIDMELEE
|
||||||
TObjPtr<AActor*> target; // thing being chased/attacked (or NULL)
|
TObjPtr<AActor*> target; // thing being chased/attacked (or NULL)
|
||||||
// also the originator for missiles
|
// also the originator for missiles
|
||||||
TObjPtr<AActor*> lastenemy; // Last known enemy -- killough 2/15/98
|
TObjPtr<AActor*> lastenemy; // Last known enemy -- killough 2/15/98
|
||||||
|
@ -1070,7 +1070,7 @@ public:
|
||||||
player_t *player; // only valid if type of APlayerPawn
|
player_t *player; // only valid if type of APlayerPawn
|
||||||
TObjPtr<AActor*> LastLookActor; // Actor last looked for (if TIDtoHate != 0)
|
TObjPtr<AActor*> LastLookActor; // Actor last looked for (if TIDtoHate != 0)
|
||||||
DVector3 SpawnPoint; // For nightmare respawn
|
DVector3 SpawnPoint; // For nightmare respawn
|
||||||
WORD SpawnAngle;
|
uint16_t SpawnAngle;
|
||||||
int StartHealth;
|
int StartHealth;
|
||||||
uint8_t WeaveIndexXY; // Separated from special2 because it's used by globally accessible functions.
|
uint8_t WeaveIndexXY; // Separated from special2 because it's used by globally accessible functions.
|
||||||
uint8_t WeaveIndexZ;
|
uint8_t WeaveIndexZ;
|
||||||
|
@ -1092,9 +1092,9 @@ public:
|
||||||
int waterlevel; // 0=none, 1=feet, 2=waist, 3=eyes
|
int waterlevel; // 0=none, 1=feet, 2=waist, 3=eyes
|
||||||
uint8_t boomwaterlevel; // splash information for non-swimmable water sectors
|
uint8_t boomwaterlevel; // splash information for non-swimmable water sectors
|
||||||
uint8_t MinMissileChance;// [RH] If a random # is > than this, then missile attack.
|
uint8_t MinMissileChance;// [RH] If a random # is > than this, then missile attack.
|
||||||
SBYTE LastLookPlayerNumber;// Player number last looked for (if TIDtoHate == 0)
|
int8_t LastLookPlayerNumber;// Player number last looked for (if TIDtoHate == 0)
|
||||||
ActorBounceFlags BounceFlags; // which bouncing type?
|
ActorBounceFlags BounceFlags; // which bouncing type?
|
||||||
DWORD SpawnFlags; // Increased to DWORD because of Doom 64
|
uint32_t SpawnFlags; // Increased to uint32_t because of Doom 64
|
||||||
double meleerange; // specifies how far a melee attack reaches.
|
double meleerange; // specifies how far a melee attack reaches.
|
||||||
double meleethreshold; // Distance below which a monster doesn't try to shoot missiles anynore
|
double meleethreshold; // Distance below which a monster doesn't try to shoot missiles anynore
|
||||||
// but instead tries to come closer for a melee attack.
|
// but instead tries to come closer for a melee attack.
|
||||||
|
@ -1137,13 +1137,13 @@ public:
|
||||||
|
|
||||||
|
|
||||||
TObjPtr<AInventory*> Inventory; // [RH] This actor's inventory
|
TObjPtr<AInventory*> Inventory; // [RH] This actor's inventory
|
||||||
DWORD InventoryID; // A unique ID to keep track of inventory items
|
uint32_t InventoryID; // A unique ID to keep track of inventory items
|
||||||
|
|
||||||
uint8_t smokecounter;
|
uint8_t smokecounter;
|
||||||
uint8_t FloatBobPhase;
|
uint8_t FloatBobPhase;
|
||||||
uint8_t FriendPlayer; // [RH] Player # + 1 this friendly monster works for (so 0 is no player, 1 is player 0, etc)
|
uint8_t FriendPlayer; // [RH] Player # + 1 this friendly monster works for (so 0 is no player, 1 is player 0, etc)
|
||||||
PalEntry BloodColor;
|
PalEntry BloodColor;
|
||||||
DWORD BloodTranslation;
|
uint32_t BloodTranslation;
|
||||||
|
|
||||||
// [RH] Stuff that used to be part of an Actor Info
|
// [RH] Stuff that used to be part of an Actor Info
|
||||||
FSoundIDNoInit SeeSound;
|
FSoundIDNoInit SeeSound;
|
||||||
|
@ -1160,7 +1160,7 @@ public:
|
||||||
double MaxStepHeight;
|
double MaxStepHeight;
|
||||||
|
|
||||||
int32_t Mass;
|
int32_t Mass;
|
||||||
SWORD PainChance;
|
int16_t PainChance;
|
||||||
int PainThreshold;
|
int PainThreshold;
|
||||||
FNameNoInit DamageType;
|
FNameNoInit DamageType;
|
||||||
FNameNoInit DamageTypeReceived;
|
FNameNoInit DamageTypeReceived;
|
||||||
|
@ -1545,7 +1545,7 @@ template<class T> inline T *Spawn() // for inventory items we do not need coordi
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintMiscActorInfo(AActor * query);
|
void PrintMiscActorInfo(AActor * query);
|
||||||
AActor *P_LinePickActor(AActor *t1, DAngle angle, double distance, DAngle pitch, ActorFlags actorMask, DWORD wallMask);
|
AActor *P_LinePickActor(AActor *t1, DAngle angle, double distance, DAngle pitch, ActorFlags actorMask, uint32_t wallMask);
|
||||||
|
|
||||||
// If we want to make P_AimLineAttack capable of handling arbitrary portals, it needs to pass a lot more info than just the linetarget actor.
|
// If we want to make P_AimLineAttack capable of handling arbitrary portals, it needs to pass a lot more info than just the linetarget actor.
|
||||||
struct FTranslatedLineTarget
|
struct FTranslatedLineTarget
|
||||||
|
|
|
@ -256,7 +256,7 @@ struct AMColorset
|
||||||
c[i].FromCVar(*values[i]);
|
c[i].FromCVar(*values[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD ba = *(values[0]);
|
uint32_t ba = *(values[0]);
|
||||||
|
|
||||||
int r = RPART(ba) - 16;
|
int r = RPART(ba) - 16;
|
||||||
int g = GPART(ba) - 16;
|
int g = GPART(ba) - 16;
|
||||||
|
@ -791,7 +791,7 @@ static bool stopped = true;
|
||||||
static void AM_calcMinMaxMtoF();
|
static void AM_calcMinMaxMtoF();
|
||||||
|
|
||||||
static void DrawMarker (FTexture *tex, double x, double y, int yadjust,
|
static void DrawMarker (FTexture *tex, double x, double y, int yadjust,
|
||||||
INTBOOL flip, double xscale, double yscale, int translation, double alpha, DWORD fillcolor, FRenderStyle renderstyle);
|
INTBOOL flip, double xscale, double yscale, int translation, double alpha, uint32_t fillcolor, FRenderStyle renderstyle);
|
||||||
|
|
||||||
void AM_rotatePoint (double *x, double *y);
|
void AM_rotatePoint (double *x, double *y);
|
||||||
void AM_rotate (double *x, double *y, DAngle an);
|
void AM_rotate (double *x, double *y, DAngle an);
|
||||||
|
@ -1920,7 +1920,7 @@ void AM_drawSubsectors()
|
||||||
|
|
||||||
// Fill the points array from the subsector.
|
// Fill the points array from the subsector.
|
||||||
points.Resize(subsectors[i].numlines);
|
points.Resize(subsectors[i].numlines);
|
||||||
for (DWORD j = 0; j < subsectors[i].numlines; ++j)
|
for (uint32_t j = 0; j < subsectors[i].numlines; ++j)
|
||||||
{
|
{
|
||||||
mpoint_t pt = { subsectors[i].firstline[j].v1->fX(),
|
mpoint_t pt = { subsectors[i].firstline[j].v1->fX(),
|
||||||
subsectors[i].firstline[j].v1->fY() };
|
subsectors[i].firstline[j].v1->fY() };
|
||||||
|
@ -2911,7 +2911,7 @@ void AM_drawThings ()
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
static void DrawMarker (FTexture *tex, double x, double y, int yadjust,
|
static void DrawMarker (FTexture *tex, double x, double y, int yadjust,
|
||||||
INTBOOL flip, double xscale, double yscale, int translation, double alpha, DWORD fillcolor, FRenderStyle renderstyle)
|
INTBOOL flip, double xscale, double yscale, int translation, double alpha, uint32_t fillcolor, FRenderStyle renderstyle)
|
||||||
{
|
{
|
||||||
if (tex == NULL || tex->UseType == FTexture::TEX_Null)
|
if (tex == NULL || tex->UseType == FTexture::TEX_Null)
|
||||||
{
|
{
|
||||||
|
@ -2932,7 +2932,7 @@ static void DrawMarker (FTexture *tex, double x, double y, int yadjust,
|
||||||
DTA_TranslationIndex, translation,
|
DTA_TranslationIndex, translation,
|
||||||
DTA_Alpha, alpha,
|
DTA_Alpha, alpha,
|
||||||
DTA_FillColor, fillcolor,
|
DTA_FillColor, fillcolor,
|
||||||
DTA_RenderStyle, DWORD(renderstyle),
|
DTA_RenderStyle, uint32_t(renderstyle),
|
||||||
TAG_DONE);
|
TAG_DONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2977,7 +2977,7 @@ void AM_drawAuthorMarkers ()
|
||||||
|
|
||||||
FTextureID picnum;
|
FTextureID picnum;
|
||||||
FTexture *tex;
|
FTexture *tex;
|
||||||
WORD flip = 0;
|
uint16_t flip = 0;
|
||||||
|
|
||||||
if (mark->picnum.isValid())
|
if (mark->picnum.isValid())
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,8 +37,8 @@ typedef int INTBOOL;
|
||||||
typedef struct _GUID
|
typedef struct _GUID
|
||||||
{
|
{
|
||||||
DWORD Data1;
|
DWORD Data1;
|
||||||
WORD Data2;
|
uint16_t Data2;
|
||||||
WORD Data3;
|
uint16_t Data3;
|
||||||
uint8_t Data4[8];
|
uint8_t Data4[8];
|
||||||
} GUID;
|
} GUID;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -94,7 +94,7 @@ CVAR(Bool, con_notablist, false, CVAR_ARCHIVE)
|
||||||
|
|
||||||
|
|
||||||
static FTextureID conback;
|
static FTextureID conback;
|
||||||
static DWORD conshade;
|
static uint32_t conshade;
|
||||||
static bool conline;
|
static bool conline;
|
||||||
|
|
||||||
extern int gametic;
|
extern int gametic;
|
||||||
|
|
|
@ -74,7 +74,7 @@ FBaseCVar::FBaseCVar (const FBaseCVar &var)
|
||||||
I_FatalError ("Use of cvar copy constructor");
|
I_FatalError ("Use of cvar copy constructor");
|
||||||
}
|
}
|
||||||
|
|
||||||
FBaseCVar::FBaseCVar (const char *var_name, DWORD flags, void (*callback)(FBaseCVar &))
|
FBaseCVar::FBaseCVar (const char *var_name, uint32_t flags, void (*callback)(FBaseCVar &))
|
||||||
{
|
{
|
||||||
FBaseCVar *var;
|
FBaseCVar *var;
|
||||||
|
|
||||||
|
@ -573,8 +573,8 @@ UCVarValue FBaseCVar::FromString (const char *value, ECVarType type)
|
||||||
if (i == 38 && value[i] == 0)
|
if (i == 38 && value[i] == 0)
|
||||||
{
|
{
|
||||||
cGUID.Data1 = strtoul (value + 1, NULL, 16);
|
cGUID.Data1 = strtoul (value + 1, NULL, 16);
|
||||||
cGUID.Data2 = (WORD)strtoul (value + 10, NULL, 16);
|
cGUID.Data2 = (uint16_t)strtoul (value + 10, NULL, 16);
|
||||||
cGUID.Data3 = (WORD)strtoul (value + 15, NULL, 16);
|
cGUID.Data3 = (uint16_t)strtoul (value + 15, NULL, 16);
|
||||||
cGUID.Data4[0] = HexToByte (value + 20);
|
cGUID.Data4[0] = HexToByte (value + 20);
|
||||||
cGUID.Data4[1] = HexToByte (value + 22);
|
cGUID.Data4[1] = HexToByte (value + 22);
|
||||||
cGUID.Data4[2] = HexToByte (value + 25);
|
cGUID.Data4[2] = HexToByte (value + 25);
|
||||||
|
@ -690,7 +690,7 @@ DEFINE_ACTION_FUNCTION(_CVar, GetRealType)
|
||||||
// Boolean cvar implementation
|
// Boolean cvar implementation
|
||||||
//
|
//
|
||||||
|
|
||||||
FBoolCVar::FBoolCVar (const char *name, bool def, DWORD flags, void (*callback)(FBoolCVar &))
|
FBoolCVar::FBoolCVar (const char *name, bool def, uint32_t flags, void (*callback)(FBoolCVar &))
|
||||||
: FBaseCVar (name, flags, reinterpret_cast<void (*)(FBaseCVar &)>(callback))
|
: FBaseCVar (name, flags, reinterpret_cast<void (*)(FBaseCVar &)>(callback))
|
||||||
{
|
{
|
||||||
DefaultValue = def;
|
DefaultValue = def;
|
||||||
|
@ -748,7 +748,7 @@ void FBoolCVar::DoSet (UCVarValue value, ECVarType type)
|
||||||
// Integer cvar implementation
|
// Integer cvar implementation
|
||||||
//
|
//
|
||||||
|
|
||||||
FIntCVar::FIntCVar (const char *name, int def, DWORD flags, void (*callback)(FIntCVar &))
|
FIntCVar::FIntCVar (const char *name, int def, uint32_t flags, void (*callback)(FIntCVar &))
|
||||||
: FBaseCVar (name, flags, reinterpret_cast<void (*)(FBaseCVar &)>(callback))
|
: FBaseCVar (name, flags, reinterpret_cast<void (*)(FBaseCVar &)>(callback))
|
||||||
{
|
{
|
||||||
DefaultValue = def;
|
DefaultValue = def;
|
||||||
|
@ -806,7 +806,7 @@ void FIntCVar::DoSet (UCVarValue value, ECVarType type)
|
||||||
// Floating point cvar implementation
|
// Floating point cvar implementation
|
||||||
//
|
//
|
||||||
|
|
||||||
FFloatCVar::FFloatCVar (const char *name, float def, DWORD flags, void (*callback)(FFloatCVar &))
|
FFloatCVar::FFloatCVar (const char *name, float def, uint32_t flags, void (*callback)(FFloatCVar &))
|
||||||
: FBaseCVar (name, flags, reinterpret_cast<void (*)(FBaseCVar &)>(callback))
|
: FBaseCVar (name, flags, reinterpret_cast<void (*)(FBaseCVar &)>(callback))
|
||||||
{
|
{
|
||||||
DefaultValue = def;
|
DefaultValue = def;
|
||||||
|
@ -874,7 +874,7 @@ void FFloatCVar::DoSet (UCVarValue value, ECVarType type)
|
||||||
// String cvar implementation
|
// String cvar implementation
|
||||||
//
|
//
|
||||||
|
|
||||||
FStringCVar::FStringCVar (const char *name, const char *def, DWORD flags, void (*callback)(FStringCVar &))
|
FStringCVar::FStringCVar (const char *name, const char *def, uint32_t flags, void (*callback)(FStringCVar &))
|
||||||
: FBaseCVar (name, flags, reinterpret_cast<void (*)(FBaseCVar &)>(callback))
|
: FBaseCVar (name, flags, reinterpret_cast<void (*)(FBaseCVar &)>(callback))
|
||||||
{
|
{
|
||||||
DefaultValue = copystring (def);
|
DefaultValue = copystring (def);
|
||||||
|
@ -943,7 +943,7 @@ void FStringCVar::DoSet (UCVarValue value, ECVarType type)
|
||||||
// Color cvar implementation
|
// Color cvar implementation
|
||||||
//
|
//
|
||||||
|
|
||||||
FColorCVar::FColorCVar (const char *name, int def, DWORD flags, void (*callback)(FColorCVar &))
|
FColorCVar::FColorCVar (const char *name, int def, uint32_t flags, void (*callback)(FColorCVar &))
|
||||||
: FIntCVar (name, def, flags, reinterpret_cast<void (*)(FIntCVar &)>(callback))
|
: FIntCVar (name, def, flags, reinterpret_cast<void (*)(FIntCVar &)>(callback))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -1024,7 +1024,7 @@ int FColorCVar::ToInt2 (UCVarValue value, ECVarType type)
|
||||||
// GUID cvar implementation
|
// GUID cvar implementation
|
||||||
//
|
//
|
||||||
|
|
||||||
FGUIDCVar::FGUIDCVar (const char *name, const GUID *def, DWORD flags, void (*callback)(FGUIDCVar &))
|
FGUIDCVar::FGUIDCVar (const char *name, const GUID *def, uint32_t flags, void (*callback)(FGUIDCVar &))
|
||||||
: FBaseCVar (name, flags, reinterpret_cast<void (*)(FBaseCVar &)>(callback))
|
: FBaseCVar (name, flags, reinterpret_cast<void (*)(FBaseCVar &)>(callback))
|
||||||
{
|
{
|
||||||
if (def != NULL)
|
if (def != NULL)
|
||||||
|
@ -1141,7 +1141,7 @@ DEFINE_ACTION_FUNCTION(_CVar, ResetToDefault)
|
||||||
// the network. The "host" cvar is responsible for that.
|
// the network. The "host" cvar is responsible for that.
|
||||||
//
|
//
|
||||||
|
|
||||||
FFlagCVar::FFlagCVar (const char *name, FIntCVar &realvar, DWORD bitval)
|
FFlagCVar::FFlagCVar (const char *name, FIntCVar &realvar, uint32_t bitval)
|
||||||
: FBaseCVar (name, 0, NULL),
|
: FBaseCVar (name, 0, NULL),
|
||||||
ValueVar (realvar),
|
ValueVar (realvar),
|
||||||
BitVal (bitval)
|
BitVal (bitval)
|
||||||
|
@ -1246,7 +1246,7 @@ void FFlagCVar::DoSet (UCVarValue value, ECVarType type)
|
||||||
// Similar to FFlagCVar but can have multiple bits
|
// Similar to FFlagCVar but can have multiple bits
|
||||||
//
|
//
|
||||||
|
|
||||||
FMaskCVar::FMaskCVar (const char *name, FIntCVar &realvar, DWORD bitval)
|
FMaskCVar::FMaskCVar (const char *name, FIntCVar &realvar, uint32_t bitval)
|
||||||
: FBaseCVar (name, 0, NULL),
|
: FBaseCVar (name, 0, NULL),
|
||||||
ValueVar (realvar),
|
ValueVar (realvar),
|
||||||
BitVal (bitval)
|
BitVal (bitval)
|
||||||
|
@ -1354,7 +1354,7 @@ static int sortcvars (const void *a, const void *b)
|
||||||
return strcmp (((*(FBaseCVar **)a))->GetName(), ((*(FBaseCVar **)b))->GetName());
|
return strcmp (((*(FBaseCVar **)a))->GetName(), ((*(FBaseCVar **)b))->GetName());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilterCompactCVars (TArray<FBaseCVar *> &cvars, DWORD filter)
|
void FilterCompactCVars (TArray<FBaseCVar *> &cvars, uint32_t filter)
|
||||||
{
|
{
|
||||||
// Accumulate all cvars that match the filter flags.
|
// Accumulate all cvars that match the filter flags.
|
||||||
for (FBaseCVar *cvar = CVars; cvar != NULL; cvar = cvar->m_Next)
|
for (FBaseCVar *cvar = CVars; cvar != NULL; cvar = cvar->m_Next)
|
||||||
|
@ -1370,7 +1370,7 @@ void FilterCompactCVars (TArray<FBaseCVar *> &cvars, DWORD filter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void C_WriteCVars (uint8_t **demo_p, DWORD filter, bool compact)
|
void C_WriteCVars (uint8_t **demo_p, uint32_t filter, bool compact)
|
||||||
{
|
{
|
||||||
FString dump = C_GetMassCVarString(filter, compact);
|
FString dump = C_GetMassCVarString(filter, compact);
|
||||||
size_t dumplen = dump.Len() + 1; // include terminating \0
|
size_t dumplen = dump.Len() + 1; // include terminating \0
|
||||||
|
@ -1378,7 +1378,7 @@ void C_WriteCVars (uint8_t **demo_p, DWORD filter, bool compact)
|
||||||
*demo_p += dumplen;
|
*demo_p += dumplen;
|
||||||
}
|
}
|
||||||
|
|
||||||
FString C_GetMassCVarString (DWORD filter, bool compact)
|
FString C_GetMassCVarString (uint32_t filter, bool compact)
|
||||||
{
|
{
|
||||||
FBaseCVar *cvar;
|
FBaseCVar *cvar;
|
||||||
FString dump;
|
FString dump;
|
||||||
|
@ -1420,7 +1420,7 @@ void C_ReadCVars (uint8_t **demo_p)
|
||||||
{ // compact mode
|
{ // compact mode
|
||||||
TArray<FBaseCVar *> cvars;
|
TArray<FBaseCVar *> cvars;
|
||||||
FBaseCVar *cvar;
|
FBaseCVar *cvar;
|
||||||
DWORD filter;
|
uint32_t filter;
|
||||||
|
|
||||||
ptr++;
|
ptr++;
|
||||||
breakpt = strchr (ptr, '\\');
|
breakpt = strchr (ptr, '\\');
|
||||||
|
@ -1613,7 +1613,7 @@ FBaseCVar *GetUserCVar(int playernum, const char *cvarname)
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
FBaseCVar *C_CreateCVar(const char *var_name, ECVarType var_type, DWORD flags)
|
FBaseCVar *C_CreateCVar(const char *var_name, ECVarType var_type, uint32_t flags)
|
||||||
{
|
{
|
||||||
assert(FindCVar(var_name, NULL) == NULL);
|
assert(FindCVar(var_name, NULL) == NULL);
|
||||||
flags |= CVAR_AUTO;
|
flags |= CVAR_AUTO;
|
||||||
|
@ -1634,7 +1634,7 @@ void UnlatchCVars (void)
|
||||||
|
|
||||||
while (LatchedValues.Pop (var))
|
while (LatchedValues.Pop (var))
|
||||||
{
|
{
|
||||||
DWORD oldflags = var.Variable->Flags;
|
uint32_t oldflags = var.Variable->Flags;
|
||||||
var.Variable->Flags &= ~(CVAR_LATCH | CVAR_SERVERINFO);
|
var.Variable->Flags &= ~(CVAR_LATCH | CVAR_SERVERINFO);
|
||||||
var.Variable->SetGenericRep (var.Value, var.Type);
|
var.Variable->SetGenericRep (var.Value, var.Type);
|
||||||
if (var.Type == CVAR_String)
|
if (var.Type == CVAR_String)
|
||||||
|
@ -1643,7 +1643,7 @@ void UnlatchCVars (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DestroyCVarsFlagged (DWORD flags)
|
void DestroyCVarsFlagged (uint32_t flags)
|
||||||
{
|
{
|
||||||
FBaseCVar *cvar = CVars;
|
FBaseCVar *cvar = CVars;
|
||||||
FBaseCVar *next = cvar;
|
FBaseCVar *next = cvar;
|
||||||
|
@ -1808,7 +1808,7 @@ void FBaseCVar::ListVars (const char *filter, bool plain)
|
||||||
{
|
{
|
||||||
if (CheckWildcards (filter, var->GetName()))
|
if (CheckWildcards (filter, var->GetName()))
|
||||||
{
|
{
|
||||||
DWORD flags = var->GetFlags();
|
uint32_t flags = var->GetFlags();
|
||||||
if (plain)
|
if (plain)
|
||||||
{ // plain formatting does not include user-defined cvars
|
{ // plain formatting does not include user-defined cvars
|
||||||
if (!(flags & CVAR_UNSETTABLE))
|
if (!(flags & CVAR_UNSETTABLE))
|
||||||
|
|
|
@ -165,7 +165,7 @@ private:
|
||||||
friend FBaseCVar *FindCVar (const char *var_name, FBaseCVar **prev);
|
friend FBaseCVar *FindCVar (const char *var_name, FBaseCVar **prev);
|
||||||
friend FBaseCVar *FindCVarSub (const char *var_name, int namelen);
|
friend FBaseCVar *FindCVarSub (const char *var_name, int namelen);
|
||||||
friend void UnlatchCVars (void);
|
friend void UnlatchCVars (void);
|
||||||
friend void DestroyCVarsFlagged (DWORD flags);
|
friend void DestroyCVarsFlagged (uint32_t flags);
|
||||||
friend void C_ArchiveCVars (FConfigFile *f, uint32 filter);
|
friend void C_ArchiveCVars (FConfigFile *f, uint32 filter);
|
||||||
friend void C_SetCVarsToDefaults (void);
|
friend void C_SetCVarsToDefaults (void);
|
||||||
friend void FilterCompactCVars (TArray<FBaseCVar *> &cvars, uint32 filter);
|
friend void FilterCompactCVars (TArray<FBaseCVar *> &cvars, uint32 filter);
|
||||||
|
@ -196,13 +196,13 @@ FBaseCVar *GetCVar(AActor *activator, const char *cvarname);
|
||||||
FBaseCVar *GetUserCVar(int playernum, const char *cvarname);
|
FBaseCVar *GetUserCVar(int playernum, const char *cvarname);
|
||||||
|
|
||||||
// Create a new cvar with the specified name and type
|
// Create a new cvar with the specified name and type
|
||||||
FBaseCVar *C_CreateCVar(const char *var_name, ECVarType var_type, DWORD flags);
|
FBaseCVar *C_CreateCVar(const char *var_name, ECVarType var_type, uint32_t flags);
|
||||||
|
|
||||||
// Called from G_InitNew()
|
// Called from G_InitNew()
|
||||||
void UnlatchCVars (void);
|
void UnlatchCVars (void);
|
||||||
|
|
||||||
// Destroy CVars with the matching flags; called from CCMD(restart)
|
// Destroy CVars with the matching flags; called from CCMD(restart)
|
||||||
void DestroyCVarsFlagged (DWORD flags);
|
void DestroyCVarsFlagged (uint32_t flags);
|
||||||
|
|
||||||
// archive cvars to FILE f
|
// archive cvars to FILE f
|
||||||
void C_ArchiveCVars (FConfigFile *f, uint32 filter);
|
void C_ArchiveCVars (FConfigFile *f, uint32 filter);
|
||||||
|
|
|
@ -297,13 +297,13 @@ static int ListActionCommands (const char *pattern)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined (get16bits)
|
#if !defined (get16bits)
|
||||||
#define get16bits(d) ((((DWORD)(((const uint8_t *)(d))[1])) << 8)\
|
#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
|
||||||
+(DWORD)(((const uint8_t *)(d))[0]) )
|
+(uint32_t)(((const uint8_t *)(d))[0]) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DWORD SuperFastHash (const char *data, size_t len)
|
uint32_t SuperFastHash (const char *data, size_t len)
|
||||||
{
|
{
|
||||||
DWORD hash = 0, tmp;
|
uint32_t hash = 0, tmp;
|
||||||
size_t rem;
|
size_t rem;
|
||||||
|
|
||||||
if (len == 0 || data == NULL) return 0;
|
if (len == 0 || data == NULL) return 0;
|
||||||
|
@ -352,12 +352,12 @@ DWORD SuperFastHash (const char *data, size_t len)
|
||||||
/* A modified version to do a case-insensitive hash */
|
/* A modified version to do a case-insensitive hash */
|
||||||
|
|
||||||
#undef get16bits
|
#undef get16bits
|
||||||
#define get16bits(d) ((((DWORD)tolower(((const uint8_t *)(d))[1])) << 8)\
|
#define get16bits(d) ((((uint32_t)tolower(((const uint8_t *)(d))[1])) << 8)\
|
||||||
+(DWORD)tolower(((const uint8_t *)(d))[0]) )
|
+(uint32_t)tolower(((const uint8_t *)(d))[0]) )
|
||||||
|
|
||||||
DWORD SuperFastHashI (const char *data, size_t len)
|
uint32_t SuperFastHashI (const char *data, size_t len)
|
||||||
{
|
{
|
||||||
DWORD hash = 0, tmp;
|
uint32_t hash = 0, tmp;
|
||||||
size_t rem;
|
size_t rem;
|
||||||
|
|
||||||
if (len <= 0 || data == NULL) return 0;
|
if (len <= 0 || data == NULL) return 0;
|
||||||
|
|
|
@ -152,7 +152,7 @@ struct FButtonStatus
|
||||||
{
|
{
|
||||||
enum { MAX_KEYS = 6 }; // Maximum number of keys that can press this button
|
enum { MAX_KEYS = 6 }; // Maximum number of keys that can press this button
|
||||||
|
|
||||||
WORD Keys[MAX_KEYS];
|
uint16_t Keys[MAX_KEYS];
|
||||||
BYTE bDown; // Button is down right now
|
BYTE bDown; // Button is down right now
|
||||||
BYTE bWentDown; // Button went down this tic
|
BYTE bWentDown; // Button went down this tic
|
||||||
BYTE bWentUp; // Button went up this tic
|
BYTE bWentUp; // Button went up this tic
|
||||||
|
|
|
@ -50,7 +50,7 @@ FColorMatcher::FColorMatcher ()
|
||||||
Pal = NULL;
|
Pal = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FColorMatcher::FColorMatcher (const DWORD *palette)
|
FColorMatcher::FColorMatcher (const uint32_t *palette)
|
||||||
{
|
{
|
||||||
SetPalette (palette);
|
SetPalette (palette);
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ FColorMatcher &FColorMatcher::operator= (const FColorMatcher &other)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FColorMatcher::SetPalette (const DWORD *palette)
|
void FColorMatcher::SetPalette (const uint32_t *palette)
|
||||||
{
|
{
|
||||||
Pal = (const PalEntry *)palette;
|
Pal = (const PalEntry *)palette;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,10 +38,10 @@ class FColorMatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FColorMatcher ();
|
FColorMatcher ();
|
||||||
FColorMatcher (const DWORD *palette);
|
FColorMatcher (const uint32_t *palette);
|
||||||
FColorMatcher (const FColorMatcher &other);
|
FColorMatcher (const FColorMatcher &other);
|
||||||
|
|
||||||
void SetPalette (const DWORD *palette);
|
void SetPalette (const uint32_t *palette);
|
||||||
uint8_t Pick (int r, int g, int b);
|
uint8_t Pick (int r, int g, int b);
|
||||||
uint8_t Pick (PalEntry pe)
|
uint8_t Pick (PalEntry pe)
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
struct FCompatOption
|
struct FCompatOption
|
||||||
{
|
{
|
||||||
const char *Name;
|
const char *Name;
|
||||||
DWORD CompatFlags;
|
uint32_t CompatFlags;
|
||||||
int WhichSlot;
|
int WhichSlot;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
union FMD5Holder
|
union FMD5Holder
|
||||||
{
|
{
|
||||||
BYTE Bytes[16];
|
BYTE Bytes[16];
|
||||||
DWORD DWords[4];
|
uint32_t DWords[4];
|
||||||
hash_t Hash;
|
hash_t Hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -871,7 +871,7 @@ const char *FConfigFile::GenerateEndTag(const char *value)
|
||||||
|
|
||||||
for (int i = 0; i < 5; ++i)
|
for (int i = 0; i < 5; ++i)
|
||||||
{
|
{
|
||||||
//DWORD three_bytes = (rand_bytes[i*3] << 16) | (rand_bytes[i*3+1] << 8) | (rand_bytes[i*3+2]); // ???
|
//uint32_t three_bytes = (rand_bytes[i*3] << 16) | (rand_bytes[i*3+1] << 8) | (rand_bytes[i*3+2]); // ???
|
||||||
EndTag[4+i*4 ] = Base64Table[rand_bytes[i*3] >> 2];
|
EndTag[4+i*4 ] = Base64Table[rand_bytes[i*3] >> 2];
|
||||||
EndTag[4+i*4+1] = Base64Table[((rand_bytes[i*3] & 3) << 4) | (rand_bytes[i*3+1] >> 4)];
|
EndTag[4+i*4+1] = Base64Table[((rand_bytes[i*3] & 3) << 4) | (rand_bytes[i*3+1] >> 4)];
|
||||||
EndTag[4+i*4+2] = Base64Table[((rand_bytes[i*3+1] & 15) << 2) | (rand_bytes[i*3+2] >> 6)];
|
EndTag[4+i*4+2] = Base64Table[((rand_bytes[i*3+1] & 15) << 2) | (rand_bytes[i*3+2] >> 6)];
|
||||||
|
|
|
@ -401,11 +401,11 @@ static bool HandleKey (const struct Key *keys, void *structure, const char *key,
|
||||||
static int FindSprite (const char *sprname)
|
static int FindSprite (const char *sprname)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
DWORD nameint = *((DWORD *)sprname);
|
uint32_t nameint = *((uint32_t *)sprname);
|
||||||
|
|
||||||
for (i = 0; i < NumUnchangedSprites; ++i)
|
for (i = 0; i < NumUnchangedSprites; ++i)
|
||||||
{
|
{
|
||||||
if (*((DWORD *)&UnchangedSpriteNames[i*4]) == nameint)
|
if (*((uint32_t *)&UnchangedSpriteNames[i*4]) == nameint)
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -850,7 +850,7 @@ static int PatchThing (int thingy)
|
||||||
bool patchedStates = false;
|
bool patchedStates = false;
|
||||||
ActorFlags oldflags;
|
ActorFlags oldflags;
|
||||||
PClassActor *type;
|
PClassActor *type;
|
||||||
SWORD *ednum, dummyed;
|
int16_t *ednum, dummyed;
|
||||||
|
|
||||||
type = NULL;
|
type = NULL;
|
||||||
info = (AActor *)&dummy;
|
info = (AActor *)&dummy;
|
||||||
|
@ -898,7 +898,7 @@ static int PatchThing (int thingy)
|
||||||
}
|
}
|
||||||
else if (linelen == 11 && stricmp (Line1, "Pain chance") == 0)
|
else if (linelen == 11 && stricmp (Line1, "Pain chance") == 0)
|
||||||
{
|
{
|
||||||
info->PainChance = (SWORD)val;
|
info->PainChance = (int16_t)val;
|
||||||
}
|
}
|
||||||
else if (linelen == 12 && stricmp (Line1, "Translucency") == 0)
|
else if (linelen == 12 && stricmp (Line1, "Translucency") == 0)
|
||||||
{
|
{
|
||||||
|
@ -1049,7 +1049,7 @@ static int PatchThing (int thingy)
|
||||||
}
|
}
|
||||||
else if (stricmp (Line1, "Bits") == 0)
|
else if (stricmp (Line1, "Bits") == 0)
|
||||||
{
|
{
|
||||||
DWORD value[4] = { 0, 0, 0 };
|
uint32_t value[4] = { 0, 0, 0 };
|
||||||
bool vchanged[4] = { false, false, false };
|
bool vchanged[4] = { false, false, false };
|
||||||
// ZDoom used to block the upper range of bits to force use of mnemonics for extra flags.
|
// ZDoom used to block the upper range of bits to force use of mnemonics for extra flags.
|
||||||
// MBF also defined extra flags in the same range, but without forcing mnemonics. For MBF
|
// MBF also defined extra flags in the same range, but without forcing mnemonics. For MBF
|
||||||
|
@ -1244,7 +1244,7 @@ static int PatchThing (int thingy)
|
||||||
}
|
}
|
||||||
else if (stricmp (Line1, "ID #") == 0)
|
else if (stricmp (Line1, "ID #") == 0)
|
||||||
{
|
{
|
||||||
*ednum = (SWORD)val;
|
*ednum = (int16_t)val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else Printf (unknown_str, Line1, "Thing", thingy);
|
else Printf (unknown_str, Line1, "Thing", thingy);
|
||||||
|
@ -2111,7 +2111,7 @@ static int PatchCodePtrs (int dummy)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TArray<DWORD> &args = sym->Variants[0].ArgFlags;
|
TArray<uint32_t> &args = sym->Variants[0].ArgFlags;
|
||||||
unsigned numargs = sym->GetImplicitArgs();
|
unsigned numargs = sym->GetImplicitArgs();
|
||||||
if ((sym->Variants[0].Flags & VARF_Virtual || (args.Size() > numargs && !(args[numargs] & VARF_Optional))))
|
if ((sym->Variants[0].Flags & VARF_Virtual || (args.Size() > numargs && !(args[numargs] & VARF_Optional))))
|
||||||
{
|
{
|
||||||
|
@ -2594,7 +2594,7 @@ static bool DoDehPatch()
|
||||||
|
|
||||||
static inline bool CompareLabel (const char *want, const uint8_t *have)
|
static inline bool CompareLabel (const char *want, const uint8_t *have)
|
||||||
{
|
{
|
||||||
return *(DWORD *)want == *(DWORD *)have;
|
return *(uint32_t *)want == *(uint32_t *)have;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int DehUseCount;
|
static int DehUseCount;
|
||||||
|
@ -2724,7 +2724,7 @@ static bool LoadDehSupp ()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TArray<DWORD> &args = sym->Variants[0].ArgFlags;
|
TArray<uint32_t> &args = sym->Variants[0].ArgFlags;
|
||||||
unsigned numargs = sym->GetImplicitArgs();
|
unsigned numargs = sym->GetImplicitArgs();
|
||||||
if ((sym->Variants[0].Flags & VARF_Virtual || (args.Size() > numargs && !(args[numargs] & VARF_Optional))))
|
if ((sym->Variants[0].Flags & VARF_Virtual || (args.Size() > numargs && !(args[numargs] & VARF_Optional))))
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,9 +47,9 @@ struct event_t
|
||||||
{
|
{
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
uint8_t subtype;
|
uint8_t subtype;
|
||||||
SWORD data1; // keys / mouse/joystick buttons
|
int16_t data1; // keys / mouse/joystick buttons
|
||||||
SWORD data2;
|
int16_t data2;
|
||||||
SWORD data3;
|
int16_t data3;
|
||||||
int x; // mouse/joystick x move
|
int x; // mouse/joystick x move
|
||||||
int y; // mouse/joystick y move
|
int y; // mouse/joystick y move
|
||||||
};
|
};
|
||||||
|
|
|
@ -261,7 +261,7 @@ void FIWadManager::ParseIWadInfos(const char *fn)
|
||||||
FResourceFile *resfile = FResourceFile::OpenResourceFile(fn, NULL, true);
|
FResourceFile *resfile = FResourceFile::OpenResourceFile(fn, NULL, true);
|
||||||
if (resfile != NULL)
|
if (resfile != NULL)
|
||||||
{
|
{
|
||||||
DWORD cnt = resfile->LumpCount();
|
uint32_t cnt = resfile->LumpCount();
|
||||||
for(int i=cnt-1; i>=0; i--)
|
for(int i=cnt-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
FResourceLump *lmp = resfile->GetLump(i);
|
FResourceLump *lmp = resfile->GetLump(i);
|
||||||
|
@ -296,7 +296,7 @@ int FIWadManager::ScanIWAD (const char *iwad)
|
||||||
if (iwadfile != NULL)
|
if (iwadfile != NULL)
|
||||||
{
|
{
|
||||||
ClearChecks();
|
ClearChecks();
|
||||||
for(DWORD ii = 0; ii < iwadfile->LumpCount(); ii++)
|
for(uint32_t ii = 0; ii < iwadfile->LumpCount(); ii++)
|
||||||
{
|
{
|
||||||
FResourceLump *lump = iwadfile->GetLump(ii);
|
FResourceLump *lump = iwadfile->GetLump(ii);
|
||||||
|
|
||||||
|
|
|
@ -1939,7 +1939,7 @@ static FString CheckGameInfo(TArray<FString> & pwads)
|
||||||
|
|
||||||
if (resfile != NULL)
|
if (resfile != NULL)
|
||||||
{
|
{
|
||||||
DWORD cnt = resfile->LumpCount();
|
uint32_t cnt = resfile->LumpCount();
|
||||||
for(int i=cnt-1; i>=0; i--)
|
for(int i=cnt-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
FResourceLump *lmp = resfile->GetLump(i);
|
FResourceLump *lmp = resfile->GetLump(i);
|
||||||
|
|
|
@ -77,8 +77,8 @@ struct FIWADInfo
|
||||||
FString Autoname; // Name of autoload ini section for this IWAD
|
FString Autoname; // Name of autoload ini section for this IWAD
|
||||||
FString Configname; // Name of config section for this IWAD
|
FString Configname; // Name of config section for this IWAD
|
||||||
FString Required; // Requires another IWAD
|
FString Required; // Requires another IWAD
|
||||||
DWORD FgColor; // Foreground color for title banner
|
uint32_t FgColor; // Foreground color for title banner
|
||||||
DWORD BkColor; // Background color for title banner
|
uint32_t BkColor; // Background color for title banner
|
||||||
EGameType gametype; // which game are we playing?
|
EGameType gametype; // which game are we playing?
|
||||||
FString MapInfo; // Base mapinfo to load
|
FString MapInfo; // Base mapinfo to load
|
||||||
TArray<FString> Load; // Wads to be loaded with this one.
|
TArray<FString> Load; // Wads to be loaded with this one.
|
||||||
|
@ -92,8 +92,8 @@ struct FIWADInfo
|
||||||
struct FStartupInfo
|
struct FStartupInfo
|
||||||
{
|
{
|
||||||
FString Name;
|
FString Name;
|
||||||
DWORD FgColor; // Foreground color for title banner
|
uint32_t FgColor; // Foreground color for title banner
|
||||||
DWORD BkColor; // Background color for title banner
|
uint32_t BkColor; // Background color for title banner
|
||||||
FString Song;
|
FString Song;
|
||||||
int Type;
|
int Type;
|
||||||
enum
|
enum
|
||||||
|
|
|
@ -127,7 +127,7 @@ void D_ProcessEvents (void);
|
||||||
void G_BuildTiccmd (ticcmd_t *cmd);
|
void G_BuildTiccmd (ticcmd_t *cmd);
|
||||||
void D_DoAdvanceDemo (void);
|
void D_DoAdvanceDemo (void);
|
||||||
|
|
||||||
static void SendSetup (DWORD playersdetected[MAXNETNODES], uint8_t gotsetup[MAXNETNODES], int len);
|
static void SendSetup (uint32_t playersdetected[MAXNETNODES], uint8_t gotsetup[MAXNETNODES], int len);
|
||||||
static void RunScript(uint8_t **stream, APlayerPawn *pawn, int snum, int argn, int always);
|
static void RunScript(uint8_t **stream, APlayerPawn *pawn, int snum, int argn, int always);
|
||||||
|
|
||||||
int reboundpacket;
|
int reboundpacket;
|
||||||
|
@ -1405,7 +1405,7 @@ void NetUpdate (void)
|
||||||
|
|
||||||
struct ArbitrateData
|
struct ArbitrateData
|
||||||
{
|
{
|
||||||
DWORD playersdetected[MAXNETNODES];
|
uint32_t playersdetected[MAXNETNODES];
|
||||||
uint8_t gotsetup[MAXNETNODES];
|
uint8_t gotsetup[MAXNETNODES];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1490,7 +1490,7 @@ bool DoArbitrate (void *userdata)
|
||||||
if (consoleplayer == Net_Arbitrator)
|
if (consoleplayer == Net_Arbitrator)
|
||||||
{
|
{
|
||||||
for (i = 0; i < doomcom.numnodes; ++i)
|
for (i = 0; i < doomcom.numnodes; ++i)
|
||||||
if (data->playersdetected[i] != DWORD(1 << doomcom.numnodes) - 1 || !data->gotsetup[i])
|
if (data->playersdetected[i] != uint32_t(1 << doomcom.numnodes) - 1 || !data->gotsetup[i])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (i == doomcom.numnodes)
|
if (i == doomcom.numnodes)
|
||||||
|
@ -1631,7 +1631,7 @@ void D_ArbitrateNetStart (void)
|
||||||
StartScreen->NetDone();
|
StartScreen->NetDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SendSetup (DWORD playersdetected[MAXNETNODES], uint8_t gotsetup[MAXNETNODES], int len)
|
static void SendSetup (uint32_t playersdetected[MAXNETNODES], uint8_t gotsetup[MAXNETNODES], int len)
|
||||||
{
|
{
|
||||||
if (consoleplayer != Net_Arbitrator)
|
if (consoleplayer != Net_Arbitrator)
|
||||||
{
|
{
|
||||||
|
@ -2270,7 +2270,7 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
|
||||||
case DEM_INVUSE:
|
case DEM_INVUSE:
|
||||||
case DEM_INVDROP:
|
case DEM_INVDROP:
|
||||||
{
|
{
|
||||||
DWORD which = ReadLong (stream);
|
uint32_t which = ReadLong (stream);
|
||||||
int amt = -1;
|
int amt = -1;
|
||||||
|
|
||||||
if (type == DEM_INVDROP) amt = ReadLong(stream);
|
if (type == DEM_INVDROP) amt = ReadLong(stream);
|
||||||
|
@ -2308,7 +2308,7 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
|
||||||
{
|
{
|
||||||
PClassActor *typeinfo;
|
PClassActor *typeinfo;
|
||||||
int angle = 0;
|
int angle = 0;
|
||||||
SWORD tid = 0;
|
int16_t tid = 0;
|
||||||
uint8_t special = 0;
|
uint8_t special = 0;
|
||||||
int args[5];
|
int args[5];
|
||||||
|
|
||||||
|
|
24
src/d_net.h
24
src/d_net.h
|
@ -59,27 +59,27 @@
|
||||||
//
|
//
|
||||||
struct doomcom_t
|
struct doomcom_t
|
||||||
{
|
{
|
||||||
DWORD id; // should be DOOMCOM_ID
|
uint32_t id; // should be DOOMCOM_ID
|
||||||
SWORD intnum; // DOOM executes an int to execute commands
|
int16_t intnum; // DOOM executes an int to execute commands
|
||||||
|
|
||||||
// communication between DOOM and the driver
|
// communication between DOOM and the driver
|
||||||
SWORD command; // CMD_SEND or CMD_GET
|
int16_t command; // CMD_SEND or CMD_GET
|
||||||
SWORD remotenode; // dest for send, set by get (-1 = no packet).
|
int16_t remotenode; // dest for send, set by get (-1 = no packet).
|
||||||
SWORD datalength; // bytes in doomdata to be sent
|
int16_t datalength; // bytes in doomdata to be sent
|
||||||
|
|
||||||
// info common to all nodes
|
// info common to all nodes
|
||||||
SWORD numnodes; // console is always node 0.
|
int16_t numnodes; // console is always node 0.
|
||||||
SWORD ticdup; // 1 = no duplication, 2-5 = dup for slow nets
|
int16_t ticdup; // 1 = no duplication, 2-5 = dup for slow nets
|
||||||
#ifdef DJGPP
|
#ifdef DJGPP
|
||||||
SWORD pad[5]; // keep things aligned for DOS drivers
|
int16_t pad[5]; // keep things aligned for DOS drivers
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// info specific to this node
|
// info specific to this node
|
||||||
SWORD consoleplayer;
|
int16_t consoleplayer;
|
||||||
SWORD numplayers;
|
int16_t numplayers;
|
||||||
#ifdef DJGPP
|
#ifdef DJGPP
|
||||||
SWORD angleoffset; // does not work, but needed to preserve
|
int16_t angleoffset; // does not work, but needed to preserve
|
||||||
SWORD drone; // alignment for DOS drivers
|
int16_t drone; // alignment for DOS drivers
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// packet data to be sent
|
// packet data to be sent
|
||||||
|
|
|
@ -256,7 +256,7 @@ public:
|
||||||
bool CheckSkin (int skin);
|
bool CheckSkin (int skin);
|
||||||
|
|
||||||
PClassActor *Type;
|
PClassActor *Type;
|
||||||
DWORD Flags;
|
uint32_t Flags;
|
||||||
TArray<int> Skins;
|
TArray<int> Skins;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ public:
|
||||||
uint8_t playerstate;
|
uint8_t playerstate;
|
||||||
ticcmd_t cmd;
|
ticcmd_t cmd;
|
||||||
usercmd_t original_cmd;
|
usercmd_t original_cmd;
|
||||||
DWORD original_oldbuttons;
|
uint32_t original_oldbuttons;
|
||||||
|
|
||||||
userinfo_t userinfo; // [RH] who is this?
|
userinfo_t userinfo; // [RH] who is this?
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ public:
|
||||||
|
|
||||||
bool attackdown;
|
bool attackdown;
|
||||||
bool usedown;
|
bool usedown;
|
||||||
DWORD oldbuttons;
|
uint32_t oldbuttons;
|
||||||
int health; // only used between levels, mo->health
|
int health; // only used between levels, mo->health
|
||||||
// is used during levels
|
// is used during levels
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ public:
|
||||||
int lastkilltime; // [RH] For multikills
|
int lastkilltime; // [RH] For multikills
|
||||||
uint8_t multicount;
|
uint8_t multicount;
|
||||||
uint8_t spreecount; // [RH] Keep track of killing sprees
|
uint8_t spreecount; // [RH] Keep track of killing sprees
|
||||||
WORD WeaponState;
|
uint16_t WeaponState;
|
||||||
|
|
||||||
AWeapon *ReadyWeapon;
|
AWeapon *ReadyWeapon;
|
||||||
AWeapon *PendingWeapon; // WP_NOCHANGE if not changing
|
AWeapon *PendingWeapon; // WP_NOCHANGE if not changing
|
||||||
|
@ -464,11 +464,11 @@ public:
|
||||||
FName LastDamageType; // [RH] For damage-specific pain and death sounds
|
FName LastDamageType; // [RH] For damage-specific pain and death sounds
|
||||||
|
|
||||||
TObjPtr<AActor*> MUSINFOactor; // For MUSINFO purposes
|
TObjPtr<AActor*> MUSINFOactor; // For MUSINFO purposes
|
||||||
SBYTE MUSINFOtics;
|
int8_t MUSINFOtics;
|
||||||
|
|
||||||
bool settings_controller; // Player can control game settings.
|
bool settings_controller; // Player can control game settings.
|
||||||
SBYTE crouching;
|
int8_t crouching;
|
||||||
SBYTE crouchdir;
|
int8_t crouchdir;
|
||||||
|
|
||||||
//Added by MC:
|
//Added by MC:
|
||||||
TObjPtr<DBot*> Bot;
|
TObjPtr<DBot*> Bot;
|
||||||
|
|
|
@ -159,7 +159,7 @@ int UnpackUserCmd (usercmd_t *ucmd, const usercmd_t *basis, uint8_t **stream)
|
||||||
// We can support up to 29 buttons, using from 0 to 4 bytes to store them.
|
// We can support up to 29 buttons, using from 0 to 4 bytes to store them.
|
||||||
if (flags & UCMDF_BUTTONS)
|
if (flags & UCMDF_BUTTONS)
|
||||||
{
|
{
|
||||||
DWORD buttons = ucmd->buttons;
|
uint32_t buttons = ucmd->buttons;
|
||||||
uint8_t in = ReadByte(stream);
|
uint8_t in = ReadByte(stream);
|
||||||
|
|
||||||
buttons = (buttons & ~0x7F) | (in & 0x7F);
|
buttons = (buttons & ~0x7F) | (in & 0x7F);
|
||||||
|
@ -204,7 +204,7 @@ int PackUserCmd (const usercmd_t *ucmd, const usercmd_t *basis, uint8_t **stream
|
||||||
uint8_t *temp = *stream;
|
uint8_t *temp = *stream;
|
||||||
uint8_t *start = *stream;
|
uint8_t *start = *stream;
|
||||||
usercmd_t blank;
|
usercmd_t blank;
|
||||||
DWORD buttons_changed;
|
uint32_t buttons_changed;
|
||||||
|
|
||||||
if (basis == NULL)
|
if (basis == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,7 @@ struct zdemoheader_s {
|
||||||
|
|
||||||
struct usercmd_t
|
struct usercmd_t
|
||||||
{
|
{
|
||||||
DWORD buttons;
|
uint32_t buttons;
|
||||||
short pitch; // up/down
|
short pitch; // up/down
|
||||||
short yaw; // left/right
|
short yaw; // left/right
|
||||||
short roll; // "tilt"
|
short roll; // "tilt"
|
||||||
|
@ -141,7 +141,7 @@ enum EDemoCommand
|
||||||
DEM_DELCONTROLLER, // 49 Player to remove from the controller list.
|
DEM_DELCONTROLLER, // 49 Player to remove from the controller list.
|
||||||
DEM_KILLCLASSCHEAT, // 50 String: Class to kill.
|
DEM_KILLCLASSCHEAT, // 50 String: Class to kill.
|
||||||
DEM_UNDONE11, // 51
|
DEM_UNDONE11, // 51
|
||||||
DEM_SUMMON2, // 52 String: Thing to fabricate, WORD: angle offset
|
DEM_SUMMON2, // 52 String: Thing to fabricate, uint16_t: angle offset
|
||||||
DEM_SUMMONFRIEND2, // 53
|
DEM_SUMMONFRIEND2, // 53
|
||||||
DEM_SUMMONFOE2, // 54
|
DEM_SUMMONFOE2, // 54
|
||||||
DEM_ADDSLOTDEFAULT, // 55
|
DEM_ADDSLOTDEFAULT, // 55
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
struct ticcmd_t
|
struct ticcmd_t
|
||||||
{
|
{
|
||||||
usercmd_t ucmd;
|
usercmd_t ucmd;
|
||||||
SWORD consistancy; // checks for net game
|
int16_t consistancy; // checks for net game
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __D_TICCMD_H__
|
#endif // __D_TICCMD_H__
|
||||||
|
|
|
@ -89,10 +89,10 @@ private:
|
||||||
|
|
||||||
struct FDecalLib::FTranslation
|
struct FDecalLib::FTranslation
|
||||||
{
|
{
|
||||||
FTranslation (DWORD start, DWORD end);
|
FTranslation (uint32_t start, uint32_t end);
|
||||||
FTranslation *LocateTranslation (DWORD start, DWORD end);
|
FTranslation *LocateTranslation (uint32_t start, uint32_t end);
|
||||||
|
|
||||||
DWORD StartColor, EndColor;
|
uint32_t StartColor, EndColor;
|
||||||
FTranslation *Next;
|
FTranslation *Next;
|
||||||
uint16_t Index;
|
uint16_t Index;
|
||||||
};
|
};
|
||||||
|
@ -546,7 +546,7 @@ void FDecalLib::ParseDecal (FScanner &sc)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DECAL_COLORS:
|
case DECAL_COLORS:
|
||||||
DWORD startcolor, endcolor;
|
uint32_t startcolor, endcolor;
|
||||||
|
|
||||||
sc.MustGetString (); startcolor = V_GetColor (NULL, sc);
|
sc.MustGetString (); startcolor = V_GetColor (NULL, sc);
|
||||||
sc.MustGetString (); endcolor = V_GetColor (NULL, sc);
|
sc.MustGetString (); endcolor = V_GetColor (NULL, sc);
|
||||||
|
@ -1009,7 +1009,7 @@ FDecalBase *FDecalLib::ScanTreeForName (const char *name, FDecalBase *root)
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalLib::FTranslation *FDecalLib::GenerateTranslation (DWORD start, DWORD end)
|
FDecalLib::FTranslation *FDecalLib::GenerateTranslation (uint32_t start, uint32_t end)
|
||||||
{
|
{
|
||||||
FTranslation *trans;
|
FTranslation *trans;
|
||||||
|
|
||||||
|
@ -1069,9 +1069,9 @@ const FDecalTemplate *FDecalTemplate::GetDecal () const
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalLib::FTranslation::FTranslation (DWORD start, DWORD end)
|
FDecalLib::FTranslation::FTranslation (uint32_t start, uint32_t end)
|
||||||
{
|
{
|
||||||
DWORD ri, gi, bi, rs, gs, bs;
|
uint32_t ri, gi, bi, rs, gs, bs;
|
||||||
PalEntry *first, *last;
|
PalEntry *first, *last;
|
||||||
uint8_t *table;
|
uint8_t *table;
|
||||||
unsigned int i, tablei;
|
unsigned int i, tablei;
|
||||||
|
@ -1112,7 +1112,7 @@ FDecalLib::FTranslation::FTranslation (DWORD start, DWORD end)
|
||||||
Index = (uint16_t)TRANSLATION(TRANSLATION_Decals, tablei >> 8);
|
Index = (uint16_t)TRANSLATION(TRANSLATION_Decals, tablei >> 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalLib::FTranslation *FDecalLib::FTranslation::LocateTranslation (DWORD start, DWORD end)
|
FDecalLib::FTranslation *FDecalLib::FTranslation::LocateTranslation (uint32_t start, uint32_t end)
|
||||||
{
|
{
|
||||||
FTranslation *trans = this;
|
FTranslation *trans = this;
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ protected:
|
||||||
|
|
||||||
FDecalBase *Left, *Right;
|
FDecalBase *Left, *Right;
|
||||||
FName Name;
|
FName Name;
|
||||||
WORD SpawnID;
|
uint16_t SpawnID;
|
||||||
TArray<const PClass *> Users; // Which actors generate this decal
|
TArray<const PClass *> Users; // Which actors generate this decal
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -75,11 +75,11 @@ public:
|
||||||
void ReplaceDecalRef (FDecalBase *from, FDecalBase *to);
|
void ReplaceDecalRef (FDecalBase *from, FDecalBase *to);
|
||||||
|
|
||||||
double ScaleX, ScaleY;
|
double ScaleX, ScaleY;
|
||||||
DWORD ShadeColor;
|
uint32_t ShadeColor;
|
||||||
DWORD Translation;
|
uint32_t Translation;
|
||||||
FRenderStyle RenderStyle;
|
FRenderStyle RenderStyle;
|
||||||
FTextureID PicNum;
|
FTextureID PicNum;
|
||||||
WORD RenderFlags;
|
uint16_t RenderFlags;
|
||||||
double Alpha; // same as actor->alpha
|
double Alpha; // same as actor->alpha
|
||||||
const FDecalAnimator *Animator;
|
const FDecalAnimator *Animator;
|
||||||
const FDecalBase *LowerDecal;
|
const FDecalBase *LowerDecal;
|
||||||
|
@ -97,22 +97,22 @@ public:
|
||||||
void ReadDecals (FScanner &sc);
|
void ReadDecals (FScanner &sc);
|
||||||
void ReadAllDecals ();
|
void ReadAllDecals ();
|
||||||
|
|
||||||
const FDecalTemplate *GetDecalByNum (WORD num) const;
|
const FDecalTemplate *GetDecalByNum (uint16_t num) const;
|
||||||
const FDecalTemplate *GetDecalByName (const char *name) const;
|
const FDecalTemplate *GetDecalByName (const char *name) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct FTranslation;
|
struct FTranslation;
|
||||||
|
|
||||||
static void DelTree (FDecalBase *root);
|
static void DelTree (FDecalBase *root);
|
||||||
static FDecalBase *ScanTreeForNum (const WORD num, FDecalBase *root);
|
static FDecalBase *ScanTreeForNum (const uint16_t num, FDecalBase *root);
|
||||||
static FDecalBase *ScanTreeForName (const char *name, FDecalBase *root);
|
static FDecalBase *ScanTreeForName (const char *name, FDecalBase *root);
|
||||||
static void ReplaceDecalRef (FDecalBase *from, FDecalBase *to, FDecalBase *root);
|
static void ReplaceDecalRef (FDecalBase *from, FDecalBase *to, FDecalBase *root);
|
||||||
FTranslation *GenerateTranslation (DWORD start, DWORD end);
|
FTranslation *GenerateTranslation (uint32_t start, uint32_t end);
|
||||||
void AddDecal (const char *name, WORD num, const FDecalTemplate &decal);
|
void AddDecal (const char *name, uint16_t num, const FDecalTemplate &decal);
|
||||||
void AddDecal (FDecalBase *decal);
|
void AddDecal (FDecalBase *decal);
|
||||||
FDecalAnimator *FindAnimator (const char *name);
|
FDecalAnimator *FindAnimator (const char *name);
|
||||||
|
|
||||||
WORD GetDecalID (FScanner &sc);
|
uint16_t GetDecalID (FScanner &sc);
|
||||||
void ParseDecal (FScanner &sc);
|
void ParseDecal (FScanner &sc);
|
||||||
void ParseDecalGroup (FScanner &sc);
|
void ParseDecalGroup (FScanner &sc);
|
||||||
void ParseGenerator (FScanner &sc);
|
void ParseGenerator (FScanner &sc);
|
||||||
|
|
|
@ -150,7 +150,7 @@ DObject *Gray;
|
||||||
DObject *Root;
|
DObject *Root;
|
||||||
DObject *SoftRoots;
|
DObject *SoftRoots;
|
||||||
DObject **SweepPos;
|
DObject **SweepPos;
|
||||||
DWORD CurrentWhite = OF_White0 | OF_Fixed;
|
uint32_t CurrentWhite = OF_White0 | OF_Fixed;
|
||||||
EGCState State = GCS_Pause;
|
EGCState State = GCS_Pause;
|
||||||
int Pause = DEFAULT_GCPAUSE;
|
int Pause = DEFAULT_GCPAUSE;
|
||||||
int StepMul = DEFAULT_GCMUL;
|
int StepMul = DEFAULT_GCMUL;
|
||||||
|
|
|
@ -673,11 +673,11 @@ int PInt::GetValueInt(void *addr) const
|
||||||
}
|
}
|
||||||
else if (Size == 1)
|
else if (Size == 1)
|
||||||
{
|
{
|
||||||
return Unsigned ? *(uint8_t *)addr : *(SBYTE *)addr;
|
return Unsigned ? *(uint8_t *)addr : *(int8_t *)addr;
|
||||||
}
|
}
|
||||||
else if (Size == 2)
|
else if (Size == 2)
|
||||||
{
|
{
|
||||||
return Unsigned ? *(uint16_t *)addr : *(SWORD *)addr;
|
return Unsigned ? *(uint16_t *)addr : *(int16_t *)addr;
|
||||||
}
|
}
|
||||||
else if (Size == 8)
|
else if (Size == 8)
|
||||||
{ // truncated output
|
{ // truncated output
|
||||||
|
@ -2372,7 +2372,7 @@ bool PStruct::ReadFields(FSerializer &ar, void *addr) const
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
PField *PStruct::AddField(FName name, PType *type, DWORD flags)
|
PField *PStruct::AddField(FName name, PType *type, uint32_t flags)
|
||||||
{
|
{
|
||||||
PField *field = new PField(name, type, flags);
|
PField *field = new PField(name, type, flags);
|
||||||
|
|
||||||
|
@ -2405,7 +2405,7 @@ PField *PStruct::AddField(FName name, PType *type, DWORD flags)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
PField *PStruct::AddNativeField(FName name, PType *type, size_t address, DWORD flags, int bitvalue)
|
PField *PStruct::AddNativeField(FName name, PType *type, size_t address, uint32_t flags, int bitvalue)
|
||||||
{
|
{
|
||||||
PField *field = new PField(name, type, flags|VARF_Native|VARF_Transient, address, bitvalue);
|
PField *field = new PField(name, type, flags|VARF_Native|VARF_Transient, address, bitvalue);
|
||||||
|
|
||||||
|
@ -2495,7 +2495,7 @@ PField::PField()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PField::PField(FName name, PType *type, DWORD flags, size_t offset, int bitvalue)
|
PField::PField(FName name, PType *type, uint32_t flags, size_t offset, int bitvalue)
|
||||||
: PSymbol(name), Offset(offset), Type(type), Flags(flags)
|
: PSymbol(name), Offset(offset), Type(type), Flags(flags)
|
||||||
{
|
{
|
||||||
if (bitvalue != 0)
|
if (bitvalue != 0)
|
||||||
|
@ -3330,7 +3330,7 @@ PClass *PClass::CreateDerivedClass(FName name, unsigned int size)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
PField *PClass::AddMetaField(FName name, PType *type, DWORD flags)
|
PField *PClass::AddMetaField(FName name, PType *type, uint32_t flags)
|
||||||
{
|
{
|
||||||
PField *field = new PField(name, type, flags);
|
PField *field = new PField(name, type, flags);
|
||||||
|
|
||||||
|
@ -3360,7 +3360,7 @@ PField *PClass::AddMetaField(FName name, PType *type, DWORD flags)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
PField *PClass::AddField(FName name, PType *type, DWORD flags)
|
PField *PClass::AddField(FName name, PType *type, uint32_t flags)
|
||||||
{
|
{
|
||||||
if (!(flags & VARF_Meta))
|
if (!(flags & VARF_Meta))
|
||||||
{
|
{
|
||||||
|
|
|
@ -525,8 +525,8 @@ public:
|
||||||
VMFunction *mConstructor = nullptr;
|
VMFunction *mConstructor = nullptr;
|
||||||
VMFunction *mDestructor = nullptr;
|
VMFunction *mDestructor = nullptr;
|
||||||
|
|
||||||
virtual PField *AddField(FName name, PType *type, DWORD flags=0);
|
virtual PField *AddField(FName name, PType *type, uint32_t flags=0);
|
||||||
virtual PField *AddNativeField(FName name, PType *type, size_t address, DWORD flags = 0, int bitvalue = 0);
|
virtual PField *AddNativeField(FName name, PType *type, size_t address, uint32_t flags = 0, int bitvalue = 0);
|
||||||
|
|
||||||
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
|
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
|
||||||
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
|
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
|
||||||
|
@ -581,7 +581,7 @@ protected:
|
||||||
void Derive(PClass *newclass, FName name);
|
void Derive(PClass *newclass, FName name);
|
||||||
void InitializeSpecials(void *addr, void *defaults, TArray<FTypeAndOffset> PClass::*Inits);
|
void InitializeSpecials(void *addr, void *defaults, TArray<FTypeAndOffset> PClass::*Inits);
|
||||||
void SetSuper();
|
void SetSuper();
|
||||||
PField *AddMetaField(FName name, PType *type, DWORD flags);
|
PField *AddMetaField(FName name, PType *type, uint32_t flags);
|
||||||
public:
|
public:
|
||||||
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
|
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
|
||||||
void WriteAllFields(FSerializer &ar, const void *addr) const;
|
void WriteAllFields(FSerializer &ar, const void *addr) const;
|
||||||
|
@ -617,7 +617,7 @@ public:
|
||||||
void InsertIntoHash();
|
void InsertIntoHash();
|
||||||
DObject *CreateNew();
|
DObject *CreateNew();
|
||||||
PClass *CreateDerivedClass(FName name, unsigned int size);
|
PClass *CreateDerivedClass(FName name, unsigned int size);
|
||||||
PField *AddField(FName name, PType *type, DWORD flags=0) override;
|
PField *AddField(FName name, PType *type, uint32_t flags=0) override;
|
||||||
void InitializeActorInfo();
|
void InitializeActorInfo();
|
||||||
void BuildFlatPointers();
|
void BuildFlatPointers();
|
||||||
void BuildArrayPointers();
|
void BuildArrayPointers();
|
||||||
|
|
|
@ -241,7 +241,7 @@ struct mapsubsector_t
|
||||||
struct mapsubsector4_t
|
struct mapsubsector4_t
|
||||||
{
|
{
|
||||||
uint16_t numsegs;
|
uint16_t numsegs;
|
||||||
DWORD firstseg; // index of first one, segs are stored sequentially
|
uint32_t firstseg; // index of first one, segs are stored sequentially
|
||||||
};
|
};
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
|
@ -251,10 +251,10 @@ struct mapseg_t
|
||||||
{
|
{
|
||||||
uint16_t v1;
|
uint16_t v1;
|
||||||
uint16_t v2;
|
uint16_t v2;
|
||||||
SWORD angle;
|
int16_t angle;
|
||||||
uint16_t linedef;
|
uint16_t linedef;
|
||||||
SWORD side;
|
int16_t side;
|
||||||
SWORD offset;
|
int16_t offset;
|
||||||
|
|
||||||
int V1() { return LittleShort(v1); }
|
int V1() { return LittleShort(v1); }
|
||||||
int V2() { return LittleShort(v2); }
|
int V2() { return LittleShort(v2); }
|
||||||
|
@ -264,10 +264,10 @@ struct mapseg4_t
|
||||||
{
|
{
|
||||||
int32_t v1;
|
int32_t v1;
|
||||||
int32_t v2;
|
int32_t v2;
|
||||||
SWORD angle;
|
int16_t angle;
|
||||||
uint16_t linedef;
|
uint16_t linedef;
|
||||||
SWORD side;
|
int16_t side;
|
||||||
SWORD offset;
|
int16_t offset;
|
||||||
|
|
||||||
int V1() { return LittleLong(v1); }
|
int V1() { return LittleLong(v1); }
|
||||||
int V2() { return LittleLong(v2); }
|
int V2() { return LittleLong(v2); }
|
||||||
|
@ -286,13 +286,13 @@ struct mapnode_t
|
||||||
NF_SUBSECTOR = 0x8000,
|
NF_SUBSECTOR = 0x8000,
|
||||||
NF_LUMPOFFSET = 0
|
NF_LUMPOFFSET = 0
|
||||||
};
|
};
|
||||||
SWORD x,y,dx,dy; // partition line
|
int16_t x,y,dx,dy; // partition line
|
||||||
SWORD bbox[2][4]; // bounding box for each child
|
int16_t bbox[2][4]; // bounding box for each child
|
||||||
// If NF_SUBSECTOR is or'ed in, it's a subsector,
|
// If NF_SUBSECTOR is or'ed in, it's a subsector,
|
||||||
// else it's a node of another subtree.
|
// else it's a node of another subtree.
|
||||||
uint16_t children[2];
|
uint16_t children[2];
|
||||||
|
|
||||||
DWORD Child(int num) { return LittleShort(children[num]); }
|
uint32_t Child(int num) { return LittleShort(children[num]); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -303,13 +303,13 @@ struct mapnode4_t
|
||||||
NF_SUBSECTOR = 0x80000000,
|
NF_SUBSECTOR = 0x80000000,
|
||||||
NF_LUMPOFFSET = 8
|
NF_LUMPOFFSET = 8
|
||||||
};
|
};
|
||||||
SWORD x,y,dx,dy; // partition line
|
int16_t x,y,dx,dy; // partition line
|
||||||
SWORD bbox[2][4]; // bounding box for each child
|
int16_t bbox[2][4]; // bounding box for each child
|
||||||
// If NF_SUBSECTOR is or'ed in, it's a subsector,
|
// If NF_SUBSECTOR is or'ed in, it's a subsector,
|
||||||
// else it's a node of another subtree.
|
// else it's a node of another subtree.
|
||||||
DWORD children[2];
|
uint32_t children[2];
|
||||||
|
|
||||||
DWORD Child(int num) { return LittleLong(children[num]); }
|
uint32_t Child(int num) { return LittleLong(children[num]); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -318,22 +318,22 @@ struct mapnode4_t
|
||||||
// plus skill/visibility flags and attributes.
|
// plus skill/visibility flags and attributes.
|
||||||
struct mapthing_t
|
struct mapthing_t
|
||||||
{
|
{
|
||||||
SWORD x;
|
int16_t x;
|
||||||
SWORD y;
|
int16_t y;
|
||||||
SWORD angle;
|
int16_t angle;
|
||||||
SWORD type;
|
int16_t type;
|
||||||
SWORD options;
|
int16_t options;
|
||||||
};
|
};
|
||||||
|
|
||||||
// [RH] Hexen-compatible MapThing.
|
// [RH] Hexen-compatible MapThing.
|
||||||
struct mapthinghexen_t
|
struct mapthinghexen_t
|
||||||
{
|
{
|
||||||
SWORD thingid;
|
int16_t thingid;
|
||||||
SWORD x;
|
int16_t x;
|
||||||
SWORD y;
|
int16_t y;
|
||||||
SWORD z;
|
int16_t z;
|
||||||
SWORD angle;
|
int16_t angle;
|
||||||
SWORD type;
|
int16_t type;
|
||||||
uint16_t flags;
|
uint16_t flags;
|
||||||
uint8_t special;
|
uint8_t special;
|
||||||
uint8_t args[5];
|
uint8_t args[5];
|
||||||
|
@ -351,19 +351,19 @@ struct FMapThing
|
||||||
uint16_t ClassFilter;
|
uint16_t ClassFilter;
|
||||||
int16_t EdNum;
|
int16_t EdNum;
|
||||||
FDoomEdEntry *info;
|
FDoomEdEntry *info;
|
||||||
DWORD flags;
|
uint32_t flags;
|
||||||
int special;
|
int special;
|
||||||
int args[5];
|
int args[5];
|
||||||
int Conversation;
|
int Conversation;
|
||||||
double Gravity;
|
double Gravity;
|
||||||
double Alpha;
|
double Alpha;
|
||||||
DWORD fillcolor;
|
uint32_t fillcolor;
|
||||||
DVector2 Scale;
|
DVector2 Scale;
|
||||||
double Health;
|
double Health;
|
||||||
int score;
|
int score;
|
||||||
int16_t pitch;
|
int16_t pitch;
|
||||||
int16_t roll;
|
int16_t roll;
|
||||||
DWORD RenderStyle;
|
uint32_t RenderStyle;
|
||||||
int FloatbobPhase;
|
int FloatbobPhase;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -377,9 +377,9 @@ enum
|
||||||
#define BLINKTHRESHOLD (4*32)
|
#define BLINKTHRESHOLD (4*32)
|
||||||
|
|
||||||
#ifndef __BIG_ENDIAN__
|
#ifndef __BIG_ENDIAN__
|
||||||
#define MAKE_ID(a,b,c,d) ((DWORD)((a)|((b)<<8)|((c)<<16)|((d)<<24)))
|
#define MAKE_ID(a,b,c,d) ((uint32_t)((a)|((b)<<8)|((c)<<16)|((d)<<24)))
|
||||||
#else
|
#else
|
||||||
#define MAKE_ID(a,b,c,d) ((DWORD)((d)|((c)<<8)|((b)<<16)|((a)<<24)))
|
#define MAKE_ID(a,b,c,d) ((uint32_t)((d)|((c)<<8)|((b)<<16)|((a)<<24)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // __DOOMDEF_H__
|
#endif // __DOOMDEF_H__
|
||||||
|
|
|
@ -95,8 +95,8 @@ struct EDMapthing
|
||||||
int type;
|
int type;
|
||||||
double height;
|
double height;
|
||||||
int args[5];
|
int args[5];
|
||||||
WORD skillfilter;
|
uint16_t skillfilter;
|
||||||
DWORD flags;
|
uint32_t flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EDLinedef
|
struct EDLinedef
|
||||||
|
@ -107,8 +107,8 @@ struct EDLinedef
|
||||||
int id;
|
int id;
|
||||||
int args[5];
|
int args[5];
|
||||||
double alpha;
|
double alpha;
|
||||||
DWORD flags;
|
uint32_t flags;
|
||||||
DWORD activation;
|
uint32_t activation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,9 +117,9 @@ struct EDSector
|
||||||
{
|
{
|
||||||
int recordnum;
|
int recordnum;
|
||||||
|
|
||||||
DWORD flags;
|
uint32_t flags;
|
||||||
DWORD flagsRemove;
|
uint32_t flagsRemove;
|
||||||
DWORD flagsAdd;
|
uint32_t flagsAdd;
|
||||||
|
|
||||||
int damageamount;
|
int damageamount;
|
||||||
int damageinterval;
|
int damageinterval;
|
||||||
|
@ -130,11 +130,11 @@ struct EDSector
|
||||||
int floorterrain;
|
int floorterrain;
|
||||||
int ceilingterrain;
|
int ceilingterrain;
|
||||||
|
|
||||||
DWORD color;
|
uint32_t color;
|
||||||
|
|
||||||
DWORD damageflags;
|
uint32_t damageflags;
|
||||||
DWORD damageflagsAdd;
|
uint32_t damageflagsAdd;
|
||||||
DWORD damageflagsRemove;
|
uint32_t damageflagsRemove;
|
||||||
|
|
||||||
bool flagsSet;
|
bool flagsSet;
|
||||||
bool damageflagsSet;
|
bool damageflagsSet;
|
||||||
|
@ -143,7 +143,7 @@ struct EDSector
|
||||||
// colormaptop//bottom cannot be used because ZDoom has no corresponding properties.
|
// colormaptop//bottom cannot be used because ZDoom has no corresponding properties.
|
||||||
double xoffs[2], yoffs[2];
|
double xoffs[2], yoffs[2];
|
||||||
DAngle angle[2];
|
DAngle angle[2];
|
||||||
DWORD portalflags[2];
|
uint32_t portalflags[2];
|
||||||
double Overlayalpha[2];
|
double Overlayalpha[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -222,8 +222,8 @@ static void parseLinedef(FScanner &sc)
|
||||||
else if (sc.Compare("extflags"))
|
else if (sc.Compare("extflags"))
|
||||||
{
|
{
|
||||||
// these are needed to build the proper activation mask out of the possible flags which do not match ZDoom 1:1.
|
// these are needed to build the proper activation mask out of the possible flags which do not match ZDoom 1:1.
|
||||||
DWORD actmethod = 0;
|
uint32_t actmethod = 0;
|
||||||
DWORD acttype = 0;
|
uint32_t acttype = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
sc.CheckString("=");
|
sc.CheckString("=");
|
||||||
|
@ -291,7 +291,7 @@ static void parseSector(FScanner &sc)
|
||||||
}
|
}
|
||||||
else if (sc.Compare("flags"))
|
else if (sc.Compare("flags"))
|
||||||
{
|
{
|
||||||
DWORD *flagvar = NULL;
|
uint32_t *flagvar = NULL;
|
||||||
if (sc.CheckString("."))
|
if (sc.CheckString("."))
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
|
@ -348,7 +348,7 @@ static void parseSector(FScanner &sc)
|
||||||
}
|
}
|
||||||
else if (sc.Compare("damageflags"))
|
else if (sc.Compare("damageflags"))
|
||||||
{
|
{
|
||||||
DWORD *flagvar = NULL;
|
uint32_t *flagvar = NULL;
|
||||||
uint8_t *leakvar = NULL;
|
uint8_t *leakvar = NULL;
|
||||||
if (sc.CheckString("."))
|
if (sc.CheckString("."))
|
||||||
{
|
{
|
||||||
|
@ -449,7 +449,7 @@ static void parseSector(FScanner &sc)
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
// Eternity is based on SMMU and uses colormaps differently than all other ports.
|
// Eternity is based on SMMU and uses colormaps differently than all other ports.
|
||||||
// The only solution here is to convert the colormap to an RGB value and set it as the sector's color.
|
// The only solution here is to convert the colormap to an RGB value and set it as the sector's color.
|
||||||
DWORD cmap = R_ColormapNumForName(sc.String);
|
uint32_t cmap = R_ColormapNumForName(sc.String);
|
||||||
if (cmap != 0)
|
if (cmap != 0)
|
||||||
{
|
{
|
||||||
sec.color = R_BlendForColormap(cmap) & 0xff000000;
|
sec.color = R_BlendForColormap(cmap) & 0xff000000;
|
||||||
|
@ -700,7 +700,7 @@ void ProcessEDLinedef(line_t *ld, int recordnum)
|
||||||
ld->special = 0;
|
ld->special = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const DWORD fmask = ML_REPEAT_SPECIAL | ML_FIRSTSIDEONLY | ML_ADDTRANS | ML_BLOCKEVERYTHING | ML_ZONEBOUNDARY | ML_CLIP_MIDTEX;
|
const uint32_t fmask = ML_REPEAT_SPECIAL | ML_FIRSTSIDEONLY | ML_ADDTRANS | ML_BLOCKEVERYTHING | ML_ZONEBOUNDARY | ML_CLIP_MIDTEX;
|
||||||
ld->special = eld->special;
|
ld->special = eld->special;
|
||||||
ld->activation = eld->activation;
|
ld->activation = eld->activation;
|
||||||
ld->flags = (ld->flags&~fmask) | eld->flags;
|
ld->flags = (ld->flags&~fmask) | eld->flags;
|
||||||
|
@ -719,7 +719,7 @@ void ProcessEDSector(sector_t *sec, int recordnum)
|
||||||
}
|
}
|
||||||
|
|
||||||
// In ZDoom the regular and the damage flags are part of the same flag word so we need to do some masking.
|
// In ZDoom the regular and the damage flags are part of the same flag word so we need to do some masking.
|
||||||
const DWORD flagmask = SECF_SECRET | SECF_WASSECRET | SECF_FRICTION | SECF_PUSH | SECF_SILENT | SECF_SILENTMOVE;
|
const uint32_t flagmask = SECF_SECRET | SECF_WASSECRET | SECF_FRICTION | SECF_PUSH | SECF_SILENT | SECF_SILENTMOVE;
|
||||||
if (esec->flagsSet) sec->Flags = (sec->Flags & ~flagmask);
|
if (esec->flagsSet) sec->Flags = (sec->Flags & ~flagmask);
|
||||||
sec->Flags = (sec->Flags | esec->flags | esec->flagsAdd) & ~esec->flagsRemove;
|
sec->Flags = (sec->Flags | esec->flags | esec->flagsAdd) & ~esec->flagsRemove;
|
||||||
|
|
||||||
|
@ -740,7 +740,7 @@ void ProcessEDSector(sector_t *sec, int recordnum)
|
||||||
|
|
||||||
if (esec->colorSet) sec->SetColor(RPART(esec->color), GPART(esec->color), BPART(esec->color), 0);
|
if (esec->colorSet) sec->SetColor(RPART(esec->color), GPART(esec->color), BPART(esec->color), 0);
|
||||||
|
|
||||||
const DWORD pflagmask = PLANEF_DISABLED | PLANEF_NORENDER | PLANEF_NOPASS | PLANEF_BLOCKSOUND | PLANEF_ADDITIVE;
|
const uint32_t pflagmask = PLANEF_DISABLED | PLANEF_NORENDER | PLANEF_NOPASS | PLANEF_BLOCKSOUND | PLANEF_ADDITIVE;
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
sec->SetXOffset(i, esec->xoffs[i]);
|
sec->SetXOffset(i, esec->xoffs[i]);
|
||||||
|
|
40
src/files.h
40
src/files.h
|
@ -19,27 +19,27 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderBase &operator>> (SBYTE &v)
|
FileReaderBase &operator>> (int8_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 1);
|
Read (&v, 1);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderBase &operator>> (WORD &v)
|
FileReaderBase &operator>> (uint16_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 2);
|
Read (&v, 2);
|
||||||
v = LittleShort(v);
|
v = LittleShort(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderBase &operator>> (SWORD &v)
|
FileReaderBase &operator>> (int16_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 2);
|
Read (&v, 2);
|
||||||
v = LittleShort(v);
|
v = LittleShort(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderBase &operator>> (DWORD &v)
|
FileReaderBase &operator>> (uint32_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 4);
|
Read (&v, 4);
|
||||||
v = LittleLong(v);
|
v = LittleLong(v);
|
||||||
|
@ -85,27 +85,27 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReader &operator>> (SBYTE &v)
|
FileReader &operator>> (int8_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 1);
|
Read (&v, 1);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReader &operator>> (WORD &v)
|
FileReader &operator>> (uint16_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 2);
|
Read (&v, 2);
|
||||||
v = LittleShort(v);
|
v = LittleShort(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReader &operator>> (SWORD &v)
|
FileReader &operator>> (int16_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 2);
|
Read (&v, 2);
|
||||||
v = LittleShort(v);
|
v = LittleShort(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReader &operator>> (DWORD &v)
|
FileReader &operator>> (uint32_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 4);
|
Read (&v, 4);
|
||||||
v = LittleLong(v);
|
v = LittleLong(v);
|
||||||
|
@ -144,27 +144,27 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderZ &operator>> (SBYTE &v)
|
FileReaderZ &operator>> (int8_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 1);
|
Read (&v, 1);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderZ &operator>> (WORD &v)
|
FileReaderZ &operator>> (uint16_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 2);
|
Read (&v, 2);
|
||||||
v = LittleShort(v);
|
v = LittleShort(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderZ &operator>> (SWORD &v)
|
FileReaderZ &operator>> (int16_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 2);
|
Read (&v, 2);
|
||||||
v = LittleShort(v);
|
v = LittleShort(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderZ &operator>> (DWORD &v)
|
FileReaderZ &operator>> (uint32_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 4);
|
Read (&v, 4);
|
||||||
v = LittleLong(v);
|
v = LittleLong(v);
|
||||||
|
@ -206,27 +206,27 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderBZ2 &operator>> (SBYTE &v)
|
FileReaderBZ2 &operator>> (int8_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 1);
|
Read (&v, 1);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderBZ2 &operator>> (WORD &v)
|
FileReaderBZ2 &operator>> (uint16_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 2);
|
Read (&v, 2);
|
||||||
v = LittleShort(v);
|
v = LittleShort(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderBZ2 &operator>> (SWORD &v)
|
FileReaderBZ2 &operator>> (int16_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 2);
|
Read (&v, 2);
|
||||||
v = LittleShort(v);
|
v = LittleShort(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderBZ2 &operator>> (DWORD &v)
|
FileReaderBZ2 &operator>> (uint32_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 4);
|
Read (&v, 4);
|
||||||
v = LittleLong(v);
|
v = LittleLong(v);
|
||||||
|
@ -270,27 +270,27 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderLZMA &operator>> (SBYTE &v)
|
FileReaderLZMA &operator>> (int8_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 1);
|
Read (&v, 1);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderLZMA &operator>> (WORD &v)
|
FileReaderLZMA &operator>> (uint16_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 2);
|
Read (&v, 2);
|
||||||
v = LittleShort(v);
|
v = LittleShort(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderLZMA &operator>> (SWORD &v)
|
FileReaderLZMA &operator>> (int16_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 2);
|
Read (&v, 2);
|
||||||
v = LittleShort(v);
|
v = LittleShort(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReaderLZMA &operator>> (DWORD &v)
|
FileReaderLZMA &operator>> (uint32_t &v)
|
||||||
{
|
{
|
||||||
Read (&v, 4);
|
Read (&v, 4);
|
||||||
v = LittleLong(v);
|
v = LittleLong(v);
|
||||||
|
|
|
@ -265,7 +265,7 @@ void OpenGLFrameBuffer::DoSetGamma()
|
||||||
bool useHWGamma = m_supportsGamma && ((vid_hwgamma == 0) || (vid_hwgamma == 2 && IsFullscreen()));
|
bool useHWGamma = m_supportsGamma && ((vid_hwgamma == 0) || (vid_hwgamma == 2 && IsFullscreen()));
|
||||||
if (useHWGamma)
|
if (useHWGamma)
|
||||||
{
|
{
|
||||||
WORD gammaTable[768];
|
uint16_t gammaTable[768];
|
||||||
|
|
||||||
// This formula is taken from Doomsday
|
// This formula is taken from Doomsday
|
||||||
float gamma = clamp<float>(Gamma, 0.1f, 4.f);
|
float gamma = clamp<float>(Gamma, 0.1f, 4.f);
|
||||||
|
@ -281,7 +281,7 @@ void OpenGLFrameBuffer::DoSetGamma()
|
||||||
val += bright * 128;
|
val += bright * 128;
|
||||||
if(gamma != 1) val = pow(val, invgamma) / norm;
|
if(gamma != 1) val = pow(val, invgamma) / norm;
|
||||||
|
|
||||||
gammaTable[i] = gammaTable[i + 256] = gammaTable[i + 512] = (WORD)clamp<double>(val*256, 0, 0xffff);
|
gammaTable[i] = gammaTable[i + 256] = gammaTable[i + 512] = (uint16_t)clamp<double>(val*256, 0, 0xffff);
|
||||||
}
|
}
|
||||||
SetGammaTable(gammaTable);
|
SetGammaTable(gammaTable);
|
||||||
|
|
||||||
|
|
|
@ -135,8 +135,8 @@ struct PreGamePacket
|
||||||
};
|
};
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
DWORD address;
|
uint32_t address;
|
||||||
WORD port;
|
uint16_t port;
|
||||||
uint8_t player;
|
uint8_t player;
|
||||||
uint8_t pad;
|
uint8_t pad;
|
||||||
} machines[MAXNETNODES];
|
} machines[MAXNETNODES];
|
||||||
|
|
|
@ -36,8 +36,8 @@ typedef uintptr_t Bitu;
|
||||||
typedef intptr_t Bits;
|
typedef intptr_t Bits;
|
||||||
typedef DWORD Bit32u;
|
typedef DWORD Bit32u;
|
||||||
typedef int32_t Bit32s;
|
typedef int32_t Bit32s;
|
||||||
typedef WORD Bit16u;
|
typedef uint16_t Bit16u;
|
||||||
typedef SWORD Bit16s;
|
typedef int16_t Bit16s;
|
||||||
typedef uint8_t Bit8u;
|
typedef uint8_t Bit8u;
|
||||||
typedef SBYTE Bit8s;
|
typedef SBYTE Bit8s;
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ void OPLio::OPLwriteValue(uint32_t regbase, uint32_t channel, uint8_t value)
|
||||||
OPLwriteReg (which, reg, value);
|
OPLwriteReg (which, reg, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static WORD frequencies[] =
|
static uint16_t frequencies[] =
|
||||||
{
|
{
|
||||||
0x133, 0x133, 0x134, 0x134, 0x135, 0x136, 0x136, 0x137, 0x137, 0x138, 0x138, 0x139,
|
0x133, 0x133, 0x134, 0x134, 0x135, 0x136, 0x136, 0x137, 0x137, 0x138, 0x138, 0x139,
|
||||||
0x139, 0x13a, 0x13b, 0x13b, 0x13c, 0x13c, 0x13d, 0x13d, 0x13e, 0x13f, 0x13f, 0x140,
|
0x139, 0x13a, 0x13b, 0x13b, 0x13c, 0x13c, 0x13d, 0x13d, 0x13e, 0x13f, 0x13f, 0x140,
|
||||||
|
|
|
@ -101,7 +101,7 @@ public:
|
||||||
{
|
{
|
||||||
if (File != NULL)
|
if (File != NULL)
|
||||||
{
|
{
|
||||||
WORD endmark = 0xFFFF;
|
uint16_t endmark = 0xFFFF;
|
||||||
fwrite(&endmark, 2, 1, File);
|
fwrite(&endmark, 2, 1, File);
|
||||||
fclose(File);
|
fclose(File);
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ public:
|
||||||
|
|
||||||
double clock_rate;
|
double clock_rate;
|
||||||
int clock_mul;
|
int clock_mul;
|
||||||
WORD clock_word;
|
uint16_t clock_word;
|
||||||
|
|
||||||
clock_rate = samples_per_tick * ADLIB_CLOCK_MUL;
|
clock_rate = samples_per_tick * ADLIB_CLOCK_MUL;
|
||||||
clock_mul = 1;
|
clock_mul = 1;
|
||||||
|
@ -141,7 +141,7 @@ public:
|
||||||
{
|
{
|
||||||
clock_mul++;
|
clock_mul++;
|
||||||
}
|
}
|
||||||
clock_word = WORD(clock_rate / clock_mul + 0.5);
|
clock_word = uint16_t(clock_rate / clock_mul + 0.5);
|
||||||
|
|
||||||
if (NeedClockRate)
|
if (NeedClockRate)
|
||||||
{ // Set the initial clock rate.
|
{ // Set the initial clock rate.
|
||||||
|
|
|
@ -107,7 +107,7 @@ struct OPL2instrument {
|
||||||
|
|
||||||
/* OP2 instrument file entry */
|
/* OP2 instrument file entry */
|
||||||
struct OP2instrEntry {
|
struct OP2instrEntry {
|
||||||
/*00*/ WORD flags; // see FL_xxx below
|
/*00*/ uint16_t flags; // see FL_xxx below
|
||||||
/*02*/ uint8_t finetune; // finetune value for 2-voice sounds
|
/*02*/ uint8_t finetune; // finetune value for 2-voice sounds
|
||||||
/*03*/ uint8_t note; // note # for fixed instruments
|
/*03*/ uint8_t note; // note # for fixed instruments
|
||||||
/*04*/ struct OPL2instrument instr[2]; // instruments
|
/*04*/ struct OPL2instrument instr[2]; // instruments
|
||||||
|
|
|
@ -36,8 +36,8 @@ typedef uintptr_t Bitu;
|
||||||
typedef intptr_t Bits;
|
typedef intptr_t Bits;
|
||||||
typedef DWORD Bit32u;
|
typedef DWORD Bit32u;
|
||||||
typedef int32_t Bit32s;
|
typedef int32_t Bit32s;
|
||||||
typedef WORD Bit16u;
|
typedef uint16_t Bit16u;
|
||||||
typedef SWORD Bit16s;
|
typedef int16_t Bit16s;
|
||||||
typedef uint8_t Bit8u;
|
typedef uint8_t Bit8u;
|
||||||
typedef SBYTE Bit8s;
|
typedef SBYTE Bit8s;
|
||||||
|
|
||||||
|
|
|
@ -79,17 +79,17 @@ fail: delete[] scoredata;
|
||||||
((DWORD *)scoredata)[1] == MAKE_ID('D','A','T','A'))
|
((DWORD *)scoredata)[1] == MAKE_ID('D','A','T','A'))
|
||||||
{
|
{
|
||||||
RawPlayer = RDosPlay;
|
RawPlayer = RDosPlay;
|
||||||
if (*(WORD *)(scoredata + 8) == 0)
|
if (*(uint16_t *)(scoredata + 8) == 0)
|
||||||
{ // A clock speed of 0 is bad
|
{ // A clock speed of 0 is bad
|
||||||
*(WORD *)(scoredata + 8) = 0xFFFF;
|
*(uint16_t *)(scoredata + 8) = 0xFFFF;
|
||||||
}
|
}
|
||||||
SamplesPerTick = LittleShort(*(WORD *)(scoredata + 8)) / ADLIB_CLOCK_MUL;
|
SamplesPerTick = LittleShort(*(uint16_t *)(scoredata + 8)) / ADLIB_CLOCK_MUL;
|
||||||
}
|
}
|
||||||
// Check for DosBox OPL dump
|
// Check for DosBox OPL dump
|
||||||
else if (((DWORD *)scoredata)[0] == MAKE_ID('D','B','R','A') &&
|
else if (((DWORD *)scoredata)[0] == MAKE_ID('D','B','R','A') &&
|
||||||
((DWORD *)scoredata)[1] == MAKE_ID('W','O','P','L'))
|
((DWORD *)scoredata)[1] == MAKE_ID('W','O','P','L'))
|
||||||
{
|
{
|
||||||
if (LittleShort(((WORD *)scoredata)[5]) == 1)
|
if (LittleShort(((uint16_t *)scoredata)[5]) == 1)
|
||||||
{
|
{
|
||||||
RawPlayer = DosBox1;
|
RawPlayer = DosBox1;
|
||||||
SamplesPerTick = OPL_SAMPLE_RATE / 1000;
|
SamplesPerTick = OPL_SAMPLE_RATE / 1000;
|
||||||
|
@ -117,7 +117,7 @@ fail: delete[] scoredata;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Printf("Unsupported DOSBox Raw OPL version %d.%d\n", LittleShort(((WORD *)scoredata)[4]), LittleShort(((WORD *)scoredata)[5]));
|
Printf("Unsupported DOSBox Raw OPL version %d.%d\n", LittleShort(((uint16_t *)scoredata)[4]), LittleShort(((uint16_t *)scoredata)[5]));
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ void OPLmusicFile::Restart ()
|
||||||
{
|
{
|
||||||
case RDosPlay:
|
case RDosPlay:
|
||||||
score = scoredata + 10;
|
score = scoredata + 10;
|
||||||
SamplesPerTick = LittleShort(*(WORD *)(scoredata + 8)) / ADLIB_CLOCK_MUL;
|
SamplesPerTick = LittleShort(*(uint16_t *)(scoredata + 8)) / ADLIB_CLOCK_MUL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DosBox1:
|
case DosBox1:
|
||||||
|
@ -364,7 +364,7 @@ void OPLmusicBlock::OffsetSamples(float *buff, int count)
|
||||||
int OPLmusicFile::PlayTick ()
|
int OPLmusicFile::PlayTick ()
|
||||||
{
|
{
|
||||||
uint8_t reg, data;
|
uint8_t reg, data;
|
||||||
WORD delay;
|
uint16_t delay;
|
||||||
|
|
||||||
switch (RawPlayer)
|
switch (RawPlayer)
|
||||||
{
|
{
|
||||||
|
@ -385,7 +385,7 @@ int OPLmusicFile::PlayTick ()
|
||||||
case 2: // Speed change or OPL3 switch
|
case 2: // Speed change or OPL3 switch
|
||||||
if (data == 0)
|
if (data == 0)
|
||||||
{
|
{
|
||||||
SamplesPerTick = LittleShort(*(WORD *)(score)) / ADLIB_CLOCK_MUL;
|
SamplesPerTick = LittleShort(*(uint16_t *)(score)) / ADLIB_CLOCK_MUL;
|
||||||
io->SetClockRate(SamplesPerTick);
|
io->SetClockRate(SamplesPerTick);
|
||||||
score += 2;
|
score += 2;
|
||||||
}
|
}
|
||||||
|
@ -493,7 +493,7 @@ int OPLmusicFile::PlayTick ()
|
||||||
}
|
}
|
||||||
reg = score[0];
|
reg = score[0];
|
||||||
data = score[1];
|
data = score[1];
|
||||||
delay = LittleShort(((WORD *)score)[1]);
|
delay = LittleShort(((uint16_t *)score)[1]);
|
||||||
score += 4;
|
score += 4;
|
||||||
io->OPLwriteReg (0, reg, data);
|
io->OPLwriteReg (0, reg, data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,7 +317,7 @@ uint8_t ModifierToDIK(const uint32_t modifier)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWORD ModifierFlagsToGUIKeyModifiers(NSEvent* theEvent)
|
int16_t ModifierFlagsToGUIKeyModifiers(NSEvent* theEvent)
|
||||||
{
|
{
|
||||||
const NSUInteger modifiers([theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask);
|
const NSUInteger modifiers([theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask);
|
||||||
return ((modifiers & NSShiftKeyMask ) ? GKM_SHIFT : 0)
|
return ((modifiers & NSShiftKeyMask ) ? GKM_SHIFT : 0)
|
||||||
|
@ -690,7 +690,7 @@ void ProcessMouseButtonEvent(NSEvent* theEvent)
|
||||||
|
|
||||||
void ProcessMouseWheelEvent(NSEvent* theEvent)
|
void ProcessMouseWheelEvent(NSEvent* theEvent)
|
||||||
{
|
{
|
||||||
const SWORD modifiers = ModifierFlagsToGUIKeyModifiers(theEvent);
|
const int16_t modifiers = ModifierFlagsToGUIKeyModifiers(theEvent);
|
||||||
const CGFloat delta = (modifiers & GKM_SHIFT)
|
const CGFloat delta = (modifiers & GKM_SHIFT)
|
||||||
? [theEvent deltaX]
|
? [theEvent deltaX]
|
||||||
: [theEvent deltaY];
|
: [theEvent deltaY];
|
||||||
|
|
|
@ -1138,7 +1138,7 @@ SDLGLFB::SDLGLFB(void*, const int width, const int height, int, int, const bool
|
||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < GAMMA_TABLE_SIZE; ++i)
|
for (uint32_t i = 0; i < GAMMA_TABLE_SIZE; ++i)
|
||||||
{
|
{
|
||||||
m_originalGamma[i] = static_cast<WORD>(gammaTable[i] * 65535.0f);
|
m_originalGamma[i] = static_cast<uint16_t>(gammaTable[i] * 65535.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1222,7 +1222,7 @@ void SDLGLFB::SwapBuffers()
|
||||||
[[NSOpenGLContext currentContext] flushBuffer];
|
[[NSOpenGLContext currentContext] flushBuffer];
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDLGLFB::SetGammaTable(WORD* table)
|
void SDLGLFB::SetGammaTable(uint16_t* table)
|
||||||
{
|
{
|
||||||
if (m_supportsGamma)
|
if (m_supportsGamma)
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,7 +74,7 @@ protected:
|
||||||
static const uint32_t GAMMA_TABLE_SIZE = GAMMA_CHANNEL_SIZE * GAMMA_CHANNEL_COUNT;
|
static const uint32_t GAMMA_TABLE_SIZE = GAMMA_CHANNEL_SIZE * GAMMA_CHANNEL_COUNT;
|
||||||
|
|
||||||
bool m_supportsGamma;
|
bool m_supportsGamma;
|
||||||
WORD m_originalGamma[GAMMA_TABLE_SIZE];
|
uint16_t m_originalGamma[GAMMA_TABLE_SIZE];
|
||||||
|
|
||||||
SDLGLFB();
|
SDLGLFB();
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ protected:
|
||||||
bool CanUpdate();
|
bool CanUpdate();
|
||||||
void SwapBuffers();
|
void SwapBuffers();
|
||||||
|
|
||||||
void SetGammaTable(WORD* table);
|
void SetGammaTable(uint16_t* table);
|
||||||
void ResetGammaTable();
|
void ResetGammaTable();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ IMPLEMENT_CLASS(SDLGLFB, true, false)
|
||||||
|
|
||||||
struct MiniModeInfo
|
struct MiniModeInfo
|
||||||
{
|
{
|
||||||
WORD Width, Height;
|
uint16_t Width, Height;
|
||||||
};
|
};
|
||||||
|
|
||||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||||
|
@ -377,7 +377,7 @@ bool SDLGLFB::CanUpdate ()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDLGLFB::SetGammaTable(WORD *tbl)
|
void SDLGLFB::SetGammaTable(uint16_t *tbl)
|
||||||
{
|
{
|
||||||
if (m_supportsGamma)
|
if (m_supportsGamma)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool CanUpdate();
|
bool CanUpdate();
|
||||||
void SetGammaTable(WORD *tbl);
|
void SetGammaTable(uint16_t *tbl);
|
||||||
void ResetGammaTable();
|
void ResetGammaTable();
|
||||||
void InitializeState();
|
void InitializeState();
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ IMPLEMENT_CLASS(SDLFB, false, false)
|
||||||
|
|
||||||
struct MiniModeInfo
|
struct MiniModeInfo
|
||||||
{
|
{
|
||||||
WORD Width, Height;
|
uint16_t Width, Height;
|
||||||
};
|
};
|
||||||
|
|
||||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||||
|
@ -743,7 +743,7 @@ void SDLFB::SetVSync (bool vsync)
|
||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDLFB::ScaleCoordsFromWindow(SWORD &x, SWORD &y)
|
void SDLFB::ScaleCoordsFromWindow(int16_t &x, int16_t &y)
|
||||||
{
|
{
|
||||||
int w, h;
|
int w, h;
|
||||||
SDL_GetWindowSize (Screen, &w, &h);
|
SDL_GetWindowSize (Screen, &w, &h);
|
||||||
|
@ -773,8 +773,8 @@ void SDLFB::ScaleCoordsFromWindow(SWORD &x, SWORD &y)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = (SWORD)(x*Width/w);
|
x = (int16_t)(x*Width/w);
|
||||||
y = (SWORD)(y*Height/h);
|
y = (int16_t)(y*Height/h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ static void R_InstallSprite (int num, spriteframewithrotate *sprtemp, int &maxfr
|
||||||
|
|
||||||
// allocate space for the frames present and copy sprtemp to it
|
// allocate space for the frames present and copy sprtemp to it
|
||||||
sprites[num].numframes = maxframe;
|
sprites[num].numframes = maxframe;
|
||||||
sprites[num].spriteframes = WORD(framestart = SpriteFrames.Reserve (maxframe));
|
sprites[num].spriteframes = uint16_t(framestart = SpriteFrames.Reserve (maxframe));
|
||||||
for (frame = 0; frame < maxframe; ++frame)
|
for (frame = 0; frame < maxframe; ++frame)
|
||||||
{
|
{
|
||||||
memcpy (SpriteFrames[framestart+frame].Texture, sprtemp[frame].Texture, sizeof(sprtemp[frame].Texture));
|
memcpy (SpriteFrames[framestart+frame].Texture, sprtemp[frame].Texture, sizeof(sprtemp[frame].Texture));
|
||||||
|
@ -428,7 +428,7 @@ static void R_ExtendSpriteFrames(spritedef_t &spr, int frame)
|
||||||
newstart = SpriteFrames.Reserve(frame - spr.numframes);
|
newstart = SpriteFrames.Reserve(frame - spr.numframes);
|
||||||
if (spr.numframes == 0)
|
if (spr.numframes == 0)
|
||||||
{
|
{
|
||||||
spr.spriteframes = WORD(newstart);
|
spr.spriteframes = uint16_t(newstart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -440,7 +440,7 @@ static void R_ExtendSpriteFrames(spritedef_t &spr, int frame)
|
||||||
{
|
{
|
||||||
SpriteFrames[newstart + i] = SpriteFrames[spr.spriteframes + i];
|
SpriteFrames[newstart + i] = SpriteFrames[spr.spriteframes + i];
|
||||||
}
|
}
|
||||||
spr.spriteframes = WORD(newstart);
|
spr.spriteframes = uint16_t(newstart);
|
||||||
newstart += i;
|
newstart += i;
|
||||||
}
|
}
|
||||||
// Initialize all new frames to 0.
|
// Initialize all new frames to 0.
|
||||||
|
|
|
@ -19,7 +19,7 @@ struct spriteframe_t
|
||||||
{
|
{
|
||||||
struct FVoxelDef *Voxel;// voxel to use for this frame
|
struct FVoxelDef *Voxel;// voxel to use for this frame
|
||||||
FTextureID Texture[16]; // texture to use for view angles 0-15
|
FTextureID Texture[16]; // texture to use for view angles 0-15
|
||||||
WORD Flip; // flip (1 = flip) to use for view angles 0-15.
|
uint16_t Flip; // flip (1 = flip) to use for view angles 0-15.
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -32,10 +32,10 @@ struct spritedef_t
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
char name[5];
|
char name[5];
|
||||||
DWORD dwName;
|
uint32_t dwName;
|
||||||
};
|
};
|
||||||
uint8_t numframes;
|
uint8_t numframes;
|
||||||
WORD spriteframes;
|
uint16_t spriteframes;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern TArray<spriteframe_t> SpriteFrames;
|
extern TArray<spriteframe_t> SpriteFrames;
|
||||||
|
|
|
@ -602,7 +602,7 @@ static bool ungzip(BYTE *data, int complen, TArray<BYTE> &newdata)
|
||||||
// Find start of compressed data stream
|
// Find start of compressed data stream
|
||||||
if (flags & GZIP_FEXTRA)
|
if (flags & GZIP_FEXTRA)
|
||||||
{
|
{
|
||||||
compstart += 2 + LittleShort(*(WORD *)(data + 10));
|
compstart += 2 + LittleShort(*(uint16_t *)(data + 10));
|
||||||
}
|
}
|
||||||
if (flags & GZIP_FNAME)
|
if (flags & GZIP_FNAME)
|
||||||
{
|
{
|
||||||
|
|
|
@ -100,7 +100,7 @@ public:
|
||||||
virtual bool FakeVolume();
|
virtual bool FakeVolume();
|
||||||
virtual bool Pause(bool paused) = 0;
|
virtual bool Pause(bool paused) = 0;
|
||||||
virtual bool NeedThreadedCallback();
|
virtual bool NeedThreadedCallback();
|
||||||
virtual void PrecacheInstruments(const WORD *instruments, int count);
|
virtual void PrecacheInstruments(const uint16_t *instruments, int count);
|
||||||
virtual void TimidityVolumeChanged();
|
virtual void TimidityVolumeChanged();
|
||||||
virtual void FluidSettingInt(const char *setting, int value);
|
virtual void FluidSettingInt(const char *setting, int value);
|
||||||
virtual void FluidSettingNum(const char *setting, double value);
|
virtual void FluidSettingNum(const char *setting, double value);
|
||||||
|
@ -133,7 +133,7 @@ public:
|
||||||
bool FakeVolume();
|
bool FakeVolume();
|
||||||
bool NeedThreadedCallback();
|
bool NeedThreadedCallback();
|
||||||
bool Pause(bool paused);
|
bool Pause(bool paused);
|
||||||
void PrecacheInstruments(const WORD *instruments, int count);
|
void PrecacheInstruments(const uint16_t *instruments, int count);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void CALLBACK CallbackFunc(HMIDIOUT, UINT, DWORD_PTR, DWORD, DWORD);
|
static void CALLBACK CallbackFunc(HMIDIOUT, UINT, DWORD_PTR, DWORD, DWORD);
|
||||||
|
@ -348,7 +348,7 @@ public:
|
||||||
~TimidityMIDIDevice();
|
~TimidityMIDIDevice();
|
||||||
|
|
||||||
int Open(void (*callback)(unsigned int, void *, DWORD, DWORD), void *userdata);
|
int Open(void (*callback)(unsigned int, void *, DWORD, DWORD), void *userdata);
|
||||||
void PrecacheInstruments(const WORD *instruments, int count);
|
void PrecacheInstruments(const uint16_t *instruments, int count);
|
||||||
FString GetStats();
|
FString GetStats();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -382,7 +382,7 @@ public:
|
||||||
~WildMIDIDevice();
|
~WildMIDIDevice();
|
||||||
|
|
||||||
int Open(void (*callback)(unsigned int, void *, DWORD, DWORD), void *userdata);
|
int Open(void (*callback)(unsigned int, void *, DWORD, DWORD), void *userdata);
|
||||||
void PrecacheInstruments(const WORD *instruments, int count);
|
void PrecacheInstruments(const uint16_t *instruments, int count);
|
||||||
FString GetStats();
|
FString GetStats();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -618,7 +618,7 @@ protected:
|
||||||
TrackInfo *TrackDue;
|
TrackInfo *TrackDue;
|
||||||
int NumTracks;
|
int NumTracks;
|
||||||
int Format;
|
int Format;
|
||||||
WORD DesignationMask;
|
uint16_t DesignationMask;
|
||||||
};
|
};
|
||||||
|
|
||||||
// HMI file played with a MIDI stream ---------------------------------------
|
// HMI file played with a MIDI stream ---------------------------------------
|
||||||
|
|
|
@ -60,7 +60,7 @@ struct ReverbContainer
|
||||||
{
|
{
|
||||||
ReverbContainer *Next;
|
ReverbContainer *Next;
|
||||||
const char *Name;
|
const char *Name;
|
||||||
WORD ID;
|
uint16_t ID;
|
||||||
bool Builtin;
|
bool Builtin;
|
||||||
bool Modified;
|
bool Modified;
|
||||||
REVERB_PROPERTIES Properties;
|
REVERB_PROPERTIES Properties;
|
||||||
|
|
|
@ -82,9 +82,9 @@ bool CDSong::IsPlaying ()
|
||||||
CDDAFile::CDDAFile (FileReader &reader)
|
CDDAFile::CDDAFile (FileReader &reader)
|
||||||
: CDSong ()
|
: CDSong ()
|
||||||
{
|
{
|
||||||
DWORD chunk;
|
uint32_t chunk;
|
||||||
WORD track;
|
uint16_t track;
|
||||||
DWORD discid;
|
uint32_t discid;
|
||||||
long endpos = reader.Tell() + reader.GetLength() - 8;
|
long endpos = reader.Tell() + reader.GetLength() - 8;
|
||||||
|
|
||||||
// I_RegisterSong already identified this as a CDDA file, so we
|
// I_RegisterSong already identified this as a CDDA file, so we
|
||||||
|
|
|
@ -94,7 +94,7 @@ struct HMISong::TrackInfo
|
||||||
size_t MaxTrackP;
|
size_t MaxTrackP;
|
||||||
DWORD Delay;
|
DWORD Delay;
|
||||||
DWORD PlayedTime;
|
DWORD PlayedTime;
|
||||||
WORD Designation[NUM_HMI_DESIGNATIONS];
|
uint16_t Designation[NUM_HMI_DESIGNATIONS];
|
||||||
bool Enabled;
|
bool Enabled;
|
||||||
bool Finished;
|
bool Finished;
|
||||||
BYTE RunningStatus;
|
BYTE RunningStatus;
|
||||||
|
|
|
@ -130,7 +130,7 @@ void I_BuildMIDIMenuList (FOptionValues *opt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintMidiDevice (int id, const char *name, WORD tech, DWORD support)
|
static void PrintMidiDevice (int id, const char *name, uint16_t tech, DWORD support)
|
||||||
{
|
{
|
||||||
if (id == snd_mididevice)
|
if (id == snd_mididevice)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1131,13 +1131,13 @@ void MIDIStreamer::Precache()
|
||||||
DoRestart();
|
DoRestart();
|
||||||
|
|
||||||
// Now pack everything into a contiguous region for the PrecacheInstruments call().
|
// Now pack everything into a contiguous region for the PrecacheInstruments call().
|
||||||
TArray<WORD> packed;
|
TArray<uint16_t> packed;
|
||||||
|
|
||||||
for (int i = 0; i < 256; ++i)
|
for (int i = 0; i < 256; ++i)
|
||||||
{
|
{
|
||||||
if (found_instruments[i])
|
if (found_instruments[i])
|
||||||
{
|
{
|
||||||
WORD packnum = (i & 127) | ((i & 128) << 7);
|
uint16_t packnum = (i & 127) | ((i & 128) << 7);
|
||||||
if (!multiple_banks)
|
if (!multiple_banks)
|
||||||
{
|
{
|
||||||
packed.Push(packnum);
|
packed.Push(packnum);
|
||||||
|
@ -1429,7 +1429,7 @@ MIDIDevice::~MIDIDevice()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void MIDIDevice::PrecacheInstruments(const WORD *instruments, int count)
|
void MIDIDevice::PrecacheInstruments(const uint16_t *instruments, int count)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,14 +211,14 @@ bool MUSSong2::CheckDone()
|
||||||
|
|
||||||
void MUSSong2::Precache()
|
void MUSSong2::Precache()
|
||||||
{
|
{
|
||||||
TArray<WORD> work(LittleShort(MusHeader->NumInstruments));
|
TArray<uint16_t> work(LittleShort(MusHeader->NumInstruments));
|
||||||
const BYTE *used = (BYTE *)MusHeader + sizeof(MUSHeader) / sizeof(BYTE);
|
const BYTE *used = (BYTE *)MusHeader + sizeof(MUSHeader) / sizeof(BYTE);
|
||||||
int i, k;
|
int i, k;
|
||||||
|
|
||||||
for (i = k = 0; i < LittleShort(MusHeader->NumInstruments); ++i)
|
for (i = k = 0; i < LittleShort(MusHeader->NumInstruments); ++i)
|
||||||
{
|
{
|
||||||
BYTE instr = used[k++];
|
BYTE instr = used[k++];
|
||||||
WORD val;
|
uint16_t val;
|
||||||
if (instr < 128)
|
if (instr < 128)
|
||||||
{
|
{
|
||||||
val = instr;
|
val = instr;
|
||||||
|
|
|
@ -67,7 +67,7 @@ struct MIDISong2::TrackInfo
|
||||||
bool Designated;
|
bool Designated;
|
||||||
bool EProgramChange;
|
bool EProgramChange;
|
||||||
bool EVolume;
|
bool EVolume;
|
||||||
WORD Designation;
|
uint16_t Designation;
|
||||||
|
|
||||||
size_t LoopBegin;
|
size_t LoopBegin;
|
||||||
DWORD LoopDelay;
|
DWORD LoopDelay;
|
||||||
|
|
|
@ -167,7 +167,7 @@ int WildMIDIDevice::Open(void (*callback)(unsigned int, void *, DWORD, DWORD), v
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void WildMIDIDevice::PrecacheInstruments(const WORD *instruments, int count)
|
void WildMIDIDevice::PrecacheInstruments(const uint16_t *instruments, int count)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -239,7 +239,7 @@ void WinMIDIDevice::Stop()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void WinMIDIDevice::PrecacheInstruments(const WORD *instruments, int count)
|
void WinMIDIDevice::PrecacheInstruments(const uint16_t *instruments, int count)
|
||||||
{
|
{
|
||||||
// Setting snd_midiprecache to false disables this precaching, since it
|
// Setting snd_midiprecache to false disables this precaching, since it
|
||||||
// does involve sleeping for more than a miniscule amount of time.
|
// does involve sleeping for more than a miniscule amount of time.
|
||||||
|
|
|
@ -221,8 +221,8 @@ private:
|
||||||
|
|
||||||
const ReverbContainer *PrevEnvironment;
|
const ReverbContainer *PrevEnvironment;
|
||||||
|
|
||||||
typedef TMap<WORD,ALuint> EffectMap;
|
typedef TMap<uint16_t,ALuint> EffectMap;
|
||||||
typedef TMapIterator<WORD,ALuint> EffectMapIter;
|
typedef TMapIterator<uint16_t,ALuint> EffectMapIter;
|
||||||
ALuint EnvSlot;
|
ALuint EnvSlot;
|
||||||
ALuint EnvFilters[2];
|
ALuint EnvFilters[2];
|
||||||
EffectMap EnvEffects;
|
EffectMap EnvEffects;
|
||||||
|
|
|
@ -29,15 +29,15 @@ struct GF1PatchHeader
|
||||||
BYTE Instruments;
|
BYTE Instruments;
|
||||||
BYTE Voices;
|
BYTE Voices;
|
||||||
BYTE Channels;
|
BYTE Channels;
|
||||||
WORD WaveForms;
|
uint16_t WaveForms;
|
||||||
WORD MasterVolume;
|
uint16_t MasterVolume;
|
||||||
DWORD DataSize;
|
DWORD DataSize;
|
||||||
BYTE Reserved[PATCH_HEADER_RESERVED_SIZE];
|
BYTE Reserved[PATCH_HEADER_RESERVED_SIZE];
|
||||||
} GCC_PACKED;
|
} GCC_PACKED;
|
||||||
|
|
||||||
struct GF1InstrumentData
|
struct GF1InstrumentData
|
||||||
{
|
{
|
||||||
WORD Instrument;
|
uint16_t Instrument;
|
||||||
char InstrumentName[INST_NAME_SIZE];
|
char InstrumentName[INST_NAME_SIZE];
|
||||||
int InstrumentSize;
|
int InstrumentSize;
|
||||||
BYTE Layers;
|
BYTE Layers;
|
||||||
|
@ -60,11 +60,11 @@ struct GF1PatchData
|
||||||
int WaveSize;
|
int WaveSize;
|
||||||
int StartLoop;
|
int StartLoop;
|
||||||
int EndLoop;
|
int EndLoop;
|
||||||
WORD SampleRate;
|
uint16_t SampleRate;
|
||||||
int LowFrequency;
|
int LowFrequency;
|
||||||
int HighFrequency;
|
int HighFrequency;
|
||||||
int RootFrequency;
|
int RootFrequency;
|
||||||
SWORD Tune;
|
int16_t Tune;
|
||||||
BYTE Balance;
|
BYTE Balance;
|
||||||
BYTE EnvelopeRate[ENVELOPES];
|
BYTE EnvelopeRate[ENVELOPES];
|
||||||
BYTE EnvelopeOffset[ENVELOPES];
|
BYTE EnvelopeOffset[ENVELOPES];
|
||||||
|
@ -75,8 +75,8 @@ struct GF1PatchData
|
||||||
BYTE VibratoRate;
|
BYTE VibratoRate;
|
||||||
BYTE VibratoDepth;
|
BYTE VibratoDepth;
|
||||||
BYTE Modes;
|
BYTE Modes;
|
||||||
SWORD ScaleFrequency;
|
int16_t ScaleFrequency;
|
||||||
WORD ScaleFactor; /* From 0 to 2048 or 0 to 2 */
|
uint16_t ScaleFactor; /* From 0 to 2048 or 0 to 2 */
|
||||||
BYTE Reserved[PATCH_DATA_RESERVED_SIZE];
|
BYTE Reserved[PATCH_DATA_RESERVED_SIZE];
|
||||||
} GCC_PACKED;
|
} GCC_PACKED;
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
|
@ -511,7 +511,7 @@ void convert_sample_data(Sample *sp, const void *data)
|
||||||
|
|
||||||
case PATCH_16:
|
case PATCH_16:
|
||||||
{ /* 16-bit, signed */
|
{ /* 16-bit, signed */
|
||||||
SWORD *cp = (SWORD *)data;
|
int16_t *cp = (int16_t *)data;
|
||||||
/* Convert these to samples */
|
/* Convert these to samples */
|
||||||
sp->data_length >>= 1;
|
sp->data_length >>= 1;
|
||||||
sp->loop_start >>= 1;
|
sp->loop_start >>= 1;
|
||||||
|
@ -534,7 +534,7 @@ void convert_sample_data(Sample *sp, const void *data)
|
||||||
|
|
||||||
case PATCH_16 | PATCH_UNSIGNED:
|
case PATCH_16 | PATCH_UNSIGNED:
|
||||||
{ /* 16-bit, unsigned */
|
{ /* 16-bit, unsigned */
|
||||||
WORD *cp = (WORD *)data;
|
auto *cp = (uint16_t *)data;
|
||||||
/* Convert these to samples */
|
/* Convert these to samples */
|
||||||
sp->data_length >>= 1;
|
sp->data_length >>= 1;
|
||||||
sp->loop_start >>= 1;
|
sp->loop_start >>= 1;
|
||||||
|
|
|
@ -56,9 +56,9 @@ struct RIFF_Chunk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD magic;
|
uint32_t magic;
|
||||||
DWORD length;
|
uint32_t length;
|
||||||
DWORD subtype;
|
uint32_t subtype;
|
||||||
BYTE *data;
|
BYTE *data;
|
||||||
RIFF_Chunk *child;
|
RIFF_Chunk *child;
|
||||||
RIFF_Chunk *next;
|
RIFF_Chunk *next;
|
||||||
|
@ -75,20 +75,20 @@ void PrintRIFF(RIFF_Chunk *chunk, int level);
|
||||||
#define RIFF MAKE_ID('R','I','F','F')
|
#define RIFF MAKE_ID('R','I','F','F')
|
||||||
#define LIST MAKE_ID('L','I','S','T')
|
#define LIST MAKE_ID('L','I','S','T')
|
||||||
|
|
||||||
static bool ChunkHasSubType(DWORD magic)
|
static bool ChunkHasSubType(uint32_t magic)
|
||||||
{
|
{
|
||||||
return (magic == RIFF || magic == LIST);
|
return (magic == RIFF || magic == LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ChunkHasSubChunks(DWORD magic)
|
static int ChunkHasSubChunks(uint32_t magic)
|
||||||
{
|
{
|
||||||
return (magic == RIFF || magic == LIST);
|
return (magic == RIFF || magic == LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LoadSubChunks(RIFF_Chunk *chunk, BYTE *data, DWORD left)
|
static void LoadSubChunks(RIFF_Chunk *chunk, BYTE *data, uint32_t left)
|
||||||
{
|
{
|
||||||
BYTE *subchunkData;
|
BYTE *subchunkData;
|
||||||
DWORD subchunkDataLen;
|
uint32_t subchunkDataLen;
|
||||||
|
|
||||||
while ( left > 8 ) {
|
while ( left > 8 ) {
|
||||||
RIFF_Chunk *child = new RIFF_Chunk;
|
RIFF_Chunk *child = new RIFF_Chunk;
|
||||||
|
@ -102,10 +102,10 @@ static void LoadSubChunks(RIFF_Chunk *chunk, BYTE *data, DWORD left)
|
||||||
chunk->child = child;
|
chunk->child = child;
|
||||||
}
|
}
|
||||||
|
|
||||||
child->magic = *(DWORD *)data;
|
child->magic = *(uint32_t *)data;
|
||||||
data += 4;
|
data += 4;
|
||||||
left -= 4;
|
left -= 4;
|
||||||
child->length = LittleLong(*(DWORD *)data);
|
child->length = LittleLong(*(uint32_t *)data);
|
||||||
data += 4;
|
data += 4;
|
||||||
left -= 4;
|
left -= 4;
|
||||||
child->data = data;
|
child->data = data;
|
||||||
|
@ -117,7 +117,7 @@ static void LoadSubChunks(RIFF_Chunk *chunk, BYTE *data, DWORD left)
|
||||||
subchunkData = child->data;
|
subchunkData = child->data;
|
||||||
subchunkDataLen = child->length;
|
subchunkDataLen = child->length;
|
||||||
if ( ChunkHasSubType(child->magic) && subchunkDataLen >= 4 ) {
|
if ( ChunkHasSubType(child->magic) && subchunkDataLen >= 4 ) {
|
||||||
child->subtype = *(DWORD *)subchunkData;
|
child->subtype = *(uint32_t *)subchunkData;
|
||||||
subchunkData += 4;
|
subchunkData += 4;
|
||||||
subchunkDataLen -= 4;
|
subchunkDataLen -= 4;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ RIFF_Chunk *LoadRIFF(FILE *src)
|
||||||
{
|
{
|
||||||
RIFF_Chunk *chunk;
|
RIFF_Chunk *chunk;
|
||||||
BYTE *subchunkData;
|
BYTE *subchunkData;
|
||||||
DWORD subchunkDataLen;
|
uint32_t subchunkDataLen;
|
||||||
|
|
||||||
/* Allocate the chunk structure */
|
/* Allocate the chunk structure */
|
||||||
chunk = new RIFF_Chunk;
|
chunk = new RIFF_Chunk;
|
||||||
|
@ -162,7 +162,7 @@ RIFF_Chunk *LoadRIFF(FILE *src)
|
||||||
subchunkData = chunk->data;
|
subchunkData = chunk->data;
|
||||||
subchunkDataLen = chunk->length;
|
subchunkDataLen = chunk->length;
|
||||||
if ( ChunkHasSubType(chunk->magic) && subchunkDataLen >= 4 ) {
|
if ( ChunkHasSubType(chunk->magic) && subchunkDataLen >= 4 ) {
|
||||||
chunk->subtype = *(DWORD *)subchunkData;
|
chunk->subtype = *(uint32_t *)subchunkData;
|
||||||
subchunkData += 4;
|
subchunkData += 4;
|
||||||
subchunkDataLen -= 4;
|
subchunkDataLen -= 4;
|
||||||
}
|
}
|
||||||
|
@ -251,10 +251,10 @@ http://www.midi.org/about-midi/dls/dlsspec.shtml
|
||||||
|
|
||||||
/* Some typedefs so the public dls headers don't need to be modified */
|
/* Some typedefs so the public dls headers don't need to be modified */
|
||||||
#define FAR
|
#define FAR
|
||||||
typedef SWORD SHORT;
|
typedef int16_t SHORT;
|
||||||
typedef WORD USHORT;
|
typedef uint16_t USHORT;
|
||||||
typedef int32_t LONG;
|
typedef int32_t LONG;
|
||||||
typedef DWORD ULONG;
|
typedef uint32_t ULONG;
|
||||||
#define mmioFOURCC MAKE_ID
|
#define mmioFOURCC MAKE_ID
|
||||||
#define DEFINE_GUID(A, B, C, E, F, G, H, I, J, K, L, M)
|
#define DEFINE_GUID(A, B, C, E, F, G, H, I, J, K, L, M)
|
||||||
|
|
||||||
|
@ -263,19 +263,19 @@ typedef DWORD ULONG;
|
||||||
|
|
||||||
struct WaveFMT
|
struct WaveFMT
|
||||||
{
|
{
|
||||||
WORD wFormatTag;
|
uint16_t wFormatTag;
|
||||||
WORD wChannels;
|
uint16_t wChannels;
|
||||||
DWORD dwSamplesPerSec;
|
uint32_t dwSamplesPerSec;
|
||||||
DWORD dwAvgBytesPerSec;
|
uint32_t dwAvgBytesPerSec;
|
||||||
WORD wBlockAlign;
|
uint16_t wBlockAlign;
|
||||||
WORD wBitsPerSample;
|
uint16_t wBitsPerSample;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DLS_Wave
|
struct DLS_Wave
|
||||||
{
|
{
|
||||||
WaveFMT *format;
|
WaveFMT *format;
|
||||||
BYTE *data;
|
BYTE *data;
|
||||||
DWORD length;
|
uint32_t length;
|
||||||
WSMPL *wsmp;
|
WSMPL *wsmp;
|
||||||
WLOOP *wsmp_loop;
|
WLOOP *wsmp_loop;
|
||||||
};
|
};
|
||||||
|
@ -303,7 +303,7 @@ struct DLS_Data
|
||||||
{
|
{
|
||||||
RIFF_Chunk *chunk;
|
RIFF_Chunk *chunk;
|
||||||
|
|
||||||
DWORD cInstruments;
|
uint32_t cInstruments;
|
||||||
DLS_Instrument *instruments;
|
DLS_Instrument *instruments;
|
||||||
|
|
||||||
POOLTABLE *ptbl;
|
POOLTABLE *ptbl;
|
||||||
|
@ -367,7 +367,7 @@ static void AllocRegions(DLS_Instrument *instrument)
|
||||||
static void FreeInstruments(DLS_Data *data)
|
static void FreeInstruments(DLS_Data *data)
|
||||||
{
|
{
|
||||||
if ( data->instruments ) {
|
if ( data->instruments ) {
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
for ( i = 0; i < data->cInstruments; ++i ) {
|
for ( i = 0; i < data->cInstruments; ++i ) {
|
||||||
FreeRegions(&data->instruments[i]);
|
FreeRegions(&data->instruments[i]);
|
||||||
}
|
}
|
||||||
|
@ -404,7 +404,7 @@ static void AllocWaveList(DLS_Data *data)
|
||||||
|
|
||||||
static void Parse_colh(DLS_Data *data, RIFF_Chunk *chunk)
|
static void Parse_colh(DLS_Data *data, RIFF_Chunk *chunk)
|
||||||
{
|
{
|
||||||
data->cInstruments = LittleLong(*(DWORD *)chunk->data);
|
data->cInstruments = LittleLong(*(uint32_t *)chunk->data);
|
||||||
AllocInstruments(data);
|
AllocInstruments(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ static void Parse_wlnk(DLS_Data *data, RIFF_Chunk *chunk, DLS_Region *region)
|
||||||
|
|
||||||
static void Parse_wsmp(DLS_Data *data, RIFF_Chunk *chunk, WSMPL **wsmp_ptr, WLOOP **wsmp_loop_ptr)
|
static void Parse_wsmp(DLS_Data *data, RIFF_Chunk *chunk, WSMPL **wsmp_ptr, WLOOP **wsmp_loop_ptr)
|
||||||
{
|
{
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
WSMPL *wsmp = (WSMPL *)chunk->data;
|
WSMPL *wsmp = (WSMPL *)chunk->data;
|
||||||
WLOOP *loop;
|
WLOOP *loop;
|
||||||
wsmp->cbSize = LittleLong(wsmp->cbSize);
|
wsmp->cbSize = LittleLong(wsmp->cbSize);
|
||||||
|
@ -465,7 +465,7 @@ static void Parse_wsmp(DLS_Data *data, RIFF_Chunk *chunk, WSMPL **wsmp_ptr, WLOO
|
||||||
|
|
||||||
static void Parse_art(DLS_Data *data, RIFF_Chunk *chunk, CONNECTIONLIST **art_ptr, CONNECTION **artList_ptr)
|
static void Parse_art(DLS_Data *data, RIFF_Chunk *chunk, CONNECTIONLIST **art_ptr, CONNECTION **artList_ptr)
|
||||||
{
|
{
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
CONNECTIONLIST *art = (CONNECTIONLIST *)chunk->data;
|
CONNECTIONLIST *art = (CONNECTIONLIST *)chunk->data;
|
||||||
CONNECTION *artList;
|
CONNECTION *artList;
|
||||||
art->cbSize = LittleLong(art->cbSize);
|
art->cbSize = LittleLong(art->cbSize);
|
||||||
|
@ -487,7 +487,7 @@ static void Parse_lart(DLS_Data *data, RIFF_Chunk *chunk, CONNECTIONLIST **conn_
|
||||||
{
|
{
|
||||||
/* FIXME: This only supports one set of connections */
|
/* FIXME: This only supports one set of connections */
|
||||||
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
||||||
DWORD magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
uint32_t magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
||||||
switch(magic) {
|
switch(magic) {
|
||||||
case FOURCC_ART1:
|
case FOURCC_ART1:
|
||||||
case FOURCC_ART2:
|
case FOURCC_ART2:
|
||||||
|
@ -500,7 +500,7 @@ static void Parse_lart(DLS_Data *data, RIFF_Chunk *chunk, CONNECTIONLIST **conn_
|
||||||
static void Parse_rgn(DLS_Data *data, RIFF_Chunk *chunk, DLS_Region *region)
|
static void Parse_rgn(DLS_Data *data, RIFF_Chunk *chunk, DLS_Region *region)
|
||||||
{
|
{
|
||||||
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
||||||
DWORD magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
uint32_t magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
||||||
switch(magic) {
|
switch(magic) {
|
||||||
case FOURCC_RGNH:
|
case FOURCC_RGNH:
|
||||||
Parse_rgnh(data, chunk, region);
|
Parse_rgnh(data, chunk, region);
|
||||||
|
@ -521,9 +521,9 @@ static void Parse_rgn(DLS_Data *data, RIFF_Chunk *chunk, DLS_Region *region)
|
||||||
|
|
||||||
static void Parse_lrgn(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrument)
|
static void Parse_lrgn(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrument)
|
||||||
{
|
{
|
||||||
DWORD region = 0;
|
uint32_t region = 0;
|
||||||
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
||||||
DWORD magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
uint32_t magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
||||||
switch(magic) {
|
switch(magic) {
|
||||||
case FOURCC_RGN:
|
case FOURCC_RGN:
|
||||||
case FOURCC_RGN2:
|
case FOURCC_RGN2:
|
||||||
|
@ -538,7 +538,7 @@ static void Parse_lrgn(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instru
|
||||||
static void Parse_INFO_INS(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrument)
|
static void Parse_INFO_INS(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrument)
|
||||||
{
|
{
|
||||||
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
||||||
DWORD magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
uint32_t magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
||||||
switch(magic) {
|
switch(magic) {
|
||||||
case FOURCC_INAM: /* Name */
|
case FOURCC_INAM: /* Name */
|
||||||
instrument->name = (const char *)chunk->data;
|
instrument->name = (const char *)chunk->data;
|
||||||
|
@ -550,7 +550,7 @@ static void Parse_INFO_INS(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *in
|
||||||
static void Parse_ins(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrument)
|
static void Parse_ins(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrument)
|
||||||
{
|
{
|
||||||
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
||||||
DWORD magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
uint32_t magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
||||||
switch(magic) {
|
switch(magic) {
|
||||||
case FOURCC_INSH:
|
case FOURCC_INSH:
|
||||||
Parse_insh(data, chunk, instrument);
|
Parse_insh(data, chunk, instrument);
|
||||||
|
@ -571,9 +571,9 @@ static void Parse_ins(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrum
|
||||||
|
|
||||||
static void Parse_lins(DLS_Data *data, RIFF_Chunk *chunk)
|
static void Parse_lins(DLS_Data *data, RIFF_Chunk *chunk)
|
||||||
{
|
{
|
||||||
DWORD instrument = 0;
|
uint32_t instrument = 0;
|
||||||
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
||||||
DWORD magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
uint32_t magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
||||||
switch(magic) {
|
switch(magic) {
|
||||||
case FOURCC_INS:
|
case FOURCC_INS:
|
||||||
if ( instrument < data->cInstruments ) {
|
if ( instrument < data->cInstruments ) {
|
||||||
|
@ -586,7 +586,7 @@ static void Parse_lins(DLS_Data *data, RIFF_Chunk *chunk)
|
||||||
|
|
||||||
static void Parse_ptbl(DLS_Data *data, RIFF_Chunk *chunk)
|
static void Parse_ptbl(DLS_Data *data, RIFF_Chunk *chunk)
|
||||||
{
|
{
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
POOLTABLE *ptbl = (POOLTABLE *)chunk->data;
|
POOLTABLE *ptbl = (POOLTABLE *)chunk->data;
|
||||||
ptbl->cbSize = LittleLong(ptbl->cbSize);
|
ptbl->cbSize = LittleLong(ptbl->cbSize);
|
||||||
ptbl->cCues = LittleLong(ptbl->cCues);
|
ptbl->cCues = LittleLong(ptbl->cCues);
|
||||||
|
@ -619,7 +619,7 @@ static void Parse_data(DLS_Data *data, RIFF_Chunk *chunk, DLS_Wave *wave)
|
||||||
static void Parse_wave(DLS_Data *data, RIFF_Chunk *chunk, DLS_Wave *wave)
|
static void Parse_wave(DLS_Data *data, RIFF_Chunk *chunk, DLS_Wave *wave)
|
||||||
{
|
{
|
||||||
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
||||||
DWORD magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
uint32_t magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
||||||
switch(magic) {
|
switch(magic) {
|
||||||
case FOURCC_FMT:
|
case FOURCC_FMT:
|
||||||
Parse_fmt(data, chunk, wave);
|
Parse_fmt(data, chunk, wave);
|
||||||
|
@ -636,9 +636,9 @@ static void Parse_wave(DLS_Data *data, RIFF_Chunk *chunk, DLS_Wave *wave)
|
||||||
|
|
||||||
static void Parse_wvpl(DLS_Data *data, RIFF_Chunk *chunk)
|
static void Parse_wvpl(DLS_Data *data, RIFF_Chunk *chunk)
|
||||||
{
|
{
|
||||||
DWORD wave = 0;
|
uint32_t wave = 0;
|
||||||
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
||||||
DWORD magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
uint32_t magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
||||||
switch(magic) {
|
switch(magic) {
|
||||||
case FOURCC_wave:
|
case FOURCC_wave:
|
||||||
if ( wave < data->ptbl->cCues ) {
|
if ( wave < data->ptbl->cCues ) {
|
||||||
|
@ -652,7 +652,7 @@ static void Parse_wvpl(DLS_Data *data, RIFF_Chunk *chunk)
|
||||||
static void Parse_INFO_DLS(DLS_Data *data, RIFF_Chunk *chunk)
|
static void Parse_INFO_DLS(DLS_Data *data, RIFF_Chunk *chunk)
|
||||||
{
|
{
|
||||||
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
|
||||||
DWORD magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
uint32_t magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
||||||
switch(magic) {
|
switch(magic) {
|
||||||
case FOURCC_IARL: /* Archival Location */
|
case FOURCC_IARL: /* Archival Location */
|
||||||
break;
|
break;
|
||||||
|
@ -713,7 +713,7 @@ DLS_Data *LoadDLS(FILE *src)
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( chunk = data->chunk->child; chunk; chunk = chunk->next ) {
|
for ( chunk = data->chunk->child; chunk; chunk = chunk->next ) {
|
||||||
DWORD magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
uint32_t magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
|
||||||
switch(magic) {
|
switch(magic) {
|
||||||
case FOURCC_COLH:
|
case FOURCC_COLH:
|
||||||
Parse_colh(data, chunk);
|
Parse_colh(data, chunk);
|
||||||
|
@ -883,7 +883,7 @@ static const char *DestinationToString(USHORT usDestination)
|
||||||
|
|
||||||
static void PrintArt(const char *type, CONNECTIONLIST *art, CONNECTION *artList)
|
static void PrintArt(const char *type, CONNECTIONLIST *art, CONNECTION *artList)
|
||||||
{
|
{
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
printf("%s Connections:\n", type);
|
printf("%s Connections:\n", type);
|
||||||
for ( i = 0; i < art->cConnections; ++i ) {
|
for ( i = 0; i < art->cConnections; ++i ) {
|
||||||
printf(" Source: %s, Control: %s, Destination: %s, Transform: %s, Scale: %d\n",
|
printf(" Source: %s, Control: %s, Destination: %s, Transform: %s, Scale: %d\n",
|
||||||
|
@ -895,14 +895,14 @@ static void PrintArt(const char *type, CONNECTIONLIST *art, CONNECTION *artList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintWave(DLS_Wave *wave, DWORD index)
|
static void PrintWave(DLS_Wave *wave, uint32_t index)
|
||||||
{
|
{
|
||||||
WaveFMT *format = wave->format;
|
WaveFMT *format = wave->format;
|
||||||
if ( format ) {
|
if ( format ) {
|
||||||
printf(" Wave %u: Format: %hu, %hu channels, %u Hz, %hu bits (length = %u)\n", index, format->wFormatTag, format->wChannels, format->dwSamplesPerSec, format->wBitsPerSample, wave->length);
|
printf(" Wave %u: Format: %hu, %hu channels, %u Hz, %hu bits (length = %u)\n", index, format->wFormatTag, format->wChannels, format->dwSamplesPerSec, format->wBitsPerSample, wave->length);
|
||||||
}
|
}
|
||||||
if ( wave->wsmp ) {
|
if ( wave->wsmp ) {
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
printf(" wsmp->usUnityNote = %hu\n", wave->wsmp->usUnityNote);
|
printf(" wsmp->usUnityNote = %hu\n", wave->wsmp->usUnityNote);
|
||||||
printf(" wsmp->sFineTune = %hd\n", wave->wsmp->sFineTune);
|
printf(" wsmp->sFineTune = %hd\n", wave->wsmp->sFineTune);
|
||||||
printf(" wsmp->lAttenuation = %d\n", wave->wsmp->lAttenuation);
|
printf(" wsmp->lAttenuation = %d\n", wave->wsmp->lAttenuation);
|
||||||
|
@ -917,7 +917,7 @@ static void PrintWave(DLS_Wave *wave, DWORD index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintRegion(DLS_Region *region, DWORD index)
|
static void PrintRegion(DLS_Region *region, uint32_t index)
|
||||||
{
|
{
|
||||||
printf(" Region %u:\n", index);
|
printf(" Region %u:\n", index);
|
||||||
if ( region->header ) {
|
if ( region->header ) {
|
||||||
|
@ -933,7 +933,7 @@ static void PrintRegion(DLS_Region *region, DWORD index)
|
||||||
printf(" wlnk->ulTableIndex = %u\n", region->wlnk->ulTableIndex);
|
printf(" wlnk->ulTableIndex = %u\n", region->wlnk->ulTableIndex);
|
||||||
}
|
}
|
||||||
if ( region->wsmp ) {
|
if ( region->wsmp ) {
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
printf(" wsmp->usUnityNote = %hu\n", region->wsmp->usUnityNote);
|
printf(" wsmp->usUnityNote = %hu\n", region->wsmp->usUnityNote);
|
||||||
printf(" wsmp->sFineTune = %hd\n", region->wsmp->sFineTune);
|
printf(" wsmp->sFineTune = %hd\n", region->wsmp->sFineTune);
|
||||||
printf(" wsmp->lAttenuation = %d\n", region->wsmp->lAttenuation);
|
printf(" wsmp->lAttenuation = %d\n", region->wsmp->lAttenuation);
|
||||||
|
@ -951,14 +951,14 @@ static void PrintRegion(DLS_Region *region, DWORD index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintInstrument(DLS_Instrument *instrument, DWORD index)
|
static void PrintInstrument(DLS_Instrument *instrument, uint32_t index)
|
||||||
{
|
{
|
||||||
printf("Instrument %u:\n", index);
|
printf("Instrument %u:\n", index);
|
||||||
if ( instrument->name ) {
|
if ( instrument->name ) {
|
||||||
printf(" Name: %s\n", instrument->name);
|
printf(" Name: %s\n", instrument->name);
|
||||||
}
|
}
|
||||||
if ( instrument->header ) {
|
if ( instrument->header ) {
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
printf(" ulBank = 0x%8.8x\n", instrument->header->Locale.ulBank);
|
printf(" ulBank = 0x%8.8x\n", instrument->header->Locale.ulBank);
|
||||||
printf(" ulInstrument = %u\n", instrument->header->Locale.ulInstrument);
|
printf(" ulInstrument = %u\n", instrument->header->Locale.ulInstrument);
|
||||||
printf(" Regions: %u\n", instrument->header->cRegions);
|
printf(" Regions: %u\n", instrument->header->cRegions);
|
||||||
|
@ -976,13 +976,13 @@ void PrintDLS(DLS_Data *data)
|
||||||
printf("DLS Data:\n");
|
printf("DLS Data:\n");
|
||||||
printf("cInstruments = %u\n", data->cInstruments);
|
printf("cInstruments = %u\n", data->cInstruments);
|
||||||
if ( data->instruments ) {
|
if ( data->instruments ) {
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
for ( i = 0; i < data->cInstruments; ++i ) {
|
for ( i = 0; i < data->cInstruments; ++i ) {
|
||||||
PrintInstrument(&data->instruments[i], i);
|
PrintInstrument(&data->instruments[i], i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( data->ptbl && data->ptbl->cCues > 0 ) {
|
if ( data->ptbl && data->ptbl->cCues > 0 ) {
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
printf("Cues: ");
|
printf("Cues: ");
|
||||||
for ( i = 0; i < data->ptbl->cCues; ++i ) {
|
for ( i = 0; i < data->ptbl->cCues; ++i ) {
|
||||||
if ( i > 0 ) {
|
if ( i > 0 ) {
|
||||||
|
@ -993,7 +993,7 @@ void PrintDLS(DLS_Data *data)
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
if ( data->waveList && data->ptbl ) {
|
if ( data->waveList && data->ptbl ) {
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
printf("Waves:\n");
|
printf("Waves:\n");
|
||||||
for ( i = 0; i < data->ptbl->cCues; ++i ) {
|
for ( i = 0; i < data->ptbl->cCues; ++i ) {
|
||||||
PrintWave(&data->waveList[i], i);
|
PrintWave(&data->waveList[i], i);
|
||||||
|
@ -1116,7 +1116,7 @@ static int load_connection(ULONG cConnections, CONNECTION *artList, USHORT desti
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void load_region_dls(Renderer *song, Sample *sample, DLS_Instrument *ins, DWORD index)
|
static void load_region_dls(Renderer *song, Sample *sample, DLS_Instrument *ins, uint32_t index)
|
||||||
{
|
{
|
||||||
DLS_Region *rgn = &ins->regions[index];
|
DLS_Region *rgn = &ins->regions[index];
|
||||||
DLS_Wave *wave = &song->patches->waveList[rgn->wlnk->ulTableIndex];
|
DLS_Wave *wave = &song->patches->waveList[rgn->wlnk->ulTableIndex];
|
||||||
|
@ -1187,7 +1187,7 @@ static void load_region_dls(Renderer *song, Sample *sample, DLS_Instrument *ins,
|
||||||
Instrument *load_instrument_dls(Renderer *song, int drum, int bank, int instrument)
|
Instrument *load_instrument_dls(Renderer *song, int drum, int bank, int instrument)
|
||||||
{
|
{
|
||||||
Instrument *inst;
|
Instrument *inst;
|
||||||
DWORD i;
|
uint32_t i;
|
||||||
DLS_Instrument *dls_ins = NULL;
|
DLS_Instrument *dls_ins = NULL;
|
||||||
|
|
||||||
if (song->patches == NULL)
|
if (song->patches == NULL)
|
||||||
|
|
|
@ -192,7 +192,7 @@ ListHandler PdtaHandlers[] =
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
static double timecent_to_sec(SWORD timecent)
|
static double timecent_to_sec(int16_t timecent)
|
||||||
{
|
{
|
||||||
if (timecent == -32768)
|
if (timecent == -32768)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -250,7 +250,7 @@ static inline int read_char(FileReader *f)
|
||||||
|
|
||||||
static inline int read_uword(FileReader *f)
|
static inline int read_uword(FileReader *f)
|
||||||
{
|
{
|
||||||
WORD x;
|
uint16_t x;
|
||||||
if (f->Read(&x, 2) != 2)
|
if (f->Read(&x, 2) != 2)
|
||||||
{
|
{
|
||||||
throw CIOErr();
|
throw CIOErr();
|
||||||
|
@ -260,7 +260,7 @@ static inline int read_uword(FileReader *f)
|
||||||
|
|
||||||
static inline int read_sword(FileReader *f)
|
static inline int read_sword(FileReader *f)
|
||||||
{
|
{
|
||||||
SWORD x;
|
int16_t x;
|
||||||
if (f->Read(&x, 2) != 2)
|
if (f->Read(&x, 2) != 2)
|
||||||
{
|
{
|
||||||
throw CIOErr();
|
throw CIOErr();
|
||||||
|
@ -317,7 +317,7 @@ static void check_list(FileReader *f, DWORD id, DWORD filelen, DWORD &chunklen)
|
||||||
|
|
||||||
static void ParseIfil(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen)
|
static void ParseIfil(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen)
|
||||||
{
|
{
|
||||||
WORD major, minor;
|
uint16_t major, minor;
|
||||||
|
|
||||||
if (chunklen != 4)
|
if (chunklen != 4)
|
||||||
{
|
{
|
||||||
|
@ -473,7 +473,7 @@ static void ParsePhdr(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen)
|
||||||
static void ParseBag(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen)
|
static void ParseBag(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen)
|
||||||
{
|
{
|
||||||
SFBag *bags, *bag;
|
SFBag *bags, *bag;
|
||||||
WORD prev_mod = 0;
|
uint16_t prev_mod = 0;
|
||||||
int numbags;
|
int numbags;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -513,7 +513,7 @@ static void ParseBag(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen)
|
||||||
for (bag = bags, i = numbags; i != 0; --i, ++bag)
|
for (bag = bags, i = numbags; i != 0; --i, ++bag)
|
||||||
{
|
{
|
||||||
bag->GenIndex = read_uword(f);
|
bag->GenIndex = read_uword(f);
|
||||||
WORD mod = read_uword(f);
|
uint16_t mod = read_uword(f);
|
||||||
// Section 7.3, page 22:
|
// Section 7.3, page 22:
|
||||||
// If the generator or modulator indices are non-monotonic or do not
|
// If the generator or modulator indices are non-monotonic or do not
|
||||||
// match the size of the respective PGEN or PMOD sub-chunks, the file
|
// match the size of the respective PGEN or PMOD sub-chunks, the file
|
||||||
|
@ -1165,7 +1165,7 @@ void SFFile::SetInstrumentGenerators(SFGenComposite *composite, int start, int s
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Set the generator
|
// Set the generator
|
||||||
((WORD *)composite)[GenDefs[gen->Oper].StructIndex] = gen->uAmount;
|
((uint16_t *)composite)[GenDefs[gen->Oper].StructIndex] = gen->uAmount;
|
||||||
if (gen->Oper == GEN_sampleID)
|
if (gen->Oper == GEN_sampleID)
|
||||||
{ // Anything past sampleID is ignored.
|
{ // Anything past sampleID is ignored.
|
||||||
break;
|
break;
|
||||||
|
@ -1209,7 +1209,7 @@ void SFFile::AddPresetGenerators(SFGenComposite *composite, int start, int stop,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Add to instrument/default generator.
|
// Add to instrument/default generator.
|
||||||
int added = ((SWORD *)composite)[def->StructIndex] + gen->Amount;
|
int added = ((int16_t *)composite)[def->StructIndex] + gen->Amount;
|
||||||
// Clamp to proper range.
|
// Clamp to proper range.
|
||||||
if (added <= -32768 && def->Flags & GENF_32768_Ok)
|
if (added <= -32768 && def->Flags & GENF_32768_Ok)
|
||||||
{
|
{
|
||||||
|
@ -1219,7 +1219,7 @@ void SFFile::AddPresetGenerators(SFGenComposite *composite, int start, int stop,
|
||||||
{
|
{
|
||||||
added = clamp<int>(added, def->Min, def->Max);
|
added = clamp<int>(added, def->Min, def->Max);
|
||||||
}
|
}
|
||||||
((SWORD *)composite)[def->StructIndex] = added;
|
((int16_t *)composite)[def->StructIndex] = added;
|
||||||
gen_set[gen->Oper] = true;
|
gen_set[gen->Oper] = true;
|
||||||
if (gen->Oper == GEN_instrument)
|
if (gen->Oper == GEN_instrument)
|
||||||
{ // Anything past the instrument generator is ignored.
|
{ // Anything past the instrument generator is ignored.
|
||||||
|
@ -1513,7 +1513,7 @@ void SFFile::LoadSample(SFSample *sample)
|
||||||
// Load 16-bit sample data.
|
// Load 16-bit sample data.
|
||||||
for (i = 0; i < sample->End - sample->Start; ++i)
|
for (i = 0; i < sample->End - sample->Start; ++i)
|
||||||
{
|
{
|
||||||
SWORD samp;
|
int16_t samp;
|
||||||
*fp >> samp;
|
*fp >> samp;
|
||||||
sample->InMemoryData[i] = samp / 32768.f;
|
sample->InMemoryData[i] = samp / 32768.f;
|
||||||
}
|
}
|
||||||
|
|
|
@ -485,7 +485,7 @@ static sample_t *rs_vib_bidir(sample_t *resample_buffer, float rate, Voice *vp,
|
||||||
sample_t *resample_voice(Renderer *song, Voice *vp, int *countptr)
|
sample_t *resample_voice(Renderer *song, Voice *vp, int *countptr)
|
||||||
{
|
{
|
||||||
int ofs;
|
int ofs;
|
||||||
WORD modes;
|
uint16_t modes;
|
||||||
|
|
||||||
if (vp->sample->sample_rate == 0)
|
if (vp->sample->sample_rate == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
typedef WORD SFGenerator;
|
typedef uint16_t SFGenerator;
|
||||||
|
|
||||||
struct SFRange
|
struct SFRange
|
||||||
{
|
{
|
||||||
|
@ -11,16 +11,16 @@ struct SFPreset
|
||||||
char Name[21];
|
char Name[21];
|
||||||
BYTE LoadOrder:7;
|
BYTE LoadOrder:7;
|
||||||
BYTE bHasGlobalZone:1;
|
BYTE bHasGlobalZone:1;
|
||||||
WORD Program;
|
uint16_t Program;
|
||||||
WORD Bank;
|
uint16_t Bank;
|
||||||
WORD BagIndex;
|
uint16_t BagIndex;
|
||||||
/* Don't care about library, genre, and morphology */
|
/* Don't care about library, genre, and morphology */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SFBag
|
struct SFBag
|
||||||
{
|
{
|
||||||
WORD GenIndex;
|
uint16_t GenIndex;
|
||||||
// WORD ModIndex; // If I am feeling ambitious, I might add support for modulators some day.
|
// uint16_t ModIndex; // If I am feeling ambitious, I might add support for modulators some day.
|
||||||
SFRange KeyRange;
|
SFRange KeyRange;
|
||||||
SFRange VelRange;
|
SFRange VelRange;
|
||||||
int Target; // Either an instrument or sample index
|
int Target; // Either an instrument or sample index
|
||||||
|
@ -31,7 +31,7 @@ struct SFInst
|
||||||
char Name[21];
|
char Name[21];
|
||||||
BYTE Pad:7;
|
BYTE Pad:7;
|
||||||
BYTE bHasGlobalZone:1;
|
BYTE bHasGlobalZone:1;
|
||||||
WORD BagIndex;
|
uint16_t BagIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SFSample
|
struct SFSample
|
||||||
|
@ -44,8 +44,8 @@ struct SFSample
|
||||||
DWORD SampleRate;
|
DWORD SampleRate;
|
||||||
BYTE OriginalPitch;
|
BYTE OriginalPitch;
|
||||||
SBYTE PitchCorrection;
|
SBYTE PitchCorrection;
|
||||||
WORD SampleLink;
|
uint16_t SampleLink;
|
||||||
WORD SampleType;
|
uint16_t SampleType;
|
||||||
char Name[21];
|
char Name[21];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -68,8 +68,8 @@ struct SFGenList
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
SFRange Range;
|
SFRange Range;
|
||||||
SWORD Amount;
|
int16_t Amount;
|
||||||
WORD uAmount;
|
uint16_t uAmount;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -142,20 +142,20 @@ enum
|
||||||
|
|
||||||
struct SFModulator
|
struct SFModulator
|
||||||
{
|
{
|
||||||
WORD Index:7;
|
uint16_t Index:7;
|
||||||
WORD CC:1;
|
uint16_t CC:1;
|
||||||
WORD Dir:1; /* 0 = min->max, 1 = max->min */
|
uint16_t Dir:1; /* 0 = min->max, 1 = max->min */
|
||||||
WORD Polarity:1; /* 0 = unipolar, 1 = bipolar */
|
uint16_t Polarity:1; /* 0 = unipolar, 1 = bipolar */
|
||||||
WORD Type:6;
|
uint16_t Type:6;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SFModList
|
struct SFModList
|
||||||
{
|
{
|
||||||
SFModulator SrcOper;
|
SFModulator SrcOper;
|
||||||
SFGenerator DestOper;
|
SFGenerator DestOper;
|
||||||
SWORD Amount;
|
int16_t Amount;
|
||||||
SFModulator AmtSrcOper;
|
SFModulator AmtSrcOper;
|
||||||
WORD Transform;
|
uint16_t Transform;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Modulator sources when CC is 0
|
// Modulator sources when CC is 0
|
||||||
|
@ -206,55 +206,55 @@ struct SFGenComposite
|
||||||
SFRange velRange;
|
SFRange velRange;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
WORD instrument; // At preset level
|
uint16_t instrument; // At preset level
|
||||||
WORD sampleID; // At instrument level
|
uint16_t sampleID; // At instrument level
|
||||||
};
|
};
|
||||||
SWORD modLfoToPitch;
|
int16_t modLfoToPitch;
|
||||||
SWORD vibLfoToPitch;
|
int16_t vibLfoToPitch;
|
||||||
SWORD modEnvToPitch;
|
int16_t modEnvToPitch;
|
||||||
SWORD initialFilterFc;
|
int16_t initialFilterFc;
|
||||||
SWORD initialFilterQ;
|
int16_t initialFilterQ;
|
||||||
SWORD modLfoToFilterFc;
|
int16_t modLfoToFilterFc;
|
||||||
SWORD modEnvToFilterFc;
|
int16_t modEnvToFilterFc;
|
||||||
SWORD modLfoToVolume;
|
int16_t modLfoToVolume;
|
||||||
SWORD chorusEffectsSend;
|
int16_t chorusEffectsSend;
|
||||||
SWORD reverbEffectsSend;
|
int16_t reverbEffectsSend;
|
||||||
SWORD pan;
|
int16_t pan;
|
||||||
SWORD delayModLFO;
|
int16_t delayModLFO;
|
||||||
SWORD freqModLFO;
|
int16_t freqModLFO;
|
||||||
SWORD delayVibLFO;
|
int16_t delayVibLFO;
|
||||||
SWORD freqVibLFO;
|
int16_t freqVibLFO;
|
||||||
SWORD delayModEnv;
|
int16_t delayModEnv;
|
||||||
SWORD attackModEnv;
|
int16_t attackModEnv;
|
||||||
SWORD holdModEnv;
|
int16_t holdModEnv;
|
||||||
SWORD decayModEnv;
|
int16_t decayModEnv;
|
||||||
SWORD sustainModEnv;
|
int16_t sustainModEnv;
|
||||||
SWORD releaseModEnv;
|
int16_t releaseModEnv;
|
||||||
SWORD keynumToModEnvHold;
|
int16_t keynumToModEnvHold;
|
||||||
SWORD keynumToModEnvDecay;
|
int16_t keynumToModEnvDecay;
|
||||||
SWORD delayVolEnv;
|
int16_t delayVolEnv;
|
||||||
SWORD attackVolEnv;
|
int16_t attackVolEnv;
|
||||||
SWORD holdVolEnv;
|
int16_t holdVolEnv;
|
||||||
SWORD decayVolEnv;
|
int16_t decayVolEnv;
|
||||||
SWORD sustainVolEnv;
|
int16_t sustainVolEnv;
|
||||||
SWORD releaseVolEnv;
|
int16_t releaseVolEnv;
|
||||||
SWORD keynumToVolEnvHold;
|
int16_t keynumToVolEnvHold;
|
||||||
SWORD keynumToVolEnvDecay;
|
int16_t keynumToVolEnvDecay;
|
||||||
SWORD initialAttenuation;
|
int16_t initialAttenuation;
|
||||||
SWORD coarseTune;
|
int16_t coarseTune;
|
||||||
SWORD fineTune;
|
int16_t fineTune;
|
||||||
SWORD scaleTuning;
|
int16_t scaleTuning;
|
||||||
|
|
||||||
// The following are only for instruments:
|
// The following are only for instruments:
|
||||||
SWORD startAddrsOffset, startAddrsCoarseOffset;
|
int16_t startAddrsOffset, startAddrsCoarseOffset;
|
||||||
SWORD endAddrsOffset, endAddrsCoarseOffset;
|
int16_t endAddrsOffset, endAddrsCoarseOffset;
|
||||||
SWORD startLoopAddrsOffset, startLoopAddrsCoarseOffset;
|
int16_t startLoopAddrsOffset, startLoopAddrsCoarseOffset;
|
||||||
SWORD endLoopAddrsOffset, endLoopAddrsCoarseOffset;
|
int16_t endLoopAddrsOffset, endLoopAddrsCoarseOffset;
|
||||||
SWORD keynum;
|
int16_t keynum;
|
||||||
SWORD velocity;
|
int16_t velocity;
|
||||||
WORD sampleModes;
|
uint16_t sampleModes;
|
||||||
SWORD exclusiveClass;
|
int16_t exclusiveClass;
|
||||||
SWORD overridingRootKey;
|
int16_t overridingRootKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Intermediate percussion representation
|
// Intermediate percussion representation
|
||||||
|
|
|
@ -240,13 +240,13 @@ struct Sample
|
||||||
tremolo_depth, vibrato_depth,
|
tremolo_depth, vibrato_depth,
|
||||||
low_vel, high_vel,
|
low_vel, high_vel,
|
||||||
type;
|
type;
|
||||||
WORD
|
uint16_t
|
||||||
modes;
|
modes;
|
||||||
SWORD
|
int16_t
|
||||||
panning;
|
panning;
|
||||||
WORD
|
uint16_t
|
||||||
scale_factor, key_group;
|
scale_factor, key_group;
|
||||||
SWORD
|
int16_t
|
||||||
scale_note;
|
scale_note;
|
||||||
bool
|
bool
|
||||||
self_nonexclusive;
|
self_nonexclusive;
|
||||||
|
@ -254,7 +254,7 @@ struct Sample
|
||||||
left_offset, right_offset;
|
left_offset, right_offset;
|
||||||
|
|
||||||
// SF2 stuff
|
// SF2 stuff
|
||||||
SWORD tune;
|
int16_t tune;
|
||||||
SBYTE velocity;
|
SBYTE velocity;
|
||||||
|
|
||||||
float initial_attenuation;
|
float initial_attenuation;
|
||||||
|
@ -432,7 +432,7 @@ struct Channel
|
||||||
volume, expression;
|
volume, expression;
|
||||||
SBYTE
|
SBYTE
|
||||||
panning;
|
panning;
|
||||||
WORD
|
uint16_t
|
||||||
rpn, nrpn;
|
rpn, nrpn;
|
||||||
bool
|
bool
|
||||||
nrpn_mode;
|
nrpn_mode;
|
||||||
|
|
|
@ -44,10 +44,10 @@ class TWeightedList
|
||||||
template<class U>
|
template<class U>
|
||||||
struct Choice
|
struct Choice
|
||||||
{
|
{
|
||||||
Choice(WORD w, U v) : Next(NULL), Weight(w), RandomVal(0), Value(v) {}
|
Choice(uint16_t w, U v) : Next(NULL), Weight(w), RandomVal(0), Value(v) {}
|
||||||
|
|
||||||
Choice<U> *Next;
|
Choice<U> *Next;
|
||||||
WORD Weight;
|
uint16_t Weight;
|
||||||
BYTE RandomVal; // 0 (never) - 255 (always)
|
BYTE RandomVal; // 0 (never) - 255 (always)
|
||||||
T Value;
|
T Value;
|
||||||
};
|
};
|
||||||
|
@ -65,7 +65,7 @@ class TWeightedList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddEntry (T value, WORD weight);
|
void AddEntry (T value, uint16_t weight);
|
||||||
T PickEntry () const;
|
T PickEntry () const;
|
||||||
void ReplaceValues (T oldval, T newval);
|
void ReplaceValues (T oldval, T newval);
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ class TWeightedList
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void TWeightedList<T>::AddEntry (T value, WORD weight)
|
void TWeightedList<T>::AddEntry (T value, uint16_t weight)
|
||||||
{
|
{
|
||||||
if (weight == 0)
|
if (weight == 0)
|
||||||
{ // If the weight is 0, don't bother adding it,
|
{ // If the weight is 0, don't bother adding it,
|
||||||
|
|
|
@ -56,8 +56,8 @@ typedef struct w32apiFixedOFNA {
|
||||||
LPCSTR lpstrInitialDir;
|
LPCSTR lpstrInitialDir;
|
||||||
LPCSTR lpstrTitle;
|
LPCSTR lpstrTitle;
|
||||||
DWORD Flags;
|
DWORD Flags;
|
||||||
WORD nFileOffset;
|
uint16_t nFileOffset;
|
||||||
WORD nFileExtension;
|
uint16_t nFileExtension;
|
||||||
LPCSTR lpstrDefExt;
|
LPCSTR lpstrDefExt;
|
||||||
LPARAM lCustData;
|
LPARAM lCustData;
|
||||||
LPOFNHOOKPROC lpfnHook;
|
LPOFNHOOKPROC lpfnHook;
|
||||||
|
@ -255,7 +255,7 @@ void PopulateEnvDropDown (HWND hCtl, bool showIDs, const ReverbContainer *defEnv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetIDEdits (HWND hDlg, WORD id)
|
void SetIDEdits (HWND hDlg, uint16_t id)
|
||||||
{
|
{
|
||||||
char text[4];
|
char text[4];
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ void PopulateEnvList (HWND hCtl, bool show, const ReverbContainer *defEnv)
|
||||||
SendMessage (hCtl, WM_SETREDRAW, TRUE, 0);
|
SendMessage (hCtl, WM_SETREDRAW, TRUE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD FirstFreeID (WORD base, bool builtin)
|
uint16_t FirstFreeID (uint16_t base, bool builtin)
|
||||||
{
|
{
|
||||||
int tryCount = 0;
|
int tryCount = 0;
|
||||||
int priID = HIBYTE(base);
|
int priID = HIBYTE(base);
|
||||||
|
@ -316,7 +316,7 @@ WORD FirstFreeID (WORD base, bool builtin)
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
WORD lastID = Environments->ID;
|
uint16_t lastID = Environments->ID;
|
||||||
const ReverbContainer *env = Environments->Next;
|
const ReverbContainer *env = Environments->Next;
|
||||||
|
|
||||||
// Find the lowest-numbered free ID with the same primary ID as base
|
// Find the lowest-numbered free ID with the same primary ID as base
|
||||||
|
|
|
@ -877,7 +877,7 @@ bool D3DFB::CreateVertexes ()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (FAILED(D3DDevice->CreateIndexBuffer(sizeof(WORD)*NUM_INDEXES,
|
if (FAILED(D3DDevice->CreateIndexBuffer(sizeof(uint16_t)*NUM_INDEXES,
|
||||||
D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFMT_INDEX16, D3DPOOL_DEFAULT, &IndexBuffer, NULL)))
|
D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFMT_INDEX16, D3DPOOL_DEFAULT, &IndexBuffer, NULL)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -468,7 +468,7 @@ bool D3DFB::Wiper_Melt::Run(int ticks, D3DFB *fb)
|
||||||
|
|
||||||
BufferedTris *quad = &fb->QuadExtra[fb->QuadBatchPos];
|
BufferedTris *quad = &fb->QuadExtra[fb->QuadBatchPos];
|
||||||
FBVERTEX *vert = &fb->VertexData[fb->VertexPos];
|
FBVERTEX *vert = &fb->VertexData[fb->VertexPos];
|
||||||
WORD *index = &fb->IndexData[fb->IndexPos];
|
uint16_t *index = &fb->IndexData[fb->IndexPos];
|
||||||
|
|
||||||
quad->Group1 = 0;
|
quad->Group1 = 0;
|
||||||
quad->Flags = BQF_DisableAlphaTest;
|
quad->Flags = BQF_DisableAlphaTest;
|
||||||
|
|
|
@ -169,15 +169,15 @@ namespace zip
|
||||||
{
|
{
|
||||||
DWORD Magic; // 0
|
DWORD Magic; // 0
|
||||||
BYTE VersionToExtract[2]; // 4
|
BYTE VersionToExtract[2]; // 4
|
||||||
WORD Flags; // 6
|
uint16_t Flags; // 6
|
||||||
WORD Method; // 8
|
uint16_t Method; // 8
|
||||||
WORD ModTime; // 10
|
uint16_t ModTime; // 10
|
||||||
WORD ModDate; // 12
|
uint16_t ModDate; // 12
|
||||||
DWORD CRC32; // 14
|
DWORD CRC32; // 14
|
||||||
DWORD CompressedSize; // 18
|
DWORD CompressedSize; // 18
|
||||||
DWORD UncompressedSize; // 22
|
DWORD UncompressedSize; // 22
|
||||||
WORD NameLength; // 26
|
uint16_t NameLength; // 26
|
||||||
WORD ExtraLength; // 28
|
uint16_t ExtraLength; // 28
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CentralDirectoryEntry
|
struct CentralDirectoryEntry
|
||||||
|
@ -185,18 +185,18 @@ namespace zip
|
||||||
DWORD Magic;
|
DWORD Magic;
|
||||||
BYTE VersionMadeBy[2];
|
BYTE VersionMadeBy[2];
|
||||||
BYTE VersionToExtract[2];
|
BYTE VersionToExtract[2];
|
||||||
WORD Flags;
|
uint16_t Flags;
|
||||||
WORD Method;
|
uint16_t Method;
|
||||||
WORD ModTime;
|
uint16_t ModTime;
|
||||||
WORD ModDate;
|
uint16_t ModDate;
|
||||||
DWORD CRC32;
|
DWORD CRC32;
|
||||||
DWORD CompressedSize;
|
DWORD CompressedSize;
|
||||||
DWORD UncompressedSize;
|
DWORD UncompressedSize;
|
||||||
WORD NameLength;
|
uint16_t NameLength;
|
||||||
WORD ExtraLength;
|
uint16_t ExtraLength;
|
||||||
WORD CommentLength;
|
uint16_t CommentLength;
|
||||||
WORD StartingDiskNumber;
|
uint16_t StartingDiskNumber;
|
||||||
WORD InternalAttributes;
|
uint16_t InternalAttributes;
|
||||||
DWORD ExternalAttributes;
|
DWORD ExternalAttributes;
|
||||||
DWORD LocalHeaderOffset;
|
DWORD LocalHeaderOffset;
|
||||||
};
|
};
|
||||||
|
@ -204,13 +204,13 @@ namespace zip
|
||||||
struct EndOfCentralDirectory
|
struct EndOfCentralDirectory
|
||||||
{
|
{
|
||||||
DWORD Magic;
|
DWORD Magic;
|
||||||
WORD DiskNumber;
|
uint16_t DiskNumber;
|
||||||
WORD FirstDisk;
|
uint16_t FirstDisk;
|
||||||
WORD NumEntries;
|
uint16_t NumEntries;
|
||||||
WORD NumEntriesOnAllDisks;
|
uint16_t NumEntriesOnAllDisks;
|
||||||
DWORD DirectorySize;
|
DWORD DirectorySize;
|
||||||
DWORD DirectoryOffset;
|
DWORD DirectoryOffset;
|
||||||
WORD ZipCommentLength;
|
uint16_t ZipCommentLength;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
}
|
}
|
||||||
|
@ -803,7 +803,7 @@ HANDLE WriteTextReport ()
|
||||||
//" Cr0NpxState=%08x\r\n"
|
//" Cr0NpxState=%08x\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
,
|
,
|
||||||
(WORD)ctxt->FloatSave.ControlWord, (WORD)ctxt->FloatSave.StatusWord, (WORD)ctxt->FloatSave.TagWord,
|
(uint16_t)ctxt->FloatSave.ControlWord, (uint16_t)ctxt->FloatSave.StatusWord, (uint16_t)ctxt->FloatSave.TagWord,
|
||||||
ctxt->FloatSave.ErrorOffset, ctxt->FloatSave.ErrorSelector, ctxt->FloatSave.DataOffset,
|
ctxt->FloatSave.ErrorOffset, ctxt->FloatSave.ErrorSelector, ctxt->FloatSave.DataOffset,
|
||||||
ctxt->FloatSave.DataSelector
|
ctxt->FloatSave.DataSelector
|
||||||
//, ctxt->FloatSave.Cr0NpxState
|
//, ctxt->FloatSave.Cr0NpxState
|
||||||
|
@ -1583,7 +1583,7 @@ static HANDLE MakeZip ()
|
||||||
central.CRC32 = LittleLong(TarFiles[i].CRC32);
|
central.CRC32 = LittleLong(TarFiles[i].CRC32);
|
||||||
central.CompressedSize = LittleLong(TarFiles[i].CompressedSize);
|
central.CompressedSize = LittleLong(TarFiles[i].CompressedSize);
|
||||||
central.UncompressedSize = LittleLong(TarFiles[i].UncompressedSize);
|
central.UncompressedSize = LittleLong(TarFiles[i].UncompressedSize);
|
||||||
central.NameLength = LittleShort((WORD)namelen);
|
central.NameLength = LittleShort((uint16_t)namelen);
|
||||||
central.LocalHeaderOffset = LittleLong(TarFiles[i].ZipOffset);
|
central.LocalHeaderOffset = LittleLong(TarFiles[i].ZipOffset);
|
||||||
WriteFile (file, ¢ral, sizeof(central), &len, NULL);
|
WriteFile (file, ¢ral, sizeof(central), &len, NULL);
|
||||||
WriteFile (file, TarFiles[i].Filename, (DWORD)namelen, &len, NULL);
|
WriteFile (file, TarFiles[i].Filename, (DWORD)namelen, &len, NULL);
|
||||||
|
@ -1648,7 +1648,7 @@ static void AddZipFile (HANDLE ziphandle, TarFile *whichfile, short dosdate, sho
|
||||||
local.ModTime = dostime;
|
local.ModTime = dostime;
|
||||||
local.ModDate = dosdate;
|
local.ModDate = dosdate;
|
||||||
local.UncompressedSize = LittleLong(whichfile->UncompressedSize);
|
local.UncompressedSize = LittleLong(whichfile->UncompressedSize);
|
||||||
local.NameLength = LittleShort((WORD)strlen(whichfile->Filename));
|
local.NameLength = LittleShort((uint16_t)strlen(whichfile->Filename));
|
||||||
|
|
||||||
whichfile->ZipOffset = SetFilePointer (ziphandle, 0, NULL, FILE_CURRENT);
|
whichfile->ZipOffset = SetFilePointer (ziphandle, 0, NULL, FILE_CURRENT);
|
||||||
WriteFile (ziphandle, &local, sizeof(local), &wrote, NULL);
|
WriteFile (ziphandle, &local, sizeof(local), &wrote, NULL);
|
||||||
|
|
|
@ -89,7 +89,7 @@ protected:
|
||||||
|
|
||||||
int WheelMove[2];
|
int WheelMove[2];
|
||||||
int LastX, LastY; // for m_filter
|
int LastX, LastY; // for m_filter
|
||||||
WORD ButtonState; // bit mask of current button states (1=down, 0=up)
|
int ButtonState; // bit mask of current button states (1=down, 0=up)
|
||||||
};
|
};
|
||||||
|
|
||||||
class FKeyboard : public FInputDevice
|
class FKeyboard : public FInputDevice
|
||||||
|
|
|
@ -1059,7 +1059,7 @@ bool FWin32Mouse::WndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
// a single message. Winuser.h describes the button field as being filled with
|
// a single message. Winuser.h describes the button field as being filled with
|
||||||
// flags, which suggests that it could merge them. My testing
|
// flags, which suggests that it could merge them. My testing
|
||||||
// indicates it does not, but I will assume it might in the future.
|
// indicates it does not, but I will assume it might in the future.
|
||||||
WORD xbuttons = GET_XBUTTON_WPARAM(wParam);
|
auto xbuttons = GET_XBUTTON_WPARAM(wParam);
|
||||||
event_t ev = { 0 };
|
event_t ev = { 0 };
|
||||||
|
|
||||||
ev.type = (message == WM_XBUTTONDOWN) ? EV_KeyDown : EV_KeyUp;
|
ev.type = (message == WM_XBUTTONDOWN) ? EV_KeyDown : EV_KeyUp;
|
||||||
|
|
|
@ -126,7 +126,7 @@ protected:
|
||||||
float Multiplier;
|
float Multiplier;
|
||||||
AxisInfo Axes[NUM_AXES];
|
AxisInfo Axes[NUM_AXES];
|
||||||
static DefaultAxisConfig DefaultAxes[NUM_AXES];
|
static DefaultAxisConfig DefaultAxes[NUM_AXES];
|
||||||
WORD LastButtons;
|
int LastButtons;
|
||||||
bool Connected;
|
bool Connected;
|
||||||
bool Marked;
|
bool Marked;
|
||||||
bool Active;
|
bool Active;
|
||||||
|
@ -481,7 +481,7 @@ bool FRawPS2Controller::ProcessInput(RAWHID *raw, int code)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate events for buttons that have changed.
|
// Generate events for buttons that have changed.
|
||||||
WORD buttons = 0;
|
int buttons = 0;
|
||||||
|
|
||||||
// If we know we are digital, ignore the D-Pad.
|
// If we know we are digital, ignore the D-Pad.
|
||||||
if (!digital)
|
if (!digital)
|
||||||
|
|
|
@ -115,7 +115,7 @@ protected:
|
||||||
AxisInfo Axes[NUM_AXES];
|
AxisInfo Axes[NUM_AXES];
|
||||||
static DefaultAxisConfig DefaultAxes[NUM_AXES];
|
static DefaultAxisConfig DefaultAxes[NUM_AXES];
|
||||||
DWORD LastPacketNumber;
|
DWORD LastPacketNumber;
|
||||||
WORD LastButtons;
|
int LastButtons;
|
||||||
bool Connected;
|
bool Connected;
|
||||||
|
|
||||||
void Attached();
|
void Attached();
|
||||||
|
|
|
@ -1342,7 +1342,7 @@ void ST_Util_DrawBlock (BITMAPINFO *bitmap_info, const BYTE *src, int x, int y,
|
||||||
{ // net progress notches
|
{ // net progress notches
|
||||||
for (; height > 0; --height)
|
for (; height > 0; --height)
|
||||||
{
|
{
|
||||||
*((WORD *)dest) = *((const WORD *)src);
|
*((uint16_t *)dest) = *((const uint16_t *)src);
|
||||||
dest += destpitch;
|
dest += destpitch;
|
||||||
src += 2;
|
src += 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1031,7 +1031,7 @@ void Win32GLFrameBuffer::ResetGammaTable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Win32GLFrameBuffer::SetGammaTable(WORD *tbl)
|
void Win32GLFrameBuffer::SetGammaTable(uint16_t *tbl)
|
||||||
{
|
{
|
||||||
if (m_supportsGamma)
|
if (m_supportsGamma)
|
||||||
{
|
{
|
||||||
|
|
|
@ -138,7 +138,7 @@ protected:
|
||||||
|
|
||||||
bool CanUpdate();
|
bool CanUpdate();
|
||||||
void ResetGammaTable();
|
void ResetGammaTable();
|
||||||
void SetGammaTable(WORD * tbl);
|
void SetGammaTable(uint16_t * tbl);
|
||||||
|
|
||||||
float m_Gamma, m_Brightness, m_Contrast;
|
float m_Gamma, m_Brightness, m_Contrast;
|
||||||
WORD m_origGamma[768];
|
WORD m_origGamma[768];
|
||||||
|
|
|
@ -127,7 +127,7 @@ public:
|
||||||
virtual void Blank () = 0;
|
virtual void Blank () = 0;
|
||||||
virtual bool PaintToWindow () = 0;
|
virtual bool PaintToWindow () = 0;
|
||||||
virtual HRESULT GetHR () = 0;
|
virtual HRESULT GetHR () = 0;
|
||||||
virtual void ScaleCoordsFromWindow(SWORD &x, SWORD &y);
|
virtual void ScaleCoordsFromWindow(int16_t &x, int16_t &y);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool CreateResources () = 0;
|
virtual bool CreateResources () = 0;
|
||||||
|
@ -304,8 +304,8 @@ private:
|
||||||
BYTE Desat;
|
BYTE Desat;
|
||||||
D3DPal *Palette;
|
D3DPal *Palette;
|
||||||
IDirect3DTexture9 *Texture;
|
IDirect3DTexture9 *Texture;
|
||||||
WORD NumVerts; // Number of _unique_ vertices used by this set.
|
int NumVerts; // Number of _unique_ vertices used by this set.
|
||||||
WORD NumTris; // Number of triangles used by this set.
|
int NumTris; // Number of triangles used by this set.
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -447,7 +447,7 @@ private:
|
||||||
IDirect3DVertexBuffer9 *VertexBuffer;
|
IDirect3DVertexBuffer9 *VertexBuffer;
|
||||||
FBVERTEX *VertexData;
|
FBVERTEX *VertexData;
|
||||||
IDirect3DIndexBuffer9 *IndexBuffer;
|
IDirect3DIndexBuffer9 *IndexBuffer;
|
||||||
WORD *IndexData;
|
uint16_t *IndexData;
|
||||||
BufferedTris *QuadExtra;
|
BufferedTris *QuadExtra;
|
||||||
int VertexPos;
|
int VertexPos;
|
||||||
int IndexPos;
|
int IndexPos;
|
||||||
|
|
|
@ -756,15 +756,15 @@ void Win32Video::SetWindowedScale (float scale)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void BaseWinFB::ScaleCoordsFromWindow(SWORD &x, SWORD &y)
|
void BaseWinFB::ScaleCoordsFromWindow(int16_t &x, int16_t &y)
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
|
||||||
int TrueHeight = GetTrueHeight();
|
int TrueHeight = GetTrueHeight();
|
||||||
if (GetClientRect(Window, &rect))
|
if (GetClientRect(Window, &rect))
|
||||||
{
|
{
|
||||||
x = SWORD(x * Width / (rect.right - rect.left));
|
x = int16_t(x * Width / (rect.right - rect.left));
|
||||||
y = SWORD(y * TrueHeight / (rect.bottom - rect.top));
|
y = int16_t(y * TrueHeight / (rect.bottom - rect.top));
|
||||||
}
|
}
|
||||||
// Subtract letterboxing borders
|
// Subtract letterboxing borders
|
||||||
y -= (TrueHeight - Height) / 2;
|
y -= (TrueHeight - Height) / 2;
|
||||||
|
|
|
@ -69,15 +69,15 @@ struct FBoomArg
|
||||||
BYTE ListSize;
|
BYTE ListSize;
|
||||||
BYTE ArgNum;
|
BYTE ArgNum;
|
||||||
BYTE ConstantValue;
|
BYTE ConstantValue;
|
||||||
WORD AndValue;
|
uint16_t AndValue;
|
||||||
WORD ResultFilter[15];
|
uint16_t ResultFilter[15];
|
||||||
BYTE ResultValue[15];
|
BYTE ResultValue[15];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FBoomTranslator
|
struct FBoomTranslator
|
||||||
{
|
{
|
||||||
WORD FirstLinetype;
|
uint16_t FirstLinetype;
|
||||||
WORD LastLinetype;
|
uint16_t LastLinetype;
|
||||||
BYTE NewSpecial;
|
BYTE NewSpecial;
|
||||||
TArray<FBoomArg> Args;
|
TArray<FBoomArg> Args;
|
||||||
} ;
|
} ;
|
||||||
|
|
Loading…
Reference in a new issue