Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
SRB2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
262
Issues
262
List
Board
Labels
Milestones
Merge Requests
67
Merge Requests
67
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
STJr
SRB2
Commits
d0abd6e8
Commit
d0abd6e8
authored
May 18, 2020
by
LJ Sonic
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'next' of
https://git.magicalgirl.moe/STJr/SRB2.git
into slope-cleanup
# Conflicts: # src/hardware/hw_main.c # src/p_spec.c
parents
a06c4a8c
4cd5d760
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
104 changed files
with
1382 additions
and
841 deletions
+1382
-841
CMakeLists.txt
CMakeLists.txt
+1
-1
appveyor.yml
appveyor.yml
+1
-1
SRB2-22.cfg
extras/conf/SRB2-22.cfg
+0
-0
CMakeLists.txt
src/CMakeLists.txt
+2
-0
Makefile
src/Makefile
+1
-0
i_video.c
src/android/i_video.c
+4
-6
b_bot.c
src/b_bot.c
+13
-0
command.c
src/command.c
+1
-1
config.h.in
src/config.h.in
+4
-2
console.c
src/console.c
+47
-13
d_clisrv.c
src/d_clisrv.c
+27
-4
d_clisrv.h
src/d_clisrv.h
+4
-7
d_main.c
src/d_main.c
+53
-10
d_net.c
src/d_net.c
+1
-0
d_netcmd.c
src/d_netcmd.c
+5
-3
d_player.h
src/d_player.h
+6
-1
dehacked.c
src/dehacked.c
+56
-6
i_video.c
src/djgppdos/i_video.c
+1
-4
vid_vesa.c
src/djgppdos/vid_vesa.c
+2
-4
doomdef.h
src/doomdef.h
+8
-8
doomstat.h
src/doomstat.h
+6
-1
i_video.c
src/dummy/i_video.c
+4
-6
f_finale.c
src/f_finale.c
+4
-2
g_demo.c
src/g_demo.c
+0
-0
g_demo.h
src/g_demo.h
+86
-0
g_game.c
src/g_game.c
+0
-0
g_game.h
src/g_game.h
+1
-64
hw_bsp.c
src/hardware/hw_bsp.c
+0
-2
hw_draw.c
src/hardware/hw_draw.c
+2
-2
hw_light.c
src/hardware/hw_light.c
+2
-0
hw_main.c
src/hardware/hw_main.c
+0
-0
hw_md2.c
src/hardware/hw_md2.c
+6
-3
hu_stuff.c
src/hu_stuff.c
+2
-2
hu_stuff.h
src/hu_stuff.h
+1
-1
i_tcp.c
src/i_tcp.c
+6
-3
i_video.h
src/i_video.h
+11
-7
info.c
src/info.c
+20
-10
info.h
src/info.h
+12
-0
lua_baselib.c
src/lua_baselib.c
+24
-3
lua_blockmaplib.c
src/lua_blockmaplib.c
+0
-4
lua_consolelib.c
src/lua_consolelib.c
+2
-16
lua_hook.h
src/lua_hook.h
+2
-0
lua_hooklib.c
src/lua_hooklib.c
+55
-23
lua_hudlib.c
src/lua_hudlib.c
+3
-3
lua_infolib.c
src/lua_infolib.c
+0
-4
lua_maplib.c
src/lua_maplib.c
+6
-0
lua_script.c
src/lua_script.c
+81
-29
lua_script.h
src/lua_script.h
+1
-0
m_anigif.c
src/m_anigif.c
+31
-26
m_argv.c
src/m_argv.c
+19
-0
m_argv.h
src/m_argv.h
+3
-0
m_cheat.c
src/m_cheat.c
+6
-0
m_fixed.h
src/m_fixed.h
+14
-2
m_menu.c
src/m_menu.c
+0
-0
m_menu.h
src/m_menu.h
+7
-1
mserv.h
src/mserv.h
+1
-1
p_ceilng.c
src/p_ceilng.c
+8
-12
p_enemy.c
src/p_enemy.c
+146
-8
p_floor.c
src/p_floor.c
+0
-0
p_inter.c
src/p_inter.c
+5
-2
p_map.c
src/p_map.c
+3
-9
p_maputl.c
src/p_maputl.c
+72
-78
p_mobj.c
src/p_mobj.c
+16
-14
p_mobj.h
src/p_mobj.h
+3
-0
p_polyobj.c
src/p_polyobj.c
+0
-0
p_polyobj.h
src/p_polyobj.h
+16
-14
p_saveg.c
src/p_saveg.c
+0
-0
p_setup.c
src/p_setup.c
+26
-48
p_sight.c
src/p_sight.c
+2
-13
p_slopes.c
src/p_slopes.c
+1
-1
p_spec.c
src/p_spec.c
+0
-0
p_spec.h
src/p_spec.h
+136
-27
p_user.c
src/p_user.c
+53
-54
r_bsp.c
src/r_bsp.c
+14
-46
r_bsp.h
src/r_bsp.h
+0
-2
r_data.c
src/r_data.c
+6
-14
r_defs.h
src/r_defs.h
+12
-17
r_draw.c
src/r_draw.c
+5
-5
r_main.c
src/r_main.c
+1
-1
r_patch.c
src/r_patch.c
+10
-4
r_plane.c
src/r_plane.c
+78
-94
r_plane.h
src/r_plane.h
+1
-9
r_segs.c
src/r_segs.c
+0
-0
r_skins.c
src/r_skins.c
+1
-0
r_things.c
src/r_things.c
+50
-61
r_things.h
src/r_things.h
+2
-1
s_sound.c
src/s_sound.c
+22
-1
s_sound.h
src/s_sound.h
+7
-6
screen.c
src/screen.c
+15
-6
Srb2SDL-vc10.vcxproj
src/sdl/Srb2SDL-vc10.vcxproj
+2
-0
Srb2SDL-vc10.vcxproj.filters
src/sdl/Srb2SDL-vc10.vcxproj.filters
+6
-0
i_main.c
src/sdl/i_main.c
+5
-5
i_system.c
src/sdl/i_system.c
+3
-3
i_video.c
src/sdl/i_video.c
+0
-0
project.pbxproj
src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj
+0
-0
sounds.c
src/sounds.c
+0
-0
st_stuff.c
src/st_stuff.c
+0
-0
v_video.c
src/v_video.c
+0
-0
v_video.h
src/v_video.h
+0
-0
w_wad.c
src/w_wad.c
+0
-0
w_wad.h
src/w_wad.h
+0
-0
win_sys.c
src/win32/win_sys.c
+0
-0
win_vid.c
src/win32/win_vid.c
+0
-0
y_inter.c
src/y_inter.c
+0
-0
No files found.
CMakeLists.txt
View file @
d0abd6e8
...
...
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string.
# Version change is fine.
project
(
SRB2
VERSION 2.2.
2
VERSION 2.2.
4
LANGUAGES C
)
if
(
${
PROJECT_SOURCE_DIR
}
MATCHES
${
PROJECT_BINARY_DIR
}
)
...
...
appveyor.yml
View file @
d0abd6e8
version
:
2.2.
2
.{branch}-{build}
version
:
2.2.
4
.{branch}-{build}
os
:
MinGW
environment
:
...
...
extras/conf/SRB2-22.cfg
View file @
d0abd6e8
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
View file @
d0abd6e8
...
...
@@ -16,6 +16,7 @@ set(SRB2_CORE_SOURCES
f_finale.c
f_wipe.c
filesrch.c
g_demo.c
g_game.c
g_input.c
hu_stuff.c
...
...
@@ -71,6 +72,7 @@ set(SRB2_CORE_HEADERS
f_finale.h
fastcmp.h
filesrch.h
g_demo.h
g_game.h
g_input.h
g_state.h
...
...
src/Makefile
View file @
d0abd6e8
...
...
@@ -422,6 +422,7 @@ OBJS:=$(i_main_o) \
$(OBJDIR)
/z_zone.o
\
$(OBJDIR)
/f_finale.o
\
$(OBJDIR)
/f_wipe.o
\
$(OBJDIR)
/g_demo.o
\
$(OBJDIR)
/g_game.o
\
$(OBJDIR)
/g_input.o
\
$(OBJDIR)
/am_map.o
\
...
...
src/android/i_video.c
View file @
d0abd6e8
...
...
@@ -19,10 +19,10 @@ boolean allow_fullscreen = false;
consvar_t
cv_vidwait
=
{
"vid_wait"
,
"On"
,
CV_SAVE
,
CV_OnOff
,
NULL
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
};
void
I_StartupGraphics
(
void
){}
void
I_StartupHardwareGraphics
(
void
){}
void
I_ShutdownGraphics
(
void
){}
void
VID_StartupOpenGL
(
void
){}
void
I_SetPalette
(
RGBA_t
*
palette
)
{
(
void
)
palette
;
...
...
@@ -52,10 +52,8 @@ INT32 VID_SetMode(INT32 modenum)
return
0
;
}
void
VID_CheckRenderer
(
void
)
{
// ..............
}
void
VID_CheckRenderer
(
void
)
{}
void
VID_CheckGLLoaded
(
rendermode_t
oldrender
)
{}
const
char
*
VID_GetModeName
(
INT32
modenum
)
{
...
...
src/b_bot.c
View file @
d0abd6e8
...
...
@@ -459,6 +459,19 @@ boolean B_CheckRespawn(player_t *player)
if
(
!
sonic
||
sonic
->
health
<=
0
)
return
false
;
// B_RespawnBot doesn't do anything if the condition above this isn't met
{
UINT8
shouldForce
=
LUAh_BotRespawn
(
sonic
,
tails
);
if
(
P_MobjWasRemoved
(
sonic
)
||
P_MobjWasRemoved
(
tails
))
return
(
shouldForce
==
1
);
// mobj was removed
if
(
shouldForce
==
1
)
return
true
;
else
if
(
shouldForce
==
2
)
return
false
;
}
// Check if Sonic is busy first.
// If he's doing any of these things, he probably doesn't want to see us.
if
(
sonic
->
player
->
pflags
&
(
PF_GLIDING
|
PF_SLIDING
|
PF_BOUNCING
)
...
...
src/command.c
View file @
d0abd6e8
...
...
@@ -80,7 +80,7 @@ static boolean joyaxis2_default = false;
static
INT32
joyaxis_count
=
0
;
static
INT32
joyaxis2_count
=
0
;
#define COM_BUF_SIZE
8192
// command buffer size
#define COM_BUF_SIZE
(32<<10)
// command buffer size
#define MAX_ALIAS_RECURSION 100 // max recursion allowed for aliases
static
INT32
com_wait
;
// one command per frame (for cmd sequences)
...
...
src/config.h.in
View file @
d0abd6e8
...
...
@@ -28,12 +28,14 @@
/* Manually defined asset hashes for non-CMake builds
* Last updated 2020 / 02 / 15 - v2.2.1 - main assets
* Last updated 2020 / 02 / 22 - v2.2.2 - patch.pk3
* Last updated 2020 / 05 / 10 - v2.2.3 - player.dta & patch.pk3
* Last updated 2020 / 05 / 11 - v2.2.4 - patch.pk3
*/
#define ASSET_HASH_SRB2_PK3 "0277c9416756627004e83cbb5b2e3e28"
#define ASSET_HASH_ZONES_PK3 "f7e88afb6af7996a834c7d663144bead"
#define ASSET_HASH_PLAYER_DTA "
ad49e07b17cc662f1ad70c454910b4ae
"
#define ASSET_HASH_PLAYER_DTA "
8a4507ddf9bc0682c09174400f26ad65
"
#ifdef USE_PATCH_DTA
#define ASSET_HASH_PATCH_PK3 "
ee54330ecb743314c5f962af4db731ff
"
#define ASSET_HASH_PATCH_PK3 "
bbbf6af3b20349612ee06e0b55979a76
"
#endif
#endif
...
...
src/console.c
View file @
d0abd6e8
...
...
@@ -97,6 +97,7 @@ static void CON_InputInit(void);
static
void
CON_RecalcSize
(
void
);
static
void
CON_ChangeHeight
(
void
);
static
void
CON_DrawBackpic
(
void
);
static
void
CONS_hudlines_Change
(
void
);
static
void
CONS_backcolor_Change
(
void
);
...
...
@@ -1530,6 +1531,51 @@ static void CON_DrawHudlines(void)
con_clearlines
=
y
;
// this is handled by HU_Erase();
}
// Lactozilla: Draws the console's background picture.
static
void
CON_DrawBackpic
(
void
)
{
patch_t
*
con_backpic
;
lumpnum_t
piclump
;
int
x
,
w
,
h
;
// Get the lumpnum for CONSBACK, or fallback into MISSING.
piclump
=
W_CheckNumForName
(
"CONSBACK"
);
if
(
piclump
==
LUMPERROR
)
piclump
=
W_GetNumForName
(
"MISSING"
);
// Cache the Software patch.
con_backpic
=
W_CacheSoftwarePatchNum
(
piclump
,
PU_PATCH
);
// Center the backpic, and draw a vertically cropped patch.
w
=
(
con_backpic
->
width
*
vid
.
dupx
);
x
=
(
vid
.
width
/
2
)
-
(
w
/
2
);
h
=
con_curlines
/
vid
.
dupy
;
// If the patch doesn't fill the entire screen,
// then fill the sides with a solid color.
if
(
x
>
0
)
{
column_t
*
column
=
(
column_t
*
)((
UINT8
*
)(
con_backpic
)
+
LONG
(
con_backpic
->
columnofs
[
0
]));
if
(
!
column
->
topdelta
)
{
UINT8
*
source
=
(
UINT8
*
)(
column
)
+
3
;
INT32
color
=
(
source
[
0
]
|
V_NOSCALESTART
);
// left side
V_DrawFill
(
0
,
0
,
x
,
con_curlines
,
color
);
// right side
V_DrawFill
((
x
+
w
),
0
,
(
vid
.
width
-
w
),
con_curlines
,
color
);
}
}
// Cache the patch normally.
con_backpic
=
W_CachePatchNum
(
piclump
,
PU_PATCH
);
V_DrawCroppedPatch
(
x
<<
FRACBITS
,
0
,
FRACUNIT
,
V_NOSCALESTART
,
con_backpic
,
0
,
(
BASEVIDHEIGHT
-
h
),
BASEVIDWIDTH
,
h
);
// Unlock the cached patch.
W_UnlockCachedPatch
(
con_backpic
);
}
// draw the console background, text, and prompt if enough place
//
static
void
CON_DrawConsole
(
void
)
...
...
@@ -1551,19 +1597,7 @@ static void CON_DrawConsole(void)
// draw console background
if
(
cons_backpic
.
value
||
con_forcepic
)
{
patch_t
*
con_backpic
=
W_CachePatchName
(
"CONSBACK"
,
PU_PATCH
);
int
h
;
h
=
con_curlines
/
vid
.
dupy
;
// Jimita: CON_DrawBackpic just called V_DrawScaledPatch
//V_DrawScaledPatch(0, 0, 0, con_backpic);
V_DrawCroppedPatch
(
0
,
0
,
FRACUNIT
,
0
,
con_backpic
,
0
,
(
BASEVIDHEIGHT
-
h
),
BASEVIDWIDTH
,
h
);
W_UnlockCachedPatch
(
con_backpic
);
}
CON_DrawBackpic
();
else
{
// inu: no more width (was always 0 and vid.width)
...
...
src/d_clisrv.c
View file @
d0abd6e8
...
...
@@ -85,6 +85,10 @@ tic_t jointimeout = (10*TICRATE);
static
boolean
sendingsavegame
[
MAXNETNODES
];
// Are we sending the savegame?
static
tic_t
freezetimeout
[
MAXNETNODES
];
// Until when can this node freeze the server before getting a timeout?
// Incremented by cv_joindelay when a client joins, decremented each tic.
// If higher than cv_joindelay * 2 (3 joins in a short timespan), joins are temporarily disabled.
static
tic_t
joindelay
=
0
;
UINT16
pingmeasurecount
=
1
;
UINT32
realpingtable
[
MAXPLAYERS
];
//the base table of ping where an average will be sent to everyone.
UINT32
playerpingtable
[
MAXPLAYERS
];
//table of player latency values.
...
...
@@ -1338,7 +1342,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
netbuffer
->
u
.
serverinfo
.
numberofplayer
=
(
UINT8
)
D_NumPlayers
();
netbuffer
->
u
.
serverinfo
.
maxplayer
=
(
UINT8
)
cv_maxplayers
.
value
;
if
(
FindRejoinerNum
(
node
)
!=
-
1
)
if
(
!
node
||
FindRejoinerNum
(
node
)
!=
-
1
)
netbuffer
->
u
.
serverinfo
.
refusereason
=
0
;
else
if
(
!
cv_allownewplayer
.
value
)
netbuffer
->
u
.
serverinfo
.
refusereason
=
1
;
...
...
@@ -1686,7 +1690,7 @@ static void CL_LoadReceivedSavegame(void)
// load a base level
if
(
P_LoadNetGame
())
{
const
INT32
actnum
=
mapheaderinfo
[
gamemap
-
1
]
->
actnum
;
const
UINT8
actnum
=
mapheaderinfo
[
gamemap
-
1
]
->
actnum
;
CONS_Printf
(
M_GetText
(
"Map is now
\"
%s"
),
G_BuildMapName
(
gamemap
));
if
(
strcmp
(
mapheaderinfo
[
gamemap
-
1
]
->
lvlttl
,
""
))
{
...
...
@@ -3077,6 +3081,8 @@ consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0,
consvar_t
cv_joinnextround
=
{
"joinnextround"
,
"Off"
,
CV_NETVAR
,
CV_OnOff
,
NULL
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
};
/// \todo not done
static
CV_PossibleValue_t
maxplayers_cons_t
[]
=
{{
2
,
"MIN"
},
{
32
,
"MAX"
},
{
0
,
NULL
}};
consvar_t
cv_maxplayers
=
{
"maxplayers"
,
"8"
,
CV_SAVE
,
maxplayers_cons_t
,
NULL
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
};
static
CV_PossibleValue_t
joindelay_cons_t
[]
=
{{
1
,
"MIN"
},
{
3600
,
"MAX"
},
{
0
,
"Off"
},
{
0
,
NULL
}};
consvar_t
cv_joindelay
=
{
"joindelay"
,
"10"
,
CV_SAVE
,
joindelay_cons_t
,
NULL
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
};
static
CV_PossibleValue_t
rejointimeout_cons_t
[]
=
{{
1
,
"MIN"
},
{
60
*
FRACUNIT
,
"MAX"
},
{
0
,
"Off"
},
{
0
,
NULL
}};
consvar_t
cv_rejointimeout
=
{
"rejointimeout"
,
"Off"
,
CV_SAVE
|
CV_FLOAT
,
rejointimeout_cons_t
,
NULL
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
};
...
...
@@ -3164,6 +3170,8 @@ void SV_ResetServer(void)
neededtic
=
maketic
;
tictoclear
=
maketic
;
joindelay
=
0
;
for
(
i
=
0
;
i
<
MAXNETNODES
;
i
++
)
ResetNode
(
i
);
...
...
@@ -3613,6 +3621,9 @@ static void HandleConnect(SINT8 node)
SV_SendRefuse
(
node
,
M_GetText
(
"No players from
\n
this node."
));
else
if
(
luafiletransfers
)
SV_SendRefuse
(
node
,
M_GetText
(
"The server is broadcasting a file
\n
requested by a Lua script.
\n
Please wait a bit and then
\n
try rejoining."
));
else
if
(
netgame
&&
joindelay
>
2
*
(
tic_t
)
cv_joindelay
.
value
*
TICRATE
)
SV_SendRefuse
(
node
,
va
(
M_GetText
(
"Too many people are connecting.
\n
Please wait %d seconds and then
\n
try rejoining."
),
(
joindelay
-
2
*
cv_joindelay
.
value
*
TICRATE
)
/
TICRATE
));
else
{
#ifndef NONET
...
...
@@ -3670,6 +3681,7 @@ static void HandleConnect(SINT8 node)
DEBFILE
(
"send savegame
\n
"
);
}
SV_AddWaitingPlayers
(
names
[
0
],
names
[
1
]);
joindelay
+=
cv_joindelay
.
value
*
TICRATE
;
player_joining
=
true
;
}
#else
...
...
@@ -4875,7 +4887,8 @@ static inline void PingUpdate(void)
{
for
(
i
=
1
;
i
<
MAXPLAYERS
;
i
++
)
{
if
(
playeringame
[
i
]
&&
(
realpingtable
[
i
]
/
pingmeasurecount
>
(
unsigned
)
cv_maxping
.
value
))
if
(
playeringame
[
i
]
&&
!
players
[
i
].
quittime
&&
(
realpingtable
[
i
]
/
pingmeasurecount
>
(
unsigned
)
cv_maxping
.
value
))
{
if
(
players
[
i
].
jointime
>
30
*
TICRATE
)
laggers
[
i
]
=
true
;
...
...
@@ -4894,8 +4907,8 @@ static inline void PingUpdate(void)
if
(
playeringame
[
i
]
&&
laggers
[
i
])
{
pingtimeout
[
i
]
++
;
// ok your net has been bad for too long, you deserve to die.
if
(
pingtimeout
[
i
]
>
cv_pingtimeout
.
value
)
// ok your net has been bad for too long, you deserve to die.
{
pingtimeout
[
i
]
=
0
;
SendKick
(
i
,
KICK_MSG_PING_HIGH
|
KICK_MSG_KEEP_BODY
);
...
...
@@ -5037,12 +5050,21 @@ void NetUpdate(void)
hu_resynching
=
true
;
}
}
Net_AckTicker
();
// Handle timeouts to prevent definitive freezes from happenning
if
(
server
)
{
for
(
i
=
1
;
i
<
MAXNETNODES
;
i
++
)
if
(
nodeingame
[
i
]
&&
freezetimeout
[
i
]
<
I_GetTime
())
Net_ConnectionTimeout
(
i
);
// In case the cvar value was lowered
if
(
joindelay
)
joindelay
=
min
(
joindelay
-
1
,
3
*
(
tic_t
)
cv_joindelay
.
value
*
TICRATE
);
}
nowtime
/=
NEWTICRATERATIO
;
if
(
nowtime
>
resptime
)
{
...
...
@@ -5050,6 +5072,7 @@ void NetUpdate(void)
M_Ticker
();
CON_Ticker
();
}
SV_FileSendTicker
();
}
...
...
src/d_clisrv.h
View file @
d0abd6e8
...
...
@@ -20,12 +20,9 @@
#include "d_player.h"
/*
The 'packet version' may be used with packets whose
format is expected to change between versions.
This version is independent of the mod name, and standard
version and subversion. It should only account for the
basic fields of the packet, and change infrequently.
The 'packet version' is used to distinguish packet formats.
This version is independent of VERSION and SUBVERSION. Different
applications may follow different packet versions.
*/
#define PACKETVERSION 3
...
...
@@ -518,7 +515,7 @@ extern UINT32 realpingtable[MAXPLAYERS];
extern
UINT32
playerpingtable
[
MAXPLAYERS
];
extern
tic_t
servermaxping
;
extern
consvar_t
cv_allownewplayer
,
cv_joinnextround
,
cv_maxplayers
,
cv_rejointimeout
;
extern
consvar_t
cv_allownewplayer
,
cv_joinnextround
,
cv_maxplayers
,
cv_
joindelay
,
cv_
rejointimeout
;
extern
consvar_t
cv_resynchattempts
,
cv_blamecfail
;
extern
consvar_t
cv_maxsend
,
cv_noticedownload
,
cv_downloadspeed
;
...
...
src/d_main.c
View file @
d0abd6e8
...
...
@@ -125,6 +125,8 @@ boolean advancedemo;
INT32
debugload
=
0
;
#endif
char
savegamename
[
256
];
char
srb2home
[
256
]
=
"."
;
char
srb2path
[
256
]
=
"."
;
boolean
usehome
=
true
;
...
...
@@ -310,7 +312,9 @@ static void D_Display(void)
F_WipeStartScreen
();
// Check for Mega Genesis fade
wipestyleflags
=
WSF_FADEOUT
;
if
(
F_TryColormapFade
(
31
))
if
(
wipegamestate
==
(
gamestate_t
)
FORCEWIPE
)
F_WipeColorFill
(
31
);
else
if
(
F_TryColormapFade
(
31
))
wipetypepost
=
-
1
;
// Don't run the fade below this one
F_WipeEndScreen
();
F_RunWipe
(
wipetypepre
,
gamestate
!=
GS_TIMEATTACK
&&
gamestate
!=
GS_TITLESCREEN
);
...
...
@@ -876,6 +880,40 @@ static inline void D_CleanFile(void)
}
}
///\brief Checks if a netgame URL is being handled, and changes working directory to the EXE's if so.
/// Done because browsers (at least, Firefox on Windows) launch the game from the browser's directory, which causes problems.
static
void
ChangeDirForUrlHandler
(
void
)
{
// URL handlers are opened by web browsers (at least Firefox) from the browser's working directory, not the game's stored directory,
// so chdir to that directory unless overridden.
if
(
M_GetUrlProtocolArg
()
!=
NULL
&&
!
M_CheckParm
(
"-nochdir"
))
{
size_t
i
;
CONS_Printf
(
"%s connect links load game files from the SRB2 application's stored directory. Switching to "
,
SERVER_URL_PROTOCOL
);
strlcpy
(
srb2path
,
myargv
[
0
],
sizeof
(
srb2path
));
// Get just the directory, minus the EXE name
for
(
i
=
strlen
(
srb2path
)
-
1
;
i
>
0
;
i
--
)
{
if
(
srb2path
[
i
]
==
'/'
||
srb2path
[
i
]
==
'\\'
)
{
srb2path
[
i
]
=
'\0'
;
break
;
}
}
CONS_Printf
(
"%s
\n
"
,
srb2path
);
#if defined (_WIN32)
SetCurrentDirectoryA
(
srb2path
);
#else
if
(
chdir
(
srb2path
)
==
-
1
)
I_OutputMsg
(
"Couldn't change working directory
\n
"
);
#endif
}
}
// ==========================================================================
// Identify the SRB2 version, and IWAD file to use.
// ==========================================================================
...
...
@@ -957,6 +995,7 @@ static void IdentifyVersion(void)
}
MUSICTEST
(
"music.dta"
)
MUSICTEST
(
"patch_music.pk3"
)
#ifdef DEVELOP // remove when music_new.dta is merged into music.dta
MUSICTEST
(
"music_new.dta"
)
#endif
...
...
@@ -1064,6 +1103,9 @@ void D_SRB2Main(void)
// Test Dehacked lists
DEH_Check
();
// Netgame URL special case: change working dir to EXE folder.
ChangeDirForUrlHandler
();
// identify the main IWAD file to use
IdentifyVersion
();
...
...
@@ -1149,9 +1191,15 @@ void D_SRB2Main(void)
if
(
M_CheckParm
(
"-password"
)
&&
M_IsNextParm
())
D_SetPassword
(
M_GetNextParm
());
CONS_Printf
(
"Z_Init(): Init zone memory allocation daemon.
\n
"
);
Z_Init
();
// Do this up here so that WADs loaded through the command line can use ExecCfg
COM_Init
();
// add any files specified on the command line with -file wadfile
// to the wad list
if
(
!
(
M_CheckParm
(
"-connect"
)
&&
!
M_CheckParm
(
"-server"
)))
if
(
!
(
(
M_GetUrlProtocolArg
()
||
M_CheckParm
(
"-connect"
)
)
&&
!
M_CheckParm
(
"-server"
)))
{
if
(
M_CheckParm
(
"-file"
))
{
...
...
@@ -1176,9 +1224,6 @@ void D_SRB2Main(void)
if
(
M_CheckParm
(
"-server"
)
||
dedicated
)
netgame
=
server
=
true
;
CONS_Printf
(
"Z_Init(): Init zone memory allocation daemon.
\n
"
);
Z_Init
();
// adapt tables to SRB2's needs, including extra slots for dehacked file support
P_PatchInfoTables
();
...
...
@@ -1186,7 +1231,7 @@ void D_SRB2Main(void)
M_InitMenuPresTables
();
// init title screen display params
if
(
M_CheckParm
(
"-connect"
))
if
(
M_
GetUrlProtocolArg
()
||
M_
CheckParm
(
"-connect"
))
F_InitMenuPresValues
();
//---------------------------------------------------- READY TIME
...
...
@@ -1250,7 +1295,6 @@ void D_SRB2Main(void)
CONS_Printf
(
"HU_Init(): Setting up heads up display.
\n
"
);
HU_Init
();
COM_Init
();
CON_Init
();
D_RegisterServerCommands
();
...
...
@@ -1284,11 +1328,10 @@ void D_SRB2Main(void)
// Set cv_renderer to the new render mode
VID_CheckRenderer
();
SCR_ChangeRendererCVars
(
setrenderneeded
);
SCR_ChangeRendererCVars
(
rendermode
);
// check the renderer's state
, and then clear setrenderneeded
// check the renderer's state
D_CheckRendererState
();
setrenderneeded
=
0
;
}
wipegamestate
=
gamestate
;
...
...
src/d_net.c
View file @
d0abd6e8
...
...
@@ -811,6 +811,7 @@ static const char *packettypename[NUMPACKETTYPE] =
"CLIENTJOIN"
,
"NODETIMEOUT"
,
"RESYNCHING"
,
"LOGIN"
,
"PING"
};
...
...
src/d_netcmd.c
View file @
d0abd6e8
...
...
@@ -573,6 +573,7 @@ void D_RegisterServerCommands(void)
// d_clisrv
CV_RegisterVar
(
&
cv_maxplayers
);
CV_RegisterVar
(
&
cv_joindelay
);
CV_RegisterVar
(
&
cv_rejointimeout
);
CV_RegisterVar
(
&
cv_resynchattempts
);
CV_RegisterVar
(
&
cv_maxsend
);
...
...
@@ -1252,7 +1253,7 @@ static void SendNameAndColor(void)
players
[
consoleplayer
].
skincolor
=
cv_playercolor
.
value
;
if
(
players
[
consoleplayer
].
mo
)
if
(
players
[
consoleplayer
].
mo
&&
!
players
[
consoleplayer
].
powers
[
pw_dye
]
)
players
[
consoleplayer
].
mo
->
color
=
players
[
consoleplayer
].
skincolor
;
if
(
metalrecording
)
...
...
@@ -1364,8 +1365,9 @@ static void SendNameAndColor2(void)
if
(
botingame
)
{
players
[
secondplaya
].
skincolor
=
botcolor
;
if
(
players
[
secondplaya
].
mo
)
if
(
players
[
secondplaya
].
mo
&&
!
players
[
secondplaya
].
powers
[
pw_dye
]
)
players
[
secondplaya
].
mo
->
color
=
players
[
secondplaya
].
skincolor
;
SetPlayerSkinByNum
(
secondplaya
,
botskin
-
1
);
return
;
}
...
...
@@ -1378,7 +1380,7 @@ static void SendNameAndColor2(void)
// don't use secondarydisplayplayer: the second player must be 1
players
[
secondplaya
].
skincolor
=
cv_playercolor2
.
value
;
if
(
players
[
secondplaya
].
mo
)
if
(
players
[
secondplaya
].
mo
&&
!
players
[
secondplaya
].
powers
[
pw_dye
]
)
players
[
secondplaya
].
mo
->
color
=
players
[
secondplaya
].
skincolor
;
if
(
cv_forceskin
.
value
>=
0
&&
(
netgame
||
multiplayer
))
// Server wants everyone to use the same player
...
...
src/d_player.h
View file @
d0abd6e8
...
...
@@ -48,6 +48,7 @@ typedef enum
SF_FASTEDGE
=
1
<<
12
,
// Faster edge teeter?
SF_MULTIABILITY
=
1
<<
13
,
// Revenge of Final Demo.
SF_NONIGHTSROTATION
=
1
<<
14
,
// Disable sprite rotation for NiGHTS
SF_NONIGHTSSUPER
=
1
<<
15
,
// Disable super colors for NiGHTS (if you have SF_SUPER)
// free up to and including 1<<31
}
skinflags_t
;
...
...
@@ -238,7 +239,8 @@ typedef enum
CR_MACESPIN
,
CR_MINECART
,
CR_ROLLOUT
,
CR_PTERABYTE
CR_PTERABYTE
,
CR_DUSTDEVIL
}
carrytype_t
;
// pw_carry
// Player powers. (don't edit this comment)
...
...
@@ -278,6 +280,9 @@ typedef enum
pw_nights_linkfreeze
,
pw_nocontrol
,
//for linedef exec 427
pw_dye
,
// for dyes
pw_justlaunched
,
// Launched off a slope this tic (0=none, 1=standard launch, 2=half-pipe launch)
NUMPOWERS
...
...
src/dehacked.c
View file @
d0abd6e8
...
...
@@ -1557,7 +1557,7 @@ static void readlevelheader(MYFILE *f, INT32 num)
}
else
if
(
fastcmp
(
word
,
"ACT"
))
{
if
(
i
>=
0
&&
i
<
20
)
// 0 for no act number, TTL1 through TTL19
if
(
i
>=
0
&&
i
<
=
99
)
// 0 for no act number
mapheaderinfo
[
num
-
1
]
->
actnum
=
(
UINT8
)
i
;
else
deh_warning
(
"Level header %d: invalid act number %d"
,
num
,
i
);
...
...
@@ -1863,6 +1863,12 @@ static void readlevelheader(MYFILE *f, INT32 num)
}
else
if
(
fastcmp
(
word
,
"STARTRINGS"
))
mapheaderinfo
[
num
-
1
]
->
startrings
=
(
UINT16
)
i
;
else
if
(
fastcmp
(
word
,
"SPECIALSTAGETIME"
))
mapheaderinfo
[
num
-
1
]
->
sstimer
=
i
;
else
if
(
fastcmp
(
word
,
"SPECIALSTAGESPHERES"
))
mapheaderinfo
[
num
-
1
]
->
ssspheres
=
i
;
else
if
(
fastcmp
(
word
,
"GRAVITY"
))
mapheaderinfo
[
num
-
1
]
->
gravity
=
FLOAT_TO_FIXED
(
atof
(
word2
));
else
deh_warning
(
"Level header %d: unknown word '%s'"
,
num
,
word
);
}
...
...
@@ -2807,7 +2813,7 @@ static actionpointer_t actionpointers[] =
{{
A_ThrownRing
},
"A_THROWNRING"
},
{{
A_SetSolidSteam
},
"A_SETSOLIDSTEAM"
},
{{
A_UnsetSolidSteam
},
"A_UNSETSOLIDSTEAM"
},
{{
A_SignSpin
},
"
S
_SIGNSPIN"
},
{{
A_SignSpin
},
"
A
_SIGNSPIN"
},
{{
A_SignPlayer
},
"A_SIGNPLAYER"
},
{{
A_OverlayThink
},
"A_OVERLAYTHINK"
},
{{
A_JetChase
},
"A_JETCHASE"
},
...
...
@@ -2909,6 +2915,7 @@ static actionpointer_t actionpointers[] =
{{
A_SetRandomTics
},
"A_SETRANDOMTICS"
},
{{
A_ChangeColorRelative
},
"A_CHANGECOLORRELATIVE"
},
{{
A_ChangeColorAbsolute
},
"A_CHANGECOLORABSOLUTE"
},
{{
A_Dye
},
"A_DYE"
},
{{
A_MoveRelative
},
"A_MOVERELATIVE"
},
{{
A_MoveAbsolute
},
"A_MOVEABSOLUTE"
},
{{
A_Thrust
},
"A_THRUST"
},
...
...
@@ -3026,6 +3033,7 @@ static actionpointer_t actionpointers[] =
{{
A_DragonbomberSpawn
},
"A_DRAGONBOMERSPAWN"
},
{{
A_DragonWing
},
"A_DRAGONWING"
},
{{
A_DragonSegment
},
"A_DRAGONSEGMENT"
},
{{
A_ChangeHeight
},
"A_CHANGEHEIGHT"
},
{{
NULL
},
"NONE"
},
// This NULL entry must be the last in the list
...
...
@@ -3880,7 +3888,26 @@ static void readmaincfg(MYFILE *f)
value
=
atoi
(
word2
);
// used for numerical settings
if
(
fastcmp
(
word
,
"EXECCFG"
))
COM_BufAddText
(
va
(
"exec %s
\n
"
,
word2
));
{
if
(
strchr
(
word2
,
'.'
))
COM_BufAddText
(
va
(
"exec %s
\n
"
,
word2
));
else
{
lumpnum_t
lumpnum
;
char
newname
[
9
];
strncpy
(
newname
,
word2
,
8
);
newname
[
8
]
=
'\0'
;
lumpnum
=
W_CheckNumForName
(
newname
);
if
(
lumpnum
==
LUMPERROR
||
W_LumpLength
(
lumpnum
)
==
0
)
CONS_Debug
(
DBG_SETUP
,
"SOC Error: script lump %s not found/not valid.
\n
"
,
newname
);
else
COM_BufInsertText
(
W_CacheLumpNum
(
lumpnum
,
PU_CACHE
));
}
}
else
if
(
fastcmp
(
word
,
"SPSTAGE_START"
))
{
...
...
@@ -4122,6 +4149,10 @@ static void readmaincfg(MYFILE *f)
{
maxXtraLife
=
(
UINT8
)
get_number
(
word2
);
}
else
if
(
fastcmp
(
word
,
"USECONTINUES"
))
{
useContinues
=
(
UINT8
)(
value
||
word2
[
0
]
==
'T'
||
word2
[
0
]
==
'Y'
);
}
else
if
(
fastcmp
(
word
,
"GAMEDATA"
))
{
...
...
@@ -6201,6 +6232,14 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_ROCKET"
,
"S_LASER"
,
"S_LASER2"
,
"S_LASERFLASH"
,
"S_LASERFLAME1"
,
"S_LASERFLAME2"
,
"S_LASERFLAME3"
,
"S_LASERFLAME4"
,
"S_LASERFLAME5"
,
"S_TORPEDO"
,
...
...
@@ -9132,7 +9171,11 @@ static const char *const POWERS_LIST[] = {
//for linedef exec 427
"NOCONTROL"
,
"JUSTLAUNCHED"
,
//for dyes
"DYE"
,
"JUSTLAUNCHED"
};
static
const
char
*
const
HUDITEMS_LIST
[]
=
{
...
...
@@ -9196,6 +9239,7 @@ static const char *const MENUTYPES_LIST[] = {
"MP_CONNECT"
,
"MP_ROOM"
,
"MP_PLAYERSETUP"
,
// MP_PlayerSetupDef shared with SPLITSCREEN if #defined NONET
"MP_SERVER_OPTIONS"
,
// Options
"OP_MAIN"
,
...
...
@@ -9205,10 +9249,14 @@ static const char *const MENUTYPES_LIST[] = {
"OP_P1MOUSE"
,
"OP_P1JOYSTICK"
,
"OP_JOYSTICKSET"
,
// OP_JoystickSetDef shared with P2
"OP_P1CAMERA"
,
"OP_P2CONTROLS"
,
"OP_P2MOUSE"
,
"OP_P2JOYSTICK"
,
"OP_P2CAMERA"
,
"OP_PLAYSTYLE"
,
"OP_VIDEO"
,
"OP_VIDEOMODE"
,
...
...
@@ -9440,6 +9488,7 @@ struct {
{
"CR_MINECART"
,
CR_MINECART
},
{
"CR_ROLLOUT"
,
CR_ROLLOUT
},
{
"CR_PTERABYTE"
,
CR_PTERABYTE
},
{
"CR_DUSTDEVIL"
,
CR_DUSTDEVIL
},
// Ring weapons (ringweapons_t)
// Useful for A_GiveWeapon
...
...
@@ -9467,6 +9516,7 @@ struct {
{
"SF_FASTEDGE"
,
SF_FASTEDGE
},
{
"SF_MULTIABILITY"
,
SF_MULTIABILITY
},
{
"SF_NONIGHTSROTATION"
,
SF_NONIGHTSROTATION
},
{
"SF_NONIGHTSSUPER"
,
SF_NONIGHTSSUPER
},
// Dashmode constants
{
"DASHMODE_THRESHOLD"
,
DASHMODE_THRESHOLD
},
...
...
@@ -9648,11 +9698,11 @@ struct {
{
"FF_CUTEXTRA"
,
FF_CUTEXTRA
},
///< Cuts out hidden translucent pixels.
{
"FF_CUTLEVEL"
,
FF_CUTLEVEL
},
///< Cuts out all hidden pixels.
{
"FF_CUTSPRITES"
,
FF_CUTSPRITES
},
///< Final step in making 3D water.
{
"FF_BOTHPLANES"
,
FF_BOTHPLANES
},
///< Render
s both planes all the time
.
{
"FF_BOTHPLANES"
,
FF_BOTHPLANES
},
///< Render
inside and outside planes
.
{
"FF_EXTRA"
,
FF_EXTRA
},
///< Gets cut by ::FF_CUTEXTRA.
{
"FF_TRANSLUCENT"
,
FF_TRANSLUCENT
},
///< See through!
{
"FF_FOG"
,
FF_FOG
},
///< Fog "brush."
{
"FF_INVERTPLANES"
,
FF_INVERTPLANES
},
///<
Reverse the plane visibility rul
es.
{
"FF_INVERTPLANES"
,
FF_INVERTPLANES
},
///<
Only render inside plan
es.
{
"FF_ALLSIDES"
,
FF_ALLSIDES
},
///< Render inside and outside sides.
{
"FF_INVERTSIDES"
,
FF_INVERTSIDES
},
///< Only render inside sides.
{
"FF_DOUBLESHADOW"
,
FF_DOUBLESHADOW
},
///< Make two lightlist entries to reset light?
...
...
src/djgppdos/i_video.c
View file @
d0abd6e8
...
...
@@ -339,7 +339,4 @@ void I_StartupGraphics(void)
}
void
I_StartupHardwareGraphics
(
void
)
{