Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Jisk/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
117 results
Select Git revision
Show changes
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
#include "md5.h" #include "md5.h"
#include "m_perfstats.h" #include "m_perfstats.h"
// aaaaaa
#include "i_joy.h"
#ifndef NONET #ifndef NONET
// cl loading screen // cl loading screen
#include "v_video.h" #include "v_video.h"
...@@ -650,6 +653,22 @@ static UINT8 Snake_GetOppositeDir(UINT8 dir) ...@@ -650,6 +653,22 @@ static UINT8 Snake_GetOppositeDir(UINT8 dir)
return 12 + 5 - dir; return 12 + 5 - dir;
} }
event_t *snakejoyevents[MAXEVENTS];
UINT16 joyeventcount = 0;
// I'm screaming the hack is clean - ashi
static boolean Snake_Joy_Grabber(event_t *ev)
{
if (ev->type == ev_joystick && ev->key == 0)
{
snakejoyevents[joyeventcount] = ev;
joyeventcount++;
return true;
}
else
return false;
}
static void Snake_FindFreeSlot(UINT8 *freex, UINT8 *freey, UINT8 headx, UINT8 heady) static void Snake_FindFreeSlot(UINT8 *freex, UINT8 *freey, UINT8 headx, UINT8 heady)
{ {
UINT8 x, y; UINT8 x, y;
...@@ -676,6 +695,9 @@ static void Snake_Handle(void) ...@@ -676,6 +695,9 @@ static void Snake_Handle(void)
UINT8 x, y; UINT8 x, y;
UINT8 oldx, oldy; UINT8 oldx, oldy;
UINT16 i; UINT16 i;
UINT16 j;
UINT16 joystate = 0;
static INT32 pjoyx = 0, pjoyy = 0;
// Handle retry // Handle retry
if (snake->gameover && (PLAYER1INPUTDOWN(GC_JUMP) || gamekeydown[KEY_ENTER])) if (snake->gameover && (PLAYER1INPUTDOWN(GC_JUMP) || gamekeydown[KEY_ENTER]))
...@@ -704,23 +726,58 @@ static void Snake_Handle(void) ...@@ -704,23 +726,58 @@ static void Snake_Handle(void)
oldx = snake->snakex[1]; oldx = snake->snakex[1];
oldy = snake->snakey[1]; oldy = snake->snakey[1];
// process the input events in here dear lord
for (j = 0; j < joyeventcount; j++)
{
event_t *ev = snakejoyevents[j];
const INT32 jdeadzone = (JOYAXISRANGE * cv_digitaldeadzone.value) / FRACUNIT;
if (ev->y != INT32_MAX)
{
if (Joystick.bGamepadStyle || abs(ev->y) > jdeadzone)
{
if (ev->y < 0 && pjoyy >= 0)
joystate = 1;
else if (ev->y > 0 && pjoyy <= 0)
joystate = 2;
pjoyy = ev->y;
}
else
pjoyy = 0;
}
if (ev->x != INT32_MAX)
{
if (Joystick.bGamepadStyle || abs(ev->x) > jdeadzone)
{
if (ev->x < 0 && pjoyx >= 0)
joystate = 3;
else if (ev->x > 0 && pjoyx <= 0)
joystate = 4;
pjoyx = ev->x;
}
else
pjoyx = 0;
}
}
joyeventcount = 0;
// Update direction // Update direction
if (gamekeydown[KEY_LEFTARROW]) if (PLAYER1INPUTDOWN(GC_STRAFELEFT) || gamekeydown[KEY_LEFTARROW] || joystate == 3)
{ {
if (snake->snakelength < 2 || x <= oldx) if (snake->snakelength < 2 || x <= oldx)
snake->snakedir[0] = 1; snake->snakedir[0] = 1;
} }
else if (gamekeydown[KEY_RIGHTARROW]) else if (PLAYER1INPUTDOWN(GC_STRAFERIGHT) || gamekeydown[KEY_RIGHTARROW] || joystate == 4)
{ {
if (snake->snakelength < 2 || x >= oldx) if (snake->snakelength < 2 || x >= oldx)
snake->snakedir[0] = 2; snake->snakedir[0] = 2;
} }
else if (gamekeydown[KEY_UPARROW]) else if (PLAYER1INPUTDOWN(GC_FORWARD) || gamekeydown[KEY_UPARROW] || joystate == 1)
{ {
if (snake->snakelength < 2 || y <= oldy) if (snake->snakelength < 2 || y <= oldy)
snake->snakedir[0] = 3; snake->snakedir[0] = 3;
} }
else if (gamekeydown[KEY_DOWNARROW]) else if (PLAYER1INPUTDOWN(GC_BACKWARD) || gamekeydown[KEY_DOWNARROW] || joystate == 2)
{ {
if (snake->snakelength < 2 || y >= oldy) if (snake->snakelength < 2 || y >= oldy)
snake->snakedir[0] = 4; snake->snakedir[0] = 4;
...@@ -1934,7 +1991,7 @@ static void M_ConfirmConnect(event_t *ev) ...@@ -1934,7 +1991,7 @@ static void M_ConfirmConnect(event_t *ev)
#ifndef NONET #ifndef NONET
if (ev->type == ev_keydown) if (ev->type == ev_keydown)
{ {
if (ev->key == ' ' || ev->key == 'y' || ev->key == KEY_ENTER) if (ev->key == ' ' || ev->key == 'y' || ev->key == KEY_ENTER || ev->key == KEY_JOY1)
{ {
if (totalfilesrequestednum > 0) if (totalfilesrequestednum > 0)
{ {
...@@ -1949,7 +2006,7 @@ static void M_ConfirmConnect(event_t *ev) ...@@ -1949,7 +2006,7 @@ static void M_ConfirmConnect(event_t *ev)
M_ClearMenus(true); M_ClearMenus(true);
} }
else if (ev->key == 'n' || ev->key == KEY_ESCAPE) else if (ev->key == 'n' || ev->key == KEY_ESCAPE || ev->key == KEY_JOY1 + 3)
{ {
cl_mode = CL_ABORTED; cl_mode = CL_ABORTED;
M_ClearMenus(true); M_ClearMenus(true);
...@@ -1964,6 +2021,7 @@ static boolean CL_FinishedFileList(void) ...@@ -1964,6 +2021,7 @@ static boolean CL_FinishedFileList(void)
{ {
INT32 i; INT32 i;
char *downloadsize = NULL; char *downloadsize = NULL;
//CONS_Printf(M_GetText("Checking files...\n")); //CONS_Printf(M_GetText("Checking files...\n"));
i = CL_CheckFiles(); i = CL_CheckFiles();
if (i == 4) // still checking ... if (i == 4) // still checking ...
...@@ -2379,8 +2437,12 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic ...@@ -2379,8 +2437,12 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
D_ProcessEvents(); //needed for menu system to receive inputs D_ProcessEvents(); //needed for menu system to receive inputs
else else
{ {
// my hand has been forced and I am dearly sorry for this awful hack :vomit:
for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1)) for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1))
G_MapEventsToControls(&events[eventtail]); {
if (!Snake_Joy_Grabber(&events[eventtail]))
G_MapEventsToControls(&events[eventtail]);
}
} }
if (gamekeydown[KEY_ESCAPE] || gamekeydown[KEY_JOY1+1] || cl_mode == CL_ABORTED) if (gamekeydown[KEY_ESCAPE] || gamekeydown[KEY_JOY1+1] || cl_mode == CL_ABORTED)
......
...@@ -447,7 +447,7 @@ int LUA_CheckGlobals(lua_State *L, const char *word) ...@@ -447,7 +447,7 @@ int LUA_CheckGlobals(lua_State *L, const char *word)
if (strlen(str) < strlength) if (strlen(str) < strlength)
return luaL_error(L, "string must not contain embedded zeros!"); return luaL_error(L, "string must not contain embedded zeros!");
strncpy(mapmusname, str, strlength); strlcpy(mapmusname, str, sizeof mapmusname);
} }
else if (fastcmp(word, "mapmusflags")) else if (fastcmp(word, "mapmusflags"))
mapmusflags = (UINT16)luaL_checkinteger(L, 2); mapmusflags = (UINT16)luaL_checkinteger(L, 2);
......
...@@ -1405,6 +1405,9 @@ void A_StatueBurst(mobj_t *actor) ...@@ -1405,6 +1405,9 @@ void A_StatueBurst(mobj_t *actor)
if (LUA_CallAction(A_STATUEBURST, actor)) if (LUA_CallAction(A_STATUEBURST, actor))
return; return;
// make statue intangible upon spawning so you can't stand above the created object for 40 tics
actor->flags &= ~MF_SOLID;
if (!locvar1 || !(new = P_SpawnMobjFromMobj(actor, 0, 0, 0, locvar1))) if (!locvar1 || !(new = P_SpawnMobjFromMobj(actor, 0, 0, 0, locvar1)))
return; return;
......