Commit 404b5f66 by Alam Ed Arias

SRB2 2.1.12 release

parent 3fe4921a
......@@ -13,7 +13,7 @@
doc = doc || document;
// from http://stackoverflow.com/questions/1145850/get-height-of-entire-document-with-javascript
var body = doc.body, html = doc.documentElement;
var height = Math.max( body.scrollHeight, body.offsetHeight,
var height = Math.max( body.scrollHeight, body.offsetHeight,
html.clientHeight, html.scrollHeight, html.offsetHeight );
return height;
}
......@@ -65,4 +65,4 @@
<iframe id="ifrm" name="ifrm" src="intro.htm" onload="setIframeHeight(this.id)"> </iframe>
</p>
</body>
</html>
\ No newline at end of file
</html>
Here it is! SRB2 v2.1.11 source code!
Here it is! SRB2 v2.1.12 source code!
(why do we keep the version number up to date
when everything else in this file is hilariously old?
- Inuyasha)
......
......@@ -319,21 +319,6 @@ LUA_API lua_Number lua_tonumber (lua_State *L, int idx) {
return 0;
}
LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) {
TValue n;
const TValue *o = index2adr(L, idx);
if (tonumber(o, &n)) {
lua_Integer res;
lua_Number num = nvalue(o);
lua_number2integer(res, num);
return res;
}
else
return 0;
}
LUA_API int lua_toboolean (lua_State *L, int idx) {
const TValue *o = index2adr(L, idx);
return !l_isfalse(o);
......@@ -446,14 +431,6 @@ LUA_API void lua_pushnumber (lua_State *L, lua_Number n) {
}
LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) {
lua_lock(L);
setnvalue(L->top, cast_num(n));
api_incr_top(L);
lua_unlock(L);
}
LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) {
lua_lock(L);
luaC_checkGC(L);
......
......@@ -186,20 +186,6 @@ LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) {
}
LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) {
lua_Integer d = lua_tointeger(L, narg);
if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */
tag_error(L, narg, LUA_TNUMBER);
return d;
}
LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg,
lua_Integer def) {
return luaL_opt(L, luaL_checkinteger, narg, def);
}
LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
if (!lua_getmetatable(L, obj)) /* no metatable? */
return 0;
......
......@@ -54,9 +54,8 @@ LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,
LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);
LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);
LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);
LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,
lua_Integer def);
#define luaL_checkinteger luaL_checknumber
#define luaL_optinteger luaL_optnumber
LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);
LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);
......
......@@ -100,7 +100,7 @@ typedef LUA_NUMBER lua_Number;
/* type for integer functions */
typedef LUA_INTEGER lua_Integer;
#define lua_Integer lua_Number
......@@ -144,7 +144,7 @@ LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2);
LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2);
LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx);
LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx);
#define lua_tointeger lua_tonumber
LUA_API int (lua_toboolean) (lua_State *L, int idx);
LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len);
LUA_API size_t (lua_objlen) (lua_State *L, int idx);
......@@ -159,7 +159,7 @@ LUA_API const void *(lua_topointer) (lua_State *L, int idx);
*/
LUA_API void (lua_pushnil) (lua_State *L);
LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n);
LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n);
#define lua_pushinteger lua_pushnumber
LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l);
LUA_API void (lua_pushstring) (lua_State *L, const char *s);
LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
......
......@@ -323,7 +323,7 @@ static void Arith (lua_State *L, StkId ra, TValue *rb,
case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break;
case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break;
case TM_DIV: if (nc == 0) { lua_pushliteral(L, "divide by zero error"); lua_error(L); } else setnvalue(ra, luai_numdiv(nb, nc)); break;
case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break;
case TM_MOD: if (nc == 0) { lua_pushliteral(L, "modulo by zero error"); lua_error(L); } else setnvalue(ra, luai_nummod(nb, nc)); break;
case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break;
case TM_UNM: setnvalue(ra, luai_numunm(nb)); break;
case TM_AND: setnvalue(ra, luai_numand(nb, nc)); break;
......@@ -494,7 +494,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
if (nc == 0) {
lua_pushliteral(L, "divide by zero error");
lua_error(L);
}
}
else
setnvalue(ra, luai_numdiv(nb, nc));
}
......@@ -503,7 +503,19 @@ void luaV_execute (lua_State *L, int nexeccalls) {
continue;
}
case OP_MOD: {
arith_op(luai_nummod, TM_MOD);
TValue *rb = RKB(i);
TValue *rc = RKC(i);
if (ttisnumber(rb) && ttisnumber(rc)) {
lua_Number nb = nvalue(rb), nc = nvalue(rc);
if (nc == 0) {
lua_pushliteral(L, "modulo by zero error");
lua_error(L);
}
else
setnvalue(ra, luai_nummod(nb, nc));
}
else
Protect(Arith(L, ra, rb, rc, TM_MOD));
continue;
}
case OP_POW: {
......
......@@ -1055,9 +1055,22 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
if (var->PossibleValue)
{
INT32 v = atoi(valstr);
if (!v && valstr[0] != '0')
v = INT32_MIN; // Invalid integer trigger
INT32 v;
if (var->flags & CV_FLOAT)
{
double d = atof(valstr);
if (!d && valstr[0] != '0')
v = INT32_MIN;
else
v = (INT32)(d * FRACUNIT);
}
else
{
v = atoi(valstr);
if (!v && valstr[0] != '0')
v = INT32_MIN; // Invalid integer trigger
}
if (var->PossibleValue[0].strvalue && !stricmp(var->PossibleValue[0].strvalue, "MIN")) // bounded cvar
{
......@@ -1134,13 +1147,13 @@ found:
var->string = var->zstring = Z_StrDup(valstr);
if (var->flags & CV_FLOAT)
if (override)
var->value = overrideval;
else if (var->flags & CV_FLOAT)
{
double d = atof(var->string);
var->value = (INT32)(d * FRACUNIT);
}
else if (override)
var->value = overrideval;
else
var->value = atoi(var->string);
......
......@@ -2921,6 +2921,12 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
displayplayer = newplayernum;
secondarydisplayplayer = newplayernum;
DEBFILE("spawning me\n");
// Apply player flags as soon as possible!
players[newplayernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE);
if (cv_flipcam.value)
players[newplayernum].pflags |= PF_FLIPCAM;
if (cv_analog.value)
players[newplayernum].pflags |= PF_ANALOGMODE;
}
else
{
......@@ -2928,6 +2934,12 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
DEBFILE("spawning my brother\n");
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;
if (cv_analog2.value)
players[newplayernum].pflags |= PF_ANALOGMODE;
}
D_SendPlayerConfig();
addedtogame = true;
......
......@@ -1087,14 +1087,14 @@ void D_SRB2Main(void)
#endif
D_CleanFile();
#if 1 // md5s last updated 8/05/14
#if 1 // md5s last updated 11/10/14
// Check MD5s of autoloaded files
W_VerifyFileMD5(0, "ac309fb3c7d4b5b685e2cd26beccf0e8"); // srb2.srb/srb2.wad
W_VerifyFileMD5(1, "f39b6c849295e3c81875726e8cc0e2c7"); // zones.dta
W_VerifyFileMD5(2, "cfca0f1c73023cbbd8f844f45480f799"); // player.dta
W_VerifyFileMD5(3, "85901ad4bf94637e5753d2ac2c03ea26"); // rings.dta
W_VerifyFileMD5(4, "3d6cfc185fd7c195eb934ce593b0248f"); // patch.dta
W_VerifyFileMD5(4, "a45cc59d13dce924f2112b3e4201d0ae"); // 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.
#endif
......
......@@ -164,6 +164,7 @@ static void Command_Archivetest_f(void);
// =========================================================================
void SendWeaponPref(void);
void SendWeaponPref2(void);
static CV_PossibleValue_t usemouse_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Force"}, {0, NULL}};
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
......@@ -1345,26 +1346,34 @@ void SendWeaponPref(void)
XBOXSTATIC UINT8 buf[1];
buf[0] = 0;
if (cv_flipcam.value)
if (players[consoleplayer].pflags & PF_FLIPCAM)
buf[0] |= 1;
if (players[consoleplayer].pflags & PF_ANALOGMODE)
buf[0] |= 2;
SendNetXCmd(XD_WEAPONPREF, buf, 1);
}
if (splitscreen)
{
buf[0] = 0;
if (cv_flipcam2.value)
buf[0] |= 1;
SendNetXCmd2(XD_WEAPONPREF, buf, 1);
}
void SendWeaponPref2(void)
{
XBOXSTATIC UINT8 buf[1];
buf[0] = 0;
if (players[secondarydisplayplayer].pflags & PF_FLIPCAM)
buf[0] |= 1;
if (players[secondarydisplayplayer].pflags & PF_ANALOGMODE)
buf[0] |= 2;
SendNetXCmd2(XD_WEAPONPREF, buf, 1);
}
static void Got_WeaponPref(UINT8 **cp,INT32 playernum)
{
UINT8 prefs = READUINT8(*cp);
players[playernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE);
if (prefs & 1)
players[playernum].pflags |= PF_FLIPCAM;
else
players[playernum].pflags &= ~PF_FLIPCAM;
if (prefs & 2)
players[playernum].pflags |= PF_ANALOGMODE;
}
void D_SendPlayerConfig(void)
......@@ -1373,6 +1382,8 @@ void D_SendPlayerConfig(void)
if (splitscreen || botingame)
SendNameAndColor2();
SendWeaponPref();
if (splitscreen)
SendWeaponPref2();
}
// Only works for displayplayer, sorry!
......@@ -1798,7 +1809,6 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
if (demorecording) // Okay, level loaded, character spawned and skinned,
G_BeginRecording(); // I AM NOW READY TO RECORD.
demo_start = true;
metal_start = true;
}
static void Command_Pause(void)
......
......@@ -151,6 +151,7 @@ typedef enum
/*** misc ***/
PF_FORCESTRAFE = 1<<29, // Turning inputs are translated into strafing inputs
PF_ANALOGMODE = 1<<30, // Analog mode?
// free: 1<<30 and 1<<31
} pflags_t;
......
......@@ -7273,6 +7273,7 @@ static const char *const PLAYERFLAG_LIST[] = {
/*** misc ***/
"FORCESTRAFE", // Translate turn inputs into strafe inputs
"ANALOGMODE", // Analog mode?
NULL // stop loop here.
};
......
......@@ -144,8 +144,8 @@ extern FILE *logstream;
#define VERSIONSTRING "Trunk"
#else
#define VERSION 201 // Game version
#define SUBVERSION 11 // more precise version number
#define VERSIONSTRING "v2.1.11"
#define SUBVERSION 12 // more precise version number
#define VERSIONSTRING "v2.1.12"
#endif
// Modification options
......@@ -428,9 +428,8 @@ extern const char *compdate, *comptime, *comprevision;
// Compile them at your own risk!
/// Max recursive portal renders
/// \note sadly some additional work will need to be done
/// before anything > 1 will function correctly
#define PORTAL_LIMIT 1
/// \note obsoleted by cv_maxportals
//#define PORTAL_LIMIT 8
/// Fun experimental slope stuff!
//#define SLOPENESS
......@@ -453,7 +452,7 @@ extern const char *compdate, *comptime, *comprevision;
//#define CHAOSISNOTDEADYET
/// Polyobject fake flat code
//#define POLYOBJECTS_PLANES
#define POLYOBJECTS_PLANES
/// Blue spheres for future use.
/// \todo Remove this define.
......@@ -493,4 +492,7 @@ extern const char *compdate, *comptime, *comprevision;
#define CLIENT_LOADINGSCREEN
#endif
/// Experimental tweaks to analog mode. (Needs a lot of work before it's ready for primetime.)
//#define REDSANALOG
#endif // __DOOMDEF__
......@@ -165,7 +165,6 @@ extern cutscene_t *cutscenes[128];
// For the Custom Exit linedef.
extern INT16 nextmapoverride;
extern INT32 nextmapgametype;
extern boolean skipstats;
extern UINT32 totalrings; // Total # of rings in a level
......
......@@ -958,29 +958,30 @@ boolean F_IntroResponder(event_t *event)
// CREDITS
// =========
static const char *credits[] = {
"\1Sonic Team Junior",
"\1Staff",
"\1Sonic Robo Blast II",
"\1Credits",
"",
"\1Game Design",
"\"SSNTails\"",
"Ben \"Mystic\" Geyer",
"\"SSNTails\"",
"Johnny \"Sonikku\" Wallbank",
"",
"\1Programming",
"\"SSNTails\"",
"Alam \"GBC\" Arias",
"Logan \"GBA\" Arias",
"Tim \"RedEnchilada\" Bordelon",
"Callum Dickinson",
"Scott \"Graue\" Feeney",
"Nathan \"Jazz\" Giroux",
"Thomas \"Shadow Hog\" Igoe",
"\"Monster\" Iestyn Jealous",
"Ronald \"Furyhunter\" Kinard", // The SDL2 port
"John \"JTE\" Muniz",
"\"SSNTails\"",
"Matthew \"Inuyasha\" Walsh",
"",
"\1Programming",
"\1Assistance",
"Tim \"RedEnchilada\" Bordelon",
"Andrew \"orospakr\" Clunis",
"Gregor \"Oogaland\" Dick",
"Julio \"Chaos Zero 64\" Guir",
......@@ -993,7 +994,6 @@ static const char *credits[] = {
"Ben \"Cue\" Woodford",
"",
"\1Sprite Artists",
"\"SSNTails\"",
"Odi \"Iceman404\" Atunzu",
"Victor \"VAdaPEGA\" Ara\x1Fjo", // Arajo -- sorry for our limited font! D:
"Jim \"MotorRoach\" DeMello",
......@@ -1001,6 +1001,7 @@ static const char *credits[] = {
"Sherman \"CoatRack\" DesJardins",
"Andrew \"Senku Niola\" Moran",
"David \"Instant Sonic\" Spencer Jr.",
"\"SSNTails\"",
"",
"\1Texture Artists",
"Ryan \"Blaze Hedgehog\" Bloom",
......@@ -1010,8 +1011,6 @@ static const char *credits[] = {
"",
"\1Music and Sound",
"\1Production",
"\"SSNTails\"",
"Michael \"Spazzo\" Antonakes",
"Malcolm \"RedXVI\" Brown",
"David \"Bulmybag\" Bulmer",
"Paul \"Boinciel\" Clempson",
......@@ -1021,12 +1020,12 @@ static const char *credits[] = {
"Jarel \"Arrow\" Jones",
"Stefan \"Stuf\" Rimalia",
"Shane Strife",
"\"Spazzo\"",
"David \"Big Wave Dave\" Spencer Sr.",
"David \"Instant Sonic\" Spencer Jr.",
"\"SSNTails\"",
"",
"\1Level Design",
"\"SSNTails\"",
"Michael \"Spazzo\" Antonakes",
"Matthew \"Fawfulfan\" Chapman",
"Paul \"Boinciel\" Clempson",
"Desmond \"Blade\" DesJardins",
......@@ -1038,12 +1037,22 @@ static const char *credits[] = {
"Thomas \"Shadow Hog\" Igoe",
"Erik \"Torgo\" Nielsen",
"Wessel \"Spherallic\" Smit",
"\"Spazzo\"",
"\"SSNTails\"",
"Rob Tisdell",
"Jarrett \"JEV3\" Voight",
"Johnny \"Sonikku\" Wallbank",
"Matthew \"Inuyasha\" Walsh",
"Marco \"Digiku\" Zafra",
"",
"\1Boss Design",
"Ben \"Mystic\" Geyer",
"Thomas \"Shadow Hog\" Igoe",
"John \"JTE\" Muniz",
"Samuel \"Prime 2.0\" Peters",
"\"SSNTails\"",
"Johnny \"Sonikku\" Wallbank",
"",
"\1Testing",
"Hank \"FuriousFox\" Brannock",
"Cody \"SRB2 Playah\" Koester",
......@@ -1060,9 +1069,12 @@ static const char *credits[] = {
"Alex \"MistaED\" Fuller",
"FreeDoom Project", // Used some of the mancubus and rocket launcher sprites for Brak
"Randy Heit (<!>)", // For his MSPaint <!> sprite that we nicked
#if 0 // (don't take your anger out on me anymore, ok, JTE...?)
"Abigail \"Raspberry\" Fox", // (Inuyasha's girlfriend. >_> <_< >_>)
#endif
"",
"\1Produced By",
"Sonic Team Junior",
"",
"\1Published By",
"A 28K dialup modem",
"",
"\1Thank you",
"\1for playing!",
......
......@@ -43,7 +43,6 @@ extern boolean singledemo;
extern boolean demo_start;
extern mobj_t *metalplayback;
extern boolean metal_start;
// gametic at level start
extern tic_t levelstarttic;
......@@ -147,6 +146,8 @@ void G_ConsGhostTic(void);
void G_GhostTicker(void);
void G_ReadMetalTic(mobj_t *metal);
void G_WriteMetalTic(mobj_t *metal);
void G_SaveMetal(UINT8 **buffer);
void G_LoadMetal(UINT8 **buffer);
void G_DoPlayDemo(char *defdemoname);
void G_TimeDemo(const char *name);
......
......@@ -3487,6 +3487,46 @@ static fixed_t HWR_OpaqueFloorAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t hei
return floorz;
}
//
// HWR_DoCulling
// Hardware version of R_DoCulling
// (see r_main.c)
static boolean HWR_DoCulling(line_t *cullheight, line_t *viewcullheight, float vz, float bottomh, float toph)
{
float cullplane;
if (!cullheight)
return false;
cullplane = FIXED_TO_FLOAT(cullheight->frontsector->floorheight);
if (cullheight->flags & ML_NOCLIMB) // Group culling
{
if (!viewcullheight)
return false;
// Make sure this is part of the same group
if (viewcullheight->frontsector == cullheight->frontsector)
{
// OK, we can cull
if (vz > cullplane && toph < cullplane) // Cull if below plane
return true;
if (bottomh > cullplane && vz <= cullplane) // Cull if above plane
return true;
}
}
<