Merge branch 'next' into bbox

This commit is contained in:
spherallic 2023-01-27 14:59:39 +01:00
commit 3bc519ed65
49 changed files with 756 additions and 7629 deletions

View file

@ -6491,7 +6491,7 @@ thingtypes
centerHitbox = true;
flagsvaluetext = "Height";
angletext = "Pitch/Yaw";
fixedrotation = 1;
parametertext = "Degrees?";
}
1706
{
@ -6551,6 +6551,8 @@ thingtypes
height = 160;
unflippable = true;
centerHitbox = true;
angletext = "Pitch/Yaw";
parametertext = "Degrees?";
}
1714
{

View file

@ -37,51 +37,51 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}</ProjectGuid>
<RootNamespace>libpng</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@ -278,7 +278,7 @@
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..;..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>$(ProjectDir)$(Platform)\$(Configuration)\</AssemblerListingLocation>
@ -288,7 +288,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View file

@ -37,51 +37,51 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{73A5729C-7323-41D4-AB48-8A03C9F81603}</ProjectGuid>
<RootNamespace>zlib</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@ -144,7 +144,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>$(ProjectDir)$(Platform)\$(Configuration)\</AssemblerListingLocation>
@ -154,7 +154,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View file

@ -1,89 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Srb2win", "src\win32\Srb2win-vc9.vcproj", "{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}"
ProjectSection(ProjectDependencies) = postProject
{73A5729C-7323-41D4-AB48-8A03C9F81603} = {73A5729C-7323-41D4-AB48-8A03C9F81603}
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052} = {72B01ACA-7A1A-4F7B-ACEF-2607299CF052}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "libs\libpng-src\projects\visualc9\libpng.vcproj", "{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}"
ProjectSection(ProjectDependencies) = postProject
{73A5729C-7323-41D4-AB48-8A03C9F81603} = {73A5729C-7323-41D4-AB48-8A03C9F81603}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "r_opengl", "src\hardware\r_opengl\r_opengl-vc9.vcproj", "{51137D5C-4E81-4955-AACF-EA3092006051}"
ProjectSection(ProjectDependencies) = postProject
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE} = {0F554F1D-ED49-4D65-A9A7-F63C57F277BE}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "libs\zlib\projects\visualc9\zlib.vcproj", "{73A5729C-7323-41D4-AB48-8A03C9F81603}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "s_openal", "src\hardware\s_openal\s_openal-vc9.vcproj", "{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}"
ProjectSection(ProjectDependencies) = postProject
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE} = {0F554F1D-ED49-4D65-A9A7-F63C57F277BE}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Srb2SDL", "src\sdl\Srb2SDL-vc9.vcproj", "{61BA7D3C-F77D-4D31-B718-1177FE482CF2}"
ProjectSection(ProjectDependencies) = postProject
{73A5729C-7323-41D4-AB48-8A03C9F81603} = {73A5729C-7323-41D4-AB48-8A03C9F81603}
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052} = {72B01ACA-7A1A-4F7B-ACEF-2607299CF052}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|Win32.ActiveCfg = Debug|Win32
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|Win32.Build.0 = Debug|Win32
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|x64.ActiveCfg = Debug|x64
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Debug|x64.Build.0 = Debug|x64
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|Win32.ActiveCfg = Release|Win32
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|Win32.Build.0 = Release|Win32
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|x64.ActiveCfg = Release|x64
{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}.Release|x64.Build.0 = Release|x64
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|Win32.ActiveCfg = Debug|Win32
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|Win32.Build.0 = Debug|Win32
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|x64.ActiveCfg = Debug|x64
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Debug|x64.Build.0 = Debug|x64
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|Win32.ActiveCfg = Release|Win32
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|Win32.Build.0 = Release|Win32
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|x64.ActiveCfg = Release|x64
{72B01ACA-7A1A-4F7B-ACEF-2607299CF052}.Release|x64.Build.0 = Release|x64
{51137D5C-4E81-4955-AACF-EA3092006051}.Debug|Win32.ActiveCfg = Debug|Win32
{51137D5C-4E81-4955-AACF-EA3092006051}.Debug|Win32.Build.0 = Debug|Win32
{51137D5C-4E81-4955-AACF-EA3092006051}.Debug|x64.ActiveCfg = Debug|x64
{51137D5C-4E81-4955-AACF-EA3092006051}.Debug|x64.Build.0 = Debug|x64
{51137D5C-4E81-4955-AACF-EA3092006051}.Release|Win32.ActiveCfg = Release|Win32
{51137D5C-4E81-4955-AACF-EA3092006051}.Release|Win32.Build.0 = Release|Win32
{51137D5C-4E81-4955-AACF-EA3092006051}.Release|x64.ActiveCfg = Release|x64
{51137D5C-4E81-4955-AACF-EA3092006051}.Release|x64.Build.0 = Release|x64
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|Win32.ActiveCfg = Debug|Win32
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|Win32.Build.0 = Debug|Win32
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|x64.ActiveCfg = Debug|x64
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Debug|x64.Build.0 = Debug|x64
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|Win32.ActiveCfg = Release|Win32
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|Win32.Build.0 = Release|Win32
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|x64.ActiveCfg = Release|x64
{73A5729C-7323-41D4-AB48-8A03C9F81603}.Release|x64.Build.0 = Release|x64
{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Debug|Win32.ActiveCfg = Debug|Win32
{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Debug|x64.ActiveCfg = Debug|x64
{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Release|Win32.ActiveCfg = Release|Win32
{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}.Release|x64.ActiveCfg = Release|x64
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|Win32.ActiveCfg = Debug|Win32
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|Win32.Build.0 = Debug|Win32
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|x64.ActiveCfg = Debug|x64
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Debug|x64.Build.0 = Debug|x64
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|Win32.ActiveCfg = Release|Win32
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|Win32.Build.0 = Release|Win32
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|x64.ActiveCfg = Release|x64
{61BA7D3C-F77D-4D31-B718-1177FE482CF2}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -188,6 +188,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
&& !(pcmd->forwardmove || pcmd->sidemove || player->dashspeed)
&& P_IsObjectOnGround(sonic) && P_IsObjectOnGround(tails)
&& !(player->pflags & PF_STASIS)
&& !(player->exiting)
&& bot->charability == CA_FLY)
mem->thinkstate = AI_THINKFLY;
else if (mem->thinkstate == AI_THINKFLY)

View file

@ -12,6 +12,10 @@
#include <stdarg.h>
#include <stddef.h>
#ifdef _MSC_VER
#include <stdint.h>
#endif
#include "luaconf.h"

View file

@ -11,9 +11,7 @@
#include <limits.h>
#include <stddef.h>
#ifdef _MSC_VER
#define INT32 __int32
#else
#ifndef _MSC_VER
#include <stdint.h>
#define INT32 int32_t
#endif
@ -147,7 +145,7 @@
** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
** machines, ptrdiff_t gives a good choice between int or long.)
*/
#define LUA_INTEGER INT32
#define LUA_INTEGER int32_t
/*
@ -509,13 +507,13 @@
*/
//#define LUA_NUMBER_DOUBLE
#define LUA_NUMBER INT32
#define LUA_NUMBER int32_t
/*
@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
@* over a number.
*/
#define LUAI_UACNUMBER INT32
#define LUAI_UACNUMBER int32_t
/*
@ -778,6 +776,4 @@ union luai_Cast { double l_d; long l_l; };
** without modifying the main part of the file.
*/
#endif

View file

@ -150,7 +150,7 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
#undef DEALIGNED
#define WRITESTRINGN(p, s, n) ({ \
#define WRITESTRINGN(p, s, n) { \
size_t tmp_i; \
\
for (tmp_i = 0; tmp_i < n && s[tmp_i] != '\0'; tmp_i++) \
@ -158,70 +158,70 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
\
if (tmp_i < n) \
WRITECHAR(p, '\0'); \
})
}
#define WRITESTRINGL(p, s, n) ({ \
#define WRITESTRINGL(p, s, n) { \
size_t tmp_i; \
\
for (tmp_i = 0; tmp_i < n - 1 && s[tmp_i] != '\0'; tmp_i++) \
WRITECHAR(p, s[tmp_i]); \
\
WRITECHAR(p, '\0'); \
})
}
#define WRITESTRING(p, s) ({ \
#define WRITESTRING(p, s) { \
size_t tmp_i; \
\
for (tmp_i = 0; s[tmp_i] != '\0'; tmp_i++) \
WRITECHAR(p, s[tmp_i]); \
\
WRITECHAR(p, '\0'); \
})
}
#define WRITEMEM(p, s, n) ({ \
#define WRITEMEM(p, s, n) { \
memcpy(p, s, n); \
p += n; \
})
}
#define SKIPSTRING(p) while (READCHAR(p) != '\0')
#define SKIPSTRINGN(p, n) ({ \
#define SKIPSTRINGN(p, n) { \
size_t tmp_i = 0; \
\
while (tmp_i < n && READCHAR(p) != '\0') \
tmp_i++; \
})
}
#define SKIPSTRINGL(p, n) SKIPSTRINGN(p, n)
#define READSTRINGN(p, s, n) ({ \
#define READSTRINGN(p, s, n) { \
size_t tmp_i = 0; \
\
while (tmp_i < n && (s[tmp_i] = READCHAR(p)) != '\0') \
tmp_i++; \
\
s[tmp_i] = '\0'; \
})
}
#define READSTRINGL(p, s, n) ({ \
#define READSTRINGL(p, s, n) { \
size_t tmp_i = 0; \
\
while (tmp_i < n - 1 && (s[tmp_i] = READCHAR(p)) != '\0') \
tmp_i++; \
\
s[tmp_i] = '\0'; \
})
}
#define READSTRING(p, s) ({ \
#define READSTRING(p, s) { \
size_t tmp_i = 0; \
\
while ((s[tmp_i] = READCHAR(p)) != '\0') \
tmp_i++; \
\
s[tmp_i] = '\0'; \
})
}
#define READMEM(p, s, n) ({ \
#define READMEM(p, s, n) { \
memcpy(s, p, n); \
p += n; \
})
}

View file

