mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 20:40:47 +00:00
- made the GameFunc constants global again.
With most of the more specific features being migrated to CCMDs the list is relatively clean now, with merely 2 buttons that are game specific.
This commit is contained in:
parent
4b299fa412
commit
f597f7c265
11 changed files with 84 additions and 255 deletions
|
@ -665,42 +665,9 @@ void ParseOptions(void)
|
||||||
|
|
||||||
void ReadAllRFS();
|
void ReadAllRFS();
|
||||||
|
|
||||||
static const char* actions[] = {
|
|
||||||
"Move_Forward",
|
|
||||||
"Move_Backward",
|
|
||||||
"Turn_Left",
|
|
||||||
"Turn_Right",
|
|
||||||
"Strafe",
|
|
||||||
"Fire",
|
|
||||||
"Open",
|
|
||||||
"Run",
|
|
||||||
"Alt_Fire", // Duke3D", Blood
|
|
||||||
"Jump",
|
|
||||||
"Crouch",
|
|
||||||
"Look_Up",
|
|
||||||
"Look_Down",
|
|
||||||
"Look_Left",
|
|
||||||
"Look_Right",
|
|
||||||
"Strafe_Left",
|
|
||||||
"Strafe_Right",
|
|
||||||
"Aim_Up",
|
|
||||||
"Aim_Down",
|
|
||||||
"SendMessage",
|
|
||||||
"Shrink_Screen",
|
|
||||||
"Enlarge_Screen",
|
|
||||||
"Show_Opponents_Weapon",
|
|
||||||
"See_Coop_View",
|
|
||||||
"Mouse_Aiming",
|
|
||||||
"Dpad_Select",
|
|
||||||
"Dpad_Aiming",
|
|
||||||
"Third_Person_View",
|
|
||||||
"Toggle_Crouch",
|
|
||||||
};
|
|
||||||
|
|
||||||
void GameInterface::app_init()
|
void GameInterface::app_init()
|
||||||
{
|
{
|
||||||
InitCheats();
|
InitCheats();
|
||||||
buttonMap.SetButtons(actions, NUM_ACTIONS);
|
|
||||||
memcpy(&gGameOptions, &gSingleGameOptions, sizeof(GAMEOPTIONS));
|
memcpy(&gGameOptions, &gSingleGameOptions, sizeof(GAMEOPTIONS));
|
||||||
gGameOptions.nMonsterSettings = !userConfig.nomonsters;
|
gGameOptions.nMonsterSettings = !userConfig.nomonsters;
|
||||||
ReadAllRFS();
|
ReadAllRFS();
|
||||||
|
|
|
@ -29,41 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
BEGIN_BLD_NS
|
BEGIN_BLD_NS
|
||||||
|
|
||||||
// Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name.
|
|
||||||
enum GameFunction_t
|
|
||||||
{
|
|
||||||
gamefunc_Move_Forward,
|
|
||||||
gamefunc_Move_Backward,
|
|
||||||
gamefunc_Turn_Left,
|
|
||||||
gamefunc_Turn_Right,
|
|
||||||
gamefunc_Strafe,
|
|
||||||
gamefunc_Fire,
|
|
||||||
gamefunc_Open,
|
|
||||||
gamefunc_Run,
|
|
||||||
gamefunc_Alt_Fire, // Duke3D, Blood
|
|
||||||
gamefunc_Jump,
|
|
||||||
gamefunc_Crouch,
|
|
||||||
gamefunc_Look_Up,
|
|
||||||
gamefunc_Look_Down,
|
|
||||||
gamefunc_Look_Left,
|
|
||||||
gamefunc_Look_Right,
|
|
||||||
gamefunc_Strafe_Left,
|
|
||||||
gamefunc_Strafe_Right,
|
|
||||||
gamefunc_Aim_Up,
|
|
||||||
gamefunc_Aim_Down,
|
|
||||||
gamefunc_SendMessage,
|
|
||||||
gamefunc_Shrink_Screen,
|
|
||||||
gamefunc_Enlarge_Screen,
|
|
||||||
gamefunc_Show_Opponents_Weapon,
|
|
||||||
gamefunc_See_Coop_View,
|
|
||||||
gamefunc_Mouse_Aiming,
|
|
||||||
gamefunc_Dpad_Select,
|
|
||||||
gamefunc_Dpad_Aiming,
|
|
||||||
gamefunc_Third_Person_View,
|
|
||||||
gamefunc_Toggle_Crouch,
|
|
||||||
NUM_ACTIONS
|
|
||||||
};
|
|
||||||
|
|
||||||
struct INIDESCRIPTION {
|
struct INIDESCRIPTION {
|
||||||
const char *pzName;
|
const char *pzName;
|
||||||
const char *pzFilename;
|
const char *pzFilename;
|
||||||
|
|
|
@ -871,6 +871,7 @@ int RunGame()
|
||||||
if (exec) exec->ExecCommands();
|
if (exec) exec->ExecCommands();
|
||||||
|
|
||||||
gamestate = GS_LEVEL;
|
gamestate = GS_LEVEL;
|
||||||
|
SetupGameButtons();
|
||||||
gi->app_init();
|
gi->app_init();
|
||||||
app_loop();
|
app_loop();
|
||||||
return 0; // this is never reached. app_loop only exits via exception.
|
return 0; // this is never reached. app_loop only exits via exception.
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
#include "gamecvars.h"
|
#include "gamecvars.h"
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
|
#include"packet.h"
|
||||||
|
#include "gamecontrol.h"
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
@ -175,3 +177,46 @@ void CONTROL_GetInput(ControlInfo* info)
|
||||||
info->dpitch += -joyaxes[JOYAXIS_Pitch] * 22.5f;
|
info->dpitch += -joyaxes[JOYAXIS_Pitch] * 22.5f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void SetupGameButtons()
|
||||||
|
{
|
||||||
|
static const char* actions[] = {
|
||||||
|
"Move_Forward",
|
||||||
|
"Move_Backward",
|
||||||
|
"Turn_Left",
|
||||||
|
"Turn_Right",
|
||||||
|
"Strafe",
|
||||||
|
"Fire",
|
||||||
|
"Open",
|
||||||
|
"Run",
|
||||||
|
"Alt_Fire",
|
||||||
|
"Jump",
|
||||||
|
"Crouch",
|
||||||
|
"Look_Up",
|
||||||
|
"Look_Down",
|
||||||
|
"Look_Left",
|
||||||
|
"Look_Right",
|
||||||
|
"Strafe_Left",
|
||||||
|
"Strafe_Right",
|
||||||
|
"Aim_Up",
|
||||||
|
"Aim_Down",
|
||||||
|
"Shrink_Screen",
|
||||||
|
"Enlarge_Screen",
|
||||||
|
"Show_Opponents_Weapon",
|
||||||
|
"See_Coop_View",
|
||||||
|
"Mouse_Aiming",
|
||||||
|
"Dpad_Select",
|
||||||
|
"Dpad_Aiming",
|
||||||
|
"Third_Person_View",
|
||||||
|
"Toggle_Crouch",
|
||||||
|
"Quick_Kick",
|
||||||
|
};
|
||||||
|
buttonMap.SetButtons(actions, NUM_ACTIONS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,3 +62,39 @@ extern InputState inputState;
|
||||||
|
|
||||||
void CONTROL_GetInput(ControlInfo* info);
|
void CONTROL_GetInput(ControlInfo* info);
|
||||||
int32_t handleevents(void);
|
int32_t handleevents(void);
|
||||||
|
|
||||||
|
enum GameFunction_t
|
||||||
|
{
|
||||||
|
gamefunc_Move_Forward,
|
||||||
|
gamefunc_Move_Backward,
|
||||||
|
gamefunc_Turn_Left,
|
||||||
|
gamefunc_Turn_Right,
|
||||||
|
gamefunc_Strafe,
|
||||||
|
gamefunc_Fire,
|
||||||
|
gamefunc_Open,
|
||||||
|
gamefunc_Run,
|
||||||
|
gamefunc_Alt_Fire,
|
||||||
|
gamefunc_Jump,
|
||||||
|
gamefunc_Crouch,
|
||||||
|
gamefunc_Look_Up,
|
||||||
|
gamefunc_Look_Down,
|
||||||
|
gamefunc_Look_Left,
|
||||||
|
gamefunc_Look_Right,
|
||||||
|
gamefunc_Strafe_Left,
|
||||||
|
gamefunc_Strafe_Right,
|
||||||
|
gamefunc_Aim_Up,
|
||||||
|
gamefunc_Aim_Down,
|
||||||
|
gamefunc_Shrink_Screen, // Automap only
|
||||||
|
gamefunc_Enlarge_Screen, // Automap only
|
||||||
|
gamefunc_Show_Opponents_Weapon, // CCMD
|
||||||
|
gamefunc_See_Coop_View, // CCMD
|
||||||
|
gamefunc_Mouse_Aiming,
|
||||||
|
gamefunc_Dpad_Select,
|
||||||
|
gamefunc_Dpad_Aiming,
|
||||||
|
gamefunc_Third_Person_View, // CCMD
|
||||||
|
gamefunc_Toggle_Crouch,
|
||||||
|
gamefunc_Quick_Kick,
|
||||||
|
NUM_ACTIONS
|
||||||
|
};
|
||||||
|
|
||||||
|
void SetupGameButtons();
|
||||||
|
|
|
@ -36,43 +36,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
BEGIN_PS_NS
|
BEGIN_PS_NS
|
||||||
|
|
||||||
// Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name.
|
|
||||||
enum GameFunction_t
|
|
||||||
{
|
|
||||||
gamefunc_Move_Forward,
|
|
||||||
gamefunc_Move_Backward,
|
|
||||||
gamefunc_Turn_Left,
|
|
||||||
gamefunc_Turn_Right,
|
|
||||||
gamefunc_Strafe,
|
|
||||||
gamefunc_Fire,
|
|
||||||
gamefunc_Open,
|
|
||||||
gamefunc_Run,
|
|
||||||
gamefunc_Alt_Fire, // Duke3D, Blood
|
|
||||||
gamefunc_Jump,
|
|
||||||
gamefunc_Crouch,
|
|
||||||
gamefunc_Look_Up,
|
|
||||||
gamefunc_Look_Down,
|
|
||||||
gamefunc_Look_Left,
|
|
||||||
gamefunc_Look_Right,
|
|
||||||
gamefunc_Strafe_Left,
|
|
||||||
gamefunc_Strafe_Right,
|
|
||||||
gamefunc_Aim_Up,
|
|
||||||
gamefunc_Aim_Down,
|
|
||||||
gamefunc_SendMessage,
|
|
||||||
gamefunc_Shrink_Screen,
|
|
||||||
gamefunc_Enlarge_Screen,
|
|
||||||
gamefunc_Show_Opponents_Weapon,
|
|
||||||
gamefunc_See_Coop_View,
|
|
||||||
gamefunc_Mouse_Aiming,
|
|
||||||
gamefunc_Dpad_Select,
|
|
||||||
gamefunc_Dpad_Aiming,
|
|
||||||
gamefunc_Last_Weapon,
|
|
||||||
gamefunc_Alt_Weapon,
|
|
||||||
gamefunc_Third_Person_View,
|
|
||||||
gamefunc_Toggle_Crouch, // This is the last one used by EDuke32.
|
|
||||||
NUM_ACTIONS,
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#define kTimerTicks 120
|
#define kTimerTicks 120
|
||||||
|
|
||||||
|
|
|
@ -3,41 +3,6 @@
|
||||||
|
|
||||||
// all game constants got collected here.
|
// all game constants got collected here.
|
||||||
|
|
||||||
// Most of these should be replaced by CCMDs eventually
|
|
||||||
enum GameFunction_t
|
|
||||||
{
|
|
||||||
gamefunc_Move_Forward,
|
|
||||||
gamefunc_Move_Backward,
|
|
||||||
gamefunc_Turn_Left,
|
|
||||||
gamefunc_Turn_Right,
|
|
||||||
gamefunc_Strafe,
|
|
||||||
gamefunc_Fire,
|
|
||||||
gamefunc_Open,
|
|
||||||
gamefunc_Run,
|
|
||||||
gamefunc_Jump,
|
|
||||||
gamefunc_Crouch,
|
|
||||||
gamefunc_Look_Up,
|
|
||||||
gamefunc_Look_Down,
|
|
||||||
gamefunc_Look_Left,
|
|
||||||
gamefunc_Look_Right,
|
|
||||||
gamefunc_Strafe_Left,
|
|
||||||
gamefunc_Strafe_Right,
|
|
||||||
gamefunc_Aim_Up,
|
|
||||||
gamefunc_Aim_Down,
|
|
||||||
gamefunc_Shrink_Screen, // CCMD
|
|
||||||
gamefunc_Enlarge_Screen, // CCMD
|
|
||||||
gamefunc_Show_Opponents_Weapon, // CCMD
|
|
||||||
gamefunc_See_Coop_View, // CCMD
|
|
||||||
gamefunc_Mouse_Aiming, // CCMD
|
|
||||||
gamefunc_Quick_Kick,
|
|
||||||
gamefunc_Dpad_Select,
|
|
||||||
gamefunc_Dpad_Aiming,
|
|
||||||
gamefunc_Third_Person_View, // CCMD
|
|
||||||
gamefunc_Toggle_Crouch,
|
|
||||||
NUM_ACTIONS
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
TICRATE = 120,
|
TICRATE = 120,
|
||||||
|
|
|
@ -234,47 +234,6 @@ static void setupbackdrop()
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
static void SetupGameButtons()
|
|
||||||
{
|
|
||||||
static const char* actions[] = {
|
|
||||||
"Move_Forward",
|
|
||||||
"Move_Backward",
|
|
||||||
"Turn_Left",
|
|
||||||
"Turn_Right",
|
|
||||||
"Strafe",
|
|
||||||
"Fire",
|
|
||||||
"Open",
|
|
||||||
"Run",
|
|
||||||
"Jump",
|
|
||||||
"Crouch",
|
|
||||||
"Look_Up",
|
|
||||||
"Look_Down",
|
|
||||||
"Look_Left",
|
|
||||||
"Look_Right",
|
|
||||||
"Strafe_Left",
|
|
||||||
"Strafe_Right",
|
|
||||||
"Aim_Up",
|
|
||||||
"Aim_Down",
|
|
||||||
"Shrink_Screen",
|
|
||||||
"Enlarge_Screen",
|
|
||||||
"Show_Opponents_Weapon",
|
|
||||||
"See_Coop_View",
|
|
||||||
"Mouse_Aiming",
|
|
||||||
"Quick_Kick",
|
|
||||||
"Dpad_Select",
|
|
||||||
"Dpad_Aiming",
|
|
||||||
"Third_Person_View",
|
|
||||||
"Toggle_Crouch",
|
|
||||||
};
|
|
||||||
buttonMap.SetButtons(actions, NUM_ACTIONS);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static void loaddefs()
|
static void loaddefs()
|
||||||
{
|
{
|
||||||
const char* defsfile = G_DefFile();
|
const char* defsfile = G_DefFile();
|
||||||
|
|
|
@ -175,46 +175,10 @@ void SybexScreen(void);
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
static const char* actions[] = {
|
|
||||||
"Move_Forward",
|
|
||||||
"Move_Backward",
|
|
||||||
"Turn_Left",
|
|
||||||
"Turn_Right",
|
|
||||||
"Strafe",
|
|
||||||
"Fire",
|
|
||||||
"Open",
|
|
||||||
"Run",
|
|
||||||
"Alt_Fire", // Duke3D", Blood
|
|
||||||
"Jump",
|
|
||||||
"Crouch",
|
|
||||||
"Look_Up",
|
|
||||||
"Look_Down",
|
|
||||||
"Look_Left",
|
|
||||||
"Look_Right",
|
|
||||||
"Strafe_Left",
|
|
||||||
"Strafe_Right",
|
|
||||||
"Aim_Up",
|
|
||||||
"Aim_Down",
|
|
||||||
"SendMessage",
|
|
||||||
"Shrink_Screen",
|
|
||||||
"Enlarge_Screen",
|
|
||||||
"Show_Opponents_Weapon",
|
|
||||||
"See_Coop_View",
|
|
||||||
"Mouse_Aiming",
|
|
||||||
"Dpad_Select",
|
|
||||||
"Dpad_Aiming",
|
|
||||||
"Last_Weapon",
|
|
||||||
"Alt_Weapon",
|
|
||||||
"Third_Person_View",
|
|
||||||
"Toggle_Crouch", // This is the last one used by EDuke32"",
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
void GameInterface::app_init()
|
void GameInterface::app_init()
|
||||||
{
|
{
|
||||||
GameTicRate = 40;
|
GameTicRate = 40;
|
||||||
InitCheats();
|
InitCheats();
|
||||||
buttonMap.SetButtons(actions, NUM_ACTIONS);
|
|
||||||
automapping = 1;
|
automapping = 1;
|
||||||
|
|
||||||
gs = gs_defaults;
|
gs = gs_defaults;
|
||||||
|
|
|
@ -73,42 +73,6 @@ typedef struct
|
||||||
extern const GAME_SET gs_defaults;
|
extern const GAME_SET gs_defaults;
|
||||||
extern GAME_SET gs;
|
extern GAME_SET gs;
|
||||||
|
|
||||||
enum GameFunction_t
|
|
||||||
{
|
|
||||||
gamefunc_Move_Forward,
|
|
||||||
gamefunc_Move_Backward,
|
|
||||||
gamefunc_Turn_Left,
|
|
||||||
gamefunc_Turn_Right,
|
|
||||||
gamefunc_Strafe,
|
|
||||||
gamefunc_Fire,
|
|
||||||
gamefunc_Open,
|
|
||||||
gamefunc_Run,
|
|
||||||
gamefunc_Alt_Fire, // Duke3D, Blood
|
|
||||||
gamefunc_Jump,
|
|
||||||
gamefunc_Crouch,
|
|
||||||
gamefunc_Look_Up,
|
|
||||||
gamefunc_Look_Down,
|
|
||||||
gamefunc_Look_Left,
|
|
||||||
gamefunc_Look_Right,
|
|
||||||
gamefunc_Strafe_Left,
|
|
||||||
gamefunc_Strafe_Right,
|
|
||||||
gamefunc_Aim_Up,
|
|
||||||
gamefunc_Aim_Down,
|
|
||||||
gamefunc_SendMessage,
|
|
||||||
gamefunc_Shrink_Screen,
|
|
||||||
gamefunc_Enlarge_Screen,
|
|
||||||
gamefunc_Show_Opponents_Weapon,
|
|
||||||
gamefunc_See_Coop_View,
|
|
||||||
gamefunc_Mouse_Aiming,
|
|
||||||
gamefunc_Dpad_Select,
|
|
||||||
gamefunc_Dpad_Aiming,
|
|
||||||
gamefunc_Last_Weapon,
|
|
||||||
gamefunc_Alt_Weapon,
|
|
||||||
gamefunc_Third_Person_View,
|
|
||||||
gamefunc_Toggle_Crouch, // This is the last one used by EDuke32.
|
|
||||||
NUM_ACTIONS
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
DREALMSPAL = 1,
|
DREALMSPAL = 1,
|
||||||
|
|
|
@ -420,9 +420,9 @@ getinput(InputPacket *loc, SWBOOL tied)
|
||||||
SET(loc->bits, prev_weapon + 1);
|
SET(loc->bits, prev_weapon + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buttonMap.ButtonDown(gamefunc_Alt_Weapon))
|
if (false)//buttonMap.ButtonDown(gamefunc_Alt_Weapon)) will be renabled in an upcoming commit.
|
||||||
{
|
{
|
||||||
buttonMap.ClearButton(gamefunc_Alt_Weapon);
|
//buttonMap.ClearButton(gamefunc_Alt_Weapon);
|
||||||
USERp u = User[pp->PlayerSprite];
|
USERp u = User[pp->PlayerSprite];
|
||||||
short const which_weapon = u->WeaponNum + 1;
|
short const which_weapon = u->WeaponNum + 1;
|
||||||
SET(loc->bits, which_weapon);
|
SET(loc->bits, which_weapon);
|
||||||
|
|
Loading…
Reference in a new issue