- Cleanup

This commit is contained in:
Christoph Oelckers 2019-10-28 07:02:42 +01:00
parent c589a6ab82
commit 4f4fc1a8d4
9 changed files with 17 additions and 158 deletions

View file

@ -25,9 +25,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
#define WIN_IS_PRESSED ( KB_KeyPressed( sc_RightWin ) || KB_KeyPressed( sc_LeftWin ) )
#define ALT_IS_PRESSED ( KB_KeyPressed( sc_RightAlt ) || KB_KeyPressed( sc_LeftAlt ) )
#define SHIFTS_IS_PRESSED ( KB_KeyPressed( sc_RightShift ) || KB_KeyPressed( sc_LeftShift ) )
#define WIN_IS_PRESSED ( inputState.WinPressed() )
#define ALT_IS_PRESSED ( inputState.AltPressed() )
#define SHIFTS_IS_PRESSED ( inputState.ShiftPressed() )
extern int32_t I_CheckAllInput(void);
extern void I_ClearAllInput(void);

View file

@ -196,12 +196,17 @@ public:
{
return KeyStatus[sc_LeftControl] || KeyStatus[sc_RightControl];
}
bool WinPressed()
{
return KeyStatus[sc_LeftWin] || KeyStatus[sc_RightWin];
}
bool ShiftPressed()
{
return KeyStatus[sc_LeftShift] || KeyStatus[sc_RightShift];
}
bool EscapePressed()
{
return !!KeyStatus[sc_Escape];

View file

@ -233,13 +233,6 @@ void G_HandleSpecialKeys(void)
if ((myplayer.gm & MODE_GAME) != MODE_GAME)
OSD_DispatchQueued();
#ifdef DEBUGGINGAIDS
if (g_quickExit == 0 && KB_KeyPressed(sc_LeftControl) && KB_KeyPressed(sc_LeftAlt) && KB_KeyPressed(sc_End))
{
g_quickExit = 1;
G_GameExit("Quick Exit.");
}
#endif
}
void G_GameQuit(void)

View file

@ -32,9 +32,9 @@ BEGIN_DUKE_NS
#define BGSTRETCH (hud_bgstretch ? 1024 : 0)
#define WIN_IS_PRESSED ( KB_KeyPressed( sc_RightWin ) || KB_KeyPressed( sc_LeftWin ) )
#define ALT_IS_PRESSED ( KB_KeyPressed( sc_RightAlt ) || KB_KeyPressed( sc_LeftAlt ) )
#define SHIFTS_IS_PRESSED ( KB_KeyPressed( sc_RightShift ) || KB_KeyPressed( sc_LeftShift ) )
#define WIN_IS_PRESSED ( inputState.WinPressed() )
#define ALT_IS_PRESSED ( inputState.AltPressed() )
#define SHIFTS_IS_PRESSED ( inputState.ShiftPressed() )
#ifndef EDUKE32_STANDALONE
#define RANDOMSCRAP(s, i) A_InsertSprite(s->sectnum,s->x+(krand()&255)-128,s->y+(krand()&255)-128,s->z-ZOFFSET3-(krand()&8191),\

View file

@ -37,9 +37,9 @@ static FORCE_INLINE int32_t krand2(void)
#define BGSTRETCH (hud_bgstretch ? 1024 : 0)
#define WIN_IS_PRESSED ( KB_KeyPressed( sc_RightWin ) || KB_KeyPressed( sc_LeftWin ) )
#define ALT_IS_PRESSED ( KB_KeyPressed( sc_RightAlt ) || KB_KeyPressed( sc_LeftAlt ) )
#define SHIFTS_IS_PRESSED ( KB_KeyPressed( sc_RightShift ) || KB_KeyPressed( sc_LeftShift ) )
#define WIN_IS_PRESSED ( inputState.WinPressed() )
#define ALT_IS_PRESSED ( inputState.AltPressed() )
#define SHIFTS_IS_PRESSED ( inputState.ShiftPressed() )
#define RANDOMSCRAP(s, i) \
{ \

View file

@ -470,13 +470,6 @@ DemoPlayBack(void)
}
else
{
#if DEBUG
if (KB_KeyPressed(KEYSC_ALT) && KB_KeyPressed(KEYSC_CTRL) && KB_KeyPressed(KEYSC_S))
{
KB_KeyPressed(KEYSC_ALT) = KB_KeyPressed(KEYSC_CTRL) = KB_KeyPressed(KEYSC_S) = 0;
saveboard("demosave.map", (vec3_t *)Player, &Player->pang, &Player->cursectnum);
}
#endif
if (BUTTON(gamefunc_See_Coop_View))
{
@ -487,19 +480,6 @@ DemoPlayBack(void)
if (screenpeek < 0)
screenpeek = connecthead;
}
#if DEBUG
if (KB_KeyPressed(KEYSC_RIGHT) || KB_KeyPressed(KEYSC_UP))
{
if (KB_KeyPressed(KEYSC_LSHIFT) || KB_KeyPressed(KEYSC_RSHIFT))
totalclock += synctics;
else
totalclock += synctics-1;
}
if (KB_KeyPressed(KEYSC_LEFT) || KB_KeyPressed(KEYSC_DOWN))
totalclock += 1-synctics;
#endif
}

View file