@ -1725,9 +1725,13 @@ void CV_SaveVars(UINT8 **p, boolean in_demo)
if ((cvar->flags & CV_NETVAR) && !CV_IsSetToDefault(cvar))
{
if (in_demo)
{
WRITESTRING(*p, cvar->name);
}
else
{
WRITEUINT16(*p, cvar->netid);
}
WRITESTRING(*p, cvar->string);
WRITEUINT8(*p, false);
++count;

80
src/d_clisrv.c Normal file → Executable file
View file

@ -48,6 +48,9 @@
#include "md5.h"
#include "m_perfstats.h"
// aaaaaa
#include "i_joy.h"
#ifndef NONET
// cl loading screen
#include "v_video.h"
@ -650,6 +653,22 @@ static UINT8 Snake_GetOppositeDir(UINT8 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)
{
UINT8 x, y;
@ -676,6 +695,9 @@ static void Snake_Handle(void)
UINT8 x, y;
UINT8 oldx, oldy;
UINT16 i;
UINT16 j;
UINT16 joystate = 0;
static INT32 pjoyx = 0, pjoyy = 0;
// Handle retry
if (snake->gameover && (PLAYER1INPUTDOWN(GC_JUMP) || gamekeydown[KEY_ENTER]))
@ -704,23 +726,58 @@ static void Snake_Handle(void)
oldx = snake->snakex[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
if (gamekeydown[KEY_LEFTARROW])
if (PLAYER1INPUTDOWN(GC_STRAFELEFT) || gamekeydown[KEY_LEFTARROW] || joystate == 3)
{
if (snake->snakelength < 2 || x <= oldx)
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)
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)
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)
snake->snakedir[0] = 4;
@ -1934,7 +1991,7 @@ static void M_ConfirmConnect(event_t *ev)
#ifndef NONET
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)
{
@ -1949,7 +2006,7 @@ static void M_ConfirmConnect(event_t *ev)
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;
M_ClearMenus(true);
@ -1964,6 +2021,7 @@ static boolean CL_FinishedFileList(void)
{
INT32 i;
char *downloadsize = NULL;
//CONS_Printf(M_GetText("Checking files...\n"));
i = CL_CheckFiles();
if (i == 4) // still checking ...
@ -2379,8 +2437,14 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
D_ProcessEvents(); //needed for menu system to receive inputs
else
{
// my hand has been forced and I am dearly sorry for this awful hack :vomit:
for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1))
G_MapEventsToControls(&events[eventtail]);
{
#ifndef NONET
if (!Snake_Joy_Grabber(&events[eventtail]))
#endif
G_MapEventsToControls(&events[eventtail]);
}
}
if (gamekeydown[KEY_ESCAPE] || gamekeydown[KEY_JOY1+1] || cl_mode == CL_ABORTED)
@ -3456,7 +3520,7 @@ consvar_t cv_resynchattempts = CVAR_INIT ("resynchattempts", "10", CV_SAVE|CV_NE
consvar_t cv_blamecfail = CVAR_INIT ("blamecfail", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL);
// max file size to send to a player (in kilobytes)
static CV_PossibleValue_t maxsend_cons_t[] = {{0, "MIN"}, {51200, "MAX"}, {0, NULL}};
static CV_PossibleValue_t maxsend_cons_t[] = {{0, "MIN"}, {204800, "MAX"}, {0, NULL}};
consvar_t cv_maxsend = CVAR_INIT ("maxsend", "4096", CV_SAVE|CV_NETVAR, maxsend_cons_t, NULL);
consvar_t cv_noticedownload = CVAR_INIT ("noticedownload", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL);

View file

@ -49,6 +49,7 @@
#include "m_anigif.h"
#include "md5.h"
#include "m_perfstats.h"
#include "hardware/u_list.h" // TODO: this should be a standard utility class
#ifdef NETGAME_DEVMODE
#define CV_RESTRICT CV_NETVAR
@ -3273,6 +3274,69 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
G_SetGameModified(true);
}
// C++ would make this SO much simpler!
typedef struct addedfile_s
{
struct addedfile_s *next;
struct addedfile_s *prev;
char *value;
} addedfile_t;
static boolean AddedFileContains(addedfile_t *list, const char *value)
{
addedfile_t *node;
for (node = list; node; node = node->next)
{
if (!strcmp(value, node->value))
return true;
}
return false;
}
static void AddedFilesAdd(addedfile_t **list, const char *value)
{
addedfile_t *item = Z_Calloc(sizeof(addedfile_t), PU_STATIC, NULL);
item->value = Z_StrDup(value);
ListAdd(item, (listitem_t**)list);
}
static void AddedFilesRemove(void *pItem, addedfile_t **itemHead)
{
addedfile_t *item = (addedfile_t *)pItem;
if (item == *itemHead) // Start of list
{
*itemHead = item->next;
if (*itemHead)
(*itemHead)->prev = NULL;
}
else if (item->next == NULL) // end of list
{
item->prev->next = NULL;
}
else // Somewhere in between
{
item->prev->next = item->next;
item->next->prev = item->prev;
}
Z_Free(item->value);
Z_Free(item);
}
static void AddedFilesClearList(addedfile_t **itemHead)
{
addedfile_t *item;
addedfile_t *next;
for (item = *itemHead; item; item = next)
{
next = item->next;
AddedFilesRemove(item, itemHead);
}
}
/** Adds a pwad at runtime.
* Searches for sounds, maps, music, new images.
*/
@ -3281,8 +3345,7 @@ static void Command_Addfile(void)
size_t argc = COM_Argc(); // amount of arguments total
size_t curarg; // current argument index
const char *addedfiles[argc]; // list of filenames already processed
size_t numfilesadded = 0; // the amount of filenames processed
addedfile_t *addedfiles = NULL; // list of filenames already processed
if (argc < 2)
{
@ -3297,25 +3360,14 @@ static void Command_Addfile(void)
char buf[256];
char *buf_p = buf;
INT32 i;
size_t ii;
int musiconly; // W_VerifyNMUSlumps isn't boolean
boolean fileadded = false;
fn = COM_Argv(curarg);
// For the amount of filenames previously processed...
for (ii = 0; ii < numfilesadded; ii++)
{
// If this is one of them, don't try to add it.
if (!strcmp(fn, addedfiles[ii]))
{
fileadded = true;
break;
}
}
// If we've added this one, skip to the next one.
if (fileadded)
fileadded = AddedFileContains(addedfiles, fn);
if (fileadded) // If this is one of them, don't try to add it.
{
CONS_Alert(CONS_WARNING, M_GetText("Already processed %s, skipping\n"), fn);
continue;
@ -3324,13 +3376,16 @@ static void Command_Addfile(void)
// Disallow non-printing characters and semicolons.
for (i = 0; fn[i] != '\0'; i++)
if (!isprint(fn[i]) || fn[i] == ';')
{
AddedFilesClearList(&addedfiles);
return;
}
musiconly = W_VerifyNMUSlumps(fn, false);
if (musiconly == -1)
{
addedfiles[numfilesadded++] = fn;
AddedFilesAdd(&addedfiles, fn);
continue;
}
@ -3349,7 +3404,7 @@ static void Command_Addfile(void)
if (!(netgame || multiplayer) || musiconly)
{
P_AddWadFile(fn);
addedfiles[numfilesadded++] = fn;
AddedFilesAdd(&addedfiles, fn);
continue;
}
@ -3364,6 +3419,7 @@ static void Command_Addfile(void)
if (numwadfiles >= MAX_WADFILES)
{
CONS_Alert(CONS_ERROR, M_GetText("Too many files loaded to add %s\n"), fn);
AddedFilesClearList(&addedfiles);
return;
}
@ -3403,13 +3459,15 @@ static void Command_Addfile(void)
WRITEMEM(buf_p, md5sum, 16);
}
addedfiles[numfilesadded++] = fn;
AddedFilesAdd(&addedfiles, fn);
if (IsPlayerAdmin(consoleplayer) && (!server)) // Request to add file
SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf);
else
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);
}
AddedFilesClearList(&addedfiles);
}
static void Command_Addfolder(void)
@ -3417,8 +3475,7 @@ static void Command_Addfolder(void)
size_t argc = COM_Argc(); // amount of arguments total
size_t curarg; // current argument index
const char *addedfolders[argc]; // list of filenames already processed
size_t numfoldersadded = 0; // the amount of filenames processed
addedfile_t *addedfolders = NULL; // list of filenames already processed
if (argc < 2)
{
@ -3434,24 +3491,13 @@ static void Command_Addfolder(void)
char buf[256];
char *buf_p = buf;
INT32 i, stat;
size_t ii;
boolean folderadded = false;
fn = COM_Argv(curarg);
// For the amount of filenames previously processed...
for (ii = 0; ii < numfoldersadded; ii++)
{
// If this is one of them, don't try to add it.
if (!strcmp(fn, addedfolders[ii]))
{
folderadded = true;
break;
}
}
// If we've added this one, skip to the next one.
if (folderadded)
folderadded = AddedFileContains(addedfolders, fn);
if (folderadded) // If we've added this one, skip to the next one.
{
CONS_Alert(CONS_WARNING, M_GetText("Already processed %s, skipping\n"), fn);
continue;
@ -3460,13 +3506,16 @@ static void Command_Addfolder(void)
// Disallow non-printing characters and semicolons.
for (i = 0; fn[i] != '\0'; i++)
if (!isprint(fn[i]) || fn[i] == ';')
{
AddedFilesClearList(&addedfolders);
return;
}
// Add file on your client directly if you aren't in a netgame.
if (!(netgame || multiplayer))
{
P_AddFolder(fn);
addedfolders[numfoldersadded++] = fn;
AddedFilesAdd(&addedfolders, fn);
continue;
}
@ -3488,6 +3537,7 @@ static void Command_Addfolder(void)
if (numwadfiles >= MAX_WADFILES)
{
CONS_Alert(CONS_ERROR, M_GetText("Too many files loaded to add %s\n"), fn);
AddedFilesClearList(&addedfolders);
return;
}
@ -3533,7 +3583,7 @@ static void Command_Addfolder(void)
Z_Free(fullpath);
addedfolders[numfoldersadded++] = fn;
AddedFilesAdd(&addedfolders, fn);
WRITESTRINGN(buf_p,p,240);

View file

@ -693,7 +693,8 @@ void readskincolor(MYFILE *f, INT32 num)
if (fastcmp(word, "NAME"))
{
size_t namesize = sizeof(skincolors[num].name);
char truncword[namesize];
char *truncword = malloc(namesize); // Follow C standard - SSNTails
UINT16 dupecheck;
deh_strlcpy(truncword, word2, namesize, va("Skincolor %d: name", num)); // truncate here to check for dupes
@ -701,7 +702,7 @@ void readskincolor(MYFILE *f, INT32 num)
if (truncword[0] != '\0' && (!stricmp(truncword, skincolors[SKINCOLOR_NONE].name) || (dupecheck && dupecheck != num)))
{
size_t lastchar = strlen(truncword);
char oldword[lastchar+1];
char *oldword = malloc(lastchar + 1); // Follow C standard - SSNTails
char dupenum = '1';
strlcpy(oldword, truncword, lastchar+1);
@ -726,9 +727,12 @@ void readskincolor(MYFILE *f, INT32 num)
}
deh_warning("Skincolor %d: name %s is a duplicate of another skincolor's name - renamed to %s", num, oldword, truncword);
free(oldword);
}
strlcpy(skincolors[num].name, truncword, namesize); // already truncated
free(truncword);
}
else if (fastcmp(word, "RAMP"))
{
@ -2759,13 +2763,13 @@ void readframe(MYFILE *f, INT32 num)
{
size_t z;
boolean found = false;
char actiontocompare[32];
size_t actionlen = strlen(word2) + 1;
char *actiontocompare = calloc(actionlen, 1);
memset(actiontocompare, 0x00, sizeof(actiontocompare));
strlcpy(actiontocompare, word2, sizeof (actiontocompare));
strcpy(actiontocompare, word2);
strupr(actiontocompare);
for (z = 0; z < 32; z++)
for (z = 0; z < actionlen; z++)
{
if (actiontocompare[z] == '\n' || actiontocompare[z] == '\r')
{
@ -2798,6 +2802,8 @@ void readframe(MYFILE *f, INT32 num)
if (!found)
deh_warning("Unknown action %s", actiontocompare);
free(actiontocompare);
}
else
deh_warning("Frame %d: unknown word '%s'", num, word1);

View file

@ -5694,7 +5694,9 @@ struct int_const_s const INT_CONST[] = {
{"GC_SYSTEMMENU",GC_SYSTEMMENU},
{"GC_SCREENSHOT",GC_SCREENSHOT},
{"GC_RECORDGIF",GC_RECORDGIF},
{"GC_VIEWPOINT",GC_VIEWPOINT},
{"GC_VIEWPOINTNEXT",GC_VIEWPOINTNEXT},
{"GC_VIEWPOINT",GC_VIEWPOINTNEXT}, // Alias for retrocompatibility. Remove for the next major version
{"GC_VIEWPOINTPREV",GC_VIEWPOINTPREV},
{"GC_CUSTOM1",GC_CUSTOM1},
{"GC_CUSTOM2",GC_CUSTOM2},
{"GC_CUSTOM3",GC_CUSTOM3},

View file

@ -31,18 +31,8 @@
#include <stdint.h>
#endif
#define UINT8 unsigned __int8
#define SINT8 signed __int8
#define UINT16 unsigned __int16
#define INT16 __int16
#define INT32 __int32
#define UINT32 unsigned __int32
#define INT64 __int64
#define UINT64 unsigned __int64
typedef long ssize_t;
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */

View file

@ -1959,6 +1959,85 @@ INT32 pausedelay = 0;
boolean pausebreakkey = false;
static INT32 camtoggledelay, camtoggledelay2 = 0;
static boolean ViewpointSwitchResponder(event_t *ev)
{
// ViewpointSwitch Lua hook.
UINT8 canSwitchView = 0;
INT32 direction = 0;
if (ev->key == KEY_F12 || ev->key == gamecontrol[GC_VIEWPOINTNEXT][0] || ev->key == gamecontrol[GC_VIEWPOINTNEXT][1])
direction = 1;
if (ev->key == gamecontrol[GC_VIEWPOINTPREV][0] || ev->key == gamecontrol[GC_VIEWPOINTPREV][1])
direction = -1;
// This enabled reverse-iterating with shift+F12, sadly I had to
// disable this in case your shift key is bound to a control =((
//if (shiftdown)
// direction = -direction;
// allow spy mode changes even during the demo
if (!(gamestate == GS_LEVEL && ev->type == ev_keydown && direction != 0))
return false;
if (splitscreen || !netgame)
{
displayplayer = consoleplayer;
return false;
}
// spy mode
do
{
// Wrap in both directions
displayplayer += direction;
displayplayer = (displayplayer + MAXPLAYERS) % MAXPLAYERS;
if (!playeringame[displayplayer])
continue;
// Call ViewpointSwitch hooks here.
canSwitchView = LUA_HookViewpointSwitch(&players[consoleplayer], &players[displayplayer], false);
if (canSwitchView == 1) // Set viewpoint to this player
break;
else if (canSwitchView == 2) // Skip this player
continue;
if (players[displayplayer].spectator)
continue;
if (G_GametypeHasTeams())
{
if (players[consoleplayer].ctfteam
&& players[displayplayer].ctfteam != players[consoleplayer].ctfteam)
continue;
}
else if (gametyperules & GTR_HIDEFROZEN)
{
if (players[consoleplayer].pflags & PF_TAGIT)
continue;
}
// Other Tag-based gametypes?
else if (G_TagGametype())
{
if (!players[consoleplayer].spectator
&& (players[consoleplayer].pflags & PF_TAGIT) != (players[displayplayer].pflags & PF_TAGIT))
continue;
}
else if (G_GametypeHasSpectators() && G_RingSlingerGametype())
{
if (!players[consoleplayer].spectator)
continue;
}
break;
} while (displayplayer != consoleplayer);
// change statusbar also if playing back demo
if (singledemo)
ST_changeDemoView();
return true;
}
//
// G_Responder
// Get info needed to make ticcmd_ts for the players.
@ -2043,74 +2122,8 @@ boolean G_Responder(event_t *ev)
if (HU_Responder(ev))
return true; // chat ate the event
// allow spy mode changes even during the demo
if (gamestate == GS_LEVEL && ev->type == ev_keydown
&& (ev->key == KEY_F12 || ev->key == gamecontrol[GC_VIEWPOINT][0] || ev->key == gamecontrol[GC_VIEWPOINT][1]))
{
// ViewpointSwitch Lua hook.
UINT8 canSwitchView = 0;
if (splitscreen || !netgame)
displayplayer = consoleplayer;
else
{
// spy mode
do
{
displayplayer++;
if (displayplayer == MAXPLAYERS)
displayplayer = 0;
if (!playeringame[displayplayer])
continue;
// Call ViewpointSwitch hooks here.
canSwitchView = LUA_HookViewpointSwitch(&players[consoleplayer], &players[displayplayer], false);
if (canSwitchView == 1) // Set viewpoint to this player
break;
else if (canSwitchView == 2) // Skip this player
continue;
if (players[displayplayer].spectator)
continue;
if (G_GametypeHasTeams())
{
if (players[consoleplayer].ctfteam
&& players[displayplayer].ctfteam != players[consoleplayer].ctfteam)
continue;
}
else if (gametyperules & GTR_HIDEFROZEN)
{
if (players[consoleplayer].pflags & PF_TAGIT)
continue;
}
// Other Tag-based gametypes?
else if (G_TagGametype())
{
if (!players[consoleplayer].spectator
&& (players[consoleplayer].pflags & PF_TAGIT) != (players[displayplayer].pflags & PF_TAGIT))
continue;
}
else if (G_GametypeHasSpectators() && G_RingSlingerGametype())
{
if (!players[consoleplayer].spectator)
continue;
}
break;
} while (displayplayer != consoleplayer);
// change statusbar also if playing back demo
if (singledemo)
ST_changeDemoView();
// tell who's the view
CONS_Printf(M_GetText("Viewpoint: %s\n"), player_names[displayplayer]);
return true;
}
}
if (ViewpointSwitchResponder(ev))
return true;
// update keys current state
G_MapEventsToControls(ev);

View file

@ -593,7 +593,8 @@ static const char *gamecontrolname[NUM_GAMECONTROLS] =
"systemmenu",
"screenshot",
"recordgif",
"viewpoint",
"viewpoint", // Rename this to "viewpointnext" for the next major version
"viewpointprev",
"custom1",
"custom2",
"custom3",
@ -713,61 +714,61 @@ void G_DefineDefaultControls(void)
for (i = 1; i < num_gamecontrolschemes; i++) // skip gcs_custom (0)
{
gamecontroldefault[i][GC_WEAPONNEXT ][0] = KEY_MOUSEWHEELUP+0;
gamecontroldefault[i][GC_WEAPONPREV ][0] = KEY_MOUSEWHEELDOWN+0;
gamecontroldefault[i][GC_WEPSLOT1 ][0] = '1';
gamecontroldefault[i][GC_WEPSLOT2 ][0] = '2';
gamecontroldefault[i][GC_WEPSLOT3 ][0] = '3';
gamecontroldefault[i][GC_WEPSLOT4 ][0] = '4';
gamecontroldefault[i][GC_WEPSLOT5 ][0] = '5';
gamecontroldefault[i][GC_WEPSLOT6 ][0] = '6';
gamecontroldefault[i][GC_WEPSLOT7 ][0] = '7';
gamecontroldefault[i][GC_WEPSLOT8 ][0] = '8';
gamecontroldefault[i][GC_WEPSLOT9 ][0] = '9';
gamecontroldefault[i][GC_WEPSLOT10 ][0] = '0';
gamecontroldefault[i][GC_TOSSFLAG ][0] = '\'';
gamecontroldefault[i][GC_CAMTOGGLE ][0] = 'v';
gamecontroldefault[i][GC_CAMRESET ][0] = 'r';
gamecontroldefault[i][GC_TALKKEY ][0] = 't';
gamecontroldefault[i][GC_TEAMKEY ][0] = 'y';
gamecontroldefault[i][GC_SCORES ][0] = KEY_TAB;
gamecontroldefault[i][GC_CONSOLE ][0] = KEY_CONSOLE;
gamecontroldefault[i][GC_PAUSE ][0] = 'p';
gamecontroldefault[i][GC_SCREENSHOT ][0] = KEY_F8;
gamecontroldefault[i][GC_RECORDGIF ][0] = KEY_F9;
gamecontroldefault[i][GC_VIEWPOINT ][0] = KEY_F12;
gamecontroldefault[i][GC_WEAPONNEXT ][0] = KEY_MOUSEWHEELUP+0;
gamecontroldefault[i][GC_WEAPONPREV ][0] = KEY_MOUSEWHEELDOWN+0;
gamecontroldefault[i][GC_WEPSLOT1 ][0] = '1';
gamecontroldefault[i][GC_WEPSLOT2 ][0] = '2';
gamecontroldefault[i][GC_WEPSLOT3 ][0] = '3';
gamecontroldefault[i][GC_WEPSLOT4 ][0] = '4';
gamecontroldefault[i][GC_WEPSLOT5 ][0] = '5';
gamecontroldefault[i][GC_WEPSLOT6 ][0] = '6';
gamecontroldefault[i][GC_WEPSLOT7 ][0] = '7';
gamecontroldefault[i][GC_WEPSLOT8 ][0] = '8';
gamecontroldefault[i][GC_WEPSLOT9 ][0] = '9';
gamecontroldefault[i][GC_WEPSLOT10 ][0] = '0';
gamecontroldefault[i][GC_TOSSFLAG ][0] = '\'';
gamecontroldefault[i][GC_CAMTOGGLE ][0] = 'v';
gamecontroldefault[i][GC_CAMRESET ][0] = 'r';
gamecontroldefault[i][GC_TALKKEY ][0] = 't';
gamecontroldefault[i][GC_TEAMKEY ][0] = 'y';
gamecontroldefault[i][GC_SCORES ][0] = KEY_TAB;
gamecontroldefault[i][GC_CONSOLE ][0] = KEY_CONSOLE;
gamecontroldefault[i][GC_PAUSE ][0] = 'p';
gamecontroldefault[i][GC_SCREENSHOT ][0] = KEY_F8;
gamecontroldefault[i][GC_RECORDGIF ][0] = KEY_F9;
gamecontroldefault[i][GC_VIEWPOINTNEXT][0] = KEY_F12;
// Gamepad controls -- same for both schemes
gamecontroldefault[i][GC_JUMP ][1] = KEY_JOY1+0; // A
gamecontroldefault[i][GC_SPIN ][1] = KEY_JOY1+2; // X
gamecontroldefault[i][GC_CUSTOM1 ][1] = KEY_JOY1+1; // B
gamecontroldefault[i][GC_CUSTOM2 ][1] = KEY_JOY1+3; // Y
gamecontroldefault[i][GC_CUSTOM3 ][1] = KEY_JOY1+8; // Left Stick
gamecontroldefault[i][GC_CENTERVIEW ][1] = KEY_JOY1+9; // Right Stick
gamecontroldefault[i][GC_WEAPONPREV ][1] = KEY_JOY1+4; // LB
gamecontroldefault[i][GC_WEAPONNEXT ][1] = KEY_JOY1+5; // RB
gamecontroldefault[i][GC_SCREENSHOT ][1] = KEY_JOY1+6; // Back
gamecontroldefault[i][GC_SYSTEMMENU ][0] = KEY_JOY1+7; // Start
gamecontroldefault[i][GC_CAMTOGGLE ][1] = KEY_HAT1+0; // D-Pad Up
gamecontroldefault[i][GC_VIEWPOINT ][1] = KEY_HAT1+1; // D-Pad Down
gamecontroldefault[i][GC_TOSSFLAG ][1] = KEY_HAT1+2; // D-Pad Left
gamecontroldefault[i][GC_SCORES ][1] = KEY_HAT1+3; // D-Pad Right
gamecontroldefault[i][GC_JUMP ][1] = KEY_JOY1+0; // A
gamecontroldefault[i][GC_SPIN ][1] = KEY_JOY1+2; // X
gamecontroldefault[i][GC_CUSTOM1 ][1] = KEY_JOY1+1; // B
gamecontroldefault[i][GC_CUSTOM2 ][1] = KEY_JOY1+3; // Y
gamecontroldefault[i][GC_CUSTOM3 ][1] = KEY_JOY1+8; // Left Stick
gamecontroldefault[i][GC_CENTERVIEW ][1] = KEY_JOY1+9; // Right Stick
gamecontroldefault[i][GC_WEAPONPREV ][1] = KEY_JOY1+4; // LB
gamecontroldefault[i][GC_WEAPONNEXT ][1] = KEY_JOY1+5; // RB
gamecontroldefault[i][GC_SCREENSHOT ][1] = KEY_JOY1+6; // Back
gamecontroldefault[i][GC_SYSTEMMENU ][0] = KEY_JOY1+7; // Start
gamecontroldefault[i][GC_CAMTOGGLE ][1] = KEY_HAT1+0; // D-Pad Up
gamecontroldefault[i][GC_VIEWPOINTNEXT][1] = KEY_HAT1+1; // D-Pad Down
gamecontroldefault[i][GC_TOSSFLAG ][1] = KEY_HAT1+2; // D-Pad Left
gamecontroldefault[i][GC_SCORES ][1] = KEY_HAT1+3; // D-Pad Right
// Second player controls only have joypad defaults
gamecontrolbisdefault[i][GC_JUMP ][1] = KEY_2JOY1+0; // A
gamecontrolbisdefault[i][GC_SPIN ][1] = KEY_2JOY1+2; // X
gamecontrolbisdefault[i][GC_CUSTOM1 ][1] = KEY_2JOY1+1; // B
gamecontrolbisdefault[i][GC_CUSTOM2 ][1] = KEY_2JOY1+3; // Y
gamecontrolbisdefault[i][GC_CUSTOM3 ][1] = KEY_2JOY1+8; // Left Stick
gamecontrolbisdefault[i][GC_CENTERVIEW ][1] = KEY_2JOY1+9; // Right Stick
gamecontrolbisdefault[i][GC_WEAPONPREV ][1] = KEY_2JOY1+4; // LB
gamecontrolbisdefault[i][GC_WEAPONNEXT ][1] = KEY_2JOY1+5; // RB
gamecontrolbisdefault[i][GC_SCREENSHOT ][1] = KEY_2JOY1+6; // Back
//gamecontrolbisdefault[i][GC_SYSTEMMENU ][0] = KEY_2JOY1+7; // Start
gamecontrolbisdefault[i][GC_CAMTOGGLE ][1] = KEY_2HAT1+0; // D-Pad Up
gamecontrolbisdefault[i][GC_VIEWPOINT ][1] = KEY_2HAT1+1; // D-Pad Down
gamecontrolbisdefault[i][GC_TOSSFLAG ][1] = KEY_2HAT1+2; // D-Pad Left
//gamecontrolbisdefault[i][GC_SCORES ][1] = KEY_2HAT1+3; // D-Pad Right
gamecontrolbisdefault[i][GC_JUMP ][1] = KEY_2JOY1+0; // A
gamecontrolbisdefault[i][GC_SPIN ][1] = KEY_2JOY1+2; // X
gamecontrolbisdefault[i][GC_CUSTOM1 ][1] = KEY_2JOY1+1; // B
gamecontrolbisdefault[i][GC_CUSTOM2 ][1] = KEY_2JOY1+3; // Y
gamecontrolbisdefault[i][GC_CUSTOM3 ][1] = KEY_2JOY1+8; // Left Stick
gamecontrolbisdefault[i][GC_CENTERVIEW ][1] = KEY_2JOY1+9; // Right Stick
gamecontrolbisdefault[i][GC_WEAPONPREV ][1] = KEY_2JOY1+4; // LB
gamecontrolbisdefault[i][GC_WEAPONNEXT ][1] = KEY_2JOY1+5; // RB
gamecontrolbisdefault[i][GC_SCREENSHOT ][1] = KEY_2JOY1+6; // Back
//gamecontrolbisdefault[i][GC_SYSTEMMENU ][0] = KEY_2JOY1+7; // Start
gamecontrolbisdefault[i][GC_CAMTOGGLE ][1] = KEY_2HAT1+0; // D-Pad Up
gamecontrolbisdefault[i][GC_VIEWPOINTNEXT][1] = KEY_2HAT1+1; // D-Pad Down
gamecontrolbisdefault[i][GC_TOSSFLAG ][1] = KEY_2HAT1+2; // D-Pad Left
//gamecontrolbisdefault[i][GC_SCORES ][1] = KEY_2HAT1+3; // D-Pad Right
}
}

View file

@ -96,7 +96,8 @@ typedef enum
GC_SYSTEMMENU,
GC_SCREENSHOT,
GC_RECORDGIF,
GC_VIEWPOINT,
GC_VIEWPOINTNEXT,
GC_VIEWPOINTPREV,
GC_CUSTOM1, // Lua scriptable
GC_CUSTOM2, // Lua scriptable
GC_CUSTOM3, // Lua scriptable

View file

@ -5246,7 +5246,15 @@ static void HWR_ProjectSprite(mobj_t *thing)
if (thing->rollangle
&& !(splat && !(thing->renderflags & RF_NOSPLATROLLANGLE)))
{
rollangle = R_GetRollAngle(thing->rollangle);
if (papersprite)
{
// a positive rollangle should should pitch papersprites upwards relative to their facing angle
rollangle = R_GetRollAngle(InvAngle(thing->rollangle));
}
else
{
rollangle = R_GetRollAngle(thing->rollangle);
}
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle);
if (rotsprite != NULL)
@ -5298,9 +5306,9 @@ static void HWR_ProjectSprite(mobj_t *thing)
if (caster && !P_MobjWasRemoved(caster))
{
interpmobjstate_t casterinterp = {};
interpmobjstate_t casterinterp = { 0 };
fixed_t groundz;
fixed_t floordiff;
fixed_t floordiff;
if (R_UsingFrameInterpolation() && !paused)
{
@ -5310,7 +5318,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
{
R_InterpolateMobjState(caster, FRACUNIT, &casterinterp);
}
groundz = R_GetShadowZ(thing, NULL);
floordiff = abs(((thing->eflags & MFE_VERTICALFLIP) ? caster->height : 0) + casterinterp.z - groundz);
@ -5406,7 +5414,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer)
{
interpmobjstate_t tracer_interp = {};
interpmobjstate_t tracer_interp = { 0 };
if (! R_ThingVisible(thing->tracer))
return;

View file

@ -38,51 +38,51 @@
<ProjectName>r_opengl</ProjectName>
<ProjectGuid>{51137D5C-4E81-4955-AACF-EA3092006051}</ProjectGuid>
<RootNamespace>r_opengl</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

View file

@ -1136,7 +1136,7 @@ static void GLPerspective(GLfloat fovy, GLfloat aspect)
const GLfloat zNear = NEAR_CLIPPING_PLANE;
const GLfloat zFar = FAR_CLIPPING_PLANE;
const GLfloat radians = (GLfloat)(fovy / 2.0f * M_PIl / 180.0f);
const GLfloat sine = sin(radians);
const GLfloat sine = (GLfloat)sin(radians);
const GLfloat deltaZ = zFar - zNear;
GLfloat cotangent;
@ -2048,9 +2048,9 @@ static void Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAF
if (Surface != NULL)
{
UNIFORM_1(shader->uniforms[gluniform_lighting], Surface->LightInfo.light_level, pglUniform1f);
UNIFORM_1(shader->uniforms[gluniform_fade_start], Surface->LightInfo.fade_start, pglUniform1f);
UNIFORM_1(shader->uniforms[gluniform_fade_end], Surface->LightInfo.fade_end, pglUniform1f);
UNIFORM_1(shader->uniforms[gluniform_lighting], (GLfloat)Surface->LightInfo.light_level, pglUniform1f);
UNIFORM_1(shader->uniforms[gluniform_fade_start], (GLfloat)Surface->LightInfo.fade_start, pglUniform1f);
UNIFORM_1(shader->uniforms[gluniform_fade_end], (GLfloat)Surface->LightInfo.fade_end, pglUniform1f);
}
UNIFORM_1(shader->uniforms[gluniform_leveltime], shader_leveltime, pglUniform1f);
@ -3044,7 +3044,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
if (special_splitscreen)
{
used_fov = atan(tan(used_fov*M_PI/360)*0.8)*360/M_PI;
used_fov = (float)(atan(tan(used_fov*M_PI/360)*0.8)*360/M_PI);
GLPerspective(used_fov, 2*ASPECT_RATIO);
}
else

View file

@ -38,52 +38,52 @@
<ProjectName>s_openal</ProjectName>
<ProjectGuid>{E662D0B3-412D-4D55-A5EC-8CBD680DDCBE}</ProjectGuid>
<RootNamespace>s_openal</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View file

@ -65,6 +65,8 @@ static I_mutex hms_api_mutex;
static char *hms_server_token;
static char hms_useragent[512];
struct HMS_buffer
{
CURL *curl;
@ -81,6 +83,22 @@ Contact_error (void)
);
}
static void
get_user_agent(char *buf, size_t len)
{
if (snprintf(buf, len, "%s/%s (%s; %s; %i; %i) SRB2BASE/%i", SRB2APPLICATION, VERSIONSTRING, compbranch, comprevision, MODID, MODVERSION, CODEBASE) < 0)
I_Error("http-mserv: get_user_agent failed");
}
static void
init_user_agent_once(void)
{
if (hms_useragent[0] != '\0')
return;
get_user_agent(hms_useragent, 512);
}
static size_t
HMS_on_read (char *s, size_t _1, size_t n, void *userdata)
{
@ -156,6 +174,8 @@ HMS_connect (const char *format, ...)
I_lock_mutex(&hms_api_mutex);
#endif
init_user_agent_once();
seek = strlen(hms_api) + 1;/* + '/' */
va_start (ap, format);
@ -202,6 +222,8 @@ HMS_connect (const char *format, ...)
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HMS_on_read);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer);
curl_easy_setopt(curl, CURLOPT_USERAGENT, hms_useragent);
curl_free(quack_token);
free(url);

View file

@ -1758,14 +1758,14 @@ state_t states[NUMSTATES] =
// Metal Sonic
{SPR_PLAY, SPR2_STND, -1, {NULL}, 0, 0, S_METALSONIC_RACE}, // S_METALSONIC_RACE
{SPR_METL, 4, -1, {NULL}, 0, 0, S_NULL}, // S_METALSONIC_FLOAT
{SPR_METL, 4, -1, {NULL}, 0, 0, S_METALSONIC_FLOAT}, // S_METALSONIC_FLOAT
{SPR_METL, 16|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_METALSONIC_STUN}, // S_METALSONIC_VECTOR
{SPR_METL, 15, -1, {NULL}, 0, 0, S_METALSONIC_FLOAT}, // S_METALSONIC_STUN
{SPR_METL, 17, 20, {NULL}, 0, 0, S_METALSONIC_GATHER},// S_METALSONIC_RAISE
{SPR_METL, 18, -1, {NULL}, 0, 0, S_NULL}, // S_METALSONIC_GATHER
{SPR_METL, 18, -1, {NULL}, 0, 0, S_METALSONIC_FLOAT}, // S_METALSONIC_GATHER
{SPR_METL, 6|FF_FULLBRIGHT|FF_ANIMATE|FF_GLOBALANIM, -1, {NULL}, 1, 2, S_METALSONIC_BOUNCE},// S_METALSONIC_DASH
{SPR_METL, 18|FF_FULLBRIGHT|FF_ANIMATE|FF_GLOBALANIM, -1, {NULL}, 1, 2, S_NULL}, // S_METALSONIC_BOUNCE
{SPR_METL, 14, -1, {NULL}, 0, 0, S_NULL}, // S_METALSONIC_BADBOUNCE
{SPR_METL, 18|FF_FULLBRIGHT|FF_ANIMATE|FF_GLOBALANIM, -1, {NULL}, 1, 2, S_METALSONIC_FLOAT}, // S_METALSONIC_BOUNCE
{SPR_METL, 14, -1, {NULL}, 0, 0, S_METALSONIC_FLOAT}, // S_METALSONIC_BADBOUNCE
{SPR_METL, 17, -1, {NULL}, 0, 0, S_METALSONIC_GATHER},// S_METALSONIC_SHOOT
{SPR_METL, 15, 40, {A_Pain}, 0, 0, S_METALSONIC_FLOAT}, // S_METALSONIC_PAIN
{SPR_METL, 17, 2, {A_Fall}, 0, 0, S_METALSONIC_DEATH2},// S_METALSONIC_DEATH1

View file

@ -41,6 +41,7 @@ automatically.
X (MobjMoveBlocked),/* P_XYMovement (when movement is blocked) */\
X (MapThingSpawn),/* P_SpawnMapThing */\
X (FollowMobj),/* P_PlayerAfterThink Smiles mobj-following */\
X (HurtMsg),/* imhurttin */\
#define HOOK_LIST(X) \
X (NetVars),/* add to archive table (netsave) */\
@ -56,7 +57,6 @@ automatically.
X (JumpSpinSpecial),/* P_DoJumpStuff (Spin button effect (mid-air)) */\
X (BotTiccmd),/* B_BuildTiccmd */\
X (PlayerMsg),/* chat messages */\
X (HurtMsg),/* imhurttin */\
X (PlayerSpawn),/* G_SpawnPlayer */\
X (ShieldSpawn),/* P_SpawnShieldOrb */\
X (ShieldSpecial),/* shield abilities */\

View file

@ -72,7 +72,7 @@ static boolean mobj_hook_available(int hook_type, mobjtype_t mobj_type)
return
(
mobjHookIds [MT_NULL] [hook_type].numHooks > 0 ||
mobjHookIds[mobj_type][hook_type].numHooks > 0
(mobj_type < NUMMOBJTYPES && mobjHookIds[mobj_type][hook_type].numHooks > 0)
);
}
@ -343,8 +343,11 @@ static boolean prepare_mobj_hook
Hook_State * hook,
int default_status,
int hook_type,
mobjtype_t mobj_type
mobj_t * primary_mobj
){
const mobjtype_t mobj_type =
primary_mobj ? primary_mobj->type : NUMMOBJTYPES;
#ifdef PARANOIA
if (mobj_type == MT_NULL)
I_Error("MT_NULL has been passed to a mobj hook\n");
@ -505,7 +508,9 @@ static int call_hooks
{
/* call generic mobj hooks first */
calls += call_mobj_type_hooks(hook, MT_NULL);
calls += call_mobj_type_hooks(hook, hook->mobj_type);
if (hook->mobj_type < NUMMOBJTYPES)
calls += call_mobj_type_hooks(hook, hook->mobj_type);
ps_lua_mobjhooks.value.i += calls;
}
@ -553,7 +558,7 @@ static void res_force(Hook_State *hook)
int LUA_HookMobj(mobj_t *mobj, int hook_type)
{
Hook_State hook;
if (prepare_mobj_hook(&hook, false, hook_type, mobj->type))
if (prepare_mobj_hook(&hook, false, hook_type, mobj))
{
LUA_PushUserdata(gL, mobj, META_MOBJ);
call_hooks(&hook, 1, res_true);
@ -564,7 +569,7 @@ int LUA_HookMobj(mobj_t *mobj, int hook_type)
int LUA_Hook2Mobj(mobj_t *t1, mobj_t *t2, int hook_type)
{
Hook_State hook;
if (prepare_mobj_hook(&hook, 0, hook_type, t1->type))
if (prepare_mobj_hook(&hook, 0, hook_type, t1))
{
LUA_PushUserdata(gL, t1, META_MOBJ);
LUA_PushUserdata(gL, t2, META_MOBJ);
@ -712,7 +717,7 @@ void LUA_HookThinkFrame(void)
int LUA_HookMobjLineCollide(mobj_t *mobj, line_t *line)
{
Hook_State hook;
if (prepare_mobj_hook(&hook, 0, MOBJ_HOOK(MobjLineCollide), mobj->type))
if (prepare_mobj_hook(&hook, 0, MOBJ_HOOK(MobjLineCollide), mobj))
{
LUA_PushUserdata(gL, mobj, META_MOBJ);
LUA_PushUserdata(gL, line, META_LINE);
@ -724,7 +729,7 @@ int LUA_HookMobjLineCollide(mobj_t *mobj, line_t *line)
int LUA_HookTouchSpecial(mobj_t *special, mobj_t *toucher)
{
Hook_State hook;
if (prepare_mobj_hook(&hook, false, MOBJ_HOOK(TouchSpecial), special->type))
if (prepare_mobj_hook(&hook, false, MOBJ_HOOK(TouchSpecial), special))
{
LUA_PushUserdata(gL, special, META_MOBJ);
LUA_PushUserdata(gL, toucher, META_MOBJ);
@ -744,7 +749,7 @@ static int damage_hook
Hook_Callback results_handler
){
Hook_State hook;
if (prepare_mobj_hook(&hook, 0, hook_type, target->type))
if (prepare_mobj_hook(&hook, 0, hook_type, target))
{
LUA_PushUserdata(gL, target, META_MOBJ);
LUA_PushUserdata(gL, inflictor, META_MOBJ);
@ -778,7 +783,7 @@ int LUA_HookMobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 d
int LUA_HookMobjMoveBlocked(mobj_t *t1, mobj_t *t2, line_t *line)
{
Hook_State hook;
if (prepare_mobj_hook(&hook, 0, MOBJ_HOOK(MobjMoveBlocked), t1->type))
if (prepare_mobj_hook(&hook, 0, MOBJ_HOOK(MobjMoveBlocked), t1))
{
LUA_PushUserdata(gL, t1, META_MOBJ);
LUA_PushUserdata(gL, t2, META_MOBJ);
@ -905,7 +910,7 @@ int LUA_HookPlayerMsg(int source, int target, int flags, char *msg)
int LUA_HookHurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8 damagetype)
{
Hook_State hook;
if (prepare_hook(&hook, false, HOOK(HurtMsg)))
if (prepare_mobj_hook(&hook, false, MOBJ_HOOK(HurtMsg), inflictor))
{
LUA_PushUserdata(gL, player, META_PLAYER);
LUA_PushUserdata(gL, inflictor, META_MOBJ);
@ -949,7 +954,7 @@ void LUA_HookNetArchive(lua_CFunction archFunc)
int LUA_HookMapThingSpawn(mobj_t *mobj, mapthing_t *mthing)
{
Hook_State hook;
if (prepare_mobj_hook(&hook, false, MOBJ_HOOK(MapThingSpawn), mobj->type))
if (prepare_mobj_hook(&hook, false, MOBJ_HOOK(MapThingSpawn), mobj))
{
LUA_PushUserdata(gL, mobj, META_MOBJ);
LUA_PushUserdata(gL, mthing, META_MAPTHING);
@ -961,7 +966,7 @@ int LUA_HookMapThingSpawn(mobj_t *mobj, mapthing_t *mthing)
int LUA_HookFollowMobj(player_t *player, mobj_t *mobj)
{
Hook_State hook;
if (prepare_mobj_hook(&hook, false, MOBJ_HOOK(FollowMobj), mobj->type))
if (prepare_mobj_hook(&hook, false, MOBJ_HOOK(FollowMobj), mobj))
{
LUA_PushUserdata(gL, player, META_PLAYER);
LUA_PushUserdata(gL, mobj, META_MOBJ);

View file

@ -447,7 +447,7 @@ int LUA_CheckGlobals(lua_State *L, const char *word)
if (strlen(str) < strlength)
return luaL_error(L, "string must not contain embedded zeros!");
strncpy(mapmusname, str, strlength);
strlcpy(mapmusname, str, sizeof mapmusname);
}
else if (fastcmp(word, "mapmusflags"))
mapmusflags = (UINT16)luaL_checkinteger(L, 2);

View file

@ -1129,10 +1129,11 @@ static menuitem_t OP_ChangeControlsMenu[] =
{IT_CALL | IT_STRING2, NULL, "Game Status",
M_ChangeControl, GC_SCORES },
{IT_CALL | IT_STRING2, NULL, "Pause / Run Retry", M_ChangeControl, GC_PAUSE },
{IT_CALL | IT_STRING2, NULL, "Screenshot", M_ChangeControl, GC_SCREENSHOT },
{IT_CALL | IT_STRING2, NULL, "Toggle GIF Recording", M_ChangeControl, GC_RECORDGIF },
{IT_CALL | IT_STRING2, NULL, "Open/Close Menu (ESC)", M_ChangeControl, GC_SYSTEMMENU },
{IT_CALL | IT_STRING2, NULL, "Change Viewpoint", M_ChangeControl, GC_VIEWPOINT },
{IT_CALL | IT_STRING2, NULL, "Screenshot", M_ChangeControl, GC_SCREENSHOT },
{IT_CALL | IT_STRING2, NULL, "Toggle GIF Recording", M_ChangeControl, GC_RECORDGIF },
{IT_CALL | IT_STRING2, NULL, "Open/Close Menu (ESC)", M_ChangeControl, GC_SYSTEMMENU },
{IT_CALL | IT_STRING2, NULL, "Next Viewpoint", M_ChangeControl, GC_VIEWPOINTNEXT },
{IT_CALL | IT_STRING2, NULL, "Prev Viewpoint", M_ChangeControl, GC_VIEWPOINTPREV },
{IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, GC_CONSOLE },
{IT_HEADER, NULL, "Multiplayer", NULL, 0},
{IT_SPACE, NULL, NULL, NULL, 0}, // padding
@ -11668,7 +11669,10 @@ static void M_StartServerMenu(INT32 choice)
// CONNECT VIA IP
// ==============
static char setupm_ip[28];
#define CONNIP_LEN 128
static char setupm_ip[CONNIP_LEN];
#define DOTS "... "
// Draw the funky Connect IP menu. Tails 11-19-2002
// So much work for such a little thing!
@ -11676,6 +11680,11 @@ static void M_DrawMPMainMenu(void)
{
INT32 x = currentMenu->x;
INT32 y = currentMenu->y;
const INT32 boxwidth = /*16*8 + 6*/ (BASEVIDWIDTH - 2*(x+5));
const INT32 maxstrwidth = boxwidth - 5;
char *drawnstr = malloc(sizeof(setupm_ip));
char *drawnstr_orig = drawnstr;
boolean drawthin, shorten = false;
// use generic drawer for cursor, items and title
M_DrawGenericMenu();
@ -11691,17 +11700,55 @@ static void M_DrawMPMainMenu(void)
y += 22;
V_DrawFill(x+5, y+4+5, /*16*8 + 6,*/ BASEVIDWIDTH - 2*(x+5), 8+6, 159);
V_DrawFill(x+5, y+4+5, boxwidth, 8+6, 159);
strcpy(drawnstr, setupm_ip);
drawthin = V_StringWidth(drawnstr, V_ALLOWLOWERCASE) + V_StringWidth("_", V_ALLOWLOWERCASE) > maxstrwidth;
// draw name string
V_DrawString(x+8,y+12, V_ALLOWLOWERCASE, setupm_ip);
if (drawthin)
{
INT32 dotswidth = V_ThinStringWidth(DOTS, V_ALLOWLOWERCASE);
//UINT32 color = 0;
while (V_ThinStringWidth(drawnstr, V_ALLOWLOWERCASE) + V_ThinStringWidth("_", V_ALLOWLOWERCASE) >= maxstrwidth)
{
shorten = true;
drawnstr++;
}
if (shorten)
{
INT32 initiallen = V_ThinStringWidth(drawnstr, V_ALLOWLOWERCASE);
INT32 cutofflen = 0;
while ((cutofflen = initiallen - V_ThinStringWidth(drawnstr, V_ALLOWLOWERCASE)) < dotswidth)
drawnstr++;
V_DrawThinString(x+8,y+13, V_ALLOWLOWERCASE|V_GRAYMAP, DOTS);
x += V_ThinStringWidth(DOTS, V_ALLOWLOWERCASE);
}
V_DrawThinString(x+8,y+13, V_ALLOWLOWERCASE, drawnstr);
}
else
{
V_DrawString(x+8,y+12, V_ALLOWLOWERCASE, drawnstr);
}
// draw text cursor for name
if (itemOn == 2 //0
&& skullAnimCounter < 4) //blink cursor
V_DrawCharacter(x+8+V_StringWidth(setupm_ip, V_ALLOWLOWERCASE),y+12,'_',false);
&& skullAnimCounter < 4) //blink cursor
{
if (drawthin)
V_DrawCharacter(x+8+V_ThinStringWidth(drawnstr, V_ALLOWLOWERCASE),y+12,'_',false);
else
V_DrawCharacter(x+8+V_StringWidth(drawnstr, V_ALLOWLOWERCASE),y+12,'_',false);
}
free(drawnstr_orig);
}
#undef DOTS
// Tails 11-19-2002
static void M_ConnectIP(INT32 choice)
{
@ -11782,7 +11829,7 @@ static void M_HandleConnectIP(INT32 choice)
const char *paste = I_ClipboardPaste();
if (paste != NULL) {
strncat(setupm_ip, paste, 28-1 - l); // Concat the ip field with clipboard
strncat(setupm_ip, paste, CONNIP_LEN-1 - l); // Concat the ip field with clipboard
if (strlen(paste) != 0) // Don't play sound if nothing was pasted
S_StartSound(NULL,sfx_menu1); // Tails
}
@ -11816,7 +11863,7 @@ static void M_HandleConnectIP(INT32 choice)
const char *paste = I_ClipboardPaste();
if (paste != NULL) {
strncat(setupm_ip, paste, 28-1 - l); // Concat the ip field with clipboard
strncat(setupm_ip, paste, CONNIP_LEN-1 - l); // Concat the ip field with clipboard
if (strlen(paste) != 0) // Don't play sound if nothing was pasted
S_StartSound(NULL,sfx_menu1); // Tails
}
@ -11833,7 +11880,7 @@ static void M_HandleConnectIP(INT32 choice)
}
}
if (l >= 28-1)
if (l >= CONNIP_LEN-1)
break;
// Rudimentary number and period enforcing - also allows letters so hostnames can be used instead
@ -12750,13 +12797,14 @@ static void M_Setup1PControlsMenu(INT32 choice)
OP_ChangeControlsMenu[18+5].status = IT_CALL|IT_STRING2;
OP_ChangeControlsMenu[18+6].status = IT_CALL|IT_STRING2;
//OP_ChangeControlsMenu[18+7].status = IT_CALL|IT_STRING2;
OP_ChangeControlsMenu[18+8].status = IT_CALL|IT_STRING2;
//OP_ChangeControlsMenu[18+8].status = IT_CALL|IT_STRING2;
OP_ChangeControlsMenu[18+9].status = IT_CALL|IT_STRING2;
// ...
OP_ChangeControlsMenu[27+0].status = IT_HEADER;
OP_ChangeControlsMenu[27+1].status = IT_SPACE;
OP_ChangeControlsMenu[28+0].status = IT_HEADER;
OP_ChangeControlsMenu[28+1].status = IT_SPACE;
// ...
OP_ChangeControlsMenu[27+2].status = IT_CALL|IT_STRING2;
OP_ChangeControlsMenu[27+3].status = IT_CALL|IT_STRING2;
OP_ChangeControlsMenu[28+2].status = IT_CALL|IT_STRING2;
OP_ChangeControlsMenu[28+3].status = IT_CALL|IT_STRING2;
OP_ChangeControlsDef.prevMenu = &OP_P1ControlsDef;
OP_ChangeControlsDef.menuid &= ~(((1 << MENUBITS) - 1) << MENUBITS); // remove second level
@ -12781,13 +12829,14 @@ static void M_Setup2PControlsMenu(INT32 choice)
OP_ChangeControlsMenu[18+5].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[18+6].status = IT_GRAYEDOUT2;
//OP_ChangeControlsMenu[18+7].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[18+8].status = IT_GRAYEDOUT2;
//OP_ChangeControlsMenu[18+8].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[18+9].status = IT_GRAYEDOUT2;
// ...
OP_ChangeControlsMenu[27+0].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[27+1].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[28+0].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[28+1].status = IT_GRAYEDOUT2;
// ...
OP_ChangeControlsMenu[27+2].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[27+3].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[28+2].status = IT_GRAYEDOUT2;
OP_ChangeControlsMenu[28+3].status = IT_GRAYEDOUT2;
OP_ChangeControlsDef.prevMenu = &OP_P2ControlsDef;
OP_ChangeControlsDef.menuid &= ~(((1 << MENUBITS) - 1) << MENUBITS); // remove second level

View file

@ -1405,6 +1405,9 @@ void A_StatueBurst(mobj_t *actor)
if (LUA_CallAction(A_STATUEBURST, actor))
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)))
return;
@ -2668,7 +2671,7 @@ void A_LobShot(mobj_t *actor)
fixed_t z;
fixed_t dist;
fixed_t vertical, horizontal;
fixed_t airtime = var2 & 65535;
fixed_t airtime = max(1, var2 & 65535);
if (LUA_CallAction(A_LOBSHOT, actor))
return;
@ -4856,12 +4859,12 @@ void A_FishJump(mobj_t *actor)
else
{
if (actor->spawnpoint && actor->spawnpoint->args[0])
jumpval = actor->spawnpoint->args[0];
jumpval = actor->spawnpoint->args[0] << (FRACBITS - 2);
else
jumpval = 44;
jumpval = 44 << (FRACBITS - 2);
}
actor->momz = FixedMul(jumpval << (FRACBITS - 2), actor->scale);
actor->momz = FixedMul(jumpval, actor->scale);
P_SetMobjStateNF(actor, actor->info->seestate);
}

View file

@ -3989,12 +3989,11 @@ void P_NullPrecipThinker(precipmobj_t *mobj)
{
//(void)mobj;
mobj->precipflags &= ~PCF_THUNK;
R_ResetPrecipitationMobjInterpolationState(mobj);
}
void P_SnowThinker(precipmobj_t *mobj)
{
R_ResetPrecipitationMobjInterpolationState(mobj);
P_CycleStateAnimation((mobj_t *)mobj);
// adjust height
@ -4007,8 +4006,6 @@ void P_SnowThinker(precipmobj_t *mobj)
void P_RainThinker(precipmobj_t *mobj)
{
R_ResetPrecipitationMobjInterpolationState(mobj);
P_CycleStateAnimation((mobj_t *)mobj);
if (mobj->state != &states[S_RAIN1])
@ -5664,6 +5661,8 @@ static void P_Boss9Thinker(mobj_t *mobj)
{
mobj_t *missile = P_SpawnMissile(spawner, mobj, MT_MSGATHER);
missile->fuse = (dist/P_AproxDistance(missile->momx, missile->momy));
if (missile->fuse <= 0) // Prevents a division by zero when calculating missile->scalespeed
missile->fuse = 1;
if (missile->fuse > mobj->fuse)
P_RemoveMobj(missile);
@ -11147,6 +11146,8 @@ void P_RemoveMobj(mobj_t *mobj)
memset((UINT8 *)mobj + sizeof(thinker_t), 0xff, sizeof(mobj_t) - sizeof(thinker_t));
#endif
R_RemoveMobjInterpolator(mobj);
// free block
if (!mobj->thinker.next)
{ // Uh-oh, the mobj doesn't think, P_RemoveThinker would never go through!
@ -11163,8 +11164,6 @@ void P_RemoveMobj(mobj_t *mobj)
}
P_RemoveThinker((thinker_t *)mobj);
R_RemoveMobjInterpolator(mobj);
}
// This does not need to be added to Lua.
@ -11195,21 +11194,41 @@ void P_RemovePrecipMobj(precipmobj_t *mobj)
void P_RemoveSavegameMobj(mobj_t *mobj)
{
// unlink from sector and block lists
P_UnsetThingPosition(mobj);
// Remove touching_sectorlist from mobj.
if (sector_list)
if (((thinker_t *)mobj)->function.acp1 == (actionf_p1)P_NullPrecipThinker)
{
P_DelSeclist(sector_list);
sector_list = NULL;
P_UnsetPrecipThingPosition((precipmobj_t *)mobj);
if (precipsector_list)
{
P_DelPrecipSeclist(precipsector_list);
precipsector_list = NULL;
}
}
else
{
// unlink from sector and block lists
P_UnsetThingPosition(mobj);
// Remove touching_sectorlist from mobj.
if (sector_list)
{
P_DelSeclist(sector_list);
sector_list = NULL;
}
}
// stop any playing sound
S_StopSound(mobj);
R_RemoveMobjInterpolator(mobj);
// free block
P_RemoveThinker((thinker_t *)mobj);
R_RemoveMobjInterpolator(mobj);
// Here we use the same code as R_RemoveThinkerDelayed, but without reference counting (we're removing everything so it shouldn't matter) and without touching currentthinker since we aren't in P_RunThinkers
{
thinker_t *thinker = (thinker_t *)mobj;
thinker_t *next = thinker->next;
(next->prev = thinker->prev)->next = next;
Z_Free(thinker);
}
}
static CV_PossibleValue_t respawnitemtime_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}};
@ -13506,7 +13525,7 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numi
static void P_SpawnSingularItemRow(mapthing_t *mthing, mobjtype_t itemtype, INT32 numitems, fixed_t horizontalspacing, fixed_t verticalspacing, INT16 fixedangle, boolean bonustime)
{
mobjtype_t itemtypes[1] = { itemtype };
return P_SpawnItemRow(mthing, itemtypes, 1, numitems, horizontalspacing, verticalspacing, fixedangle, bonustime);
P_SpawnItemRow(mthing, itemtypes, 1, numitems, horizontalspacing, verticalspacing, fixedangle, bonustime);
}
static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t size, boolean bonustime)

View file

@ -296,16 +296,16 @@ typedef struct polywaypointdata_s
typedef enum
{
TMPV_NOCHANGE = 1,
TMPV_VISIBLE = 1<<1,
TMPV_INVISIBLE = 1<<2,
TMPV_NOCHANGE = 0,
TMPV_VISIBLE = 1,
TMPV_INVISIBLE = 2,
} textmappolyvisibility_t;
typedef enum
{
TMPT_NOCHANGE = 1,
TMPT_TANGIBLE = 1<<1,
TMPT_INTANGIBLE = 1<<2,
TMPT_NOCHANGE = 0,
TMPT_TANGIBLE = 1,
TMPT_INTANGIBLE = 2,
} textmappolytangibility_t;
// polyobject door types

View file

@ -3059,6 +3059,18 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker)
mobj->player->viewz = mobj->player->mo->z + mobj->player->viewheight;
}
if (mobj->type == MT_SKYBOX && mobj->spawnpoint)
{
mtag_t tag = Tag_FGet(&mobj->spawnpoint->tags);
if (tag >= 0 && tag <= 15)
{
if (mobj->spawnpoint->args[0])
skyboxcenterpnts[tag] = mobj;
else
skyboxviewpnts[tag] = mobj;
}
}
mobj->info = (mobjinfo_t *)next; // temporarily, set when leave this function
R_AddMobjInterpolator(mobj);
@ -3680,10 +3692,14 @@ static void P_NetUnArchiveThinkers(void)
{
next = currentthinker->next;
if (currentthinker->function.acp1 == (actionf_p1)P_MobjThinker)
if (currentthinker->function.acp1 == (actionf_p1)P_MobjThinker || currentthinker->function.acp1 == (actionf_p1)P_NullPrecipThinker)
P_RemoveSavegameMobj((mobj_t *)currentthinker); // item isn't saved, don't remove it
else
{
(next->prev = currentthinker->prev)->next = next;
R_DestroyLevelInterpolators(currentthinker);
Z_Free(currentthinker);
}
}
}
@ -3885,6 +3901,10 @@ static void P_NetUnArchiveThinkers(void)
CONS_Debug(DBG_NETPLAY, "%u thinkers loaded in list %d\n", numloaded, i);
}
// Set each skyboxmo to the first skybox (or NULL)
skyboxmo[0] = skyboxviewpnts[0];
skyboxmo[1] = skyboxcenterpnts[0];
if (restoreNum)
{
executor_t *delay = NULL;

View file

@ -3009,7 +3009,7 @@ static inline void P_LoadSubsectors(UINT8 *data)
for (i = 0; i < numsubsectors; i++, ss++, ms++)
{
ss->numlines = SHORT(ms->numsegs);
ss->firstline = SHORT(ms->firstseg);
ss->firstline = (UINT16)SHORT(ms->firstseg);
P_InitializeSubsector(ss);
}
}
@ -4910,9 +4910,9 @@ static void P_ConvertBinaryLinedefTypes(void)
case 331: // Player skin - continuous
case 332: // Player skin - each time
case 333: // Player skin - once
if (lines[i].special == 303)
if (lines[i].special == 333)
lines[i].args[0] = TMT_ONCE;
else if (lines[i].special == 302)
else if (lines[i].special == 332)
lines[i].args[0] = (lines[i].flags & ML_BOUNCY) ? TMT_EACHTIMEENTERANDEXIT : TMT_EACHTIMEENTER;
else
lines[i].args[0] = TMT_CONTINUOUS;
@ -6627,8 +6627,8 @@ static void P_ConvertBinaryThingTypes(void)
case 1713: //Hoop (Customizable)
{
UINT16 oldangle = mapthings[i].angle;
mapthings[i].angle = ((oldangle >> 8)*360)/256;
mapthings[i].pitch = ((oldangle & 255)*360)/256;
mapthings[i].angle = (mapthings[i].extrainfo == 1) ? oldangle - 90 : ((oldangle >> 8)*360)/256;
mapthings[i].pitch = (mapthings[i].extrainfo == 1) ? oldangle / 360 : ((oldangle & 255)*360)/256;
mapthings[i].args[0] = (mapthings[i].type == 1705) ? 96 : (mapthings[i].options & 0xF)*16 + 32;
mapthings[i].options &= ~0xF;
mapthings[i].type = 1713;
@ -7789,6 +7789,10 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
if (rendermode == render_none || reloadinggamestate)
return true;
R_ResetViewInterpolation(0);
R_ResetViewInterpolation(0);
R_UpdateMobjInterpolators();
// Title card!
G_StartTitleCard();

View file

@ -172,6 +172,9 @@ void T_DynamicSlopeVert (dynvertexplanethink_t* th)
for (i = 0; i < 3; i++)
{
if (!th->secs[i])
continue;
if (th->relative & (1 << i))
th->vex[i].z = th->origvecheights[i] + (th->secs[i]->floorheight - th->origsecheights[i]);
else
@ -205,16 +208,11 @@ static inline void P_AddDynVertexSlopeThinker (pslope_t* slope, const INT16 tags
for (i = 0; i < 3; i++) {
l = Tag_FindLineSpecial(799, tags[i]);
if (l == -1)
{
Z_Free(th);
return;
}
th->secs[i] = lines[l].frontsector;
th->secs[i] = (l == -1) ? NULL : lines[l].frontsector;
th->vex[i] = vx[i];
th->origsecheights[i] = lines[l].frontsector->floorheight;
th->origsecheights[i] = (l == -1) ? 0 : lines[l].frontsector->floorheight;
th->origvecheights[i] = vx[i].z;
if (lines[l].args[0])
if (l != -1 && lines[l].args[0])
th->relative |= 1<<i;
}
P_AddThinker(THINK_DYNSLOPE, &th->thinker);

View file

@ -1882,7 +1882,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
// "Trigger on X calls" linedefs reset if args[2] is set
if (specialtype == 321 && triggerline->args[2])
triggerline->callcount = triggerline->args[3];
triggerline->callcount = triggerline->args[1];
else
{
// These special types work only once

View file

@ -4984,7 +4984,7 @@ void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range)
static void P_DoTwinSpin(player_t *player)
{
player->pflags &= ~PF_NOJUMPDAMAGE;
player->pflags &= ~(PF_NOJUMPDAMAGE|PF_SPINNING);
player->pflags |= P_GetJumpFlags(player) | PF_THOKKED;
S_StartSound(player->mo, sfx_s3k42);
player->mo->frame = 0;
@ -5031,6 +5031,7 @@ static boolean P_PlayerShieldThink(player_t *player, ticcmd_t *cmd, mobj_t *lock
if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE)
{
player->pflags |= PF_THOKKED|PF_SHIELDABILITY;
player->pflags &= ~PF_SPINNING;
player->mo->momx = player->mo->momy = player->mo->momz = 0;
S_StartSound(player->mo, sfx_ngskid);
}
@ -5046,11 +5047,13 @@ static boolean P_PlayerShieldThink(player_t *player, ticcmd_t *cmd, mobj_t *lock
// Armageddon pow
case SH_ARMAGEDDON:
player->pflags |= PF_THOKKED|PF_SHIELDABILITY;
player->pflags &= ~PF_SPINNING;
P_BlackOw(player);
break;
// Attraction blast
case SH_ATTRACT:
player->pflags |= PF_THOKKED|PF_SHIELDABILITY;
player->pflags &= ~PF_SPINNING;
player->homing = 2;
P_SetTarget(&player->mo->target, P_SetTarget(&player->mo->tracer, lockonshield));
if (lockonshield)
@ -5070,6 +5073,7 @@ static boolean P_PlayerShieldThink(player_t *player, ticcmd_t *cmd, mobj_t *lock
{
boolean elem = ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL);
player->pflags |= PF_THOKKED|PF_SHIELDABILITY;
player->pflags &= ~PF_SPINNING;
if (elem)
{
player->mo->momx = player->mo->momy = 0;
@ -5092,7 +5096,7 @@ static boolean P_PlayerShieldThink(player_t *player, ticcmd_t *cmd, mobj_t *lock
player->pflags |= PF_THOKKED|PF_SHIELDABILITY;
P_Thrust(player->mo, player->mo->angle, FixedMul(30*FRACUNIT - FixedSqrt(FixedDiv(player->speed, player->mo->scale)), player->mo->scale));
player->drawangle = player->mo->angle;
player->pflags &= ~PF_NOJUMPDAMAGE;
player->pflags &= ~(PF_NOJUMPDAMAGE|PF_SPINNING);
P_SetPlayerMobjState(player->mo, S_PLAY_ROLL);
S_StartSound(player->mo, sfx_s3k43);
default:
@ -5385,7 +5389,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
if (!(player->pflags & PF_THOKKED) || ((player->charflags & SF_MULTIABILITY) && (player->secondjump < (player->actionspd >> FRACBITS))))
{
player->pflags |= PF_THOKKED;
player->pflags &= ~PF_JUMPED;
player->pflags &= ~(PF_JUMPED|PF_SPINNING);
P_DoJump(player, true);
player->secondjump++;
}
@ -5411,6 +5415,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
P_Telekinesis(player,
FixedMul(player->actionspd, player->mo->scale), // +ve thrust (pushing away from player)
FixedMul(384*FRACUNIT, player->mo->scale));
player->pflags &= ~PF_SPINNING;
}
break;
case CA_FALLSWITCH:
@ -5419,6 +5424,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
player->mo->momz = -player->mo->momz;
P_SpawnThokMobj(player);
player->pflags |= PF_THOKKED;
player->pflags &= ~PF_SPINNING;
}
break;
case CA_AIRDRILL:
@ -5426,6 +5432,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
{
player->flyangle = 56 + (60-(player->actionspd>>FRACBITS))/3;
player->pflags |= PF_THOKKED;
player->pflags &= ~PF_SPINNING;
S_StartSound(player->mo, sfx_spndsh);
}
break;
@ -5433,7 +5440,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
if (!(player->pflags & PF_THOKKED) || player->charflags & SF_MULTIABILITY)
{
P_SetPlayerMobjState(player->mo, S_PLAY_BOUNCE);
player->pflags &= ~(PF_JUMPED|PF_NOJUMPDAMAGE);
player->pflags &= ~(PF_JUMPED|PF_NOJUMPDAMAGE|PF_SPINNING);
player->pflags |= PF_THOKKED|PF_BOUNCING;
player->mo->momx >>= 1;
player->mo->momy >>= 1;
@ -11031,6 +11038,21 @@ static void P_MinecartThink(player_t *player)
S_StartSound(minecart, minecart->info->activesound);
}
}
// Mark interpolation; the old positions need to be relative to the displacement from the minecart _after_ it's moved.
// This isn't quite correct (it captures the landing wobble) but it works well enough
if (detleft)
{
detleft->old_x = detleft->x - (minecart->old_x - minecart->old_x2);
detleft->old_y = detleft->y - (minecart->old_y - minecart->old_y2);
detleft->old_z = detleft->z - (minecart->old_z - minecart->old_z2);
}
if (detright)
{
detright->old_x = detright->x - (minecart->old_x - minecart->old_x2);
detright->old_y = detright->y - (minecart->old_y - minecart->old_y2);
detright->old_z = detright->z - (minecart->old_z - minecart->old_z2);
}
}
else
{

View file

@ -399,8 +399,8 @@ static void R_AddLine(seg_t *line)
return;
// big room fix
angle1 = R_PointToAngleEx(viewx, viewy, line->v1->x, line->v1->y);
angle2 = R_PointToAngleEx(viewx, viewy, line->v2->x, line->v2->y);
angle1 = R_PointToAngle64(line->v1->x, line->v1->y);
angle2 = R_PointToAngle64(line->v2->x, line->v2->y);
curline = line;
// Clip to view edges.
@ -620,8 +620,8 @@ static boolean R_CheckBBox(const fixed_t *bspcoord)
check = checkcoord[boxpos];
// big room fix
angle1 = R_PointToAngleEx(viewx, viewy, bspcoord[check[0]], bspcoord[check[1]]) - viewangle;
angle2 = R_PointToAngleEx(viewx, viewy, bspcoord[check[2]], bspcoord[check[3]]) - viewangle;
angle1 = R_PointToAngle64(bspcoord[check[0]], bspcoord[check[1]]) - viewangle;
angle2 = R_PointToAngle64(bspcoord[check[2]], bspcoord[check[3]]) - viewangle;
if ((signed)angle1 < (signed)angle2)
{

View file

@ -587,7 +587,7 @@ typedef struct subsector_s
{
sector_t *sector;
INT16 numlines;
UINT16 firstline;
UINT32 firstline;
struct polyobj_s *polyList; // haleyjd 02/19/06: list of polyobjects
size_t validcount;
} subsector_t;

View file

@ -266,13 +266,13 @@ INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node)
if (!node->dy)
return y <= node->y ? node->dx < 0 : node->dx > 0;
x -= node->x;
y -= node->y;
fixed_t dx = (x >> 1) - (node->x >> 1);
fixed_t dy = (y >> 1) - (node->y >> 1);
// Try to quickly decide by looking at sign bits.
if ((node->dy ^ node->dx ^ x ^ y) < 0)
return (node->dy ^ x) < 0; // (left is negative)
return FixedMul(y, node->dx>>FRACBITS) >= FixedMul(node->dy>>FRACBITS, x);
if ((node->dy ^ node->dx ^ dx ^ dy) < 0)
return (node->dy ^ dx) < 0; // (left is negative)
return FixedMul(dy, node->dx>>FRACBITS) >= FixedMul(node->dy>>FRACBITS, dx);
}
// killough 5/2/98: reformatted
@ -289,13 +289,13 @@ INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line)
if (!ldy)
return y <= ly ? ldx < 0 : ldx > 0;
x -= lx;
y -= ly;
fixed_t dx = (x >> 1) - (lx >> 1);
fixed_t dy = (y >> 1) - (ly >> 1);
// Try to quickly decide by looking at sign bits.
if ((ldy ^ ldx ^ x ^ y) < 0)
return (ldy ^ x) < 0; // (left is negative)
return FixedMul(y, ldx>>FRACBITS) >= FixedMul(ldy>>FRACBITS, x);
if ((ldy ^ ldx ^ dx ^ dy) < 0)
return (ldy ^ dx) < 0; // (left is negative)
return FixedMul(dy, ldx>>FRACBITS) >= FixedMul(ldy>>FRACBITS, dx);
}
//
@ -620,7 +620,7 @@ static struct {
0,
0,
{}, {},
{0}, {0},
false
};

View file

@ -447,7 +447,7 @@ void *Picture_FlatConvert(
for (y = 0; y < inheight; y++)
for (x = 0; x < inwidth; x++)
{
void *input;
void *input = NULL;
size_t offs = ((y * inwidth) + x);
// Read pixel

View file

@ -1870,7 +1870,11 @@ static void R_ProjectSprite(mobj_t *thing)
range++; // fencepost problem
scalestep = ((yscale2 - yscale)/range) ?: 1;
// Compatibility with MSVC - SSNTails
scalestep = ((yscale2 - yscale) / range);
if (!scalestep)
scalestep = 1;
xscale = FixedDiv(range<<FRACBITS, abs(offset2));
// The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2?
@ -2000,7 +2004,7 @@ static void R_ProjectSprite(mobj_t *thing)
if (shadoweffects)
{
mobj_t *caster = thing->target;
interpmobjstate_t casterinterp = {};
interpmobjstate_t casterinterp = { 0 }; // MSVC compatibility - SSNTails
if (R_UsingFrameInterpolation() && !paused)
{

View file

@ -401,7 +401,6 @@ void SCR_SetDefaultMode(void)
// remember the default screen size
CV_SetValue(&cv_scr_width, vid.width);
CV_SetValue(&cv_scr_height, vid.height);
CV_SetValue(&cv_scr_depth, vid.bpp*8);
}
// Change fullscreen on/off according to cv_fullscreen
@ -622,7 +621,13 @@ void SCR_ClosedCaptions(void)
y = basey-((i + 2)*10);
if (closedcaptions[i].b)
y -= (closedcaptions[i].b--)*vid.dupy;
{
y -= closedcaptions[i].b * vid.dupy;
if (renderisnewtic)
{
closedcaptions[i].b--;
}
}
if (closedcaptions[i].t < CAPTIONFADETICS)
flags |= (((CAPTIONFADETICS-closedcaptions[i].t)/2)*V_10TRANS);

View file

@ -39,46 +39,46 @@
<ProjectGuid>{61BA7D3C-F77D-4D31-B718-1177FE482CF2}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Srb2SDL</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>Srb2Win</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
@ -134,6 +134,9 @@
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>$(ProjectName)_Debug</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -154,6 +157,26 @@
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;ole32.lib;advapi32.lib;shell32.lib;gdi32.lib;oleaut32.lib;uuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<LanguageStandard_C>Default</LanguageStandard_C>
<TreatWarningAsError>false</TreatWarningAsError>
<DisableSpecificWarnings>4244;4267;4146</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<DisableSpecificWarnings>4244;4267;4146;4003</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\libs\libpng-src\projects\visualc10\libpng.vcxproj">
<Project>{72b01aca-7a1a-4f7b-acef-2607299cf052}</Project>
@ -246,11 +269,13 @@
<ClInclude Include="..\i_system.h" />
<ClInclude Include="..\i_tcp.h" />
<ClInclude Include="..\i_threads.h" />
<ClInclude Include="..\i_time.h" />
<ClInclude Include="..\i_video.h" />
<ClInclude Include="..\keys.h" />
<ClInclude Include="..\libdivide.h" />
<ClInclude Include="..\lua_hook.h" />
<ClInclude Include="..\lua_hud.h" />
<ClInclude Include="..\lua_hudlib_drawlist.h" />
<ClInclude Include="..\lua_libs.h" />
<ClInclude Include="..\lua_script.h" />
<ClInclude Include="..\lzf.h" />
@ -264,6 +289,7 @@
<ClInclude Include="..\m_cheat.h" />
<ClInclude Include="..\m_cond.h" />
<ClInclude Include="..\m_dllist.h" />
<ClInclude Include="..\m_easing.h" />
<ClInclude Include="..\m_fixed.h" />
<ClInclude Include="..\m_menu.h" />
<ClInclude Include="..\m_misc.h" />
@ -272,6 +298,7 @@
<ClInclude Include="..\m_random.h" />
<ClInclude Include="..\m_swap.h" />
<ClInclude Include="..\p5prof.h" />
<ClInclude Include="..\p_haptic.h" />
<ClInclude Include="..\p_local.h" />
<ClInclude Include="..\p_maputl.h" />
<ClInclude Include="..\p_mobj.h" />
@ -286,6 +313,7 @@
<ClInclude Include="..\r_data.h" />
<ClInclude Include="..\r_defs.h" />
<ClInclude Include="..\r_draw.h" />
<ClInclude Include="..\r_fps.h" />
<ClInclude Include="..\r_local.h" />
<ClInclude Include="..\r_main.h" />
<ClInclude Include="..\r_patch.h" />
@ -403,11 +431,13 @@
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\i_tcp.c" />
<ClCompile Include="..\i_time.c" />
<ClCompile Include="..\lua_baselib.c" />
<ClCompile Include="..\lua_blockmaplib.c" />
<ClCompile Include="..\lua_consolelib.c" />
<ClCompile Include="..\lua_hooklib.c" />
<ClCompile Include="..\lua_hudlib.c" />
<ClCompile Include="..\lua_hudlib_drawlist.c" />
<ClCompile Include="..\lua_infolib.c" />
<ClCompile Include="..\lua_inputlib.c" />
<ClCompile Include="..\lua_maplib.c" />
@ -429,6 +459,7 @@
<ClCompile Include="..\m_bbox.c" />
<ClCompile Include="..\m_cheat.c" />
<ClCompile Include="..\m_cond.c" />
<ClCompile Include="..\m_easing.c" />
<ClCompile Include="..\m_fixed.c" />
<ClCompile Include="..\m_menu.c" />
<ClCompile Include="..\m_misc.c" />
@ -438,6 +469,7 @@
<ClCompile Include="..\p_ceilng.c" />
<ClCompile Include="..\p_enemy.c" />
<ClCompile Include="..\p_floor.c" />
<ClCompile Include="..\p_haptic.c" />
<ClCompile Include="..\p_inter.c" />
<ClCompile Include="..\p_lights.c" />
<ClCompile Include="..\p_map.c" />
@ -464,6 +496,7 @@
<ClCompile Include="..\r_draw8_npo2.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\r_fps.c" />
<ClCompile Include="..\r_main.c" />
<ClCompile Include="..\r_patch.c" />
<ClCompile Include="..\r_patchrotation.c" />
@ -478,7 +511,6 @@
<ClCompile Include="..\r_things.c" />
<ClCompile Include="..\screen.c" />
<ClCompile Include="..\sounds.c" />
<ClCompile Include="..\strcasestr.c" />
<ClCompile Include="..\string.c" />
<ClCompile Include="..\st_stuff.c" />
<ClCompile Include="..\s_sound.c" />
@ -507,7 +539,7 @@
<ClCompile Include="IMG_xpm.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="i_cdmus.c" />
<ClCompile Include="i_gamepad.c" />
<ClCompile Include="i_main.c" />
<ClCompile Include="i_net.c" />
<ClCompile Include="i_system.c" />
@ -524,4 +556,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -144,7 +144,6 @@
<ClInclude Include="..\deh_tables.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\doomdata.h">
<Filter>D_Doom</Filter>
</ClInclude>
@ -511,6 +510,21 @@
<ClInclude Include="..\r_portal.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\lua_hudlib_drawlist.h">
<Filter>LUA</Filter>
</ClInclude>
<ClInclude Include="..\i_time.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\r_fps.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\p_haptic.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\m_easing.h">
<Filter>M_Misc</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\tmap.nas">
@ -625,7 +639,6 @@
<ClCompile Include="..\deh_tables.c">
<Filter>D_Doom</Filter>
</ClCompile>
<ClCompile Include="..\d_clisrv.c">
<Filter>D_Doom</Filter>
</ClCompile>
@ -821,9 +834,6 @@
<ClCompile Include="..\string.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\strcasestr.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\comptime.c">
<Filter>O_Other</Filter>
</ClCompile>
@ -965,9 +975,6 @@
<ClCompile Include="hwsym_sdl.c">
<Filter>SDLApp</Filter>
</ClCompile>
<ClCompile Include="i_cdmus.c">
<Filter>SDLApp</Filter>
</ClCompile>
<ClCompile Include="i_main.c">
<Filter>SDLApp</Filter>
</ClCompile>
@ -1023,10 +1030,28 @@
<ClCompile Include="..\r_portal.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\lua_hudlib_drawlist.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="i_gamepad.c">
<Filter>SDLApp</Filter>
</ClCompile>
<ClCompile Include="..\i_time.c">
<Filter>I_Interface</Filter>
</ClCompile>
<ClCompile Include="..\r_fps.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\p_haptic.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\m_easing.c">
<Filter>M_Misc</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="Srb2SDL.ico">
<Filter>SDLApp</Filter>
</Image>
</ItemGroup>
</Project>
</Project>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,74 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Srb2SDL"=.\Srb2SDL.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name libpng
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
Project: "libpng"="..\..\libs\libpng-src\projects\visualc6\libpng.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
Project: "s_openal"=..\hardware\s_openal\s_openal.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "zlib"=..\..\libs\zlib\projects\visualc6\zlib.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View file

@ -164,7 +164,7 @@ hudinfo_t hudinfo[NUMHUDITEMS] =
{ 288, 176, V_SNAPTORIGHT|V_SNAPTOBOTTOM}, // HUD_POWERUPS
};
static huddrawlist_h luahuddrawlist_game;
static huddrawlist_h luahuddrawlist_game[2];
static huddrawlist_h luahuddrawlist_titlecard;
//
@ -427,7 +427,8 @@ void ST_Init(void)
ST_LoadGraphics();
luahuddrawlist_game = LUA_HUD_CreateDrawList();
luahuddrawlist_game[0] = LUA_HUD_CreateDrawList();
luahuddrawlist_game[1] = LUA_HUD_CreateDrawList();
luahuddrawlist_titlecard = LUA_HUD_CreateDrawList();
}
@ -2757,10 +2758,13 @@ static void ST_overlayDrawer(void)
if (!(netgame || multiplayer) || !hu_showscores)
{
INT32 hooklistindex = splitscreen && stplyr == &players[secondarydisplayplayer] ? 1 : 0;
if (renderisnewtic)
{
LUA_HUDHOOK(game, luahuddrawlist_game);
LUA_HUD_ClearDrawList(luahuddrawlist_game[hooklistindex]);
LUA_HUDHOOK(game, luahuddrawlist_game[hooklistindex]);
}
LUA_HUD_DrawList(luahuddrawlist_game[hooklistindex]);
}
// draw level title Tails
@ -2839,10 +2843,6 @@ void ST_Drawer(void)
if (st_overlay)
{
if (renderisnewtic)
{
LUA_HUD_ClearDrawList(luahuddrawlist_game);
}
// No deadview!
stplyr = &players[displayplayer];
ST_overlayDrawer();
@ -2852,7 +2852,5 @@ void ST_Drawer(void)
stplyr = &players[secondarydisplayplayer];
ST_overlayDrawer();
}
LUA_HUD_DrawList(luahuddrawlist_game);
}
}

View file

@ -22,6 +22,16 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef _MSC_VER
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifndef strncasecmp
#define strncasecmp _strnicmp
#endif
#endif
static inline int
trycmp (char **pp, char *cp,

View file

@ -91,6 +91,7 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
configure_file("${ZLIB_SOURCE_DIR}/zlib.pc.cmakein" "${ZLIB_BINARY_DIR}/zlib.pc" @ONLY)
configure_file("${ZLIB_SOURCE_DIR}/zconf.h.cmakein" "${ZLIB_BINARY_DIR}/include/zconf.h" @ONLY)
configure_file("${ZLIB_SOURCE_DIR}/zlib.h" "${ZLIB_BINARY_DIR}/include/zlib.h" @ONLY)
add_library(ZLIB ${SRB2_INTERNAL_LIBRARY_TYPE} ${ZLIB_SRCS})
set_target_properties(ZLIB PROPERTIES
@ -173,8 +174,8 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
target_include_directories(png PUBLIC "${png_BINARY_DIR}/include")
# ... and these also need to be present only for png build
target_include_directories(png PRIVATE "${zlib_SOURCE_DIR}")
target_include_directories(png PRIVATE "${zlib_BINARY_DIR}")
target_include_directories(png PRIVATE "${ZLIB_SOURCE_DIR}")
target_include_directories(png PRIVATE "${ZLIB_BINARY_DIR}")
target_include_directories(png PRIVATE "${png_BINARY_DIR}")
target_link_libraries(png PRIVATE ZLIB::ZLIB)
@ -495,7 +496,7 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
if("${CMAKE_C_COMPILER_ID}" STREQUAL GNU OR "${CMAKE_C_COMPILER_ID}" STREQUAL Clang OR "${CMAKE_C_COMPILER_ID}" STREQUAL AppleClang)
target_compile_options(openmpt PRIVATE "-g0")
endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL Windows)
if("${CMAKE_SYSTEM_NAME}" STREQUAL Windows AND "${CMAKE_C_COMPILER_ID}" STREQUAL MSVC)
target_link_libraries(openmpt PRIVATE Rpcrt4)
endif()
target_compile_features(openmpt PRIVATE cxx_std_11)
@ -521,6 +522,7 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
OPTIONS
"BUILD_SHARED_LIBS ${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}"
"ENABLE_UBSAN OFF"
"GME_YM2612_EMU MAME"
)
target_compile_features(gme PRIVATE cxx_std_11)
target_link_libraries(gme PRIVATE ZLIB::ZLIB)