- remove the remains of Lunatic from RR code.

This commit is contained in:
Christoph Oelckers 2020-06-07 10:46:22 +02:00
parent a54d408d59
commit 9aa2224110
12 changed files with 5 additions and 62 deletions

View file

@ -3776,7 +3776,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura
if (!FURY && g_player[playerNum].ps->newowner > -1) if (!FURY && g_player[playerNum].ps->newowner > -1)
{ {
// Display APLAYER sprites with action PSTAND when viewed through // Display APLAYER sprites with action PSTAND when viewed through
// a camera. Not implemented for Lunatic. // a camera.
const intptr_t *aplayer_scr = g_tile[APLAYER].execPtr; const intptr_t *aplayer_scr = g_tile[APLAYER].execPtr;
// [0]=strength, [1]=actionofs, [2]=moveofs // [0]=strength, [1]=actionofs, [2]=moveofs
@ -5262,8 +5262,6 @@ static void A_InitEnemyFlags(void)
} }
#undef SETFLAG #undef SETFLAG
// Throw in everything here that needs to be called after a Lua game state
// recreation (or on initial startup in a non-Lunatic build.)
void G_PostCreateGameState(void) void G_PostCreateGameState(void)
{ {
Net_SendClientInfo(); Net_SendClientInfo();
@ -5595,8 +5593,6 @@ int GameInterface::app_main()
Net_GetPackets(); Net_GetPackets();
// NOTE: Allocating the DukePlayer_t structs has to be before compiling scripts,
// because in Lunatic, the {pipe,trip}bomb* members are initialized.
for (int i=0; i<MAXPLAYERS; i++) for (int i=0; i<MAXPLAYERS; i++)
G_MaybeAllocPlayer(i); G_MaybeAllocPlayer(i);

View file

@ -1628,7 +1628,6 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons
case USERDEFS_M_RESPAWN_INVENTORY: ud.m_respawn_inventory = iSet; break; case USERDEFS_M_RESPAWN_INVENTORY: ud.m_respawn_inventory = iSet; break;
case USERDEFS_M_RECSTAT: m_recstat = iSet; break; case USERDEFS_M_RECSTAT: m_recstat = iSet; break;
case USERDEFS_M_MONSTERS_OFF: ud.m_monsters_off = iSet; break; case USERDEFS_M_MONSTERS_OFF: ud.m_monsters_off = iSet; break;
// REMINDER: must implement "boolean" setters like "!!iSet" in Lunatic, too.
case USERDEFS_DETAIL: /*ud.detail = clamp(iSet, 1, 16); obsolete*/ break; case USERDEFS_DETAIL: /*ud.detail = clamp(iSet, 1, 16); obsolete*/ break;
case USERDEFS_M_FFIRE: m_ffire = iSet; break; case USERDEFS_M_FFIRE: m_ffire = iSet; break;
case USERDEFS_FFIRE: ud.ffire = iSet; break; case USERDEFS_FFIRE: ud.ffire = iSet; break;

View file

@ -40,7 +40,6 @@ BEGIN_RR_NS
#define ACTOR_MAXFALLINGZVEL 6144 #define ACTOR_MAXFALLINGZVEL 6144
#define ACTOR_ONWATER_ADDZ (24<<8) #define ACTOR_ONWATER_ADDZ (24<<8)
// KEEPINSYNC lunatic/con_lang.lua
#define STAT_DEFAULT 0 #define STAT_DEFAULT 0
#define STAT_ACTOR 1 #define STAT_ACTOR 1
#define STAT_ZOMBIEACTOR 2 #define STAT_ZOMBIEACTOR 2
@ -118,8 +117,6 @@ enum actionflags
AF_VIEWPOINT = 1u<<0u, AF_VIEWPOINT = 1u<<0u,
}; };
// Select an actor's actiontics and movflags locations depending on
// whether we compile the Lunatic build.
// <spr>: sprite pointer // <spr>: sprite pointer
// <a>: actor_t pointer // <a>: actor_t pointer
# define AC_ACTIONTICS(spr, a) ((spr)->lotag) # define AC_ACTIONTICS(spr, a) ((spr)->lotag)
@ -179,7 +176,6 @@ typedef struct
} tiledata_t; } tiledata_t;
// KEEPINSYNC lunatic/con_lang.lua
enum sflags_t enum sflags_t
{ {
SFLAG_SHADOW = 0x00000001, SFLAG_SHADOW = 0x00000001,

View file

@ -55,7 +55,6 @@ BEGIN_RR_NS
#define RECSYNCBUFSIZ 2520 //2520 is the (LCM of 1-8)*3 #define RECSYNCBUFSIZ 2520 //2520 is the (LCM of 1-8)*3
#define MOVEFIFOSIZ 256 #define MOVEFIFOSIZ 256
// KEEPINSYNC lunatic/con_lang.lua
#define MAXLEVELS 64 #define MAXLEVELS 64
#define MAXGAMETYPES 16 #define MAXGAMETYPES 16

View file

@ -3,7 +3,6 @@
#define EDUKE32_EVENTS_DEFS_H_ #define EDUKE32_EVENTS_DEFS_H_
// the order of these can't be changed or else compatibility with EDuke 2.0 mods will break // the order of these can't be changed or else compatibility with EDuke 2.0 mods will break
// KEEPINSYNC with EventNames[] and lunatic/con_lang.lua
enum GameEvent_t { enum GameEvent_t {
EVENT_INIT, // 0 EVENT_INIT, // 0
EVENT_ENTERLEVEL, EVENT_ENTERLEVEL,

View file

@ -5075,7 +5075,7 @@ default_case1:
if (g_player[playerNum].ps->newowner > -1) if (g_player[playerNum].ps->newowner > -1)
{ {
// Display APLAYER sprites with action PSTAND when viewed through // Display APLAYER sprites with action PSTAND when viewed through
// a camera. Not implemented for Lunatic. // a camera.
const intptr_t *aplayer_scr = g_tile[APLAYER].execPtr; const intptr_t *aplayer_scr = g_tile[APLAYER].execPtr;
// [0]=strength, [1]=actionofs, [2]=moveofs // [0]=strength, [1]=actionofs, [2]=moveofs
@ -6740,8 +6740,6 @@ static void A_InitEnemyFlags(void)
} }
#undef SETFLAG #undef SETFLAG
// Throw in everything here that needs to be called after a Lua game state
// recreation (or on initial startup in a non-Lunatic build.)
void G_PostCreateGameState(void) void G_PostCreateGameState(void)
{ {
Net_SendClientInfo(); Net_SendClientInfo();
@ -7074,7 +7072,7 @@ int GameInterface::app_main()
Net_InitNetwork(); Net_InitNetwork();
#endif #endif
numplayers = 1; numplayers = 1;
g_mostConcurrentPlayers = ud.multimode; // Lunatic needs this (player[] bound) g_mostConcurrentPlayers = ud.multimode;
if (!g_fakeMultiMode) if (!g_fakeMultiMode)
{ {
@ -7092,8 +7090,6 @@ int GameInterface::app_main()
Net_GetPackets(); Net_GetPackets();
// NOTE: Allocating the DukePlayer_t structs has to be before compiling scripts,
// because in Lunatic, the {pipe,trip}bomb* members are initialized.
for (bssize_t i=0; i<MAXPLAYERS; i++) for (bssize_t i=0; i<MAXPLAYERS; i++)
G_MaybeAllocPlayer(i); G_MaybeAllocPlayer(i);

View file

@ -123,8 +123,6 @@ void A_DeleteSprite(int spriteNum);
#define MAX_RETURN_VALUES 6 #define MAX_RETURN_VALUES 6
// KEEPINSYNC lunatic/_defs_game.lua
typedef struct { typedef struct {
vec3_t camerapos; vec3_t camerapos;
int32_t const_visibility,uw_framerate; int32_t const_visibility,uw_framerate;

View file

@ -348,7 +348,6 @@ enum ScriptKeywords_t
CON_IFPUPWIND, // 166 CON_IFPUPWIND, // 166
CON_END CON_END
}; };
// KEEPINSYNC with the keyword list in lunatic/con_lang.lua
END_RR_NS END_RR_NS

View file

@ -654,32 +654,18 @@ static int32_t G_StaticToDynamicSound(int32_t const sound)
} }
} }
// Initialize WEAPONx_* gamevars. Since for Lunatic, they reside on the C side, // Initialize WEAPONx_* gamevars. In C-CON, a new CON variable is defined together with
// they're set directly. In C-CON, a new CON variable is defined together with
// its initial value. // its initial value.
#ifdef LUNATIC
# define ADDWEAPONVAR(Weapidx, Membname) do { \
int32_t j; \
for (j=0; j<MAXPLAYERS; j++) \
g_playerWeapon[j][Weapidx].Membname = weapondefaults[Weapidx].Membname; \
} while (0)
#else
# define ADDWEAPONVAR(Weapidx, Membname) do { \ # define ADDWEAPONVAR(Weapidx, Membname) do { \
FStringf aszBuf("WEAPON%d_" #Membname, Weapidx); \ FStringf aszBuf("WEAPON%d_" #Membname, Weapidx); \
aszBuf.ToUpper(); \ aszBuf.ToUpper(); \
Gv_NewVar(aszBuf, weapondefaults[Weapidx].Membname, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); \ Gv_NewVar(aszBuf, weapondefaults[Weapidx].Membname, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); \
} while (0) } while (0)
#endif
// After CON translation, get not-overridden members from weapondefaults[] back // After CON translation, get not-overridden members from weapondefaults[] back
// into the live arrays! (That is, g_playerWeapon[][] for Lunatic, WEAPONx_* // into the live arrays!
// gamevars on the CON side in C-CON.)
#ifdef LUNATIC
# define POSTADDWEAPONVAR(Weapidx, Membname) ADDWEAPONVAR(Weapidx, Membname)
#else
// NYI // NYI
# define POSTADDWEAPONVAR(Weapidx, Membname) do {} while (0) # define POSTADDWEAPONVAR(Weapidx, Membname) do {} while (0)
#endif
// Finish a default weapon member after CON translation. If it was not // Finish a default weapon member after CON translation. If it was not
// overridden from CON itself (see example at g_weaponOverridden[]), we set // overridden from CON itself (see example at g_weaponOverridden[]), we set
@ -714,9 +700,7 @@ void Gv_FinalizeWeaponDefaults(void)
#undef FINISH_WEAPON_DEFAULT_X #undef FINISH_WEAPON_DEFAULT_X
#undef POSTADDWEAPONVAR #undef POSTADDWEAPONVAR
#if !defined LUNATIC
static int32_t lastvisinc; static int32_t lastvisinc;
#endif
static void Gv_AddSystemVars(void) static void Gv_AddSystemVars(void)
{ {
@ -770,26 +754,15 @@ static void Gv_AddSystemVars(void)
void Gv_Init(void) void Gv_Init(void)
{ {
#if !defined LUNATIC
// already initialized // already initialized
if (aGameVars[0].flags) if (aGameVars[0].flags)
return; return;
#else
static int32_t inited=0;
if (inited)
return;
inited = 1;
#endif
// Set up weapon defaults, g_playerWeapon[][]. // Set up weapon defaults, g_playerWeapon[][].
Gv_AddSystemVars(); Gv_AddSystemVars();
#if !defined LUNATIC
Gv_InitWeaponPointers(); Gv_InitWeaponPointers();
#endif
Gv_ResetSystemDefaults();
} }
#if !defined LUNATIC
void Gv_InitWeaponPointers(void) void Gv_InitWeaponPointers(void)
{ {
char aszBuf[64]; char aszBuf[64];
@ -853,6 +826,5 @@ void Gv_RefreshPointers(void)
aGameVars[Gv_GetVarIndex("RESPAWN_MONSTERS")].global = (intptr_t)&ud.respawn_monsters; aGameVars[Gv_GetVarIndex("RESPAWN_MONSTERS")].global = (intptr_t)&ud.respawn_monsters;
aGameVars[Gv_GetVarIndex("VOLUME")].global = (intptr_t)&ud.volume_number; aGameVars[Gv_GetVarIndex("VOLUME")].global = (intptr_t)&ud.volume_number;
} }
#endif
END_RR_NS END_RR_NS

View file

@ -46,7 +46,6 @@ BEGIN_RR_NS
#endif #endif
#define MAXINTERPOLATIONS MAXSPRITES #define MAXINTERPOLATIONS MAXSPRITES
// KEEPINSYNC lunatic/con_lang.lua
// duke3d global soup :( // duke3d global soup :(

View file

@ -132,7 +132,6 @@ typedef struct {
// * char --> int8_t // * char --> int8_t
// Need to carefully think about implications! // Need to carefully think about implications!
// TODO: rearrange this if the opportunity arises! // TODO: rearrange this if the opportunity arises!
// KEEPINSYNC lunatic/_defs_game.lua
typedef struct { typedef struct {
vec3_t pos, opos, vel, npos; vec3_t pos, opos, vel, npos;
vec2_t bobpos, fric; vec2_t bobpos, fric;
@ -231,7 +230,6 @@ typedef struct {
int8_t padding_[3]; int8_t padding_[3];
} DukePlayer_t; } DukePlayer_t;
// KEEPINSYNC lunatic/_defs_game.lua
typedef struct typedef struct
{ {
DukePlayer_t *ps; DukePlayer_t *ps;
@ -255,7 +253,6 @@ typedef struct
} playerdata_t; } playerdata_t;
#pragma pack(pop) #pragma pack(pop)
// KEEPINSYNC lunatic/con_lang.lua
typedef struct typedef struct
{ {
// NOTE: the member names must be identical to aplWeapon* suffixes. // NOTE: the member names must be identical to aplWeapon* suffixes.
@ -277,10 +274,6 @@ typedef struct
int32_t FlashColor; // Muzzle flash color int32_t FlashColor; // Muzzle flash color
} weapondata_t; } weapondata_t;
#ifdef LUNATIC
# define PWEAPON(Player, Weapon, Wmember) (g_playerWeapon[Player][Weapon].Wmember)
extern weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS];
#else
# define PWEAPON(Player, Weapon, Wmember) (aplWeapon ## Wmember [Weapon][Player]) # define PWEAPON(Player, Weapon, Wmember) (aplWeapon ## Wmember [Weapon][Player])
extern intptr_t *aplWeaponClip[MAX_WEAPONS]; // number of items in clip extern intptr_t *aplWeaponClip[MAX_WEAPONS]; // number of items in clip
extern intptr_t *aplWeaponReload[MAX_WEAPONS]; // delay to reload (include fire) extern intptr_t *aplWeaponReload[MAX_WEAPONS]; // delay to reload (include fire)
@ -298,9 +291,7 @@ extern intptr_t *aplWeaponFireSound[MAX_WEAPONS]; // Sound made wh
extern intptr_t *aplWeaponSound2Time[MAX_WEAPONS]; // Alternate sound time extern intptr_t *aplWeaponSound2Time[MAX_WEAPONS]; // Alternate sound time
extern intptr_t *aplWeaponSound2Sound[MAX_WEAPONS]; // Alternate sound sound ID extern intptr_t *aplWeaponSound2Sound[MAX_WEAPONS]; // Alternate sound sound ID
extern intptr_t *aplWeaponFlashColor[MAX_WEAPONS]; // Color for polymer muzzle flash extern intptr_t *aplWeaponFlashColor[MAX_WEAPONS]; // Color for polymer muzzle flash
#endif
// KEEPINSYNC lunatic/_defs_game.lua
typedef struct { typedef struct {
int32_t cur, count; // "cur" is the only member that is *used* int32_t cur, count; // "cur" is the only member that is *used*
int32_t gunposx, lookhalfang; // weapon_xoffset, ps->look_ang>>1 int32_t gunposx, lookhalfang; // weapon_xoffset, ps->look_ang>>1

View file

@ -35,7 +35,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_RR_NS BEGIN_RR_NS
// KEEPINSYNC lunatic/con_lang.lua
#define MAXSOUNDS 4096 #define MAXSOUNDS 4096
#define LOUDESTVOLUME 111 #define LOUDESTVOLUME 111