diff --git a/.travis.yml b/.travis.yml
index 708b8f60..01660248 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,8 +29,8 @@ addons:
- p7zip-full
before_script:
- - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2114-assets.7z -O $HOME/srb2_cache/SRB2-v2114-assets.7z
- - 7z x $HOME/srb2_cache/SRB2-v2114-assets.7z -oassets
+ - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z
+ - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets
- mkdir build
- cd build
- cmake ..
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a735be00..cb93d22f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -100,7 +100,8 @@ set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
include(GitUtilities)
git_describe(SRB2_GIT_DESCRIBE "${CMAKE_SOURCE_DIR}")
git_current_branch(SRB2_GIT_BRANCH "${CMAKE_SOURCE_DIR}")
-set(SRB2_COMP_REVISION "${SRB2_GIT_DESCRIBE}-<${SRB2_GIT_BRANCH}>")
+set(SRB2_COMP_BRANCH "${SRB2_GIT_BRANCH}")
+set(SRB2_COMP_REVISION "${SRB2_GIT_DESCRIBE}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
##### PACKAGE CONFIGURATION #####
diff --git a/SRB2.cbp b/SRB2.cbp
index 4834563e..43696ee2 100644
--- a/SRB2.cbp
+++ b/SRB2.cbp
@@ -154,8 +154,8 @@ HW3SOUND for 3D hardware sound support
-
-
+
+
@@ -200,8 +200,8 @@ HW3SOUND for 3D hardware sound support
-
-
+
+
@@ -3293,23 +3293,6 @@ HW3SOUND for 3D hardware sound support
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -4141,283 +4124,170 @@ HW3SOUND for 3D hardware sound support
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -4590,13 +4460,13 @@ HW3SOUND for 3D hardware sound support
-
+
+
-
-
-
+
+
diff --git a/cmake/Modules/FindSDL2.cmake b/cmake/Modules/FindSDL2.cmake
index ec9f3835..2fc833ce 100644
--- a/cmake/Modules/FindSDL2.cmake
+++ b/cmake/Modules/FindSDL2.cmake
@@ -27,7 +27,6 @@ find_library(SDL2_LIBRARY
"/usr/local/lib"
)
-
# set include dir variables
set(SDL2_PROCESS_INCLUDES SDL2_INCLUDE_DIR)
set(SDL2_PROCESS_LIBS SDL2_LIBRARY)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6ec8f2d7..035b4655 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -139,7 +139,6 @@ set(SRB2_CORE_RENDER_SOURCES
set(SRB2_CORE_GAME_SOURCES
p_ceilng.c
p_enemy.c
- p_fab.c
p_floor.c
p_inter.c
p_lights.c
@@ -150,6 +149,7 @@ set(SRB2_CORE_GAME_SOURCES
p_saveg.c
p_setup.c
p_sight.c
+ p_slopes.c
p_spec.c
p_telept.c
p_tick.c
@@ -162,6 +162,7 @@ set(SRB2_CORE_GAME_SOURCES
p_pspr.h
p_saveg.h
p_setup.h
+ p_slopes.h
p_spec.h
p_tick.h
)
diff --git a/src/Makefile b/src/Makefile
index 701cdcfb..b6930ffd 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -372,7 +372,7 @@ else
# build a normal optimised version
WINDRESFLAGS = -DNDEBUG
- CFLAGS+=-O2
+ #CFLAGS+=-O2
endif
CFLAGS+=-g $(OPTS) $(M5) $(WINDRESFLAGS)
@@ -437,7 +437,6 @@ OBJS:=$(i_main_o) \
$(OBJDIR)/info.o \
$(OBJDIR)/p_ceilng.o \
$(OBJDIR)/p_enemy.o \
- $(OBJDIR)/p_fab.o \
$(OBJDIR)/p_floor.o \
$(OBJDIR)/p_inter.o \
$(OBJDIR)/p_lights.o \
@@ -452,6 +451,7 @@ OBJS:=$(i_main_o) \
$(OBJDIR)/p_telept.o \
$(OBJDIR)/p_tick.o \
$(OBJDIR)/p_user.o \
+ $(OBJDIR)/p_slopes.o \
$(OBJDIR)/tables.o \
$(OBJDIR)/r_bsp.o \
$(OBJDIR)/r_data.o \
diff --git a/src/am_map.c b/src/am_map.c
index 97b7c516..90f81572 100644
--- a/src/am_map.c
+++ b/src/am_map.c
@@ -2,19 +2,20 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file am_map.c
-/// \brief the automap code
+/// \brief Code for the 'automap', former Doom feature used for DEVMODE testing
#include "g_game.h"
#include "am_map.h"
#include "g_input.h"
#include "p_local.h"
+#include "p_slopes.h"
#include "v_video.h"
#include "i_video.h"
#include "r_state.h"
@@ -996,6 +997,10 @@ static inline void AM_drawWalls(void)
{
size_t i;
static mline_t l;
+#ifdef ESLOPE
+ fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends
+ fixed_t backf1, backf2, backc1, backc2; // back floor ceiling ends
+#endif
for (i = 0; i < numlines; i++)
{
@@ -1003,6 +1008,22 @@ static inline void AM_drawWalls(void)
l.a.y = lines[i].v1->y;
l.b.x = lines[i].v2->x;
l.b.y = lines[i].v2->y;
+#ifdef ESLOPE
+#define SLOPEPARAMS(slope, end1, end2, normalheight) \
+ if (slope) { \
+ end1 = P_GetZAt(slope, l.a.x, l.a.y); \
+ end2 = P_GetZAt(slope, l.b.x, l.b.y); \
+ } else \
+ end1 = end2 = normalheight;
+
+ SLOPEPARAMS(lines[i].frontsector->f_slope, frontf1, frontf2, lines[i].frontsector->floorheight)
+ SLOPEPARAMS(lines[i].frontsector->c_slope, frontc1, frontc2, lines[i].frontsector->ceilingheight)
+ if (lines[i].backsector) {
+ SLOPEPARAMS(lines[i].backsector->f_slope, backf1, backf2, lines[i].backsector->floorheight)
+ SLOPEPARAMS(lines[i].backsector->c_slope, backc1, backc2, lines[i].backsector->ceilingheight)
+ }
+#undef SLOPEPARAMS
+#endif
// AM_drawMline(&l, GRAYS + 3); // Old, everything-is-gray automap
if (!lines[i].backsector) // 1-sided
@@ -1016,11 +1037,19 @@ static inline void AM_drawWalls(void)
AM_drawMline(&l, WALLCOLORS+lightlev);
}
}
+#ifdef ESLOPE
+ else if ((backf1 == backc1 && backf2 == backc2) // Back is thok barrier
+ || (frontf1 == frontc1 && frontf2 == frontc2)) // Front is thok barrier
+ {
+ if (backf1 == backc1 && backf2 == backc2
+ && frontf1 == frontc1 && frontf2 == frontc2) // BOTH are thok barriers
+#else
else if (lines[i].backsector->floorheight == lines[i].backsector->ceilingheight // Back is thok barrier
|| lines[i].frontsector->floorheight == lines[i].frontsector->ceilingheight) // Front is thok barrier
{
if (lines[i].backsector->floorheight == lines[i].backsector->ceilingheight
&& lines[i].frontsector->floorheight == lines[i].frontsector->ceilingheight) // BOTH are thok barriers
+#endif
{
if (lines[i].flags & ML_NOCLIMB)
{
@@ -1046,12 +1075,20 @@ static inline void AM_drawWalls(void)
else
{
if (lines[i].flags & ML_NOCLIMB) {
+#ifdef ESLOPE
+ if (backf1 != frontf1 || backf2 != frontf2) {
+#else
if (lines[i].backsector->floorheight
!= lines[i].frontsector->floorheight) {
+#endif
AM_drawMline(&l, NOCLIMBFDWALLCOLORS + lightlev); // floor level change
}
+#ifdef ESLOPE
+ else if (backc1 != frontc1 || backc2 != frontc2) {
+#else
else if (lines[i].backsector->ceilingheight
!= lines[i].frontsector->ceilingheight) {
+#endif
AM_drawMline(&l, NOCLIMBCDWALLCOLORS+lightlev); // ceiling level change
}
else {
@@ -1060,12 +1097,20 @@ static inline void AM_drawWalls(void)
}
else
{
+#ifdef ESLOPE
+ if (backf1 != frontf1 || backf2 != frontf2) {
+#else
if (lines[i].backsector->floorheight
!= lines[i].frontsector->floorheight) {
+#endif
AM_drawMline(&l, FDWALLCOLORS + lightlev); // floor level change
}
+#ifdef ESLOPE
+ else if (backc1 != frontc1 || backc2 != frontc2) {
+#else
else if (lines[i].backsector->ceilingheight
!= lines[i].frontsector->ceilingheight) {
+#endif
AM_drawMline(&l, CDWALLCOLORS+lightlev); // ceiling level change
}
else {
diff --git a/src/am_map.h b/src/am_map.h
index 009a10e7..df145848 100644
--- a/src/am_map.h
+++ b/src/am_map.h
@@ -2,14 +2,14 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file am_map.h
-/// \brief AutoMap module
+/// \brief Code for the 'automap', former Doom feature used for DEVMODE testing
#ifndef __AMMAP_H__
#define __AMMAP_H__
diff --git a/src/b_bot.c b/src/b_bot.c
index e9b00497..56be0613 100644
--- a/src/b_bot.c
+++ b/src/b_bot.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
-// Copyright (C) 2007-2014 by John "JTE" Muniz.
-// Copyright (C) 2011-2014 by Sonic Team Junior.
+// Copyright (C) 2007-2016 by John "JTE" Muniz.
+// Copyright (C) 2011-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/b_bot.h b/src/b_bot.h
index 1bb546ec..259405f3 100644
--- a/src/b_bot.h
+++ b/src/b_bot.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
-// Copyright (C) 2007-2014 by John "JTE" Muniz.
-// Copyright (C) 2012-2014 by Sonic Team Junior.
+// Copyright (C) 2007-2016 by John "JTE" Muniz.
+// Copyright (C) 2012-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/blua/luaconf.h b/src/blua/luaconf.h
index 4fb94079..9e2948f4 100644
--- a/src/blua/luaconf.h
+++ b/src/blua/luaconf.h
@@ -11,6 +11,13 @@
#include
#include
+#ifdef _MSC_VER
+#define INT32 __int32
+#else
+#include
+#define INT32 int32_t
+#endif
+
/*
** ==================================================================
@@ -140,7 +147,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 ptrdiff_t
+#define LUA_INTEGER INT32
/*
@@ -502,13 +509,13 @@
*/
//#define LUA_NUMBER_DOUBLE
-#define LUA_NUMBER ptrdiff_t
+#define LUA_NUMBER INT32
/*
@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
@* over a number.
*/
-#define LUAI_UACNUMBER ptrdiff_t
+#define LUAI_UACNUMBER INT32
/*
@@ -519,14 +526,14 @@
@@ lua_str2number converts a string to a number.
*/
#ifdef LUA_WIN
- #define LUA_NUMBER_SCAN "%Ii"
- #define LUA_NUMBER_FMT "%Ii"
+ #define LUA_NUMBER_SCAN "%d"
+ #define LUA_NUMBER_FMT "%d"
#else
- #define LUA_NUMBER_SCAN "%ti"
- #define LUA_NUMBER_FMT "%ti"
+ #define LUA_NUMBER_SCAN "%d"
+ #define LUA_NUMBER_FMT "%d"
#endif
#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n))
-#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */
+#define LUAI_MAXNUMBER2STR 12 /* 10 digits, sign, and \0 */
#define lua_str2number(s,p) strtol((s), (p), 10)
diff --git a/src/byteptr.h b/src/byteptr.h
index 352c4d7b..410d7c00 100644
--- a/src/byteptr.h
+++ b/src/byteptr.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/command.c b/src/command.c
index e10787f1..84d777ac 100644
--- a/src/command.c
+++ b/src/command.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/command.h b/src/command.h
index a17e8eac..989ead8c 100644
--- a/src/command.h
+++ b/src/command.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/comptime.c b/src/comptime.c
index 9f1fe2f7..398eda07 100644
--- a/src/comptime.c
+++ b/src/comptime.c
@@ -9,7 +9,7 @@
#if (defined(CMAKECONFIG))
#include "config.h"
-const char *compbranch = ""; // hell if I know what to do with cmake
+const char *compbranch = SRB2_COMP_BRANCH;
const char *comprevision = SRB2_COMP_REVISION;
#elif (defined(COMPVERSION))
diff --git a/src/config.h.in b/src/config.h.in
index 2ed7aec3..5f06ec45 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -15,9 +15,12 @@
#define ASSET_HASH_PLAYER_DTA "${SRB2_ASSET_player.dta_HASH}"
#define ASSET_HASH_RINGS_DTA "${SRB2_ASSET_rings.dta_HASH}"
#define ASSET_HASH_ZONES_DTA "${SRB2_ASSET_zones.dta_HASH}"
+#ifdef USE_PATCH_DTA
#define ASSET_HASH_PATCH_DTA "${SRB2_ASSET_patch.dta_HASH}"
+#endif
#define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}"
+#define SRB2_COMP_BRANCH "${SRB2_COMP_BRANCH}"
#define SRB2_GIT_DESCRIBE "${SRB2_GIT_DESCRIBE}"
#define SRB2_GIT_BRANCH "${SRB2_GIT_BRANCH}"
@@ -25,10 +28,16 @@
#else
+/* Manually defined asset hashes for non-CMake builds
+ * Last updated 2015 / 05 / 03
+ */
#define ASSET_HASH_SRB2_SRB "c1b9577687f8a795104aef4600720ea7"
#define ASSET_HASH_ZONES_DTA "303838c6c534d9540288360fa49cca60"
#define ASSET_HASH_PLAYER_DTA "cfca0f1c73023cbbd8f844f45480f799"
#define ASSET_HASH_RINGS_DTA "85901ad4bf94637e5753d2ac2c03ea26"
+#ifdef USE_PATCH_DTA
+#define ASSET_HASH_PATCH_DTA "dbbf8bc6121618ee3be2d5b14650429b"
+#endif
#endif
#endif
diff --git a/src/console.c b/src/console.c
index e77c400b..025bc1c1 100644
--- a/src/console.c
+++ b/src/console.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -202,7 +202,7 @@ static void CONS_Bind_f(void)
}
key = G_KeyStringtoNum(COM_Argv(1));
- if (!key)
+ if (key <= 0 || key >= NUMINPUTS)
{
CONS_Alert(CONS_NOTICE, M_GetText("Invalid key name\n"));
return;
diff --git a/src/console.h b/src/console.h
index c95f2b03..47af65e2 100644
--- a/src/console.h
+++ b/src/console.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_clisrv.c b/src/d_clisrv.c
index c0179ca1..c0f81ba3 100644
--- a/src/d_clisrv.c
+++ b/src/d_clisrv.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -517,9 +517,9 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
rsp->thokitem = (UINT32)LONG(players[i].thokitem); //mobjtype_t
rsp->spinitem = (UINT32)LONG(players[i].spinitem); //mobjtype_t
rsp->revitem = (UINT32)LONG(players[i].revitem); //mobjtype_t
- rsp->actionspd = LONG(players[i].actionspd);
- rsp->mindash = LONG(players[i].mindash);
- rsp->maxdash = LONG(players[i].maxdash);
+ rsp->actionspd = (fixed_t)LONG(players[i].actionspd);
+ rsp->mindash = (fixed_t)LONG(players[i].mindash);
+ rsp->maxdash = (fixed_t)LONG(players[i].maxdash);
rsp->jumpfactor = (fixed_t)LONG(players[i].jumpfactor);
rsp->speed = (fixed_t)LONG(players[i].speed);
@@ -531,6 +531,7 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
rsp->deadtimer = players[i].deadtimer;
rsp->exiting = (tic_t)LONG(players[i].exiting);
rsp->homing = players[i].homing;
+ rsp->skidtime = (tic_t)LONG(players[i].skidtime);
rsp->cmomx = (fixed_t)LONG(players[i].cmomx);
rsp->cmomy = (fixed_t)LONG(players[i].cmomy);
rsp->rmomx = (fixed_t)LONG(players[i].rmomx);
@@ -590,7 +591,7 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
rsp->tics = LONG(players[i].mo->tics);
rsp->statenum = (statenum_t)LONG(players[i].mo->state-states); // :(
- rsp->eflags = (UINT32)LONG(players[i].mo->eflags);
+ rsp->eflags = (UINT16)SHORT(players[i].mo->eflags);
rsp->flags = LONG(players[i].mo->flags);
rsp->flags2 = LONG(players[i].mo->flags2);
@@ -642,9 +643,9 @@ static void resynch_read_player(resynch_pak *rsp)
players[i].thokitem = (UINT32)LONG(rsp->thokitem); //mobjtype_t
players[i].spinitem = (UINT32)LONG(rsp->spinitem); //mobjtype_t
players[i].revitem = (UINT32)LONG(rsp->revitem); //mobjtype_t
- players[i].actionspd = LONG(rsp->actionspd);
- players[i].mindash = LONG(rsp->mindash);
- players[i].maxdash = LONG(rsp->maxdash);
+ players[i].actionspd = (fixed_t)LONG(rsp->actionspd);
+ players[i].mindash = (fixed_t)LONG(rsp->mindash);
+ players[i].maxdash = (fixed_t)LONG(rsp->maxdash);
players[i].jumpfactor = (fixed_t)LONG(rsp->jumpfactor);
players[i].speed = (fixed_t)LONG(rsp->speed);
@@ -656,6 +657,7 @@ static void resynch_read_player(resynch_pak *rsp)
players[i].deadtimer = rsp->deadtimer;
players[i].exiting = (tic_t)LONG(rsp->exiting);
players[i].homing = rsp->homing;
+ players[i].skidtime = (tic_t)LONG(rsp->skidtime);
players[i].cmomx = (fixed_t)LONG(rsp->cmomx);
players[i].cmomy = (fixed_t)LONG(rsp->cmomy);
players[i].rmomx = (fixed_t)LONG(rsp->rmomx);
@@ -713,7 +715,7 @@ static void resynch_read_player(resynch_pak *rsp)
//At this point, the player should have a body, whether they were respawned or not.
P_UnsetThingPosition(players[i].mo);
players[i].mo->angle = (angle_t)LONG(rsp->angle);
- players[i].mo->eflags = (UINT32)LONG(rsp->eflags);
+ players[i].mo->eflags = (UINT16)SHORT(rsp->eflags);
players[i].mo->flags = LONG(rsp->flags);
players[i].mo->flags2 = LONG(rsp->flags2);
players[i].mo->friction = LONG(rsp->friction);
@@ -2935,9 +2937,9 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
if (botingame)
players[newplayernum].bot = 1;
// Same goes for player 2 when relevant
- players[newplayernum].pflags &= ~(/*PF_FLIPCAM|*/PF_ANALOGMODE);
- //if (cv_flipcam2.value)
- //players[newplayernum].pflags |= PF_FLIPCAM;
+ players[newplayernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE);
+ if (cv_flipcam2.value)
+ players[newplayernum].pflags |= PF_FLIPCAM;
if (cv_analog2.value)
players[newplayernum].pflags |= PF_ANALOGMODE;
}
diff --git a/src/d_clisrv.h b/src/d_clisrv.h
index 6bc06f13..14b59092 100644
--- a/src/d_clisrv.h
+++ b/src/d_clisrv.h
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -177,9 +177,9 @@ typedef struct
UINT32 thokitem; //mobjtype_t
UINT32 spinitem; //mobjtype_t
UINT32 revitem; //mobjtype_t
- INT32 actionspd;
- INT32 mindash;
- INT32 maxdash;
+ fixed_t actionspd;
+ fixed_t mindash;
+ fixed_t maxdash;
fixed_t jumpfactor;
fixed_t speed;
@@ -191,6 +191,7 @@ typedef struct
INT32 deadtimer;
tic_t exiting;
UINT8 homing;
+ tic_t skidtime;
fixed_t cmomx;
fixed_t cmomy;
fixed_t rmomx;
@@ -241,11 +242,11 @@ typedef struct
fixed_t friction;
fixed_t movefactor;
- INT16 tics;
+ INT32 tics;
statenum_t statenum;
UINT32 flags;
UINT32 flags2;
- UINT8 eflags;
+ UINT16 eflags;
fixed_t radius;
fixed_t height;
diff --git a/src/d_event.h b/src/d_event.h
index cf5cf02d..b0d0e3c5 100644
--- a/src/d_event.h
+++ b/src/d_event.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_main.c b/src/d_main.c
index 0a3fae3b..14a8a06e 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -96,6 +96,10 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
#include "hardware/hw3sound.h"
#endif
+#ifdef HAVE_BLUA
+#include "lua_script.h"
+#endif
+
// platform independant focus loss
UINT8 window_notinfocus = false;
@@ -217,10 +221,7 @@ gamestate_t wipegamestate = GS_LEVEL;
static void D_Display(void)
{
- static boolean menuactivestate = false;
- static gamestate_t oldgamestate = -1;
- boolean redrawsbar = false;
-
+ boolean forcerefresh = false;
static boolean wipe = false;
INT32 wipedefindex = 0;
@@ -241,23 +242,15 @@ static void D_Display(void)
if (setsizeneeded)
{
R_ExecuteSetViewSize();
- oldgamestate = -1; // force background redraw
- redrawsbar = true;
+ forcerefresh = true; // force background redraw
}
- // save the current screen if about to wipe
- if (gamestate != wipegamestate)
- {
- wipe = true;
- F_WipeStartScreen();
- }
- else
- wipe = false;
-
// draw buffered stuff to screen
// Used only by linux GGI version
I_UpdateNoBlit();
+ // save the current screen if about to wipe
+ wipe = (gamestate != wipegamestate);
if (wipe)
{
// set for all later
@@ -276,6 +269,7 @@ static void D_Display(void)
if (gamestate != GS_LEVEL // fades to black on its own timing, always
&& wipedefs[wipedefindex] != UINT8_MAX)
{
+ F_WipeStartScreen();
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
F_WipeEndScreen();
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
@@ -294,8 +288,6 @@ static void D_Display(void)
HU_Erase();
if (automapactive)
AM_Drawer();
- if (wipe || menuactivestate || (rendermode != render_soft && rendermode != render_none) || vid.recalc)
- redrawsbar = true;
break;
case GS_INTERMISSION:
@@ -353,11 +345,6 @@ static void D_Display(void)
// see if the border needs to be initially drawn
if (gamestate == GS_LEVEL)
{
-#if 0
- if (oldgamestate != GS_LEVEL)
- R_FillBackScreen(); // draw the pattern into the back screen
-#endif
-
// draw the view directly
if (!automapactive && !dedicated && cv_renderview.value)
{
@@ -413,17 +400,17 @@ static void D_Display(void)
lastdraw = false;
}
- ST_Drawer(redrawsbar);
+ ST_Drawer();
HU_Drawer();
}
// change gamma if needed
- if (gamestate != oldgamestate && gamestate != GS_LEVEL)
+ // (GS_LEVEL handles this already due to level-specific palettes)
+ if (forcerefresh && gamestate != GS_LEVEL)
V_SetPalette(0);
- menuactivestate = menuactive;
- oldgamestate = wipegamestate = gamestate;
+ wipegamestate = gamestate;
// draw pause pic
if (paused && cv_showhud.value && (!menuactive || netgame))
@@ -446,15 +433,22 @@ static void D_Display(void)
CON_Drawer();
M_Drawer(); // menu is drawn even on top of everything
+ // focus lost moved to M_Drawer
- // focus lost notification goes on top of everything, even the former everything
- if (window_notinfocus)
+ //
+ // wipe update
+ //
+ if (wipe)
{
- M_DrawTextBox((BASEVIDWIDTH/2) - (60), (BASEVIDHEIGHT/2) - (16), 13, 2);
- if (gamestate == GS_LEVEL && (P_AutoPause() || paused))
- V_DrawCenteredString(BASEVIDWIDTH/2, (BASEVIDHEIGHT/2) - (4), V_YELLOWMAP, "Game Paused");
- else
- V_DrawCenteredString(BASEVIDWIDTH/2, (BASEVIDHEIGHT/2) - (4), V_YELLOWMAP, "Focus Lost");
+ // note: moved up here because NetUpdate does input changes
+ // and input during wipe tends to mess things up
+ wipedefindex += WIPEFINALSHIFT;
+
+ if (rendermode != render_none)
+ {
+ F_WipeEndScreen();
+ F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
+ }
}
NetUpdate(); // send out any new accumulation
@@ -489,18 +483,6 @@ static void D_Display(void)
}
I_FinishUpdate(); // page flip or blit buffer
- return;
- }
-
- //
- // wipe update
- //
- wipedefindex += WIPEFINALSHIFT;
-
- if (rendermode != render_none)
- {
- F_WipeEndScreen();
- F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
}
}
@@ -632,6 +614,10 @@ void D_SRB2Loop(void)
#ifdef HW3SOUND
HW3S_EndFrameUpdate();
#endif
+
+#ifdef HAVE_BLUA
+ LUA_Step();
+#endif
}
}
@@ -831,8 +817,10 @@ static void IdentifyVersion(void)
// Add the weapons
D_AddFile(va(pandf,srb2waddir,"rings.dta"));
+#ifdef USE_PATCH_DTA
// Add our crappy patches to fix our bugs
- // D_AddFile(va(pandf,srb2waddir,"patch.dta"));
+ D_AddFile(va(pandf,srb2waddir,"patch.dta"));
+#endif
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
{
@@ -941,9 +929,9 @@ void D_SRB2Main(void)
#endif
#if defined (_WIN32_WCE) //|| defined (_DEBUG) || defined (GP2X)
- devparm = !M_CheckParm("-nodebug");
+ devparm = M_CheckParm("-nodebug") == 0;
#else
- devparm = M_CheckParm("-debug");
+ devparm = M_CheckParm("-debug") != 0;
#endif
// for dedicated server
@@ -1116,19 +1104,25 @@ void D_SRB2Main(void)
#endif
D_CleanFile();
-#if 1 // md5s last updated 12/14/14
+#ifndef DEVELOP // md5s last updated 12/14/14
// Check MD5s of autoloaded files
W_VerifyFileMD5(0, ASSET_HASH_SRB2_SRB); // srb2.srb/srb2.wad
W_VerifyFileMD5(1, ASSET_HASH_ZONES_DTA); // zones.dta
W_VerifyFileMD5(2, ASSET_HASH_PLAYER_DTA); // player.dta
W_VerifyFileMD5(3, ASSET_HASH_RINGS_DTA); // rings.dta
- //W_VerifyFileMD5(4, "0c66790502e648bfce90fdc5bb15722e"); // patch.dta
- // don't check music.dta because people like to modify it, and it doesn't matter if they do
- // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for.
+#ifdef USE_PATCH_DTA
+ W_VerifyFileMD5(4, ASSET_HASH_PATCH_DTA); // patch.dta
#endif
- mainwads = 4; // there are 5 wads not to unload
+ // don't check music.dta because people like to modify it, and it doesn't matter if they do
+ // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for.
+#endif //ifndef DEVELOP
+
+ mainwads = 4; // there are 4 wads not to unload
+#ifdef USE_PATCH_DTA
+ ++mainwads; // patch.dta adds one more
+#endif
cht_Init();
diff --git a/src/d_main.h b/src/d_main.h
index c5ce19ef..88387a57 100644
--- a/src/d_main.h
+++ b/src/d_main.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_net.c b/src/d_net.c
index d13c4bd2..03e126b5 100644
--- a/src/d_net.c
+++ b/src/d_net.c
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_net.h b/src/d_net.h
index 72de080d..285b4423 100644
--- a/src/d_net.h
+++ b/src/d_net.h
@@ -2,7 +2,7 @@
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index 30208422..3dd95bf9 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
-// Copyright (C) 1999-2014 by Sonic Team Junior.
+// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@@ -597,7 +597,9 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_gif_optimize);
CV_RegisterVar(&cv_gif_downscale);
+#ifdef WALLSPLATS
CV_RegisterVar(&cv_splats);
+#endif
// register these so it is saved to config
if ((username = I_GetUserName()))
@@ -808,7 +810,7 @@ static boolean IsNameGood(char *name, INT32 playernum)
else if (len == 1) // Agh!
{
// Last ditch effort...
- sprintf(name, "%d", M_Random() & 7);
+ sprintf(name, "%d", M_RandomKey(10));
if (!IsNameGood (name, playernum))
return false;
}
@@ -1111,6 +1113,13 @@ static void SendNameAndColor(void)
players[consoleplayer].mo->color = (UINT8)players[consoleplayer].skincolor;
}
}
+ else
+ {
+ cv_skin.value = players[consoleplayer].skin;
+ CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
+ // will always be same as current
+ SetPlayerSkin(consoleplayer, cv_skin.string);
+ }
return;
}
@@ -1228,6 +1237,13 @@ static void SendNameAndColor2(void)
players[secondplaya].mo->color = players[secondplaya].skincolor;
}
}
+ else
+ {
+ cv_skin2.value = players[secondplaya].skin;
+ CV_StealthSet(&cv_skin2, skins[players[secondplaya].skin].name);
+ // will always be same as current
+ SetPlayerSkin(secondplaya, cv_skin2.string);
+ }
return;
}
@@ -1854,10 +1870,10 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
if (paused)
{
if (!menuactive || netgame)
- S_PauseSound();
+ S_PauseAudio();
}
else
- S_ResumeSound();
+ S_ResumeAudio();
}
}
@@ -3197,7 +3213,27 @@ static void Command_ModDetails_f(void)
//
static void Command_ShowGametype_f(void)
{
- CONS_Printf(M_GetText("Current gametype is %d\n"), gametype);
+ INT32 j;
+ const char *gametypestr = NULL;
+
+ if (!(netgame || multiplayer)) // print "Single player" instead of "Co-op"
+ {
+ CONS_Printf(M_GetText("Current gametype is %s\n"), M_GetText("Single player"));
+ return;
+ }
+ // find name string for current gametype
+ for (j = 0; gametype_cons_t[j].strvalue; j++)
+ {
+ if (gametype_cons_t[j].value == gametype)
+ {
+ gametypestr = gametype_cons_t[j].strvalue;
+ break;
+ }
+ }
+ if (gametypestr)
+ CONS_Printf(M_GetText("Current gametype is %s\n"), gametypestr);
+ else // string for current gametype was not found above (should never happen)
+ CONS_Printf(M_GetText("Unknown gametype set (%d)\n"), gametype);
}
/** Plays the intro.
@@ -3563,7 +3599,7 @@ retryscramble:
for (i = 0; i < playercount; i++)
{
if (repick)
- newteam = (INT16)((M_Random() % 2) + 1);
+ newteam = (INT16)((M_RandomByte() % 2) + 1);
// One team has the most players they can get, assign the rest to the other team.
if (red == maxcomposition || blue == maxcomposition)
@@ -3608,7 +3644,7 @@ retryscramble:
{
if (repick)
{
- newteam = (INT16)((M_Random() % 2) + 1);
+ newteam = (INT16)((M_RandomByte() % 2) + 1);
repick = false;
}
else
@@ -3741,50 +3777,66 @@ static void Command_Displayplayer_f(void)
static void Command_Tunes_f(void)
{
const char *tunearg;
- UINT16 tune, track = 0;
+ UINT16 tunenum, track = 0;
const size_t argc = COM_Argc();
if (argc < 2) //tunes slot ...
{
- CONS_Printf("tunes