Skip to content

Commit

Permalink
Linux Compat Test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrikpowell committed Jul 19, 2024
1 parent d37efe7 commit d6a6e33
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 79 deletions.
40 changes: 19 additions & 21 deletions prboom2/src/dsda/animate.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,10 @@ extern int Check_E3map_Animate;
extern int Check_Victory_Animate;
extern int Check_Endpic_Animate;

extern int D_CheckAnimate(const char *lump_s, const char *lump_e)
extern int D_CheckAnimate(const char* lump_s, const char* lump_e)
{
static int SCheck = 0;
static int ECheck = 0;
static int SLump = 0;
static int ELump = 0;
static int SCheck;
static int ECheck;
static int Animate = 0;

SCheck = W_CheckNumForName(lump_s);
Expand All @@ -88,12 +86,12 @@ extern int D_CheckAnimate(const char *lump_s, const char *lump_e)
return Animate;
}

extern void D_DrawAnimate(const char *lump_s, const char *lump_e)
extern void D_DrawAnimate(const char* lump_s, const char* lump_e)
{
int frameDiff = 0;
int frame = 0;
static int SLump = 0;
static int ELump = 0;
int frameDiff;
int frame;
static int SLump;
static int ELump;
SLump = W_GetNumForName(lump_s);
ELump = W_GetNumForName(lump_e);
frameDiff = ELump - SLump;
Expand All @@ -116,33 +114,33 @@ extern void D_DrawAnimate(const char *lump_s, const char *lump_e)
V_DrawNumPatch(lump_x, lump_y, 0, SLump + frame, CR_DEFAULT, VPT_STRETCH);
}*/

extern void M_DrawMenuAnimate(const char *lump_x, const char *lump_y, const char *lump_s, const char *lump_e)
extern void M_DrawMenuAnimate(const int lump_x, const int lump_y, const char* lump_s, const char* lump_e)
{
int frameDiff = 0;
int frame = 0;
static int SLump = 0;
static int ELump = 0;
int frameDiff;
int frame;
static int SLump;
static int ELump;
SLump = W_GetNumForName(lump_s);
ELump = W_GetNumForName(lump_e);
frameDiff = ELump - SLump;
frame = (AnimateTime) % (frameDiff + 1);
V_DrawNumPatch(lump_x, lump_y, 0, SLump + frame, CR_DEFAULT, VPT_STRETCH);
}

extern void M_DrawStbarAnimate(const char *lump_x, const char *lump_y, const char *lump_z, const char *lump_s, const char *lump_e)
extern void M_DrawStbarAnimate(const int lump_x, const int lump_y, const int lump_z, const char* lump_s, const char* lump_e)
{
int frameDiff = 0;
int frame = 0;
static int SLump = 0;
static int ELump = 0;
int frameDiff;
int frame;
static int SLump;
static int ELump;
SLump = W_GetNumForName(lump_s);
ELump = W_GetNumForName(lump_e);
frameDiff = ELump - SLump;
frame = (AnimateTime) % (frameDiff + 1);
V_DrawNumPatch(lump_x, lump_y, lump_z, SLump + frame, CR_DEFAULT, VPT_ALIGN_BOTTOM);
}

