Skip to content

Commit

Permalink
use the correct constant to determine registeredness
Browse files Browse the repository at this point in the history
And so I don't confuse myself again, make them less ambiguous.

Fixes #36
  • Loading branch information
jonof committed Dec 7, 2022
1 parent 5073711 commit 65bd2bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ BOOL InGame = FALSE;
int CommandSetup = FALSE;

const char *GameEditionName = "Unknown edition";
int GameVariant = GRPFILE_GAME_SW;
int GameVariant = GRPFILE_GAME_REG;
BOOL UseDarts = FALSE;

char UserMapName[80]="", buffer[80], ch;
Expand Down Expand Up @@ -3397,15 +3397,15 @@ int DetectShareware(void)
h = kopen4load(DOS_SCREEN_NAME_SW,1);
if (h >= 0)
{
GameVariant = GRPFILE_GAME_SWSW;
GameVariant = GRPFILE_GAME_SHARE;
kclose(h);
return 0;
}

h = kopen4load(DOS_SCREEN_NAME_REG,1);
if (h >= 0)
{
GameVariant = GRPFILE_GAME_SW;
GameVariant = GRPFILE_GAME_REG;
kclose(h);
return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "settings.h"

enum {
GRPFILE_GAME_SW = 0,
GRPFILE_GAME_SWSW = 1,
GRPFILE_GAME_REG = 0,
GRPFILE_GAME_SHARE = 1,
GRPFILE_GAME_WD = 2,
};

extern BOOL UseDarts;
extern const char *GameEditionName;
extern int GameVariant;
#define SW_SHAREWARE (GameVariant == GRPFILE_GAME_SW)
#define SW_REGISTERED (GameVariant != GRPFILE_GAME_SW)
#define SW_SHAREWARE (GameVariant == GRPFILE_GAME_SHARE)
#define SW_REGISTERED (GameVariant != GRPFILE_GAME_SHARE)

// Turn warning off for unreferenced variables.
// I really should fix them at some point
Expand Down
12 changes: 6 additions & 6 deletions src/grpscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
#include "grpscan.h"

enum {
GRPFILE_GAME_SW = 0,
GRPFILE_GAME_SWSW = 1,
GRPFILE_GAME_REG = 0,
GRPFILE_GAME_SHARE = 1,
GRPFILE_GAME_WD = 2,
};

struct grpfile grpfiles[] = {
{ "Registered Version", 0x7545319F, 47536148, GRPFILE_GAME_SW, "sw.grp", NULL, NULL },
{ "Shareware Version", 0x08A7FA1F, 26056769, GRPFILE_GAME_SWSW, "swshare.grp", NULL, NULL },
{ "Mac Demo Version", 0x4227F535, 26056769, GRPFILE_GAME_SWSW, "swmacshare.grp", NULL, NULL },
{ "Mac Registered Version", 0xD54A99C9, 47536148, GRPFILE_GAME_SW, "swmac.grp", NULL, NULL },
{ "Registered Version", 0x7545319F, 47536148, GRPFILE_GAME_REG, "sw.grp", NULL, NULL },
{ "Shareware Version", 0x08A7FA1F, 26056769, GRPFILE_GAME_SHARE, "swshare.grp", NULL, NULL },
{ "Mac Demo Version", 0x4227F535, 26056769, GRPFILE_GAME_SHARE, "swmacshare.grp", NULL, NULL },
{ "Mac Registered Version", 0xD54A99C9, 47536148, GRPFILE_GAME_REG, "swmac.grp", NULL, NULL },
{ "Wanton Destruction (Addon)", 0xA9AAA7B7, 48698128, GRPFILE_GAME_WD, "wt.grp", NULL, NULL },
{ NULL, 0, 0, 0, NULL, NULL, NULL },
};
Expand Down

0 comments on commit 65bd2bb

Please sign in to comment.