@ -1686,14 +1686,6 @@ void DrawCheckKeys(PLAYERp pp)
extern SWBOOL ResCheat;
extern SWBOOL PauseKeySet;
/* JonoF: Who really needs this now?
if (KB_KeyPressed(KEYSC_F5) && !(KB_KeyPressed(KEYSC_RSHIFT) || KB_KeyPressed(KEYSC_LSHIFT) || KB_KeyPressed(KEYSC_ALT) || KB_KeyPressed(KEYSC_RALT)) && !PauseKeySet)
{
KB_KeyPressed(KEYSC_F5) = 0;
ResChange();
}
*/
if (ResCheat)
{
ResCheat = FALSE;

View file

@ -4149,115 +4149,7 @@ SinglePlayInput(PLAYERp pp)
}
}
if (!(KB_KeyPressed(KEYSC_ALT) | KB_KeyPressed(KEYSC_RALT)))
return;
if (!SW_SHAREWARE && KB_KeyPressed(KEYSC_M))
{
extern SWBOOL DebugActorFreeze;
KB_KeyPressed(KEYSC_M) = 0;
DebugActorFreeze++;
if (DebugActorFreeze > 2)
DebugActorFreeze = 0;
if (DebugActorFreeze == 2)
{
short i, nexti;
TRAVERSE_SPRITE_STAT(headspritestat[STAT_ENEMY], i, nexti)
{
SET(sprite[i].cstat, CSTAT_SPRITE_INVISIBLE);
if (TEST(sprite[i].cstat, CSTAT_SPRITE_BLOCK))
{
SET(sprite[i].extra, SPRX_BLOCK);
RESET(sprite[i].cstat, CSTAT_SPRITE_BLOCK);
}
}
}
if (DebugActorFreeze == 0)
{
short i, nexti;
TRAVERSE_SPRITE_STAT(headspritestat[STAT_ENEMY], i, nexti)
{
RESET(sprite[i].cstat, CSTAT_SPRITE_INVISIBLE);
if (TEST(sprite[i].extra, SPRX_BLOCK))
SET(sprite[i].cstat, CSTAT_SPRITE_BLOCK);
}
}
}
// Insert a player
if (KB_KeyPressed(KEYSC_INS))
// player
{
KB_KeyPressed(KEYSC_INS) = 0;
ManualPlayerInsert(pp);
// comes back looking through screenpeek
InitPlayerSprite(Player + screenpeek);
PlayerDeathReset(Player + screenpeek);
SetFragBar(pp);
}
// Delete a player
if (KB_KeyPressed(KEYSC_DEL))
{
KB_KeyPressed(KEYSC_DEL) = 0;
ManualPlayerDelete(pp);
}
// Move control to numbered player
if ((kp = KeyPressedRange(&KB_KeyPressed(KEYSC_1), &KB_KeyPressed(KEYSC_9))) && numplayers > 1)
{
short save_myconnectindex;
save_myconnectindex = myconnectindex;
myconnectindex = (intptr_t)kp - (intptr_t)(&KB_KeyPressed(KEYSC_1));
if (myconnectindex >= numplayers)
myconnectindex = save_myconnectindex;
screenpeek = myconnectindex;
DoPlayerDivePalette(pp);
// Now check for item or pain palette stuff
// This sets the palette to whatever it is of the player you
// just chose to view the game through.
// printf("SingPlayInput ALT+1-9 set_pal: pp->PlayerSprite = %d\n",pp->PlayerSprite);
//COVERsetbrightness(0,(char *)palette_data); // JBF: figure out what's going on here
DoPlayerNightVisionPalette(pp);
ResetKeyRange(&KB_KeyPressed(KEYSC_1), &KB_KeyPressed(KEYSC_9));
}
#if 0
if (KB_KeyPressed(KEYSC_T))
{
KB_KeyPressed(KEYSC_T) = 0;
PlayerTrackingMode ^= 1;
}
#endif
if (KB_KeyPressed(KEYSC_H))
{
short pnum;
KB_KeyPressed(KEYSC_H) = 0;
TRAVERSE_CONNECT(pnum)
{
User[Player[pnum].PlayerSprite]->Health = 100;
}
}
}
void
@ -4391,7 +4283,7 @@ FunctionKeys(PLAYERp pp)
if (KB_KeyPressed(sc_F9)) { fn_key = 9; }
if (KB_KeyPressed(sc_F10)) { fn_key = 10; }
if (KB_KeyPressed(KEYSC_ALT) || KB_KeyPressed(KEYSC_RALT))
if (inputState.AltPressed())
{
if (rts_delay > 16 && fn_key && CommEnabled && !adult_lockout && !Global_PLock)
{
@ -4403,7 +4295,6 @@ FunctionKeys(PLAYERp pp)
if (CommEnabled)
{
short pnum;
PACKET_RTS p;
p.PacketType = PACKET_TYPE_RTS;
@ -4416,7 +4307,7 @@ FunctionKeys(PLAYERp pp)
return;
}
if (KB_KeyPressed(KEYSC_LSHIFT) || KB_KeyPressed(KEYSC_RSHIFT))
if (inputState.ShiftPressed())
{
if (fn_key && CommEnabled)
{

View file

@ -498,8 +498,6 @@ int StdRandomRange(int range);
// just determine if the player is moving
#define PLAYER_MOVING(pp) ((pp)->xvect|(pp)->yvect)
#define KEY_EXT(scan) (KB_KeyPressed(scan) | KB_KeyPressed(scan+128))
#define TEST_GOTSECTOR(sect_num) (TEST(gotsector[(sect_num) >> 3], 1 << ((sect_num) & 7)))
#define RESET_GOTSECTOR(sect_num) (RESET(gotsector[(sect_num) >> 3], 1 << ((sect_num) & 7)))
#define SET_GOTSECTOR(sect_num) (SET(gotsector[(sect_num) >> 3], 1 << ((sect_num) & 7)))