extern int dsda_AnimateExistCheck(void) {
extern void dsda_AnimateExistCheck(void) {
Check_Doom_Animate = D_CheckAnimate(mdoom_start,mdoom_end);
Check_Skull_Animate = D_CheckAnimate(mskull_start,mskull_end);
Check_Stbar_Animate = D_CheckAnimate(stbar_start,stbar_end);
Expand Down
10 changes: 5 additions & 5 deletions prboom2/src/dsda/animate.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ int Check_Victory_Animate;
int Check_Endpic_Animate;


int D_CheckAnimate(const char *lump_s, const char *lump_e);
void D_DrawAnimate(const char *lump_s, const char *lump_e);
int D_CheckAnimate(const char* lump_s, const char* lump_e);
void D_DrawAnimate(const char* lump_s, const char* lump_e);
//void D_DrawAnimateBunny(const char *lump_x, const char *lump_y, const char *lump_s, const char *lump_e);
void M_DrawMenuAnimate(const char *lump_x, const char *lump_y, const char *lump_s, const char *lump_e);
void M_DrawStbarAnimate(const char *lump_x, const char *lump_y, const char *lump_z, const char *lump_s, const char *lump_e);
int dsda_AnimateExistCheck(void);
void M_DrawMenuAnimate(const int lump_x, const int lump_y, const char* lump_s, const char* lump_e);
void M_DrawStbarAnimate(const int lump_x, const int lump_y, const int lump_z, const char* lump_s, const char* lump_e);
void dsda_AnimateExistCheck(void);

#endif
61 changes: 25 additions & 36 deletions prboom2/src/dsda/hud_components/sml_armor.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,55 +19,44 @@

#include "sml_armor.h"

#define PATCH_DELTA_X 14
#define PATCH_DELTA 10
#define PATCH_SPACING 2
#define PATCH_VERTICAL_SPACING 2

typedef struct {
dsda_patch_component_t component;
} local_component_t;

static local_component_t* local;

static const char* dsda_ArmorName(player_t* player) {
int armor;

armor = player->armorpoints[ARMOR_ARMOR];

if (player->armortype >= 2)
if (gamemission == chex) { return "CHXARMS2"; }
else { return "STFARMS4"; }
else if (player->armortype == 1)
if (gamemission == chex) { return "CHXARMS1"; }
else { return "STFARMS3"; }
else
return NULL;
}

void drawArmorIcon(player_t* player, int* x, int* y, const char* (*armor)(player_t*)) {
const char* name;

name = armor(player);

if (name)
V_DrawNamePatch(*x, *y, FG, name, CR_DEFAULT, local->component.vpt);
}

static void dsda_DrawComponent(void) {
player_t* player;
int x, y;
char* lump;
int armor;

player = &players[displayplayer];

x = local->component.x;
y = local->component.y;
if (!raven)
{
if (gamemission == chex)
drawArmorIcon(player, &x, &y, dsda_ArmorName);
else
drawArmorIcon(player, &x, &y+2, dsda_ArmorName);

if (!raven) {
armor = player->armorpoints[ARMOR_ARMOR];
if (armor <= 0) {
lump = NULL;
}
else {
if (gamemission == chex) {
if (player->armortype < 2)
lump = "CHXARMS1";
else
lump = "CHXARMS2";
V_DrawNamePatch(x, y+2, FG, lump, CR_DEFAULT, local->component.vpt);

}
else {
if (player->armortype < 2)
lump = "STFARMS3";
else
lump = "STFARMS4";
V_DrawNamePatch(x, y, FG, lump, CR_DEFAULT, local->component.vpt);
}
}
}
}

Expand Down
23 changes: 8 additions & 15 deletions prboom2/src/dsda/widescreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,18 @@ extern int Check_Bunny1_Wide;
extern int Check_Bunny2_Wide;
extern int Check_Endpic_Wide;

extern int D_CheckWide(const char *lump) {
static int ws = 0;
static int last_numwadfiles = -1;
extern int D_CheckWide(const char* lump) {
static int widecheck;
static int widescreen = 0;

// This might be called before all wads are loaded
if (numwadfiles != last_numwadfiles) {
int num;
widecheck = W_CheckNumForName(lump);

last_numwadfiles = numwadfiles;
num = W_CheckNumForName(lump);

if (num != LUMP_NOT_FOUND) {
ws = 1;
}
}
return ws;
if (widecheck != LUMP_NOT_FOUND)
widescreen = 1;
return widescreen;
}

extern int dsda_WideExistCheck(void) {
extern void dsda_WideExistCheck(void) {
Check_Stbar_Wide = D_CheckWide(stbar_wide);
Check_Titlepic_Wide = D_CheckWide(titlepic_wide);
Check_Interpic_Wide = D_CheckWide(interpic_wide);
Expand Down
4 changes: 2 additions & 2 deletions prboom2/src/dsda/widescreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const char* bunny1_wide;
const char* bunny2_wide;
const char* endpic_wide;

int D_CheckWide(const char *lump);
int D_CheckWide(const char* lump);

int dsda_WideExistCheck(void);
void dsda_WideExistCheck(void);
int Check_Stbar_Wide;
int Check_Titlepic_Wide;
int Check_Interpic_Wide;
Expand Down

0 comments on commit d6a6e33

Please sign in to comment.