Merge remote-tracking branch 'upstream/master'
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 1.5 KiB |
|
@ -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>
|
||||
</html>
|
||||
|
|
Before Width: | Height: | Size: 6 KiB |
Before Width: | Height: | Size: 5 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 938 B |
Before Width: | Height: | Size: 938 B |
Before Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 937 B |
Before Width: | Height: | Size: 937 B |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 502 B |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.1 KiB |
|
@ -1,4 +1,4 @@
|
|||
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;
|
||||
|
|
|
@ -7349,6 +7349,7 @@ static const char *const PLAYERFLAG_LIST[] = {
|
|||
|
||||
/*** misc ***/
|
||||
"FORCESTRAFE", // Translate turn inputs into strafe inputs
|
||||
"ANALOGMODE", // Analog mode?
|
||||
|
||||
NULL // stop loop here.
|
||||
};
|
||||
|
@ -8770,12 +8771,7 @@ static inline int lib_getenum(lua_State *L)
|
|||
lua_pushinteger(L, mapmusic);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"server")) {
|
||||
if (dedicated || !playeringame[serverplayer])
|
||||
return 0;
|
||||
LUA_PushUserdata(L, &players[serverplayer], META_PLAYER);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"dedicatedserver")) {
|
||||
if (!dedicated)
|
||||
if (!playeringame[serverplayer])
|
||||
return 0;
|
||||
LUA_PushUserdata(L, &players[serverplayer], META_PLAYER);
|
||||
return 1;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -307,7 +307,11 @@ typedef UINT32 tic_t;
|
|||
#define FUNCTARGET(X) __attribute__ ((__target__ (X)))
|
||||
#endif
|
||||
#endif
|
||||
#if defined (__MINGW32__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
||||
#define ATTRPACK __attribute__((packed, gcc_struct))
|
||||
#else
|
||||
#define ATTRPACK __attribute__((packed))
|
||||
#endif
|
||||
#define ATTRUNUSED __attribute__((unused))
|
||||
#ifdef _XBOX
|
||||
#define FILESTAMP I_OutputMsg("%s:%d\n",__FILE__,__LINE__);
|
||||
|
|
|
@ -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", // Araújo -- 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!",
|
||||
|
|
14
src/f_wipe.c
|
@ -172,15 +172,6 @@ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) {
|
|||
*/
|
||||
static void F_DoWipe(fademask_t *fademask)
|
||||
{
|
||||
#ifdef HWRENDER
|
||||
/// \todo Mask wipes for OpenGL
|
||||
if(rendermode != render_soft)
|
||||
{
|
||||
HWR_DoScreenWipe();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Software mask wipe -- optimized; though it might not look like it!
|
||||
// Okay, to save you wondering *how* this is more optimized than the simpler
|
||||
// version that came before it...
|
||||
|
@ -344,6 +335,11 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
|
|||
I_Sleep();
|
||||
lastwipetic = nowtime;
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
HWR_DoWipe(wipetype, wipeframe-1); // send in the wipe type and wipeframe because we need to cache the graphic
|
||||
else
|
||||
#endif
|
||||
F_DoWipe(fmask);
|
||||
I_OsPolling();
|
||||
I_UpdateNoBlit();
|
||||
|
|
277
src/g_game.c
|
@ -131,7 +131,6 @@ boolean countdowntimeup = false;
|
|||
cutscene_t *cutscenes[128];
|
||||
|
||||
INT16 nextmapoverride;
|
||||
INT32 nextmapgametype;
|
||||
boolean skipstats;
|
||||
|
||||
// Pointers to each CTF flag
|
||||
|
@ -244,7 +243,6 @@ mobj_t *metalplayback;
|
|||
static UINT8 *metalbuffer = NULL;
|
||||
static UINT8 *metal_p;
|
||||
static UINT16 metalversion;
|
||||
boolean metal_start;
|
||||
|
||||
// extra data stuff (events registered this frame while recording)
|
||||
static struct {
|
||||
|
@ -283,6 +281,8 @@ static void UserAnalog_OnChange(void);
|
|||
static void UserAnalog2_OnChange(void);
|
||||
static void Analog_OnChange(void);
|
||||
static void Analog2_OnChange(void);
|
||||
void SendWeaponPref(void);
|
||||
void SendWeaponPref2(void);
|
||||
|
||||
static CV_PossibleValue_t crosshair_cons_t[] = {{0, "Off"}, {1, "Cross"}, {2, "Angle"}, {3, "Point"}, {0, NULL}};
|
||||
static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
|
||||
|
@ -595,14 +595,18 @@ void G_AddTempNightsRecords(UINT32 pscore, tic_t ptime, UINT8 mare)
|
|||
void G_SetNightsRecords(void)
|
||||
{
|
||||
INT32 i;
|
||||
UINT32 totalscore = 0;
|
||||
tic_t totaltime = 0;
|
||||
|
||||
const size_t glen = strlen(srb2home)+1+strlen("replay")+1+strlen(timeattackfolder)+1+strlen("MAPXX")+1;
|
||||
char *gpath;
|
||||
char lastdemo[256], bestdemo[256];
|
||||
|
||||
if (!ntemprecords.nummares)
|
||||
return;
|
||||
|
||||
// Set overall
|
||||
{
|
||||
UINT32 totalscore = 0;
|
||||
tic_t totaltime = 0;
|
||||
UINT8 totalrank = 0, realrank = 0;
|
||||
|
||||
for (i = 1; i <= ntemprecords.nummares; ++i)
|
||||
|
@ -648,6 +652,50 @@ void G_SetNightsRecords(void)
|
|||
|
||||
memset(&ntemprecords, 0, sizeof(nightsdata_t));
|
||||
|
||||
// Save demo!
|
||||
bestdemo[255] = '\0';
|
||||
lastdemo[255] = '\0';
|
||||
G_SetDemoTime(totaltime, totalscore, 0);
|
||||
G_CheckDemoStatus();
|
||||
|
||||
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
|
||||
I_mkdir(va("%s"PATHSEP"replay"PATHSEP"%s", srb2home, timeattackfolder), 0755);
|
||||
|
||||
if ((gpath = malloc(glen)) == NULL)
|
||||
I_Error("Out of memory for replay filepath\n");
|
||||
|
||||
sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap));
|
||||
snprintf(lastdemo, 255, "%s-last.lmp", gpath);
|
||||
|
||||
if (FIL_FileExists(lastdemo))
|
||||
{
|
||||
UINT8 *buf;
|
||||
size_t len = FIL_ReadFile(lastdemo, &buf);
|
||||
|
||||
snprintf(bestdemo, 255, "%s-time-best.lmp", gpath);
|
||||
if (!FIL_FileExists(bestdemo) || G_CmpDemoTime(bestdemo, lastdemo) & 1)
|
||||
{ // Better time, save this demo.
|
||||
if (FIL_FileExists(bestdemo))
|
||||
remove(bestdemo);
|
||||
FIL_WriteFile(bestdemo, buf, len);
|
||||
CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW RECORD TIME!"), M_GetText("Saved replay as"), bestdemo);
|
||||
}
|
||||
|
||||
snprintf(bestdemo, 255, "%s-score-best.lmp", gpath);
|
||||
if (!FIL_FileExists(bestdemo) || (G_CmpDemoTime(bestdemo, lastdemo) & (1<<1)))
|
||||
{ // Better score, save this demo.
|
||||
if (FIL_FileExists(bestdemo))
|
||||
remove(bestdemo);
|
||||
FIL_WriteFile(bestdemo, buf, len);
|
||||
CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW HIGH SCORE!"), M_GetText("Saved replay as"), bestdemo);
|
||||
}
|
||||
|
||||
//CONS_Printf("%s '%s'\n", M_GetText("Saved replay as"), lastdemo);
|
||||
|
||||
Z_Free(buf);
|
||||
}
|
||||
free(gpath);
|
||||
|
||||
// If the mare count changed, this will update the score display
|
||||
CV_AddValue(&cv_nextmap, 1);
|
||||
CV_AddValue(&cv_nextmap, -1);
|
||||
|
@ -909,6 +957,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
// these ones used for multiple conditions
|
||||
boolean turnleft, turnright, mouseaiming, analogjoystickmove, gamepadjoystickmove;
|
||||
player_t *player = &players[consoleplayer];
|
||||
camera_t *thiscam = &camera;
|
||||
|
||||
static INT32 turnheld; // for accelerative turning
|
||||
static boolean keyboard_look; // true if lookup/down using keyboard
|
||||
|
@ -1172,8 +1221,16 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
cmd->forwardmove = (SINT8)(cmd->forwardmove + forward);
|
||||
cmd->sidemove = (SINT8)(cmd->sidemove + side);
|
||||
|
||||
localangle += (cmd->angleturn<<16);
|
||||
cmd->angleturn = (INT16)(localangle >> 16);
|
||||
if (cv_analog.value) {
|
||||
cmd->angleturn = (INT16)(thiscam->angle >> 16);
|
||||
if (player->awayviewtics)
|
||||
cmd->angleturn = (INT16)(player->awayviewmobj->angle >> 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
localangle += (cmd->angleturn<<16);
|
||||
cmd->angleturn = (INT16)(localangle >> 16);
|
||||
}
|
||||
|
||||
//Reset away view if a command is given.
|
||||
if ((cmd->forwardmove || cmd->sidemove || cmd->buttons)
|
||||
|
@ -1190,6 +1247,7 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
|||
// these ones used for multiple conditions
|
||||
boolean turnleft, turnright, mouseaiming, analogjoystickmove, gamepadjoystickmove;
|
||||
player_t *player = &players[secondarydisplayplayer];
|
||||
camera_t *thiscam = (player->bot == 2 ? &camera : &camera2);
|
||||
|
||||
static INT32 turnheld; // for accelerative turning
|
||||
static boolean keyboard_look; // true if lookup/down using keyboard
|
||||
|
@ -1463,8 +1521,16 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
|||
}
|
||||
}
|
||||
|
||||
localangle2 += (cmd->angleturn<<16);
|
||||
cmd->angleturn = (INT16)(localangle2 >> 16);
|
||||
if (cv_analog2.value) {
|
||||
cmd->angleturn = (INT16)(thiscam->angle >> 16);
|
||||
if (player->awayviewtics)
|
||||
cmd->angleturn = (INT16)(player->awayviewmobj->angle >> 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
localangle2 += (cmd->angleturn<<16);
|
||||
cmd->angleturn = (INT16)(localangle2 >> 16);
|
||||
}
|
||||
}
|
||||
|
||||
// User has designated that they want
|
||||
|
@ -1497,25 +1563,45 @@ static void Analog_OnChange(void)
|
|||
|
||||
if (leveltime > 1)
|
||||
CV_SetValue(&cv_cam_dist, 128);
|
||||
if (netgame)
|
||||
CV_StealthSetValue(&cv_analog, 0);
|
||||
else if (cv_analog.value || demoplayback)
|
||||
if (cv_analog.value || demoplayback)
|
||||
CV_SetValue(&cv_cam_dist, 192);
|
||||
|
||||
if (!cv_chasecam.value && cv_analog.value) {
|
||||
CV_SetValue(&cv_analog, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cv_analog.value)
|
||||
players[consoleplayer].pflags |= PF_ANALOGMODE;
|
||||
else
|
||||
players[consoleplayer].pflags &= ~PF_ANALOGMODE;
|
||||
|
||||
SendWeaponPref();
|
||||
}
|
||||
|
||||
static void Analog2_OnChange(void)
|
||||
{
|
||||
if (!splitscreen || !cv_cam2_dist.string)
|
||||
if (!(splitscreen || botingame) || !cv_cam2_dist.string)
|
||||
return;
|
||||
|
||||
// cameras are not initialized at this point
|
||||
|
||||
if (leveltime > 1)
|
||||
CV_SetValue(&cv_cam2_dist, 128);
|
||||
if (netgame)
|
||||
CV_StealthSetValue(&cv_analog2, 0);
|
||||
else if (cv_analog2.value)
|
||||
if (cv_analog2.value)
|
||||
CV_SetValue(&cv_cam2_dist, 192);
|
||||
|
||||
if (!cv_chasecam2.value && cv_analog2.value) {
|
||||
CV_SetValue(&cv_analog2, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cv_analog2.value)
|
||||
players[secondarydisplayplayer].pflags |= PF_ANALOGMODE;
|
||||
else
|
||||
players[secondarydisplayplayer].pflags &= ~PF_ANALOGMODE;
|
||||
|
||||
SendWeaponPref2();
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1999,7 +2085,7 @@ void G_PlayerReborn(INT32 player)
|
|||
exiting = players[player].exiting;
|
||||
jointime = players[player].jointime;
|
||||
spectator = players[player].spectator;
|
||||
pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED));
|
||||
pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE));
|
||||
|
||||
// As long as we're not in multiplayer, carry over cheatcodes from map to map
|
||||
if (!(netgame || multiplayer))
|
||||
|
@ -2838,23 +2924,12 @@ static void G_DoWorldDone(void)
|
|||
{
|
||||
if (server)
|
||||
{
|
||||
INT32 nextgametype;
|
||||
|
||||
// for custom exit (linetype 2) that changes gametype
|
||||
if (nextmapgametype != -1)
|
||||
nextgametype = nextmapgametype;
|
||||
else
|
||||
{
|
||||
// use current gametype by default
|
||||
nextgametype = gametype;
|
||||
}
|
||||
|
||||
if (gametype == GT_COOP && nextgametype == GT_COOP)
|
||||
if (gametype == GT_COOP)
|
||||
// don't reset player between maps
|
||||
D_MapChange(nextmap+1, nextgametype, ultimatemode, false, 0, false, false);
|
||||
D_MapChange(nextmap+1, gametype, ultimatemode, false, 0, false, false);
|
||||
else
|
||||
// resetplayer in match/chaos/tag/CTF/race for more equality
|
||||
D_MapChange(nextmap+1, nextgametype, ultimatemode, true, 0, false, false);
|
||||
D_MapChange(nextmap+1, gametype, ultimatemode, true, 0, false, false);
|
||||
}
|
||||
|
||||
gameaction = ga_nothing;
|
||||
|
@ -3618,6 +3693,7 @@ static ticcmd_t oldcmd;
|
|||
// Not used for Metal Sonic
|
||||
#define GZT_SPRITE 0x10 // Animation frame
|
||||
#define GZT_EXTRA 0x20
|
||||
#define GZT_NIGHTS 0x40 // NiGHTS Mode stuff!
|
||||
|
||||
// GZT_EXTRA flags
|
||||
#define EZT_THOK 0x01 // Spawned a thok object
|
||||
|
@ -3632,6 +3708,21 @@ static ticcmd_t oldcmd;
|
|||
|
||||
static mobj_t oldmetal, oldghost;
|
||||
|
||||
void G_SaveMetal(UINT8 **buffer)
|
||||
{
|
||||
I_Assert(buffer != NULL && *buffer != NULL);
|
||||
|
||||
WRITEUINT32(*buffer, metal_p - metalbuffer);
|
||||
}
|
||||
|
||||
void G_LoadMetal(UINT8 **buffer)
|
||||
{
|
||||
I_Assert(buffer != NULL && *buffer != NULL);
|
||||
|
||||
G_DoPlayMetal();
|
||||
metal_p = metalbuffer + READUINT32(*buffer);
|
||||
}
|
||||
|
||||
ticcmd_t *G_CopyTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n)
|
||||
{
|
||||
return M_Memcpy(dest, src, n*sizeof(*src));
|
||||
|
@ -3814,6 +3905,13 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
if (!(demoflags & DF_GHOST))
|
||||
return; // No ghost data to write.
|
||||
|
||||
if (ghost->player && ghost->player->pflags & PF_NIGHTSMODE && ghost->tracer)
|
||||
{
|
||||
// We're talking about the NiGHTS thing, not the normal platforming thing!
|
||||
ziptic |= GZT_NIGHTS;
|
||||
ghost = ghost->tracer;
|
||||
}
|
||||
|
||||
ziptic_p = demo_p++; // the ziptic, written at the end of this function
|
||||
|
||||
#define MAXMOM (0xFFFF<<8)
|
||||
|
@ -3875,10 +3973,7 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
}
|
||||
|
||||
// Store the sprite frame.
|
||||
if (ghost->player && ghost->player->pflags & PF_NIGHTSMODE && ghost->tracer)
|
||||
frame = ghost->tracer->frame & 0xFF; // get frame from NiGHTS tracer
|
||||
else
|
||||
frame = ghost->frame & 0xFF; // get frame from player
|
||||
frame = ghost->frame & 0xFF;
|
||||
if (frame != oldghost.frame)
|
||||
{
|
||||
oldghost.frame = frame;
|
||||
|
@ -3887,10 +3982,7 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
}
|
||||
|
||||
// Check for sprite set changes
|
||||
if (ghost->player && ghost->player->pflags & PF_NIGHTSMODE && ghost->tracer)
|
||||
sprite = ghost->tracer->sprite; // get sprite from NiGHTS tracer
|
||||
else
|
||||
sprite = ghost->sprite; // get sprite from player
|
||||
sprite = ghost->sprite;
|
||||
if (sprite != oldghost.sprite)
|
||||
{
|
||||
oldghost.sprite = sprite;
|
||||
|
@ -3957,12 +4049,16 @@ void G_ConsGhostTic(void)
|
|||
{
|
||||
UINT8 ziptic;
|
||||
UINT16 px,py,pz,gx,gy,gz;
|
||||
mobj_t *testmo;
|
||||
boolean nightsfail = false;
|
||||
|
||||
if (!demo_p || !demo_start)
|
||||
return;
|
||||
if (!(demoflags & DF_GHOST))
|
||||
return; // No ghost data to use.
|
||||
|
||||
testmo = players[0].mo;
|
||||
|
||||
// Grab ghost data.
|
||||
ziptic = READUINT8(demo_p);
|
||||
if (ziptic & GZT_XYZ)
|
||||
|
@ -3988,6 +4084,12 @@ void G_ConsGhostTic(void)
|
|||
demo_p++;
|
||||
if (ziptic & GZT_SPRITE)
|
||||
demo_p++;
|
||||
if(ziptic & GZT_NIGHTS) {
|
||||
if (!testmo->player || !(testmo->player->pflags & PF_NIGHTSMODE) || !testmo->tracer)
|
||||
nightsfail = true;
|
||||
else
|
||||
testmo = testmo->tracer;
|
||||
}
|
||||
|
||||
if (ziptic & GZT_EXTRA)
|
||||
{ // But wait, there's more!
|
||||
|
@ -4029,7 +4131,12 @@ void G_ConsGhostTic(void)
|
|||
mobj = NULL; // wasn't this one, keep searching.
|
||||
}
|
||||
if (mobj && mobj->health != health) // Wasn't damaged?! This is desync! Fix it!
|
||||
{
|
||||
if (demosynced)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
||||
demosynced = false;
|
||||
P_DamageMobj(mobj, players[0].mo, players[0].mo, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ziptic & EZT_SPRITE)
|
||||
|
@ -4037,24 +4144,24 @@ void G_ConsGhostTic(void)
|
|||
}
|
||||
|
||||
// Re-synchronise
|
||||
px = players[0].mo->x>>FRACBITS;
|
||||
py = players[0].mo->y>>FRACBITS;
|
||||
pz = players[0].mo->z>>FRACBITS;
|
||||
px = testmo->x>>FRACBITS;
|
||||
py = testmo->y>>FRACBITS;
|
||||
pz = testmo->z>>FRACBITS;
|
||||
gx = oldghost.x>>FRACBITS;
|
||||
gy = oldghost.y>>FRACBITS;
|
||||
gz = oldghost.z>>FRACBITS;
|
||||
|
||||
if (px != gx || py != gy || pz != gz)
|
||||
if (nightsfail || px != gx || py != gy || pz != gz)
|
||||
{
|
||||
if (demosynced)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
||||
demosynced = false;
|
||||
|
||||
P_UnsetThingPosition(players[0].mo);
|
||||
players[0].mo->x = oldghost.x;
|
||||
players[0].mo->y = oldghost.y;
|
||||
P_SetThingPosition(players[0].mo);
|
||||
players[0].mo->z = oldghost.z;
|
||||
P_UnsetThingPosition(testmo);
|
||||
testmo->x = oldghost.x;
|
||||
testmo->y = oldghost.y;
|
||||
P_SetThingPosition(testmo);
|
||||
testmo->z = oldghost.z;
|
||||
}
|
||||
|
||||
if (*demo_p == DEMOMARKER)
|
||||
|
@ -4272,7 +4379,7 @@ void G_ReadMetalTic(mobj_t *metal)
|
|||
UINT16 speed;
|
||||
UINT8 statetype;
|
||||
|
||||
if (!metal_p || !metal_start)
|
||||
if (!metal_p)
|
||||
return;
|
||||
ziptic = READUINT8(metal_p);
|
||||
|
||||
|
@ -4517,11 +4624,7 @@ void G_BeginRecording(void)
|
|||
memset(name,0,sizeof(name));
|
||||
|
||||
demo_p = demobuffer;
|
||||
demoflags = DF_GHOST;
|
||||
if (modeattacking == ATTACKING_RECORD)
|
||||
demoflags |= DF_RECORDATTACK;
|
||||
else if (modeattacking == ATTACKING_NIGHTS)
|
||||
demoflags |= DF_NIGHTSATTACK;
|
||||
demoflags = DF_GHOST|(modeattacking<<DF_ATTACKSHIFT);
|
||||
|
||||
// Setup header.
|
||||
M_Memcpy(demo_p, DEMOHEADER, 12); demo_p += 12;
|
||||
|
@ -4651,12 +4754,21 @@ void G_BeginMetal(void)
|
|||
|
||||
void G_SetDemoTime(UINT32 ptime, UINT32 pscore, UINT16 prings)
|
||||
{
|
||||
if (!(demorecording && demoflags & DF_RECORDATTACK && demotime_p))
|
||||
return; // Can't record a time. :(
|
||||
WRITEUINT32(demotime_p, ptime);
|
||||
WRITEUINT32(demotime_p, pscore);
|
||||
WRITEUINT16(demotime_p, prings);
|
||||
demotime_p = NULL;
|
||||
if (!demorecording || !demotime_p)
|
||||
return;
|
||||
if (demoflags & DF_RECORDATTACK)
|
||||
{
|
||||
WRITEUINT32(demotime_p, ptime);
|
||||
WRITEUINT32(demotime_p, pscore);
|
||||
WRITEUINT16(demotime_p, prings);
|
||||
demotime_p = NULL;
|
||||
}
|
||||
else if (demoflags & DF_NIGHTSATTACK)
|
||||
{
|
||||
WRITEUINT32(demotime_p, ptime);
|
||||
WRITEUINT32(demotime_p, pscore);
|
||||
demotime_p = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns bitfield:
|
||||
|
@ -4672,6 +4784,7 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
|
|||
size_t bufsize ATTRUNUSED;
|
||||
UINT8 c;
|
||||
UINT16 s ATTRUNUSED;
|
||||
UINT8 aflags = 0;
|
||||
|
||||
// load the new file
|
||||
FIL_DefaultExtension(newname, ".lmp");
|
||||
|
@ -4694,10 +4807,23 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
|
|||
p += 2; // gamemap
|
||||
p += 16; // map md5
|
||||
flags = READUINT8(p); // demoflags
|
||||
I_Assert(flags & DF_RECORDATTACK);
|
||||
newtime = READUINT32(p);
|
||||
newscore = READUINT32(p);
|
||||
newrings = READUINT16(p);
|
||||
|
||||
aflags = flags & (DF_RECORDATTACK|DF_NIGHTSATTACK);
|
||||
I_Assert(aflags);
|
||||
if (flags & DF_RECORDATTACK)
|
||||
{
|
||||
newtime = READUINT32(p);
|
||||
newscore = READUINT32(p);
|
||||
newrings = READUINT16(p);
|
||||
}
|
||||
else if (flags & DF_NIGHTSATTACK)
|
||||
{
|
||||
newtime = READUINT32(p);
|
||||
newscore = READUINT32(p);
|
||||
newrings = 0;
|
||||
}
|
||||
else // appease compiler
|
||||
return 0;
|
||||
|
||||
Z_Free(buffer);
|
||||
|
||||
|
@ -4745,15 +4871,26 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
|
|||
p += 2; // gamemap
|
||||
p += 16; // mapmd5
|
||||
flags = READUINT8(p);
|
||||
if (!(flags & DF_RECORDATTACK))
|
||||
if (!(flags & aflags))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("File '%s' not from timeattack. It will be overwritten.\n"), oldname);
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("File '%s' not from same game mode. It will be overwritten.\n"), oldname);
|
||||
Z_Free(buffer);
|
||||
return UINT8_MAX;
|
||||
}
|
||||
oldtime = READUINT32(p);
|
||||
oldscore = READUINT32(p);
|
||||
oldrings = READUINT16(p);
|
||||
if (flags & DF_RECORDATTACK)
|
||||
{
|
||||
oldtime = READUINT32(p);
|
||||
oldscore = READUINT32(p);
|
||||
oldrings = READUINT16(p);
|
||||
}
|
||||
else if (flags & DF_NIGHTSATTACK)
|
||||
{
|
||||
oldtime = READUINT32(p);
|
||||
oldscore = READUINT32(p);
|
||||
oldrings = 0;
|
||||
}
|
||||
else // appease compiler
|
||||
return UINT8_MAX;
|
||||
|
||||
Z_Free(buffer);
|
||||
|
||||
|
@ -4967,7 +5104,6 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
|
||||
// didn't start recording right away.
|
||||
demo_start = false;
|
||||
metal_start = false;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_MapChange();
|
||||
|
@ -5013,7 +5149,6 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
players[0].jumpfactor = jumpfactor;
|
||||
|
||||
demo_start = true;
|
||||
metal_start = true;
|
||||
}
|
||||
|
||||
void G_AddGhost(char *defdemoname)
|
||||
|
@ -5433,7 +5568,7 @@ boolean G_CheckDemoStatus(void)
|
|||
I_Quit();
|
||||
G_StopDemo();
|
||||
|
||||
if (modeattacking == ATTACKING_RECORD)
|
||||
if (modeattacking)
|
||||
M_EndModeAttackRun();
|
||||
else
|
||||
D_AdvanceDemo();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -452,7 +452,7 @@ static void HWR_GenerateTexture(INT32 texnum, GLTexture_t *grtex)
|
|||
//Hurdler: not efficient at all but I don't remember exactly how HWR_DrawPatchInCache works :(
|
||||
if (format2bpp[grtex->mipmap.grInfo.format]==4)
|
||||
{
|
||||
for (i = 3; i < blocksize; i += 4)
|
||||
for (i = 3; i < blocksize*4; i += 4) // blocksize*4 because blocksize doesn't include the bpp
|
||||
{
|
||||
if (block[i] == 0)
|
||||
{
|
||||
|
@ -1002,4 +1002,107 @@ GLPatch_t *HWR_GetCachedGLPatch(lumpnum_t lumpnum)
|
|||
return HWR_GetCachedGLPatchPwad(WADFILENUM(lumpnum),LUMPNUM(lumpnum));
|
||||
}
|
||||
|
||||
// Need to do this because they aren't powers of 2
|
||||
static void HWR_DrawFadeMaskInCache(GLMipmap_t *mipmap, INT32 pblockwidth, INT32 pblockheight,
|
||||
lumpnum_t fademasklumpnum, UINT16 fmwidth, UINT16 fmheight)
|
||||
{
|
||||
INT32 i,j;
|
||||
fixed_t posx, posy, stepx, stepy;
|
||||
UINT8 *block = mipmap->grInfo.data; // places the data directly into here, it already has the space allocated from HWR_ResizeBlock
|
||||
UINT8 *flat;
|
||||
UINT8 *dest, *src, texel;
|
||||
RGBA_t col;
|
||||
|
||||
// Place the flats data into flat
|
||||
W_ReadLump(fademasklumpnum, Z_Malloc(W_LumpLength(fademasklumpnum),
|
||||
PU_HWRCACHE, &flat));
|
||||
|
||||
stepy = ((INT32)SHORT(fmheight)<<FRACBITS)/pblockheight;
|
||||
stepx = ((INT32)SHORT(fmwidth)<<FRACBITS)/pblockwidth;
|
||||
posy = 0;
|
||||
for (j = 0; j < pblockheight; j++)
|
||||
{
|
||||
posx = 0;
|
||||
dest = &block[j*blockwidth]; // 1bpp
|
||||
src = &flat[(posy>>FRACBITS)*SHORT(fmwidth)];
|
||||
for (i = 0; i < pblockwidth;i++)
|
||||
{
|
||||
// fademask bpp is always 1, and is used just for alpha
|
||||
texel = src[(posx)>>FRACBITS];
|
||||
col = V_GetColor(texel);
|
||||
*dest = col.s.red; // take the red level of the colour and use it for alpha, as fademasks do
|
||||
|
||||
dest++;
|
||||
posx += stepx;
|
||||
}
|
||||
posy += stepy;
|
||||
}
|
||||
|
||||
Z_Free(flat);
|
||||
}
|
||||
|
||||
static void HWR_CacheFadeMask(GLMipmap_t *grMipmap, lumpnum_t fademasklumpnum)
|
||||
{
|
||||
size_t size;
|
||||
UINT16 fmheight = 0, fmwidth = 0;
|
||||
|
||||
// setup the texture info
|
||||
grMipmap->grInfo.format = GR_TEXFMT_ALPHA_8; // put the correct alpha levels straight in so I don't need to convert it later
|
||||
grMipmap->flags = 0;
|
||||
|
||||
size = W_LumpLength(fademasklumpnum);
|
||||
|
||||
switch (size)
|
||||
{
|
||||
// None of these are powers of 2, so I'll need to do what is done for textures and make them powers of 2 before they can be used
|
||||
case 256000: // 640x400
|
||||
fmwidth = 640;
|
||||
fmheight = 400;
|
||||
break;
|
||||
case 64000: // 320x200
|
||||
fmwidth = 320;
|
||||
fmheight = 200;
|
||||
break;
|
||||
case 16000: // 160x100
|
||||
fmwidth = 160;
|
||||
fmheight = 100;
|
||||
break;
|
||||
case 4000: // 80x50 (minimum)
|
||||
fmwidth = 80;
|
||||
fmheight = 50;
|
||||
break;
|
||||
default: // Bad lump
|
||||
CONS_Alert(CONS_WARNING, "Fade mask lump of incorrect size, ignored\n"); // I should avoid this by checking the lumpnum in HWR_RunWipe
|
||||
break;
|
||||
}
|
||||
|
||||
// Thankfully, this will still work for this scenario
|
||||
HWR_ResizeBlock(fmwidth, fmheight, &grMipmap->grInfo);
|
||||
|
||||
grMipmap->width = blockwidth;
|
||||
grMipmap->height = blockheight;
|
||||
|
||||
MakeBlock(grMipmap);
|
||||
|
||||
HWR_DrawFadeMaskInCache(grMipmap, blockwidth, blockheight, fademasklumpnum, fmwidth, fmheight);
|
||||
|
||||
// I DO need to convert this because it isn't power of 2 and we need the alpha
|
||||
}
|
||||
|
||||
|
||||
void HWR_GetFadeMask(lumpnum_t fademasklumpnum)
|
||||
{
|
||||
GLMipmap_t *grmip;
|
||||
|
||||
grmip = &HWR_GetCachedGLPatch(fademasklumpnum)->mipmap;
|
||||
|
||||
if (!grmip->downloaded && !grmip->grInfo.data)
|
||||
HWR_CacheFadeMask(grmip, fademasklumpnum);
|
||||
|
||||
HWD.pfnSetTexture(grmip);
|
||||
|
||||
// The system-memory data can be purged now.
|
||||
Z_ChangeTag(grmip->grInfo.data, PU_HWRCACHE_UNLOCKED);
|
||||
}
|
||||
|
||||
#endif //HWRENDER
|
||||
|
|
|
@ -106,6 +106,7 @@ GLPatch_t *HWR_GetPic(lumpnum_t lumpnum);
|
|||
void HWR_SetPalette(RGBA_t *palette);
|
||||
GLPatch_t *HWR_GetCachedGLPatchPwad(UINT16 wad, UINT16 lump);
|
||||
GLPatch_t *HWR_GetCachedGLPatch(lumpnum_t lumpnum);
|
||||
void HWR_GetFadeMask(lumpnum_t fademasklumpnum);
|
||||
|
||||
// --------
|
||||
// hw_draw.c
|
||||
|
|
|
@ -66,6 +66,8 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing);
|
|||
#ifdef SORTING
|
||||
void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, fixed_t fixedheight,
|
||||
INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap);
|
||||
void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, fixed_t fixedheight,
|
||||
INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap);
|
||||
#else
|
||||
static void HWR_Add3DWater(lumpnum_t lumpnum, extrasubsector_t *xsub, fixed_t fixedheight,
|
||||
INT32 lightlevel, INT32 alpha, sector_t *FOFSector);
|
||||
|
@ -1286,6 +1288,25 @@ static void HWR_SplitFog(sector_t *sector, wallVert3D *wallVerts, FSurfaceInfo*
|
|||
HWR_AddTransparentWall(wallVerts, Surf, 0, PF_Translucent|PF_NoTexture, true, lightnum, colormap);
|
||||
}
|
||||
|
||||
// HWR_DrawSkyWalls
|
||||
// Draw walls into the depth buffer so that anything behind is culled properly
|
||||
static void HWR_DrawSkyWall(wallVert3D *wallVerts, FSurfaceInfo *Surf, fixed_t bottom, fixed_t top)
|
||||
{
|
||||
HWD.pfnSetTexture(NULL);
|
||||
// no texture
|
||||
wallVerts[3].t = wallVerts[2].t = 0;
|
||||
wallVerts[0].t = wallVerts[1].t = 0;
|
||||
wallVerts[0].s = wallVerts[3].s = 0;
|
||||
wallVerts[2].s = wallVerts[1].s = 0;
|
||||
// set top/bottom coords
|
||||
wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(top); // No real way to find the correct height of this
|
||||
wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(bottom); // worldlow/bottom because it needs to cover up the lower thok barrier wall
|
||||
HWR_ProjectWall(wallVerts, Surf, PF_Invisible|PF_Clip|PF_NoTexture, 255, NULL);
|
||||
// PF_Invisible so it's not drawn into the colour buffer
|
||||
// PF_NoTexture for no texture
|
||||
// PF_Occlude is set in HWR_ProjectWall to draw into the depth buffer
|
||||
}
|
||||
|
||||
//
|
||||
// HWR_StoreWallRange
|
||||
// A portion or all of a wall segment will be drawn, from startfrac to endfrac,
|
||||
|
@ -1393,11 +1414,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
}
|
||||
|
||||
// check TOP TEXTURE
|
||||
if (worldhigh < worldtop && texturetranslation[gr_sidedef->toptexture]
|
||||
#ifdef POLYOBJECTS // polyobjects don't have top textures, silly.
|
||||
&& !gr_curline->polyseg
|
||||
#endif
|
||||
)
|
||||
if (worldhigh < worldtop && texturetranslation[gr_sidedef->toptexture])
|
||||
{
|
||||
if (drawtextured)
|
||||
{
|
||||
|
@ -1435,11 +1452,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
}
|
||||
|
||||
// check BOTTOM TEXTURE
|
||||
if (worldlow > worldbottom && texturetranslation[gr_sidedef->bottomtexture]
|
||||
#ifdef POLYOBJECTS // polyobjects don't have bottom textures, silly.
|
||||
&& !gr_curline->polyseg
|
||||
#endif
|
||||
) //only if VISIBLE!!!
|
||||
if (worldlow > worldbottom && texturetranslation[gr_sidedef->bottomtexture]) //only if VISIBLE!!!
|
||||
{
|
||||
if (drawtextured)
|
||||
{
|
||||
|
@ -1646,6 +1659,20 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
blendmode = PF_Masked;
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
if (gr_curline->polyseg && gr_curline->polyseg->translucency > 0)
|
||||
{
|
||||
if (gr_curline->polyseg->translucency >= NUMTRANSMAPS) // wall not drawn
|
||||
{
|
||||
Surf.FlatColor.s.alpha = 0x00; // This shouldn't draw anything regardless of blendmode
|
||||
blendmode = PF_Masked;
|
||||
}
|
||||
else
|
||||
blendmode = HWR_TranstableToAlpha(gr_curline->polyseg->translucency, &Surf);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (grTex->mipmap.flags & TF_TRANSPARENT)
|
||||
blendmode = PF_Translucent;
|
||||
|
||||
|
@ -1668,6 +1695,85 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
Surf.FlatColor.rgba = 0xffffffff;
|
||||
}*/
|
||||
}
|
||||
|
||||
// Isn't this just the most lovely mess
|
||||
if (!gr_curline->polyseg) // Don't do it for polyobjects
|
||||
{
|
||||
if (gr_frontsector->ceilingpic == skyflatnum || gr_backsector->ceilingpic == skyflatnum)
|
||||
{
|
||||
fixed_t depthwallheight;
|
||||
|
||||
if (!gr_sidedef->toptexture || (gr_frontsector->ceilingpic == skyflatnum && gr_backsector->ceilingpic == skyflatnum)) // when both sectors are sky, the top texture isn't drawn
|
||||
depthwallheight = gr_frontsector->ceilingheight < gr_backsector->ceilingheight ? gr_frontsector->ceilingheight : gr_backsector->ceilingheight;
|
||||
else
|
||||
depthwallheight = gr_frontsector->ceilingheight > gr_backsector->ceilingheight ? gr_frontsector->ceilingheight : gr_backsector->ceilingheight;
|
||||
|
||||
if (gr_frontsector->ceilingheight-gr_frontsector->floorheight <= 0) // current sector is a thok barrier
|
||||
{
|
||||
if (gr_backsector->ceilingheight-gr_backsector->floorheight <= 0) // behind sector is also a thok barrier
|
||||
{
|
||||
if (!gr_sidedef->bottomtexture) // Only extend further down if there's no texture
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, worldbottom < worldlow ? worldbottom : worldlow, INT32_MAX);
|
||||
else
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, worldbottom > worldlow ? worldbottom : worldlow, INT32_MAX);
|
||||
}
|
||||
// behind sector is not a thok barrier
|
||||
else if (gr_backsector->ceilingheight <= gr_frontsector->ceilingheight) // behind sector ceiling is lower or equal to current sector
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, depthwallheight, INT32_MAX);
|
||||
// gr_front/backsector heights need to be used here because of the worldtop being set to worldhigh earlier on
|
||||
}
|
||||
else if (gr_backsector->ceilingheight-gr_backsector->floorheight <= 0) // behind sector is a thok barrier, current sector is not
|
||||
{
|
||||
if (gr_backsector->ceilingheight >= gr_frontsector->ceilingheight // thok barrier ceiling height is equal to or greater than current sector ceiling height
|
||||
|| gr_backsector->floorheight <= gr_frontsector->floorheight // thok barrier ceiling height is equal to or less than current sector floor height
|
||||
|| gr_backsector->ceilingpic != skyflatnum) // thok barrier is not a sky
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, depthwallheight, INT32_MAX);
|
||||
}
|
||||
else // neither sectors are thok barriers
|
||||
{
|
||||
if ((gr_backsector->ceilingheight < gr_frontsector->ceilingheight && !gr_sidedef->toptexture) // no top texture and sector behind is lower
|
||||
|| gr_backsector->ceilingpic != skyflatnum) // behind sector is not a sky
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, depthwallheight, INT32_MAX);
|
||||
}
|
||||
}
|
||||
// And now for sky floors!
|
||||
if (gr_frontsector->floorpic == skyflatnum || gr_backsector->floorpic == skyflatnum)
|
||||
{
|
||||
fixed_t depthwallheight;
|
||||
|
||||
if (!gr_sidedef->bottomtexture)
|
||||
depthwallheight = worldbottom > worldlow ? worldbottom : worldlow;
|
||||
else
|
||||
depthwallheight = worldbottom < worldlow ? worldbottom : worldlow;
|
||||
|
||||
if (gr_frontsector->ceilingheight-gr_frontsector->floorheight <= 0) // current sector is a thok barrier
|
||||
{
|
||||
if (gr_backsector->ceilingheight-gr_backsector->floorheight <= 0) // behind sector is also a thok barrier
|
||||
{
|
||||
if (!gr_sidedef->toptexture) // Only extend up if there's no texture
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, INT32_MIN, worldtop > worldhigh ? worldtop : worldhigh);
|
||||
else
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, INT32_MIN, worldtop < worldhigh ? worldtop : worldhigh);
|
||||
}
|
||||
// behind sector is not a thok barrier
|
||||
else if (gr_backsector->floorheight >= gr_frontsector->floorheight) // behind sector floor is greater or equal to current sector
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, INT32_MIN, depthwallheight);
|
||||
}
|
||||
else if (gr_backsector->ceilingheight-gr_backsector->floorheight <= 0) // behind sector is a thok barrier, current sector is not
|
||||
{
|
||||
if (gr_backsector->floorheight <= gr_frontsector->floorheight // thok barrier floor height is equal to or less than current sector floor height
|
||||
|| gr_backsector->ceilingheight >= gr_frontsector->ceilingheight // thok barrier floor height is equal to or greater than current sector ceiling height
|
||||
|| gr_backsector->floorpic != skyflatnum) // thok barrier is not a sky
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, INT32_MIN, depthwallheight);
|
||||
}
|
||||
else // neither sectors are thok barriers
|
||||
{
|
||||
if ((gr_backsector->floorheight > gr_frontsector->floorheight && !gr_sidedef->bottomtexture) // no bottom texture and sector behind is higher
|
||||
|| gr_backsector->floorpic != skyflatnum) // behind sector is not a sky
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, INT32_MIN, depthwallheight);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1707,6 +1813,14 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
HWR_ProjectWall(wallVerts, &Surf, PF_Masked, lightnum, colormap);
|
||||
}
|
||||
}
|
||||
|
||||
if (!gr_curline->polyseg)
|
||||
{
|
||||
if (gr_frontsector->ceilingpic == skyflatnum) // It's a single-sided line with sky for its sector
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, worldtop, INT32_MAX);
|
||||
if (gr_frontsector->floorpic == skyflatnum)
|
||||
HWR_DrawSkyWall(wallVerts, &Surf, INT32_MIN, worldbottom);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2506,6 +2620,234 @@ static inline void HWR_AddPolyObjectSegs(void)
|
|||
Z_Free(pv1);
|
||||
Z_Free(gr_fakeline);
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, fixed_t fixedheight,
|
||||
FBITFIELD blendmode, UINT8 lightlevel, lumpnum_t lumpnum, sector_t *FOFsector,
|
||||
UINT8 alpha, extracolormap_t *planecolormap)
|
||||
{
|
||||
float height; //constant y for all points on the convex flat polygon
|
||||
FOutVector *v3d;
|
||||
INT32 i;
|
||||
float flatxref,flatyref;
|
||||
float fflatsize;
|
||||
INT32 flatflag;
|
||||
size_t len;
|
||||
float scrollx = 0.0f, scrolly = 0.0f;
|
||||
angle_t angle = 0;
|
||||
FSurfaceInfo Surf;
|
||||
fixed_t tempxsow, tempytow;
|
||||
size_t nrPlaneVerts;
|
||||
|
||||
static FOutVector *planeVerts = NULL;
|
||||
static UINT16 numAllocedPlaneVerts = 0;
|
||||
|
||||
nrPlaneVerts = polysector->numVertices;
|
||||
|
||||
height = FIXED_TO_FLOAT(fixedheight);
|
||||
|
||||
if (nrPlaneVerts < 3) //not even a triangle ?
|
||||
return;
|
||||
|
||||
if (nrPlaneVerts > UINT16_MAX) // FIXME: exceeds plVerts size
|
||||
{
|
||||
CONS_Debug(DBG_RENDER, "polygon size of %d exceeds max value of %d vertices\n", nrPlaneVerts, UINT16_MAX);
|
||||
return;
|
||||
}
|
||||
|
||||
// Allocate plane-vertex buffer if we need to
|
||||
if (!planeVerts || nrPlaneVerts > numAllocedPlaneVerts)
|
||||
{
|
||||
numAllocedPlaneVerts = (UINT16)nrPlaneVerts;
|
||||
Z_Free(planeVerts);
|
||||
Z_Malloc(numAllocedPlaneVerts * sizeof (FOutVector), PU_LEVEL, &planeVerts);
|
||||
}
|
||||
|
||||
len = W_LumpLength(lumpnum);
|
||||
|
||||
switch (len)
|
||||
{
|
||||
case 4194304: // 2048x2048 lump
|
||||
fflatsize = 2048.0f;
|
||||
flatflag = 2047;
|
||||
break;
|
||||
case 1048576: // 1024x1024 lump
|
||||
fflatsize = 1024.0f;
|
||||
flatflag = 1023;
|
||||
break;
|
||||
case 262144:// 512x512 lump
|
||||
fflatsize = 512.0f;
|
||||
flatflag = 511;
|
||||
break;
|
||||
case 65536: // 256x256 lump
|
||||
fflatsize = 256.0f;
|
||||
flatflag = 255;
|
||||
break;
|
||||
case 16384: // 128x128 lump
|
||||
fflatsize = 128.0f;
|
||||
flatflag = 127;
|
||||
break;
|
||||
case 1024: // 32x32 lump
|
||||
fflatsize = 32.0f;
|
||||
flatflag = 31;
|
||||
break;
|
||||
default: // 64x64 lump
|
||||
fflatsize = 64.0f;
|
||||
flatflag = 63;
|
||||
break;
|
||||
}
|
||||
|
||||
// reference point for flat texture coord for each vertex around the polygon
|
||||
flatxref = (float)(((fixed_t)FIXED_TO_FLOAT(polysector->origVerts[0].x) & (~flatflag)) / fflatsize);
|
||||
flatyref = (float)(((fixed_t)FIXED_TO_FLOAT(polysector->origVerts[0].y) & (~flatflag)) / fflatsize);
|
||||
|
||||
// transform
|
||||
v3d = planeVerts;
|
||||
|
||||
if (FOFsector != NULL)
|
||||
{
|
||||
if (fixedheight == FOFsector->floorheight) // it's a floor
|
||||
{
|
||||
scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatsize;
|
||||
scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatsize;
|
||||
angle = FOFsector->floorpic_angle>>ANGLETOFINESHIFT;
|
||||
}
|
||||
else // it's a ceiling
|
||||
{
|
||||
scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatsize;
|
||||
scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatsize;
|
||||
angle = FOFsector->ceilingpic_angle>>ANGLETOFINESHIFT;
|
||||
}
|
||||
}
|
||||
else if (gr_frontsector)
|
||||
{
|
||||
if (fixedheight < dup_viewz) // it's a floor
|
||||
{
|
||||
scrollx = FIXED_TO_FLOAT(gr_frontsector->floor_xoffs)/fflatsize;
|
||||
scrolly = FIXED_TO_FLOAT(gr_frontsector->floor_yoffs)/fflatsize;
|
||||
angle = gr_frontsector->floorpic_angle>>ANGLETOFINESHIFT;
|
||||
}
|
||||
else // it's a ceiling
|
||||
{
|
||||
scrollx = FIXED_TO_FLOAT(gr_frontsector->ceiling_xoffs)/fflatsize;
|
||||
scrolly = FIXED_TO_FLOAT(gr_frontsector->ceiling_yoffs)/fflatsize;
|
||||
angle = gr_frontsector->ceilingpic_angle>>ANGLETOFINESHIFT;
|
||||
}
|
||||
}
|
||||
|
||||
if (angle) // Only needs to be done if there's an altered angle
|
||||
{
|
||||
// This needs to be done so that it scrolls in a different direction after rotation like software
|
||||
tempxsow = FLOAT_TO_FIXED(scrollx);
|
||||
tempytow = FLOAT_TO_FIXED(scrolly);
|
||||
scrollx = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle))));
|
||||
scrolly = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));
|
||||
|
||||
// This needs to be done so everything aligns after rotation
|
||||
// It would be done so that rotation is done, THEN the translation, but I couldn't get it to rotate AND scroll like software does
|
||||
tempxsow = FLOAT_TO_FIXED(flatxref);
|
||||
tempytow = FLOAT_TO_FIXED(flatyref);
|
||||
flatxref = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle))));
|
||||
flatyref = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));
|
||||
}
|
||||
|
||||
for (i = 0; i < (INT32)nrPlaneVerts; i++,v3d++)
|
||||
{
|
||||
// Hurdler: add scrolling texture on floor/ceiling
|
||||
v3d->sow = (float)((FIXED_TO_FLOAT(polysector->origVerts[i].x) / fflatsize) - flatxref + scrollx); // Go from the polysector's original vertex locations
|
||||
v3d->tow = (float)(flatyref - (FIXED_TO_FLOAT(polysector->origVerts[i].y) / fflatsize) + scrolly); // Means the flat is offset based on the original vertex locations
|
||||
|
||||
// Need to rotate before translate
|
||||
if (angle) // Only needs to be done if there's an altered angle
|
||||
{
|
||||
tempxsow = FLOAT_TO_FIXED(v3d->sow);
|
||||
tempytow = FLOAT_TO_FIXED(v3d->tow);
|
||||
v3d->sow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle))));
|
||||
v3d->tow = (FIXED_TO_FLOAT(-FixedMul(tempxsow, FINESINE(angle)) - FixedMul(tempytow, FINECOSINE(angle))));
|
||||
}
|
||||
|
||||
v3d->x = FIXED_TO_FLOAT(polysector->lines[i]->v1->x);
|
||||
v3d->y = height;
|
||||
v3d->z = FIXED_TO_FLOAT(polysector->lines[i]->v1->y);
|
||||
}
|
||||
|
||||
|
||||
if (planecolormap)
|
||||
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, planecolormap->rgba, planecolormap->fadergba, false, true);
|
||||
else
|
||||
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, true);
|
||||
|
||||
if (blendmode & PF_Translucent)
|
||||
{
|
||||
Surf.FlatColor.s.alpha = (UINT8)alpha;
|
||||
blendmode |= PF_Modulated|PF_Occlude|PF_Clip;
|
||||
}
|
||||
else
|
||||
blendmode |= PF_Masked|PF_Modulated|PF_Clip;
|
||||
|
||||
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, blendmode);
|
||||
}
|
||||
|
||||
static void HWR_AddPolyObjectPlanes(void)
|
||||
{
|
||||
size_t i;
|
||||
sector_t *polyobjsector;
|
||||
|
||||
// Polyobject Planes need their own function for drawing because they don't have extrasubsectors by themselves
|
||||
// It should be okay because polyobjects should always be convex anyway
|
||||
|
||||
for (i = 0; i < numpolys; i++)
|
||||
{
|
||||
polyobjsector = po_ptrs[i]->lines[0]->backsector; // the in-level polyobject sector
|
||||
|
||||
if (!(po_ptrs[i]->flags & POF_RENDERPLANES)) // Only render planes when you should
|
||||
continue;
|
||||
|
||||
if (po_ptrs[i]->translucency >= NUMTRANSMAPS)
|
||||
continue;
|
||||
|
||||
if (polyobjsector->floorheight <= gr_frontsector->ceilingheight
|
||||
&& polyobjsector->floorheight >= gr_frontsector->floorheight
|
||||
&& (viewz < polyobjsector->floorheight))
|
||||
{
|
||||
if (po_ptrs[i]->translucency > 0)
|
||||
{
|
||||
FSurfaceInfo Surf;
|
||||
FBITFIELD blendmode = HWR_TranstableToAlpha(po_ptrs[i]->translucency, &Surf);
|
||||
HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->floorpic].lumpnum, po_ptrs[i], polyobjsector->floorheight,
|
||||
polyobjsector->lightlevel, Surf.FlatColor.s.alpha, polyobjsector, blendmode, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
HWR_GetFlat(levelflats[polyobjsector->floorpic].lumpnum);
|
||||
HWR_RenderPolyObjectPlane(po_ptrs[i], polyobjsector->floorheight, PF_Occlude,
|
||||
polyobjsector->lightlevel, levelflats[polyobjsector->floorpic].lumpnum,
|
||||
polyobjsector, 255, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (polyobjsector->ceilingheight >= gr_frontsector->floorheight
|
||||
&& polyobjsector->ceilingheight <= gr_frontsector->ceilingheight
|
||||
&& (viewz > polyobjsector->ceilingheight))
|
||||
{
|
||||
if (po_ptrs[i]->translucency > 0)
|
||||
{
|
||||
FSurfaceInfo Surf;
|
||||
FBITFIELD blendmode = HWR_TranstableToAlpha(po_ptrs[i]->translucency, &Surf);
|
||||
HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->ceilingpic].lumpnum, po_ptrs[i], polyobjsector->ceilingheight,
|
||||
polyobjsector->lightlevel, Surf.FlatColor.s.alpha, polyobjsector, blendmode, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
HWR_GetFlat(levelflats[polyobjsector->ceilingpic].lumpnum);
|
||||
HWR_RenderPolyObjectPlane(po_ptrs[i], polyobjsector->ceilingheight, PF_Occlude,
|
||||
polyobjsector->lightlevel, levelflats[polyobjsector->floorpic].lumpnum,
|
||||
polyobjsector, 255, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// -----------------+
|
||||
|
@ -2816,8 +3158,13 @@ static void HWR_Subsector(size_t num)
|
|||
// Draw polyobject lines.
|
||||
HWR_AddPolyObjectSegs();
|
||||
|
||||
// Draw polyobject planes
|
||||
//HWR_AddPolyObjectPlanes();
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (sub->validcount != validcount) // This validcount situation seems to let us know that the floors have already been drawn.
|
||||
{
|
||||
// Draw polyobject planes
|
||||
HWR_AddPolyObjectPlanes();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -3140,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;
|
||||
}
|
||||
}
|
||||
else // Quick culling
|
||||
{
|
||||
if (vz > cullplane && toph < cullplane) // Cull if below plane
|
||||
return true;
|
||||
|
||||
if (bottomh > cullplane && vz <= cullplane) // Cull if above plane
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
// HWR_DrawSprite : Draw flat sprites
|
||||
// : (monsters, bonuses, weapons, lights, ...)
|
||||
|
@ -3698,6 +4085,22 @@ typedef struct
|
|||
static size_t numplanes = 0; // a list of transparent floors to be drawn
|
||||
static planeinfo_t *planeinfo = NULL;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
polyobj_t *polysector;
|
||||
fixed_t fixedheight;
|
||||
INT32 lightlevel;
|
||||
lumpnum_t lumpnum;
|
||||
INT32 alpha;
|
||||
sector_t *FOFSector;
|
||||
FBITFIELD blend;
|
||||
extracolormap_t *planecolormap;
|
||||
INT32 drawcount;
|
||||
} polyplaneinfo_t;
|
||||
|
||||
static size_t numpolyplanes = 0; // a list of transparent poyobject floors to be drawn
|
||||
static polyplaneinfo_t *polyplaneinfo = NULL;
|
||||
|
||||
#ifndef SORTING
|
||||
size_t numfloors = 0;
|
||||
#else
|
||||
|
@ -3707,6 +4110,7 @@ size_t numfloors = 0;
|
|||
typedef struct gr_drawnode_s
|
||||
{
|
||||
planeinfo_t *plane;
|
||||
polyplaneinfo_t *polyplane;
|
||||
wallinfo_t *wall;
|
||||
gr_vissprite_t *sprite;
|
||||
|
||||
|
@ -3747,6 +4151,35 @@ void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub,
|
|||
numplanes++;
|
||||
}
|
||||
|
||||
// Adding this for now until I can create extrasubsector info for polyobjects
|
||||
// When that happens it'll just be done through HWR_AddTransparentFloor and HWR_RenderPlane
|
||||
void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector,
|
||||
fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap)
|
||||
{
|
||||
static size_t allocedpolyplanes = 0;
|
||||
|
||||
// Force realloc if buffer has been freed
|
||||
if (!polyplaneinfo)
|
||||
allocedpolyplanes = 0;
|
||||
|
||||
if (allocedpolyplanes < numpolyplanes + 1)
|
||||
{
|
||||
allocedpolyplanes += MAX_TRANSPARENTFLOOR;
|
||||
Z_Realloc(polyplaneinfo, allocedpolyplanes * sizeof (*polyplaneinfo), PU_LEVEL, &polyplaneinfo);
|
||||
}
|
||||
|
||||
polyplaneinfo[numpolyplanes].fixedheight = fixedheight;
|
||||
polyplaneinfo[numpolyplanes].lightlevel = lightlevel;
|
||||
polyplaneinfo[numpolyplanes].lumpnum = lumpnum;
|
||||
polyplaneinfo[numpolyplanes].polysector = polysector;
|
||||
polyplaneinfo[numpolyplanes].alpha = alpha;
|
||||
polyplaneinfo[numpolyplanes].FOFSector = FOFSector;
|
||||
polyplaneinfo[numpolyplanes].blend = blend;
|
||||
polyplaneinfo[numpolyplanes].planecolormap = planecolormap;
|
||||
polyplaneinfo[numpolyplanes].drawcount = drawcount++;
|
||||
numpolyplanes++;
|
||||
}
|
||||
|
||||
//
|
||||
// HWR_CreateDrawNodes
|
||||
// Creates and sorts a list of drawnodes for the scene being rendered.
|
||||
|
@ -3759,12 +4192,13 @@ static void HWR_CreateDrawNodes(void)
|
|||
// Could this be optimized into _AddTransparentWall/_AddTransparentPlane?
|
||||
// Hell yes! But sort algorithm must be modified to use a linked list.
|
||||
gr_drawnode_t *sortnode = Z_Calloc((sizeof(planeinfo_t)*numplanes)
|
||||
+ (sizeof(polyplaneinfo_t)*numpolyplanes)
|
||||
+ (sizeof(wallinfo_t)*numwalls)
|
||||
,PU_STATIC, NULL);
|
||||
// todo:
|
||||
// However, in reality we shouldn't be re-copying and shifting all this information
|
||||
// that is already lying around. This should all be in some sort of linked list or lists.
|
||||
size_t *sortindex = Z_Calloc(sizeof(size_t) * (numplanes + numwalls), PU_STATIC, NULL);
|
||||
size_t *sortindex = Z_Calloc(sizeof(size_t) * (numplanes + numpolyplanes + numwalls), PU_STATIC, NULL);
|
||||
|
||||
// If true, swap the draw order.
|
||||
boolean shift = false;
|
||||
|
@ -3775,6 +4209,12 @@ static void HWR_CreateDrawNodes(void)
|
|||
sortindex[p] = p;
|
||||
}
|
||||
|
||||
for (i = 0; i < numpolyplanes; i++, p++)
|
||||
{
|
||||
sortnode[p].polyplane = &polyplaneinfo[i];
|
||||
sortindex[p] = p;
|
||||
}
|
||||
|
||||
for (i = 0; i < numwalls; i++, p++)
|
||||
{
|
||||
sortnode[p].wall = &wallinfo[i];
|
||||
|
@ -3810,6 +4250,12 @@ static void HWR_CreateDrawNodes(void)
|
|||
if (ABS(sortnode[sortindex[i]].plane->fixedheight - pviewz) > ABS(sortnode[sortindex[prev]].plane->fixedheight - pviewz))
|
||||
shift = true;
|
||||
}
|
||||
if (sortnode[sortindex[prev]].polyplane)
|
||||
{
|
||||
// Plane (i) is further away than polyplane (prev)
|
||||
if (ABS(sortnode[sortindex[i]].plane->fixedheight - pviewz) > ABS(sortnode[sortindex[prev]].polyplane->fixedheight - pviewz))
|
||||
shift = true;
|
||||
}
|
||||
else if (sortnode[sortindex[prev]].wall)
|
||||
{
|
||||
// Plane (i) is further than wall (prev)
|
||||
|
@ -3817,6 +4263,28 @@ static void HWR_CreateDrawNodes(void)
|
|||
shift = true;
|
||||
}
|
||||
}
|
||||
else if (sortnode[sortindex[i]].polyplane)
|
||||
{
|
||||
// What are we comparing it with?
|
||||
if (sortnode[sortindex[prev]].plane)
|
||||
{
|
||||
// Plane (i) is further away than plane (prev)
|
||||
if (ABS(sortnode[sortindex[i]].polyplane->fixedheight - pviewz) > ABS(sortnode[sortindex[prev]].plane->fixedheight - pviewz))
|
||||
shift = true;
|
||||
}
|
||||
if (sortnode[sortindex[prev]].polyplane)
|
||||
{
|
||||
// Plane (i) is further away than polyplane (prev)
|
||||
if (ABS(sortnode[sortindex[i]].polyplane->fixedheight - pviewz) > ABS(sortnode[sortindex[prev]].polyplane->fixedheight - pviewz))
|
||||
shift = true;
|
||||
}
|
||||
else if (sortnode[sortindex[prev]].wall)
|
||||
{
|
||||
// Plane (i) is further than wall (prev)
|
||||
if (sortnode[sortindex[i]].polyplane->drawcount > sortnode[sortindex[prev]].wall->drawcount)
|
||||
shift = true;
|
||||
}
|
||||
}
|
||||
else if (sortnode[sortindex[i]].wall)
|
||||
{
|
||||
// What are we comparing it with?
|
||||
|
@ -3826,6 +4294,12 @@ static void HWR_CreateDrawNodes(void)
|
|||
if (sortnode[sortindex[i]].wall->drawcount > sortnode[sortindex[prev]].plane->drawcount)
|
||||
shift = true;
|
||||
}
|
||||
if (sortnode[sortindex[prev]].polyplane)
|
||||
{
|
||||
// Wall (i) is further than polyplane(prev)
|
||||
if (sortnode[sortindex[i]].wall->drawcount > sortnode[sortindex[prev]].polyplane->drawcount)
|
||||
shift = true;
|
||||
}
|
||||
else if (sortnode[sortindex[prev]].wall)
|
||||
{
|
||||
// Wall (i) is further than wall (prev)
|
||||
|
@ -3862,6 +4336,16 @@ static void HWR_CreateDrawNodes(void)
|
|||
HWR_RenderPlane(NULL, sortnode[sortindex[i]].plane->xsub, sortnode[sortindex[i]].plane->fixedheight, sortnode[sortindex[i]].plane->blend, sortnode[sortindex[i]].plane->lightlevel,
|
||||
sortnode[sortindex[i]].plane->lumpnum, sortnode[sortindex[i]].plane->FOFSector, sortnode[sortindex[i]].plane->alpha, sortnode[sortindex[i]].plane->fogplane, sortnode[sortindex[i]].plane->planecolormap);
|
||||
}
|
||||
else if (sortnode[sortindex[i]].polyplane)
|
||||
{
|
||||
// We aren't traversing the BSP tree, so make gr_frontsector null to avoid crashes.
|
||||
gr_frontsector = NULL;
|
||||
|
||||
if (!(sortnode[sortindex[i]].polyplane->blend & PF_NoTexture))
|
||||
HWR_GetFlat(sortnode[sortindex[i]].polyplane->lumpnum);
|
||||
HWR_RenderPolyObjectPlane(sortnode[sortindex[i]].polyplane->polysector, sortnode[sortindex[i]].polyplane->fixedheight, sortnode[sortindex[i]].polyplane->blend, sortnode[sortindex[i]].polyplane->lightlevel,
|
||||
sortnode[sortindex[i]].polyplane->lumpnum, sortnode[sortindex[i]].polyplane->FOFSector, sortnode[sortindex[i]].polyplane->alpha, sortnode[sortindex[i]].polyplane->planecolormap);
|
||||
}
|
||||
else if (sortnode[sortindex[i]].wall)
|
||||
{
|
||||
if (!(sortnode[sortindex[i]].wall->blend & PF_NoTexture))
|
||||
|
@ -3873,6 +4357,7 @@ static void HWR_CreateDrawNodes(void)
|
|||
|
||||
numwalls = 0;
|
||||
numplanes = 0;
|
||||
numpolyplanes = 0;
|
||||
|
||||
// No mem leaks, please.
|
||||
Z_Free(sortnode);
|
||||
|
@ -4162,29 +4647,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
|
||||
if (thing->subsector->sector->cullheight)
|
||||
{
|
||||
float cullplane = FIXED_TO_FLOAT(thing->subsector->sector->cullheight->frontsector->floorheight);
|
||||
if (thing->subsector->sector->cullheight->flags & ML_NOCLIMB) // Group culling
|
||||
{
|
||||
// Make sure this is part of the same group
|
||||
if (viewsector->cullheight && viewsector->cullheight->frontsector
|
||||
== thing->subsector->sector->cullheight->frontsector)
|
||||
{
|
||||
// OK, we can cull
|
||||
if (gr_viewz > cullplane && gzt < cullplane) // Cull if below plane
|
||||
return;
|
||||
|
||||
if (gz > cullplane && gr_viewz <= cullplane) // Cull if above plane
|
||||
return;
|
||||
}
|
||||
}
|
||||
else // Quick culling
|
||||
{
|
||||
if (gr_viewz > cullplane && gzt < cullplane) // Cull if below plane
|
||||
return;
|
||||
|
||||
if (gz > cullplane && gr_viewz <= cullplane) // Cull if above plane
|
||||
return;
|
||||
}
|
||||
if (HWR_DoCulling(thing->subsector->sector->cullheight, viewsector->cullheight, gr_viewz, gz, gzt))
|
||||
return;
|
||||
}
|
||||
|
||||
heightsec = thing->subsector->sector->heightsec;
|
||||
|
@ -4349,7 +4813,9 @@ static void HWR_DrawSkyBackground(player_t *player)
|
|||
{
|
||||
FOutVector v[4];
|
||||
angle_t angle;
|
||||
float f;
|
||||
float dimensionmultiply;
|
||||
float aspectratio;
|
||||
float angleturn;
|
||||
|
||||
// 3--2
|
||||
// | /|
|
||||
|
@ -4371,36 +4837,49 @@ static void HWR_DrawSkyBackground(player_t *player)
|
|||
|
||||
// X
|
||||
|
||||
if (textures[skytexture]->width > 256)
|
||||
angle = (angle_t)((float)(dup_viewangle + gr_xtoviewangle[0])
|
||||
/((float)textures[skytexture]->width/256.0f))
|
||||
%(ANGLE_90-1);
|
||||
else
|
||||
angle = (dup_viewangle + gr_xtoviewangle[0])%(ANGLE_90-1);
|
||||
// NOTE: This doesn't work right with texture widths greater than 1024
|
||||
// software doesn't draw any further than 1024 for skies anyway, but this doesn't overlap properly
|
||||
// The only time this will probably be an issue is when a sky wider than 1024 is used as a sky AND a regular wall texture
|
||||
|
||||
f = (float)((textures[skytexture]->width/2)
|
||||
* FIXED_TO_FLOAT(FINETANGENT((2048
|
||||
- ((INT32)angle>>(ANGLETOFINESHIFT + 1))) & FINEMASK)));
|
||||
angle = (dup_viewangle + gr_xtoviewangle[0]);
|
||||
|
||||
v[0].sow = v[3].sow = 0.22f+(f)/(textures[skytexture]->width/2);
|
||||
v[2].sow = v[1].sow = 0.22f+(f+(127))/(textures[skytexture]->width/2);
|
||||
dimensionmultiply = ((float)textures[skytexture]->width/256.0f);
|
||||
|
||||
v[0].sow = v[3].sow = ((float) angle / ((ANGLE_90-1)*dimensionmultiply));
|
||||
v[2].sow = v[1].sow = (-1.0f/dimensionmultiply)+((float) angle / ((ANGLE_90-1)*dimensionmultiply));
|
||||
|
||||
// Y
|
||||
angle = aimingangle;
|
||||
|
||||
if (textures[skytexture]->height > 256)
|
||||
angle = (angle_t)((float)(aimingangle)
|
||||
*(256.0f/(float)textures[skytexture]->height))
|
||||
%(ANGLE_90-1); // Just so that looking up and down scales right
|
||||
aspectratio = (float)vid.width/(float)vid.height;
|
||||
dimensionmultiply = ((float)textures[skytexture]->height/(128.0f*aspectratio));
|
||||
angleturn = (((float)ANGLE_45-1.0f)*aspectratio)*dimensionmultiply;
|
||||
|
||||
// Middle of the sky should always be at angle 0
|
||||
// need to keep correct aspect ratio with X
|
||||
if (atransform.flip)
|
||||
{
|
||||
// During vertical flip the sky should be flipped and it's y movement should also be flipped obviously
|
||||
v[3].tow = v[2].tow = -(0.5f-(0.5f/dimensionmultiply));
|
||||
v[0].tow = v[1].tow = (-1.0f/dimensionmultiply)-(0.5f-(0.5f/dimensionmultiply));
|
||||
}
|
||||
else
|
||||
angle = (aimingangle);
|
||||
{
|
||||
v[3].tow = v[2].tow = (-1.0f/dimensionmultiply)-(0.5f-(0.5f/dimensionmultiply));
|
||||
v[0].tow = v[1].tow = -(0.5f-(0.5f/dimensionmultiply));
|
||||
}
|
||||
|
||||
f = (float)((textures[skytexture]->height/2)
|
||||
* FIXED_TO_FLOAT(FINETANGENT((2048
|
||||
- ((INT32)angle>>(ANGLETOFINESHIFT + 1))) & FINEMASK)));
|
||||
|
||||
v[3].tow = v[2].tow = 0.22f+(f)/(textures[skytexture]->height/2);
|
||||
v[0].tow = v[1].tow = 0.22f+(f+(127))/(textures[skytexture]->height/2);
|
||||
if (angle > ANGLE_180) // Do this because we don't want the sky to suddenly teleport when crossing over 0 to 360 and vice versa
|
||||
{
|
||||
angle = InvAngle(angle);
|
||||
v[3].tow = v[2].tow += ((float) angle / angleturn);
|
||||
v[0].tow = v[1].tow += ((float) angle / angleturn);
|
||||
}
|
||||
else
|
||||
{
|
||||
v[3].tow = v[2].tow -= ((float) angle / angleturn);
|
||||
v[0].tow = v[1].tow -= ((float) angle / angleturn);
|
||||
}
|
||||
|
||||
HWD.pfnDrawPolygon(NULL, v, 4, 0);
|
||||
}
|
||||
|
@ -4649,7 +5128,7 @@ if (0)
|
|||
#endif
|
||||
|
||||
#ifdef SORTING
|
||||
if (numplanes || numwalls) //Hurdler: render 3D water and transparent walls after everything
|
||||
if (numplanes || numpolyplanes || numwalls) //Hurdler: render 3D water and transparent walls after everything
|
||||
{
|
||||
HWR_CreateDrawNodes();
|
||||
}
|
||||
|
@ -4879,12 +5358,12 @@ if (0)
|
|||
#endif
|
||||
|
||||
#ifdef SORTING
|
||||
if (numplanes || numwalls) //Hurdler: render 3D water and transparent walls after everything
|
||||
if (numplanes || numpolyplanes || numwalls) //Hurdler: render 3D water and transparent walls after everything
|
||||
{
|
||||
HWR_CreateDrawNodes();
|
||||
}
|
||||
#else
|
||||
if (numfloors || numwalls)
|
||||
if (numfloors || numpolyplanes || numwalls)
|
||||
{
|
||||
HWD.pfnSetTransform(&atransform);
|
||||
if (numfloors)
|
||||
|
@ -5413,7 +5892,7 @@ void HWR_StartScreenWipe(void)
|
|||
|
||||
void HWR_EndScreenWipe(void)
|
||||
{
|
||||
HWRWipeCounter = 1.0f;
|
||||
HWRWipeCounter = 0.0f;
|
||||
//CONS_Debug(DBG_RENDER, "In HWR_EndScreenWipe()\n");
|
||||
HWD.pfnEndScreenWipe();
|
||||
}
|
||||
|
@ -5423,17 +5902,38 @@ void HWR_DrawIntermissionBG(void)
|
|||
HWD.pfnDrawIntermissionBG();
|
||||
}
|
||||
|
||||
void HWR_DoScreenWipe(void)
|
||||
void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum)
|
||||
{
|
||||
//CONS_Debug(DBG_RENDER, "In HWR_DoScreenWipe(). Alpha =%f\n", HWRWipeCounter);
|
||||
static char lumpname[9] = "FADEmmss";
|
||||
lumpnum_t lumpnum;
|
||||
size_t lsize;
|
||||
|
||||
HWD.pfnDoScreenWipe(HWRWipeCounter);
|
||||
if (wipenum > 99 || scrnnum > 99) // not a valid wipe number
|
||||
return; // shouldn't end up here really, the loop should've stopped running beforehand
|
||||
|
||||
// This works for all the cases in vanilla until fade masks get done
|
||||
HWRWipeCounter -= 0.05f; // Go less opaque after
|
||||
// puts the numbers into the lumpname
|
||||
sprintf(&lumpname[4], "%.2hu%.2hu", (UINT16)wipenum, (UINT16)scrnnum);
|
||||
lumpnum = W_CheckNumForName(lumpname);
|
||||
|
||||
if (HWRWipeCounter < 0)
|
||||
HWRWipeCounter = 0;
|
||||
if (lumpnum == LUMPERROR) // again, shouldn't be here really
|
||||
return;
|
||||
|
||||
lsize = W_LumpLength(lumpnum);
|
||||
|
||||
if (!(lsize == 256000 || lsize == 64000 || lsize == 16000 || lsize == 4000))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Fade mask lump %s of incorrect size, ignored\n", lumpname);
|
||||
return; // again, shouldn't get here if it is a bad size
|
||||
}
|
||||
|
||||
HWR_GetFadeMask(lumpnum);
|
||||
|
||||
HWD.pfnDoScreenWipe(HWRWipeCounter); // Still send in wipecounter since old stuff might not support multitexturing
|
||||
|
||||
HWRWipeCounter += 0.05f; // increase opacity of end screen
|
||||
|
||||
if (HWRWipeCounter > 1.0f)
|
||||
HWRWipeCounter = 1.0f;
|
||||
}
|
||||
|
||||
#endif // HWRENDER
|
||||
|
|
|
@ -63,8 +63,8 @@ INT32 HWR_GetTextureUsed(void);
|
|||
void HWR_DoPostProcessor(player_t *player);
|
||||
void HWR_StartScreenWipe(void);
|
||||
void HWR_EndScreenWipe(void);
|
||||
void HWR_DoScreenWipe(void);
|
||||
void HWR_DrawIntermissionBG(void);
|
||||
void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum);
|
||||
|
||||
// This stuff is put here so MD2's can use them
|
||||
UINT32 HWR_Lighting(INT32 light, UINT32 color, UINT32 fadecolor, boolean fogblockpoly, boolean plane);
|
||||
|
|
|
@ -1230,7 +1230,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||
else
|
||||
p.z = FIXED_TO_FLOAT(spr->mobj->z);
|
||||
|
||||
if (spr->mobj->skin)
|
||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||
sprdef = &((skin_t *)spr->mobj->skin)->spritedef;
|
||||
else
|
||||
sprdef = &sprites[spr->mobj->sprite];
|
||||
|
|
|
@ -366,6 +366,7 @@ static INT32 WINAPI SetRes(viddef_t *lvid, vmode_t *pcurrentmode)
|
|||
else
|
||||
maximumAnisotropy = 0;
|
||||
|
||||
SetupGLFunc13();
|
||||
|
||||
screen_depth = (GLbyte)(lvid->bpp*8);
|
||||
if (screen_depth > 16)
|
||||
|
|
|
@ -157,6 +157,10 @@ float byteasfloat(UINT8 fbyte)
|
|||
|
||||
static I_Error_t I_Error_GL = NULL;
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
static boolean gl13 = false; // whether we can use opengl 1.3 functions
|
||||
#endif
|
||||
|
||||
|
||||
// -----------------+
|
||||
// DBG_Printf : Output error messages to debug log if DEBUG_TO_FILE is defined,
|
||||
|
@ -263,6 +267,11 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...)
|
|||
/* GLU functions */
|
||||
#define pgluBuild2DMipmaps gluBuild2DMipmaps
|
||||
#endif
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
/* 1.3 functions for multitexturing */
|
||||
#define pglActiveTexture, glActiveTexture;
|
||||
#define pglMultiTexCoord2f, glMultiTexCoord2f;
|
||||
#endif
|
||||
#else //!STATIC_OPENGL
|
||||
|
||||
/* 1.0 functions */
|
||||
|
@ -387,6 +396,14 @@ static PFNglCopyTexImage2D pglCopyTexImage2D;
|
|||
/* GLU functions */
|
||||
typedef GLint (APIENTRY * PFNgluBuild2DMipmaps) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
|
||||
static PFNgluBuild2DMipmaps pgluBuild2DMipmaps;
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
/* 1.3 functions for multitexturing */
|
||||
typedef void (APIENTRY *PFNglActiveTexture) (GLenum);
|
||||
static PFNglActiveTexture pglActiveTexture;
|
||||
typedef void (APIENTRY *PFNglMultiTexCoord2f) (GLenum, GLfloat, GLfloat);
|
||||
static PFNglMultiTexCoord2f pglMultiTexCoord2f;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
|
@ -402,6 +419,14 @@ static PFNgluBuild2DMipmaps pgluBuild2DMipmaps;
|
|||
#define GL_TEXTURE_MAX_LOD 0x813B
|
||||
#endif
|
||||
|
||||
/* 1.3 GL_TEXTUREi */
|
||||
#ifndef GL_TEXTURE0
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#endif
|
||||
#ifndef GL_TEXTURE1
|
||||
#define GL_TEXTURE1 0x84C1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
|
@ -492,6 +517,34 @@ boolean SetupGLfunc(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
// This has to be done after the context is created so the version number can be obtained
|
||||
boolean SetupGLFunc13(void)
|
||||
{
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
return false;
|
||||
#else
|
||||
#ifdef STATIC_OPENGL
|
||||
gl13 = true;
|
||||
#else
|
||||
if (isExtAvailable("GL_ARB_multitexture", gl_extensions))
|
||||
{
|
||||
// Get the functions
|
||||
pglActiveTexture = GetGLFunc("glActiveTextureARB");
|
||||
pglMultiTexCoord2f = GetGLFunc("glMultiTexCoord2fARB");
|
||||
|
||||
gl13 = true; // This is now true, so the new fade mask stuff can be done, if OpenGL version is less than 1.3, it still uses the old fade stuff.
|
||||
DBG_Printf("GL_ARB_multitexture support: enabled\n");
|
||||
|
||||
}
|
||||
else
|
||||
DBG_Printf("GL_ARB_multitexture support: disabled\n");
|
||||
#undef GETOPENGLFUNC
|
||||
|
||||
#endif
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
// SetNoTexture : Disable texture
|
||||
// -----------------+
|
||||
|
@ -1234,6 +1287,23 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (pTexInfo->grInfo.format == GR_TEXFMT_ALPHA_8) // Used for fade masks
|
||||
{
|
||||
const GLubyte *pImgData = (const GLubyte *)pTexInfo->grInfo.data;
|
||||
INT32 i, j;
|
||||
|
||||
for (j = 0; j < h; j++)
|
||||
{
|
||||
for (i = 0; i < w; i++)
|
||||
{
|
||||
tex[w*j+i] = (pImgData>>4)<<12;
|
||||
tex[w*j+i] |= (255>>4)<<8;
|
||||
tex[w*j+i] |= (255>>4)<<4;
|
||||
tex[w*j+i] |= (255>>4);
|
||||
pImgData++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
DBG_Printf ("SetTexture(bad format) %ld\n", pTexInfo->grInfo.format);
|
||||
#else
|
||||
|
@ -1299,6 +1369,23 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (pTexInfo->grInfo.format == GR_TEXFMT_ALPHA_8) // Used for fade masks
|
||||
{
|
||||
const GLubyte *pImgData = (const GLubyte *)pTexInfo->grInfo.data;
|
||||
INT32 i, j;
|
||||
|
||||
for (j = 0; j < h; j++)
|
||||
{
|
||||
for (i = 0; i < w; i++)
|
||||
{
|
||||
tex[w*j+i].s.red = 255; // 255 because the fade mask is modulated with the screen texture, so alpha affects it while the colours don't
|
||||
tex[w*j+i].s.green = 255;
|
||||
tex[w*j+i].s.blue = 255;
|
||||
tex[w*j+i].s.alpha = *pImgData;
|
||||
pImgData++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
DBG_Printf ("SetTexture(bad format) %ld\n", pTexInfo->grInfo.format);
|
||||
#endif
|
||||
|
@ -2109,6 +2196,10 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
INT32 texsize = 2048;
|
||||
float xfix, yfix;
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
INT32 fademaskdownloaded = tex_downloaded; // the fade mask that has been set
|
||||
#endif
|
||||
|
||||
// Use a power of two texture, dammit
|
||||
if(screen_width <= 1024)
|
||||
texsize = 1024;
|
||||
|
@ -2122,8 +2213,8 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
|
||||
SetBlend(PF_Modulated|PF_NoDepthTest|PF_Clip|PF_NoZClip);
|
||||
|
||||
// Draw the screen on bottom to fade to
|
||||
pglBindTexture(GL_TEXTURE_2D, endScreenWipe);
|
||||
// Draw the original screen
|
||||
pglBindTexture(GL_TEXTURE_2D, startScreenWipe);
|
||||
pglBegin(GL_QUADS);
|
||||
pglColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
|
@ -2142,12 +2233,56 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
// Bottom right
|
||||
pglTexCoord2f(xfix, 0.0f);
|
||||
pglVertex3f(1.0f, -1.0f, 1.0f);
|
||||
|
||||
pglEnd();
|
||||
|
||||
SetBlend(PF_Modulated|PF_Translucent|PF_NoDepthTest|PF_Clip|PF_NoZClip);
|
||||
|
||||
// Draw the screen on top that fades.
|
||||
pglBindTexture(GL_TEXTURE_2D, startScreenWipe);
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
if (gl13)
|
||||
{
|
||||
// Draw the end screen that fades in
|
||||
pglActiveTexture(GL_TEXTURE0);
|
||||
pglEnable(GL_TEXTURE_2D);
|
||||
pglBindTexture(GL_TEXTURE_2D, endScreenWipe);
|
||||
|
||||
pglActiveTexture(GL_TEXTURE1);
|
||||
pglEnable(GL_TEXTURE_2D);
|
||||
pglBindTexture(GL_TEXTURE_2D, fademaskdownloaded);
|
||||
|
||||
pglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
pglBegin(GL_QUADS);
|
||||
pglColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
// Bottom left
|
||||
pglMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0.0f);
|
||||
pglMultiTexCoord2f(GL_TEXTURE1, 0.0f, 0.0f);
|
||||
pglVertex3f(-1.0f, -1.0f, 1.0f);
|
||||
|
||||
// Top left
|
||||
pglMultiTexCoord2f(GL_TEXTURE0, 0.0f, yfix);
|
||||
pglMultiTexCoord2f(GL_TEXTURE1, 0.0f, 1.0f);
|
||||
pglVertex3f(-1.0f, 1.0f, 1.0f);
|
||||
|
||||
// Top right
|
||||
pglMultiTexCoord2f(GL_TEXTURE0, xfix, yfix);
|
||||
pglMultiTexCoord2f(GL_TEXTURE1, 1.0f, 1.0f);
|
||||
pglVertex3f(1.0f, 1.0f, 1.0f);
|
||||
|
||||
// Bottom right
|
||||
pglMultiTexCoord2f(GL_TEXTURE0, xfix, 0.0f);
|
||||
pglMultiTexCoord2f(GL_TEXTURE1, 1.0f, 0.0f);
|
||||
pglVertex3f(1.0f, -1.0f, 1.0f);
|
||||
pglEnd();
|
||||
|
||||
pglDisable(GL_TEXTURE_2D); // disable the texture in the 2nd texture unit
|
||||
pglActiveTexture(GL_TEXTURE0);
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
// Draw the end screen that fades in
|
||||
pglBindTexture(GL_TEXTURE_2D, endScreenWipe);
|
||||
pglBegin(GL_QUADS);
|
||||
pglColor4f(1.0f, 1.0f, 1.0f, alpha);
|
||||
|
||||
|
@ -2166,8 +2301,10 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
// Bottom right
|
||||
pglTexCoord2f(xfix, 0.0f);
|
||||
pglVertex3f(1.0f, -1.0f, 1.0f);
|
||||
|
||||
pglEnd();
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
}
|
||||
#endif
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
}
|
||||
|
|