Compare commits
154
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f0cf44e78 | ||
|
|
2417647110 | ||
|
|
982cd7bde2 | ||
|
|
d6bd289fcf | ||
|
|
ba44e61733 | ||
|
|
845652cbfe | ||
|
|
ceafa06efc | ||
|
|
e6f487474b | ||
|
|
d8461bb44f | ||
|
|
e25d366728 | ||
|
|
2abf0b98ac | ||
|
|
0f087d13bb | ||
|
|
2e914c61d1 | ||
|
|
3f599d5a28 | ||
|
|
6ef1f73d4d | ||
|
|
38b84baf9d | ||
|
|
fae50c0e19 | ||
|
|
50f7e2084c | ||
|
|
67cc5402cf | ||
|
|
2259d4f309 | ||
|
|
f8d903e7d2 | ||
|
|
805cde8ae8 | ||
|
|
b23906e327 | ||
|
|
2052afdb66 | ||
|
|
d9c7a40d4a | ||
|
|
cb2e017bcf | ||
|
|
d91fbf5d36 | ||
|
|
9859e43be7 | ||
|
|
306fec6f9e | ||
|
|
3e8b3e868b | ||
|
|
9261d9c5b2 | ||
|
|
f97941f86e | ||
|
|
a4810bd6c8 | ||
|
|
93cbba218a | ||
|
|
e749346f0c | ||
|
|
a658883664 | ||
|
|
d94c10014f | ||
|
|
45629386bb | ||
|
|
ffec9d64d5 | ||
|
|
3e9f17af86 | ||
|
|
03ff2fc007 | ||
|
|
4492c00840 | ||
|
|
e15319ac9b | ||
|
|
fa012aefe1 | ||
|
|
e681d2d24d | ||
|
|
76e54762d8 | ||
|
|
3b7d517be2 | ||
|
|
f4da64e3fa | ||
|
|
384acf8e31 | ||
|
|
a423451383 | ||
|
|
66cfceedaf | ||
|
|
fe9107fa9d | ||
|
|
e4f2db54e7 | ||
|
|
2f5fe01ae0 | ||
|
|
1bb7bd0abc | ||
|
|
a84ec88bc3 | ||
|
|
4a2e78081a | ||
|
|
d09d2cb445 | ||
|
|
1faa585e83 | ||
|
|
7479c82691 | ||
|
|
cfab2236da | ||
|
|
d2ee344b22 | ||
|
|
b22737223e | ||
|
|
578158c060 | ||
|
|
8eda0f78f7 | ||
|
|
2c2c82dc1a | ||
|
|
d8c9522ec9 | ||
|
|
492aef2165 | ||
|
|
fc0409e967 | ||
|
|
8a89b57e48 | ||
|
|
0f6b9ba181 | ||
|
|
8f1b4004c9 | ||
|
|
bee5250940 | ||
|
|
c61a2e6ba2 | ||
|
|
d293bb9672 | ||
|
|
9fb3f4c9a3 | ||
|
|
9a60441e54 | ||
|
|
29cf728fac | ||
|
|
3c78c5c57d | ||
|
|
7f3f332821 | ||
|
|
38576082fb | ||
|
|
4a4b5661f2 | ||
|
|
1e879dc432 | ||
|
|
f3c8ff19b9 | ||
|
|
fdd19632bf | ||
|
|
efc4a513ce | ||
|
|
b13793b2a4 | ||
|
|
e102d218ff | ||
|
|
20cdec33fb | ||
|
|
12d4a6d291 | ||
|
|
d2b1ff595d | ||
|
|
03d79fba16 | ||
|
|
989c29f7a0 | ||
|
|
8a79c0a4e0 | ||
|
|
307c333c50 | ||
|
|
3ce8b9f09c | ||
|
|
4dbe637510 | ||
|
|
c0e97e7f43 | ||
|
|
37fc64e97d | ||
|
|
ca93f08230 | ||
|
|
3581ce811c | ||
|
|
0411c40fae | ||
|
|
68cb96ab97 | ||
|
|
0159b8d0a3 | ||
|
|
aea3b49a51 | ||
|
|
1a6f775cc3 | ||
|
|
ddd192fad0 | ||
|
|
2e4fb32dac | ||
|
|
7d6e210625 | ||
|
|
3ca42ce42f | ||
|
|
e4e40cf049 | ||
|
|
d4f912e3b0 | ||
|
|
eec4443c95 | ||
|
|
b938c75892 | ||
|
|
455cb9ca24 | ||
|
|
24e7f5f864 | ||
|
|
298fa36c5d | ||
|
|
d31e9c5b55 | ||
|
|
30f53f398f | ||
|
|
eee217deec | ||
|
|
487ef6f1b9 | ||
|
|
a554b886c6 | ||
|
|
f2d68b075c | ||
|
|
dc24de3501 | ||
|
|
d2c73f072e | ||
|
|
96bc7f7aa6 | ||
|
|
bd48b24000 | ||
|
|
a26867bbdb | ||
|
|
8d570b7ba3 | ||
|
|
96f5a8adb3 | ||
|
|
3b34f0a972 | ||
|
|
fe5a0b7c64 | ||
|
|
2aa5324225 | ||
|
|
22f50402fe | ||
|
|
4e2f1bcf2b | ||
|
|
ca34b0c8d6 | ||
|
|
0df5ef996c | ||
|
|
4c0ea2695e | ||
|
|
48556ca428 | ||
|
|
5db50bbaff | ||
|
|
416da7cdc8 | ||
|
|
f47057e800 | ||
|
|
090559a766 | ||
|
|
1a6a3de443 | ||
|
|
83bb908ff0 | ||
|
|
515c18c855 | ||
|
|
58de672915 | ||
|
|
16b5037486 | ||
|
|
bcec8b98f7 | ||
|
|
fa3dcdb24f | ||
|
|
311258dda0 | ||
|
|
a0f8816de7 | ||
|
|
c546b6225c | ||
|
|
f6c6621af8 |
No files matched your search
@@ -69,6 +69,7 @@ opts+=-DHAVE_MINIUPNPC
|
||||
endif
|
||||
|
||||
ifndef NOLIBBACKTRACE
|
||||
$(eval $(call Propogate_flags,LIBBACKTRACE))
|
||||
libs+=-lbacktrace
|
||||
opts+=-DHAVE_LIBBACKTRACE
|
||||
endif
|
||||
@@ -81,6 +82,7 @@ endif
|
||||
endif
|
||||
|
||||
ifdef HAVE_DISCORDRPC
|
||||
$(eval $(call Propogate_flags,DISCORDRPC))
|
||||
libs+=-ldiscord-rpc
|
||||
opts+=-DUSE_STUN
|
||||
sources+=discord.c stun.c
|
||||
|
||||
@@ -324,6 +324,7 @@ static void AM_initVariables(void)
|
||||
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
|
||||
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
|
||||
}
|
||||
|
||||
AM_changeWindowLoc();
|
||||
|
||||
// for saving & restoring
|
||||
|
||||
+5
-5
@@ -133,26 +133,26 @@ LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) {
|
||||
|
||||
|
||||
LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) {
|
||||
if (!lua_checkstack(L, space))
|
||||
if (l_unlikely(!lua_checkstack(L, space)))
|
||||
luaL_error(L, "stack overflow (%s)", mes);
|
||||
}
|
||||
|
||||
|
||||
LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) {
|
||||
if (lua_type(L, narg) != t)
|
||||
if (l_unlikely(lua_type(L, narg) != t))
|
||||
tag_error(L, narg, t);
|
||||
}
|
||||
|
||||
|
||||
LUALIB_API void luaL_checkany (lua_State *L, int narg) {
|
||||
if (lua_type(L, narg) == LUA_TNONE)
|
||||
if (l_unlikely(lua_type(L, narg) == LUA_TNONE))
|
||||
luaL_argerror(L, narg, "value expected");
|
||||
}
|
||||
|
||||
|
||||
LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) {
|
||||
const char *s = lua_tolstring(L, narg, len);
|
||||
if (!s) tag_error(L, narg, LUA_TSTRING);
|
||||
if (l_unlikely(!s)) tag_error(L, narg, LUA_TSTRING);
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ LUALIB_API const char *luaL_optlstring (lua_State *L, int narg,
|
||||
|
||||
LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) {
|
||||
lua_Number d = lua_tonumber(L, narg);
|
||||
if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */
|
||||
if (l_unlikely(d == 0 && !lua_isnumber(L, narg))) /* avoid extra test when d is not 0 */
|
||||
tag_error(L, narg, LUA_TNUMBER);
|
||||
return d;
|
||||
}
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,
|
||||
*/
|
||||
|
||||
#define luaL_argcheck(L, cond,numarg,extramsg) \
|
||||
((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))
|
||||
((void)(l_likely(cond) || luaL_argerror(L, (numarg), (extramsg))))
|
||||
#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
|
||||
#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
|
||||
#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
|
||||
|
||||
+9
-9
@@ -106,7 +106,7 @@ static int luaB_setmetatable (lua_State *L) {
|
||||
luaL_checktype(L, 1, LUA_TTABLE);
|
||||
luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
|
||||
"nil or table expected");
|
||||
if (luaL_getmetafield(L, 1, "__metatable"))
|
||||
if (l_unlikely(luaL_getmetafield(L, 1, "__metatable")))
|
||||
luaL_error(L, "cannot change a protected metatable");
|
||||
lua_settop(L, 2);
|
||||
lua_setmetatable(L, 1);
|
||||
@@ -120,10 +120,10 @@ static void getfunc (lua_State *L, int opt) {
|
||||
lua_Debug ar;
|
||||
int level = opt ? luaL_optint(L, 1, 1) : luaL_checkint(L, 1);
|
||||
luaL_argcheck(L, level >= 0, 1, "level must be non-negative");
|
||||
if (lua_getstack(L, level, &ar) == 0)
|
||||
if (l_unlikely(lua_getstack(L, level, &ar) == 0))
|
||||
luaL_argerror(L, 1, "invalid level");
|
||||
lua_getinfo(L, "f", &ar);
|
||||
if (lua_isnil(L, -1))
|
||||
if (l_unlikely(lua_isnil(L, -1)))
|
||||
luaL_error(L, "no function environment for tail call at level %d",
|
||||
level);
|
||||
}
|
||||
@@ -151,7 +151,7 @@ static int luaB_setfenv (lua_State *L) {
|
||||
lua_setfenv(L, -2);
|
||||
return 0;
|
||||
}
|
||||
else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0)
|
||||
else if (l_unlikely(lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0))
|
||||
luaL_error(L,
|
||||
LUA_QL("setfenv") " cannot change environment of given object");
|
||||
return 1;
|
||||
@@ -265,7 +265,7 @@ static int luaB_ipairs (lua_State *L) {
|
||||
|
||||
static int luaB_assert (lua_State *L) {
|
||||
luaL_checkany(L, 1);
|
||||
if (!lua_toboolean(L, 1))
|
||||
if (l_unlikely(!lua_toboolean(L, 1)))
|
||||
return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!"));
|
||||
return lua_gettop(L);
|
||||
}
|
||||
@@ -278,7 +278,7 @@ static int luaB_unpack (lua_State *L) {
|
||||
e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1));
|
||||
if (i > e) return 0; /* empty range */
|
||||
n = e - i + 1; /* number of elements */
|
||||
if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */
|
||||
if (l_unlikely(n <= 0 || !lua_checkstack(L, n))) /* n <= 0 means arith. overflow */
|
||||
return luaL_error(L, "too many results to unpack");
|
||||
lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */
|
||||
while (i++ < e) /* push arg[i + 1...e] */
|
||||
@@ -445,9 +445,9 @@ static int luaB_costatus (lua_State *L) {
|
||||
|
||||
static int auxresume (lua_State *L, lua_State *co, int narg) {
|
||||
int status = costatus(L, co);
|
||||
if (!lua_checkstack(co, narg))
|
||||
if (l_unlikely(!lua_checkstack(co, narg)))
|
||||
luaL_error(L, "too many arguments to resume");
|
||||
if (status != CO_SUS) {
|
||||
if (l_unlikely(status != CO_SUS)) {
|
||||
lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]);
|
||||
return -1; /* error flag */
|
||||
}
|
||||
@@ -456,7 +456,7 @@ static int auxresume (lua_State *L, lua_State *co, int narg) {
|
||||
status = lua_resume(co, narg);
|
||||
if (status == 0 || status == LUA_YIELD) {
|
||||
int nres = lua_gettop(co);
|
||||
if (!lua_checkstack(L, nres + 1))
|
||||
if (l_unlikely(!lua_checkstack(L, nres + 1)))
|
||||
luaL_error(L, "too many results to resume");
|
||||
lua_xmove(co, L, nres); /* move yielded values */
|
||||
return nres;
|
||||
|
||||
+2
-2
@@ -73,7 +73,7 @@ static int db_getinfo (lua_State *L) {
|
||||
}
|
||||
else
|
||||
return luaL_argerror(L, arg+1, "function or level expected");
|
||||
if (!lua_getinfo(L1, options, &ar))
|
||||
if (l_unlikely(!lua_getinfo(L1, options, &ar)))
|
||||
return luaL_argerror(L, arg+2, "invalid option");
|
||||
lua_createtable(L, 0, 2);
|
||||
if (strchr(options, 'S')) {
|
||||
@@ -104,7 +104,7 @@ static int db_getlocal (lua_State *L) {
|
||||
lua_State *L1 = getthread(L, &arg);
|
||||
lua_Debug ar;
|
||||
const char *name;
|
||||
if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */
|
||||
if (l_unlikely(!lua_getstack(L1, luaL_checkint(L, arg+1), &ar))) /* out of range? */
|
||||
return luaL_argerror(L, arg+1, "level out of range");
|
||||
name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2));
|
||||
if (name) {
|
||||
|
||||
+13
-13
@@ -172,7 +172,7 @@ void luaD_reallocCI (lua_State *L, int newsize) {
|
||||
|
||||
|
||||
void luaD_growstack (lua_State *L, int n) {
|
||||
if (n <= L->stacksize) /* double size is enough? */
|
||||
if (l_likely(n <= L->stacksize)) /* double size is enough? */
|
||||
luaD_reallocstack(L, 2*L->stacksize);
|
||||
else
|
||||
luaD_reallocstack(L, L->stacksize + n);
|
||||
@@ -180,11 +180,11 @@ void luaD_growstack (lua_State *L, int n) {
|
||||
|
||||
|
||||
static CallInfo *growCI (lua_State *L) {
|
||||
if (L->size_ci > LUAI_MAXCALLS) /* overflow while handling overflow? */
|
||||
if (l_unlikely(L->size_ci > LUAI_MAXCALLS)) /* overflow while handling overflow? */
|
||||
luaD_throw(L, LUA_ERRERR);
|
||||
else {
|
||||
luaD_reallocCI(L, 2*L->size_ci);
|
||||
if (L->size_ci > LUAI_MAXCALLS)
|
||||
if (l_unlikely(L->size_ci > LUAI_MAXCALLS))
|
||||
luaG_runerror(L, "stack overflow");
|
||||
}
|
||||
return ++L->ci;
|
||||
@@ -257,7 +257,7 @@ static StkId tryfuncTM (lua_State *L, StkId func) {
|
||||
const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL);
|
||||
StkId p;
|
||||
ptrdiff_t funcr = savestack(L, func);
|
||||
if (!ttisfunction(tm))
|
||||
if (l_unlikely(!ttisfunction(tm)))
|
||||
luaG_typeerror(L, func, "call");
|
||||
/* Open a hole inside the stack at `func' */
|
||||
for (p = L->top; p > func; p--) setobjs2s(L, p, p-1);
|
||||
@@ -356,7 +356,7 @@ int luaD_poscall (lua_State *L, StkId firstResult) {
|
||||
StkId res;
|
||||
int wanted, i;
|
||||
CallInfo *ci;
|
||||
if (L->hookmask & LUA_MASKRET)
|
||||
if (l_unlikely(L->hookmask) & LUA_MASKRET)
|
||||
firstResult = callrethooks(L, firstResult);
|
||||
ci = L->ci--;
|
||||
res = ci->func; /* res == final position of 1st result */
|
||||
@@ -380,7 +380,7 @@ int luaD_poscall (lua_State *L, StkId firstResult) {
|
||||
** function position.
|
||||
*/
|
||||
void luaD_call (lua_State *L, StkId func, int nResults) {
|
||||
if (++L->nCcalls >= LUAI_MAXCCALLS) {
|
||||
if (l_unlikely(++L->nCcalls >= LUAI_MAXCCALLS)) {
|
||||
if (L->nCcalls == LUAI_MAXCCALLS)
|
||||
luaG_runerror(L, "C stack overflow");
|
||||
else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
|
||||
@@ -430,15 +430,15 @@ static int resume_error (lua_State *L, const char *msg) {
|
||||
LUA_API int lua_resume (lua_State *L, int nargs) {
|
||||
int status;
|
||||
lua_lock(L);
|
||||
if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci))
|
||||
if (l_unlikely(L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci)))
|
||||
return resume_error(L, "cannot resume non-suspended coroutine");
|
||||
if (L->nCcalls >= LUAI_MAXCCALLS)
|
||||
if (l_unlikely(L->nCcalls >= LUAI_MAXCCALLS))
|
||||
return resume_error(L, "C stack overflow");
|
||||
luai_userstateresume(L, nargs);
|
||||
lua_assert(L->errfunc == 0);
|
||||
L->baseCcalls = ++L->nCcalls;
|
||||
status = luaD_rawrunprotected(L, resume, L->top - nargs);
|
||||
if (status != 0) { /* error? */
|
||||
if (l_unlikely(status != 0)) { /* error? */
|
||||
L->status = cast_byte(status); /* mark thread as `dead' */
|
||||
luaD_seterrorobj(L, status, L->top);
|
||||
L->ci->top = L->top;
|
||||
@@ -456,7 +456,7 @@ LUA_API int lua_resume (lua_State *L, int nargs) {
|
||||
LUA_API int lua_yield (lua_State *L, int nresults) {
|
||||
luai_userstateyield(L, nresults);
|
||||
lua_lock(L);
|
||||
if (L->nCcalls > L->baseCcalls)
|
||||
if (l_unlikely(L->nCcalls > L->baseCcalls))
|
||||
luaG_runerror(L, "attempt to yield across metamethod/C-call boundary");
|
||||
L->base = L->top - nresults; /* protect stack slots below */
|
||||
L->status = LUA_YIELD;
|
||||
@@ -474,7 +474,7 @@ int luaD_pcall (lua_State *L, Pfunc func, void *u,
|
||||
ptrdiff_t old_errfunc = L->errfunc;
|
||||
L->errfunc = ef;
|
||||
status = luaD_rawrunprotected(L, func, u);
|
||||
if (status != 0) { /* an error occurred? */
|
||||
if (l_unlikely(status != 0)) { /* an error occurred? */
|
||||
StkId oldtop = restorestack(L, old_top);
|
||||
luaF_close(L, oldtop); /* close eventual pending closures */
|
||||
luaD_seterrorobj(L, status, oldtop);
|
||||
@@ -511,8 +511,8 @@ static void f_parser (lua_State *L, void *ud) {
|
||||
tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z,
|
||||
&p->buff, p->name);
|
||||
#else
|
||||
if (c == LUA_SIGNATURE[0])
|
||||
luaG_runerror(L, "invalid format, cannot load bytecode scripts");
|
||||
if (l_unlikely(c == LUA_SIGNATURE[0]))
|
||||
luaG_runerror(L, "invalid format, cannot load bytecode scripts");
|
||||
tf = luaY_parser(L, p->z, &p->buff, p->name);
|
||||
#endif
|
||||
cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L)));
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
#define luaD_checkstack(L,n) \
|
||||
if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
|
||||
if (l_unlikely((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue))) \
|
||||
luaD_growstack(L, n); \
|
||||
else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
|
||||
|
||||
|
||||
+10
-10
@@ -84,7 +84,7 @@ static int io_type (lua_State *L) {
|
||||
|
||||
static FILE *tofile (lua_State *L) {
|
||||
FILE **f = tofilep(L);
|
||||
if (*f == NULL)
|
||||
if (l_unlikely(*f == NULL))
|
||||
luaL_error(L, "attempt to use a closed file");
|
||||
return *f;
|
||||
}
|
||||
@@ -184,8 +184,8 @@ static int io_open (lua_State *L) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (strstr(filename, "..") || strchr(filename, ':') || StartsWith(filename, "\\")
|
||||
|| StartsWith(filename, "/") || !pass)
|
||||
if (l_unlikely(strstr(filename, "..") || strchr(filename, ':') || StartsWith(filename, "\\")
|
||||
|| StartsWith(filename, "/") || !pass))
|
||||
{
|
||||
luaL_error(L,"access denied to %s", filename);
|
||||
return pushresult(L,0,filename);
|
||||
@@ -202,7 +202,7 @@ static int io_open (lua_State *L) {
|
||||
{
|
||||
*splitter = 0;
|
||||
I_mkdir(destFilename, 0755);
|
||||
*splitter = '/';
|
||||
*splitter = '/';
|
||||
splitter++;
|
||||
|
||||
forward = strchr(splitter, '/');
|
||||
@@ -226,7 +226,7 @@ static FILE *getiofile (lua_State *L, int findex) {
|
||||
FILE *f;
|
||||
lua_rawgeti(L, LUA_ENVIRONINDEX, findex);
|
||||
f = *(FILE **)lua_touserdata(L, -1);
|
||||
if (f == NULL)
|
||||
if (l_unlikely(f == NULL))
|
||||
luaL_error(L, "standard %s file is closed", fnames[findex - 1]);
|
||||
return f;
|
||||
}
|
||||
@@ -238,7 +238,7 @@ static int g_iofile (lua_State *L, int f, const char *mode) {
|
||||
if (filename) {
|
||||
FILE **pf = newfile(L);
|
||||
*pf = fopen(filename, mode);
|
||||
if (*pf == NULL)
|
||||
if (l_unlikely(*pf == NULL))
|
||||
fileerror(L, 1, filename);
|
||||
}
|
||||
else {
|
||||
@@ -290,7 +290,7 @@ static int io_lines (lua_State *L) {
|
||||
const char *filename = luaL_checkstring(L, 1);
|
||||
FILE **pf = newfile(L);
|
||||
*pf = fopen(filename, "r");
|
||||
if (*pf == NULL)
|
||||
if (l_unlikely(*pf == NULL))
|
||||
fileerror(L, 1, filename);
|
||||
aux_lines(L, lua_gettop(L), 1);
|
||||
return 1;
|
||||
@@ -307,7 +307,7 @@ static int io_lines (lua_State *L) {
|
||||
|
||||
static int read_number (lua_State *L, FILE *f) {
|
||||
lua_Number d;
|
||||
if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) {
|
||||
if (l_likely(fscanf(f, LUA_NUMBER_SCAN, &d) == 1)) {
|
||||
lua_pushnumber(L, d);
|
||||
return 1;
|
||||
}
|
||||
@@ -454,7 +454,7 @@ static int g_write (lua_State *L, FILE *f, int arg) {
|
||||
else {
|
||||
size_t l;
|
||||
const char *s = luaL_checklstring(L, arg, &l);
|
||||
if (ftell(f) + l > FILELIMIT)
|
||||
if (l_unlikely(ftell(f) + l > FILELIMIT))
|
||||
{
|
||||
luaL_error(L,"write limit bypassed in file. Changes have been discarded.");
|
||||
break;
|
||||
@@ -483,7 +483,7 @@ static int f_seek (lua_State *L) {
|
||||
int op = luaL_checkoption(L, 2, "cur", modenames);
|
||||
long offset = luaL_optlong(L, 3, 0);
|
||||
op = fseek(f, offset, mode[op]);
|
||||
if (op)
|
||||
if (l_unlikely(op))
|
||||
return pushresult(L, 0, NULL); /* error */
|
||||
else {
|
||||
lua_pushinteger(L, ftell(f));
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems,
|
||||
void *newblock;
|
||||
int newsize;
|
||||
if (*size >= limit/2) { /* cannot double it? */
|
||||
if (*size >= limit) /* cannot grow even a little? */
|
||||
if (l_unlikely(*size >= limit)) /* cannot grow even a little? */
|
||||
luaG_runerror(L, errormsg);
|
||||
newsize = limit; /* still have at least one free place */
|
||||
}
|
||||
@@ -77,7 +77,7 @@ void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) {
|
||||
global_State *g = G(L);
|
||||
lua_assert((osize == 0) == (block == NULL));
|
||||
block = (*g->frealloc)(g->ud, block, osize, nsize);
|
||||
if (block == NULL && nsize > 0)
|
||||
if (l_unlikely(block == NULL && nsize > 0))
|
||||
luaD_throw(L, LUA_ERRMEM);
|
||||
lua_assert((nsize == 0) == (block == NULL));
|
||||
g->totalbytes = (g->totalbytes - osize) + nsize;
|
||||
|
||||
+6
-6
@@ -103,7 +103,7 @@ static void checknext (LexState *ls, int c) {
|
||||
|
||||
|
||||
static void check_match (LexState *ls, int what, int who, int where) {
|
||||
if (!testnext(ls, what)) {
|
||||
if (l_unlikely(!testnext(ls, what))) {
|
||||
if (where == ls->linenumber)
|
||||
error_expected(ls, what);
|
||||
else {
|
||||
@@ -275,7 +275,7 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
|
||||
|
||||
|
||||
static void enterlevel (LexState *ls) {
|
||||
if (++ls->L->nCcalls > LUAI_MAXCCALLS)
|
||||
if (l_unlikely(++ls->L->nCcalls > LUAI_MAXCCALLS))
|
||||
luaX_lexerror(ls, "chunk has too many syntax levels", 0);
|
||||
}
|
||||
|
||||
@@ -643,7 +643,7 @@ static void funcargs (LexState *ls, expdesc *f) {
|
||||
int line = ls->linenumber;
|
||||
switch (ls->t.token) {
|
||||
case '(': { /* funcargs -> `(' [ explist1 ] `)' */
|
||||
if (line != ls->lastline)
|
||||
if (l_unlikely(line != ls->lastline))
|
||||
luaX_syntaxerror(ls,"ambiguous syntax (function call x new statement)");
|
||||
luaX_next(ls);
|
||||
if (ls->t.token == ')') /* arg list is empty? */
|
||||
@@ -712,7 +712,7 @@ static void prefixexp (LexState *ls, expdesc *v) {
|
||||
case '$': {
|
||||
lua_Number i = ls->t.seminfo.r;
|
||||
if (i == 0) i = ls->fs->nrhs;
|
||||
if (i <= 0 || i > ls->fs->nlhs)
|
||||
if (l_unlikely(i <= 0 || i > ls->fs->nlhs))
|
||||
luaX_syntaxerror(ls, "pseudo-variable out of range or not in assignment");
|
||||
else {
|
||||
expdesc_list *lhs = ls->fs->lhs;
|
||||
@@ -1105,7 +1105,7 @@ static void breakstat (LexState *ls, lua_Number n) {
|
||||
upval |= bl->upval;
|
||||
bl = bl->previous;
|
||||
}
|
||||
if (!bl)
|
||||
if (l_unlikely(!bl))
|
||||
luaX_syntaxerror(ls, "no loop to break");
|
||||
if (upval)
|
||||
luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);
|
||||
@@ -1124,7 +1124,7 @@ static void continuestat (LexState *ls) {
|
||||
//upval |= bl->upval; // AK: ADDITION (would this fix forbody probs?)
|
||||
bl = bl->previous;
|
||||
}
|
||||
if (!bl)
|
||||
if (l_unlikely(!bl))
|
||||
luaX_syntaxerror(ls, "no loop to continue");
|
||||
|
||||
//if (upval) //AK: experimental
|
||||
|
||||
+2
-2
@@ -83,7 +83,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
|
||||
o != NULL;
|
||||
o = o->gch.next) {
|
||||
TString *ts = rawgco2ts(o);
|
||||
if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) {
|
||||
if (l_unlikely(ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0))) {
|
||||
/* string may be dead */
|
||||
if (isdead(G(L), o)) changewhite(o);
|
||||
return ts;
|
||||
@@ -95,7 +95,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
|
||||
|
||||
Udata *luaS_newudata (lua_State *L, size_t s, Table *e) {
|
||||
Udata *u;
|
||||
if (s > MAX_SIZET - sizeof(Udata))
|
||||
if (l_unlikely(s > MAX_SIZET - sizeof(Udata)))
|
||||
luaM_toobig(L);
|
||||
u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata)));
|
||||
u->uv.marked = luaC_white(G(L)); /* is not finalized */
|
||||
|
||||
+14
-12
@@ -113,7 +113,7 @@ static int str_byte (lua_State *L) {
|
||||
if ((size_t)pose > l) pose = l;
|
||||
if (posi > pose) return 0; /* empty interval; return no values */
|
||||
n = (int)(pose - posi + 1);
|
||||
if (posi + n <= pose) /* overflow? */
|
||||
if (l_unlikely(posi + n <= pose)) /* overflow? */
|
||||
luaL_error(L, "string slice too long");
|
||||
luaL_checkstack(L, n, "string slice too long");
|
||||
for (i=0; i<n; i++)
|
||||
@@ -187,7 +187,7 @@ typedef struct MatchState {
|
||||
|
||||
static int check_capture (MatchState *ms, int l) {
|
||||
l -= '1';
|
||||
if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED)
|
||||
if (l_unlikely(l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED))
|
||||
return luaL_error(ms->L, "invalid capture index");
|
||||
return l;
|
||||
}
|
||||
@@ -204,14 +204,14 @@ static int capture_to_close (MatchState *ms) {
|
||||
static const char *classend (MatchState *ms, const char *p) {
|
||||
switch (*p++) {
|
||||
case L_ESC: {
|
||||
if (*p == '\0')
|
||||
if (l_unlikely(*p == '\0'))
|
||||
luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")");
|
||||
return p+1;
|
||||
}
|
||||
case '[': {
|
||||
if (*p == '^') p++;
|
||||
do { /* look for a `]' */
|
||||
if (*p == '\0')
|
||||
if (l_unlikely(*p == '\0'))
|
||||
luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")");
|
||||
if (*(p++) == L_ESC && *p != '\0')
|
||||
p++; /* skip escapes (e.g. `%]') */
|
||||
@@ -282,7 +282,7 @@ static const char *match (MatchState *ms, const char *s, const char *p);
|
||||
|
||||
static const char *matchbalance (MatchState *ms, const char *s,
|
||||
const char *p) {
|
||||
if (*p == 0 || *(p+1) == 0)
|
||||
if (l_unlikely(*p == 0 || *(p+1) == 0))
|
||||
luaL_error(ms->L, "unbalanced pattern");
|
||||
if (*s != *p) return NULL;
|
||||
else {
|
||||
@@ -332,7 +332,8 @@ static const char *start_capture (MatchState *ms, const char *s,
|
||||
const char *p, int what) {
|
||||
const char *res;
|
||||
int level = ms->level;
|
||||
if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures");
|
||||
if (l_unlikely(level >= LUA_MAXCAPTURES))
|
||||
luaL_error(ms->L, "too many captures");
|
||||
ms->capture[level].init = s;
|
||||
ms->capture[level].len = what;
|
||||
ms->level = level+1;
|
||||
@@ -386,7 +387,7 @@ static const char *match (MatchState *ms, const char *s, const char *p) {
|
||||
case 'f': { /* frontier? */
|
||||
const char *ep; char previous;
|
||||
p += 2;
|
||||
if (*p != '[')
|
||||
if (l_unlikely(*p != '['))
|
||||
luaL_error(ms->L, "missing " LUA_QL("[") " after "
|
||||
LUA_QL("%%f") " in pattern");
|
||||
ep = classend(ms, p); /* points to what is next */
|
||||
@@ -468,14 +469,15 @@ static const char *lmemfind (const char *s1, size_t l1,
|
||||
static void push_onecapture (MatchState *ms, int i, const char *s,
|
||||
const char *e) {
|
||||
if (i >= ms->level) {
|
||||
if (i == 0) /* ms->level == 0, too */
|
||||
if (l_likely(i == 0)) /* ms->level == 0, too */
|
||||
lua_pushlstring(ms->L, s, e - s); /* add whole match */
|
||||
else
|
||||
luaL_error(ms->L, "invalid capture index");
|
||||
}
|
||||
else {
|
||||
ptrdiff_t l = ms->capture[i].len;
|
||||
if (l == CAP_UNFINISHED) luaL_error(ms->L, "unfinished capture");
|
||||
if (l_unlikely(l == CAP_UNFINISHED))
|
||||
luaL_error(ms->L, "unfinished capture");
|
||||
if (l == CAP_POSITION)
|
||||
lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1);
|
||||
else
|
||||
@@ -637,7 +639,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s,
|
||||
lua_pop(L, 1);
|
||||
lua_pushlstring(L, s, e - s); /* keep original text */
|
||||
}
|
||||
else if (!lua_isstring(L, -1))
|
||||
else if (l_unlikely(!lua_isstring(L, -1)))
|
||||
luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
|
||||
luaL_addvalue(b); /* add result to accumulator */
|
||||
}
|
||||
@@ -727,7 +729,7 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) {
|
||||
static const char *scanformat (lua_State *L, const char *strfrmt, char *form) {
|
||||
const char *p = strfrmt;
|
||||
while (*p != '\0' && strchr(FLAGS, *p) != NULL) p++; /* skip flags */
|
||||
if ((size_t)(p - strfrmt) >= sizeof(FLAGS))
|
||||
if (l_unlikely((size_t)(p - strfrmt) >= sizeof(FLAGS)))
|
||||
luaL_error(L, "invalid format (repeated flags)");
|
||||
if (isdigit(uchar(*p))) p++; /* skip width */
|
||||
if (isdigit(uchar(*p))) p++; /* (2 digits at most) */
|
||||
@@ -736,7 +738,7 @@ static const char *scanformat (lua_State *L, const char *strfrmt, char *form) {
|
||||
if (isdigit(uchar(*p))) p++; /* skip precision */
|
||||
if (isdigit(uchar(*p))) p++; /* (2 digits at most) */
|
||||
}
|
||||
if (isdigit(uchar(*p)))
|
||||
if (l_unlikely(isdigit(uchar(*p))))
|
||||
luaL_error(L, "invalid format (width or precision too long)");
|
||||
*(form++) = '%';
|
||||
strncpy(form, strfrmt, p - strfrmt + 1);
|
||||
|
||||
+4
-3
@@ -278,7 +278,7 @@ static void setnodevector (lua_State *L, Table *t, int size) {
|
||||
else {
|
||||
int i;
|
||||
lsize = ceillog2(size);
|
||||
if (lsize > MAXBITS)
|
||||
if (l_unlikely(lsize > MAXBITS))
|
||||
luaG_runerror(L, "table overflow");
|
||||
size = twoto(lsize);
|
||||
t->node = luaM_newvector(L, size, Node);
|
||||
@@ -498,8 +498,9 @@ TValue *luaH_set (lua_State *L, Table *t, const TValue *key) {
|
||||
if (p != luaO_nilobject)
|
||||
return cast(TValue *, p);
|
||||
else {
|
||||
if (ttisnil(key)) luaG_runerror(L, "table index is nil");
|
||||
else if (ttisnumber(key) && luai_numisnan(nvalue(key)))
|
||||
if (l_unlikely(ttisnil(key)))
|
||||
luaG_runerror(L, "table index is nil");
|
||||
else if (l_unlikely(ttisnumber(key) && luai_numisnan(nvalue(key))))
|
||||
luaG_runerror(L, "table index is NaN");
|
||||
return newkey(L, t, key);
|
||||
}
|
||||
|
||||
+5
-3
@@ -134,7 +134,7 @@ static int tremove (lua_State *L) {
|
||||
|
||||
static void addfield (lua_State *L, luaL_Buffer *b, int i) {
|
||||
lua_rawgeti(L, 1, i);
|
||||
if (!lua_isstring(L, -1))
|
||||
if (l_unlikely(!lua_isstring(L, -1)))
|
||||
luaL_error(L, "invalid value (%s) at index %d in table for "
|
||||
LUA_QL("concat"), luaL_typename(L, -1), i);
|
||||
luaL_addvalue(b);
|
||||
@@ -224,12 +224,14 @@ static void auxsort (lua_State *L, int l, int u) {
|
||||
for (;;) { /* invariant: a[l..i] <= P <= a[j..u] */
|
||||
/* repeat ++i until a[i] >= P */
|
||||
while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) {
|
||||
if (i>u) luaL_error(L, "invalid order function for sorting");
|
||||
if (l_unlikely(i>u))
|
||||
luaL_error(L, "invalid order function for sorting");
|
||||
lua_pop(L, 1); /* remove a[i] */
|
||||
}
|
||||
/* repeat --j until a[j] <= P */
|
||||
while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) {
|
||||
if (j<l) luaL_error(L, "invalid order function for sorting");
|
||||
if (l_unlikely(j<l))
|
||||
luaL_error(L, "invalid order function for sorting");
|
||||
lua_pop(L, 1); /* remove a[j] */
|
||||
}
|
||||
if (j<i) {
|
||||
|
||||
@@ -773,6 +773,23 @@ union luai_Cast { double l_d; long l_l; };
|
||||
|
||||
/* =================================================================== */
|
||||
|
||||
/*
|
||||
* * macros to improve jump prediction, used mostly for error handling
|
||||
** and debug facilities.
|
||||
*/
|
||||
#if !defined(l_likely)
|
||||
|
||||
#include <stdio.h>
|
||||
#if defined(__GNUC__)
|
||||
#define l_likely(x) (__builtin_expect(((x) != 0), 1))
|
||||
#define l_unlikely(x) (__builtin_expect(((x) != 0), 0))
|
||||
#else
|
||||
#define l_likely(x) (x)
|
||||
#define l_unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Local configuration. You can use this space to add your redefinitions
|
||||
** without modifying the main part of the file.
|
||||
|
||||
+12
-11
@@ -119,7 +119,7 @@ void luaV_gettable (lua_State *L, TValue *t, TValue *key, StkId val) {
|
||||
}
|
||||
/* else will try the tag method */
|
||||
}
|
||||
else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX)))
|
||||
else if (l_unlikely(ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))))
|
||||
luaG_typeerror(L, t, "index");
|
||||
if (ttisfunction(tm)) {
|
||||
callTMres(L, val, tm, t, key);
|
||||
@@ -147,7 +147,7 @@ void luaV_settable (lua_State *L, TValue *t, TValue *key, StkId val) {
|
||||
}
|
||||
/* else will try the tag method */
|
||||
}
|
||||
else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX)))
|
||||
else if (l_unlikely(ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))))
|
||||
luaG_typeerror(L, t, "index");
|
||||
if (ttisfunction(tm)) {
|
||||
callTM(L, tm, t, key, val);
|
||||
@@ -293,7 +293,8 @@ void luaV_concat (lua_State *L, int total, int last) {
|
||||
/* collect total length */
|
||||
for (n = 1; n < total && tostring(L, top-n-1); n++) {
|
||||
size_t l = tsvalue(top-n-1)->len;
|
||||
if (l >= MAX_SIZET - tl) luaG_runerror(L, "string length overflow");
|
||||
if (l_unlikely(l >= MAX_SIZET - tl))
|
||||
luaG_runerror(L, "string length overflow");
|
||||
tl += l;
|
||||
}
|
||||
buffer = luaZ_openspace(L, &G(L)->buff, tl);
|
||||
@@ -322,8 +323,8 @@ static void Arith (lua_State *L, StkId ra, TValue *rb,
|
||||
case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break;
|
||||
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) { luaG_runerror(L, "divide by zero error"); } else setnvalue(ra, luai_numdiv(nb, nc)); break;
|
||||
case TM_MOD: if (nc == 0) { luaG_runerror(L, "modulo by zero error"); } else setnvalue(ra, luai_nummod(nb, nc)); break;
|
||||
case TM_DIV: if (l_unlikely(nc == 0)) { luaG_runerror(L, "divide by zero error"); } else setnvalue(ra, luai_numdiv(nb, nc)); break;
|
||||
case TM_MOD: if (l_unlikely(nc == 0)) { luaG_runerror(L, "modulo by zero error"); } 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;
|
||||
@@ -491,7 +492,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
TValue *rc = RKC(i);
|
||||
if (ttisnumber(rb) && ttisnumber(rc)) {
|
||||
lua_Number nb = nvalue(rb), nc = nvalue(rc);
|
||||
if (nc == 0) {
|
||||
if (l_unlikely(nc == 0)) {
|
||||
luaG_runerror(L, "divide by zero error");
|
||||
}
|
||||
else
|
||||
@@ -506,7 +507,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
TValue *rc = RKC(i);
|
||||
if (ttisnumber(rb) && ttisnumber(rc)) {
|
||||
lua_Number nb = nvalue(rb), nc = nvalue(rc);
|
||||
if (nc == 0) {
|
||||
if (l_unlikely(nc == 0)) {
|
||||
luaG_runerror(L, "modulo by zero error");
|
||||
}
|
||||
else
|
||||
@@ -580,7 +581,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
}
|
||||
default: { /* try metamethod */
|
||||
Protect(
|
||||
if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN))
|
||||
if (l_unlikely(!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN)))
|
||||
luaG_typeerror(L, rb, "get length of");
|
||||
)
|
||||
}
|
||||
@@ -724,11 +725,11 @@ void luaV_execute (lua_State *L, int nexeccalls) {
|
||||
const TValue *plimit = ra+1;
|
||||
const TValue *pstep = ra+2;
|
||||
L->savedpc = pc; /* next steps may throw errors */
|
||||
if (!tonumber(init, ra))
|
||||
if (l_unlikely(!tonumber(init, ra)))
|
||||
luaG_runerror(L, LUA_QL("for") " initial value must be a number");
|
||||
else if (!tonumber(plimit, ra+1))
|
||||
else if (l_unlikely(!tonumber(plimit, ra+1)))
|
||||
luaG_runerror(L, LUA_QL("for") " limit must be a number");
|
||||
else if (!tonumber(pstep, ra+2))
|
||||
else if (l_unlikely(!tonumber(pstep, ra+2)))
|
||||
luaG_runerror(L, LUA_QL("for") " step must be a number");
|
||||
if (ra && pstep)
|
||||
setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep)));
|
||||
|
||||
+11
-140
@@ -90,9 +90,12 @@ char motd[254], server_context[8]; // Message of the Day, Unique Context (even w
|
||||
plrinfo playerinfo[MAXPLAYERS];
|
||||
SINT8 joinnode = 0; // used for CL_VIEWSERVER
|
||||
|
||||
boolean player_muted[MAXPLAYERS] = {0};
|
||||
|
||||
// Server specific vars
|
||||
UINT8 playernode[MAXPLAYERS];
|
||||
|
||||
|
||||
// Minimum timeout for sending the savegame
|
||||
// The actual timeout will be longer depending on the savegame length
|
||||
tic_t jointimeout = (3*TICRATE);
|
||||
@@ -567,58 +570,7 @@ void SendKick(UINT8 playernum, UINT8 msg)
|
||||
// end of extra data function
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
// extra data function for lmps
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
// if extradatabit is set, after the ziped tic you find this:
|
||||
//
|
||||
// type | description
|
||||
// ---------+--------------
|
||||
// byte | size of the extradata
|
||||
// byte | the extradata (xd) bits: see XD_...
|
||||
// with this byte you know what parameter folow
|
||||
// if (xd & XDNAMEANDCOLOR)
|
||||
// byte | color
|
||||
// char[MAXPLAYERNAME] | name of the player
|
||||
// endif
|
||||
// if (xd & XD_WEAPON_PREF)
|
||||
// byte | original weapon switch: boolean, true if use the old
|
||||
// | weapon switch methode
|
||||
// char[NUMWEAPONS] | the weapon switch priority
|
||||
// byte | autoaim: true if use the old autoaim system
|
||||
// endif
|
||||
/*boolean AddLmpExtradata(UINT8 **demo_point, INT32 playernum)
|
||||
{
|
||||
UINT8 *textcmd = D_GetExistingTextcmd(gametic, playernum);
|
||||
|
||||
if (!textcmd)
|
||||
return false;
|
||||
|
||||
M_Memcpy(*demo_point, textcmd, textcmd[0]+1);
|
||||
*demo_point += textcmd[0]+1;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ReadLmpExtraData(UINT8 **demo_pointer, INT32 playernum)
|
||||
{
|
||||
UINT8 nextra;
|
||||
UINT8 *textcmd;
|
||||
|
||||
if (!demo_pointer)
|
||||
return;
|
||||
|
||||
textcmd = D_GetTextcmd(gametic, playernum);
|
||||
nextra = **demo_pointer;
|
||||
M_Memcpy(textcmd, *demo_pointer, nextra + 1);
|
||||
// increment demo pointer
|
||||
*demo_pointer += nextra + 1;
|
||||
}*/
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
// end extra data function for lmps
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
// can we get rid of this finally lmao
|
||||
// -----------------------------------------------------------------
|
||||
// resynch player data
|
||||
// -----------------------------------------------------------------
|
||||
@@ -1580,70 +1532,6 @@ static boolean CL_SendJoin(void)
|
||||
return HSendPacket(servernode, false, 0, sizeof (clientconfig_pak));
|
||||
}
|
||||
|
||||
static void
|
||||
CopyCaretColors (char *p, const char *s, int n)
|
||||
{
|
||||
char *t;
|
||||
int m;
|
||||
int c;
|
||||
if (!n)
|
||||
return;
|
||||
while (( t = strchr(s, '^') ))
|
||||
{
|
||||
m = ( t - s );
|
||||
|
||||
if (m >= n)
|
||||
{
|
||||
memcpy(p, s, n);
|
||||
return;
|
||||
}
|
||||
else
|
||||
memcpy(p, s, m);
|
||||
|
||||
p += m;
|
||||
n -= m;
|
||||
s += m;
|
||||
|
||||
if (!n)
|
||||
return;
|
||||
|
||||
if (s[1])
|
||||
{
|
||||
c = toupper(s[1]);
|
||||
if (isdigit(c))
|
||||
c = 0x80 + ( c - '0' );
|
||||
else if (c >= 'A' && c <= 'F')
|
||||
c = 0x80 + ( c - 'A' );
|
||||
else
|
||||
c = 0;
|
||||
|
||||
if (c)
|
||||
{
|
||||
*p++ = c;
|
||||
n--;
|
||||
|
||||
if (!n)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (n < 2)
|
||||
break;
|
||||
|
||||
memcpy(p, s, 2);
|
||||
|
||||
p += 2;
|
||||
n -= 2;
|
||||
}
|
||||
|
||||
s += 2;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
strncpy(p, s, n);
|
||||
}
|
||||
|
||||
static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
||||
{
|
||||
UINT8 *p;
|
||||
@@ -2126,7 +2014,7 @@ static void CL_ReloadReceivedSavegame(void)
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
camera[i].subsector = R_PointInSubsector(camera[i].x, camera[i].y);
|
||||
camera[i].subsector = R_PointInSubsectorFast(camera[i].x, camera[i].y);
|
||||
}
|
||||
|
||||
cl_redownloadinggamestate = false;
|
||||
@@ -3488,6 +3376,8 @@ void CL_Reset(void)
|
||||
#endif
|
||||
G_ResetAllDeviceRumbles();
|
||||
|
||||
memset(player_muted, 0, sizeof(player_muted));
|
||||
|
||||
// D_StartTitle should get done now, but the calling function will handle it
|
||||
}
|
||||
|
||||
@@ -3508,31 +3398,12 @@ static void Command_GetPlayerNum(void)
|
||||
|
||||
SINT8 nametonum(const char *name)
|
||||
{
|
||||
INT32 playernum, i;
|
||||
INT32 playernum = D_LookupPlayer(name);
|
||||
|
||||
if (!strcmp(name, "0"))
|
||||
return 0;
|
||||
if (playernum == -1)
|
||||
CONS_Printf(M_GetText("There is no player named \"%s\"\n"), name);
|
||||
|
||||
playernum = (SINT8)atoi(name);
|
||||
|
||||
if (playernum < 0 || playernum >= MAXPLAYERS)
|
||||
return -1;
|
||||
|
||||
if (playernum)
|
||||
{
|
||||
if (playeringame[playernum])
|
||||
return (SINT8)playernum;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && !stricmp(player_names[i], name))
|
||||
return (SINT8)i;
|
||||
|
||||
CONS_Printf(M_GetText("There is no player named \"%s\"\n"), name);
|
||||
|
||||
return -1;
|
||||
return playernum;
|
||||
}
|
||||
|
||||
/** Lists all players and their player numbers.
|
||||
|
||||
@@ -671,6 +671,8 @@ SINT8 nametonum(const char *name);
|
||||
extern char motd[254], server_context[8];
|
||||
extern UINT8 playernode[MAXPLAYERS];
|
||||
|
||||
extern boolean player_muted[MAXPLAYERS];
|
||||
|
||||
INT32 D_NumPlayers(void);
|
||||
|
||||
void D_ResetTiccmds(void);
|
||||
|
||||
+21
-4
@@ -152,6 +152,8 @@ boolean dedicated = false;
|
||||
|
||||
boolean loaded_config = false; // true once config.cfg loaded AND executed
|
||||
|
||||
static void D_CleanFile(char **filearray);
|
||||
|
||||
//
|
||||
// D_PostEvent
|
||||
// Called by the I/O functions when input is detected
|
||||
@@ -896,9 +898,24 @@ void D_SRB2Loop(void)
|
||||
rendertimefrac_unpaused = FRACUNIT;
|
||||
}
|
||||
|
||||
if ((interp || doDisplay) && !frameskip)
|
||||
if (interp || doDisplay)
|
||||
{
|
||||
ranwipe = D_Display();
|
||||
if (!frameskip)
|
||||
{
|
||||
ranwipe = D_Display();
|
||||
}
|
||||
else if (!dedicated)
|
||||
{
|
||||
// always update console and hud
|
||||
// otherwise it may take minutes to open it
|
||||
CON_Drawer();
|
||||
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
ST_Drawer();
|
||||
HU_Drawer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Only take screenshots after drawing.
|
||||
@@ -1215,7 +1232,7 @@ void D_AddPostloadFiles(void)
|
||||
postautoloaded = true;
|
||||
}
|
||||
|
||||
void D_CleanFile(char **filearray)
|
||||
static void D_CleanFile(char **filearray)
|
||||
{
|
||||
size_t pnumwadfiles;
|
||||
for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++)
|
||||
@@ -1478,7 +1495,7 @@ static void D_CheckSaturnExtraFiles(void)
|
||||
}
|
||||
|
||||
// extra round joystick inputdisplay sprites
|
||||
if (W_CheckMultipleLumps("JOYBCK","JOYKNB","JOYSHD", NULL))
|
||||
if (W_CheckMultipleLumps("JOYBCK", "JOYKNB", "JOYSHD", NULL))
|
||||
{
|
||||
joystickicon = true;
|
||||
PUSHCONS(inputdisplay_cons_temp, last_inputdisplay_i, 3, "StickGFX");
|
||||
|
||||
@@ -85,8 +85,6 @@ void D_PostEvent(const event_t *ev);
|
||||
|
||||
void D_ProcessEvents(void);
|
||||
|
||||
void D_CleanFile(char **filearray);
|
||||
|
||||
const char *D_Home(void);
|
||||
|
||||
//
|
||||
|
||||
+10
-6
@@ -1026,6 +1026,7 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_scr_height);
|
||||
|
||||
CV_RegisterVar(&cv_parallelsoftware);
|
||||
CV_RegisterVar(&cv_paralleldrawmasked);
|
||||
|
||||
CV_RegisterVar(&cv_soundtest);
|
||||
|
||||
@@ -2082,7 +2083,7 @@ static void Command_ResetCamera_f(void)
|
||||
}
|
||||
|
||||
/* Consider replacing nametonum with this */
|
||||
static INT32 LookupPlayer(const char *s)
|
||||
INT32 D_LookupPlayer(const char *s)
|
||||
{
|
||||
INT32 playernum;
|
||||
|
||||
@@ -2098,8 +2099,7 @@ static INT32 LookupPlayer(const char *s)
|
||||
for (playernum = 0; playernum < MAXPLAYERS; ++playernum)
|
||||
{
|
||||
/* Match name case-insensitively: fully, or partially the start. */
|
||||
if (playeringame[playernum])
|
||||
if (strnicmp(player_names[playernum], s, strlen(s)) == 0)
|
||||
if (playeringame[playernum] && (strnicmp(player_names[playernum], s, strlen(s)) == 0))
|
||||
{
|
||||
return playernum;
|
||||
}
|
||||
@@ -2110,14 +2110,18 @@ static INT32 LookupPlayer(const char *s)
|
||||
static INT32 FindPlayerByPlace(INT32 place)
|
||||
{
|
||||
INT32 playernum;
|
||||
|
||||
for (playernum = 0; playernum < MAXPLAYERS; ++playernum)
|
||||
if (playeringame[playernum])
|
||||
{
|
||||
if (!playeringame[playernum])
|
||||
continue;
|
||||
|
||||
if (players[playernum].kartstuff[k_position] == place)
|
||||
{
|
||||
return playernum;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -2210,7 +2214,7 @@ static void Command_View_f(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (( playernum = LookupPlayer(COM_Argv(1)) ) == -1)
|
||||
if (( playernum = D_LookupPlayer(COM_Argv(1)) ) == -1)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "There is no player by that name!\n");
|
||||
return;
|
||||
@@ -5674,7 +5678,7 @@ static void Command_Archivetest_f(void)
|
||||
// assign mobjnum
|
||||
i = 1;
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
if (th->function.acp1 == (actionf_p1)P_MobjThinker)
|
||||
if (th->function == (actionf_p1)P_MobjThinker)
|
||||
((mobj_t *)th)->mobjnum = i++;
|
||||
|
||||
// allocate buffer
|
||||
|
||||
@@ -323,6 +323,7 @@ void ClearAdminPlayers(void);
|
||||
void RemoveAdminPlayer(INT32 playernum);
|
||||
void ItemFinder_OnChange(void);
|
||||
void D_SetPassword(const char *pw);
|
||||
INT32 D_LookupPlayer(const char *s);
|
||||
|
||||
// used for the player setup menu
|
||||
UINT8 CanChangeSkin(INT32 playernum);
|
||||
|
||||
@@ -1185,6 +1185,18 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
|
||||
if (cv_addons_option.value == 3 && *cv_addons_folder.string != '\0')
|
||||
{
|
||||
// next, check any custom directory if specified
|
||||
homecheck = filesearch(filename, cv_addons_folder.string, wantedmd5sum, completepath, 10);
|
||||
|
||||
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
|
||||
return FS_FOUND;
|
||||
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
}
|
||||
|
||||
// finally check "." directory
|
||||
homecheck = filesearch(filename, ".", wantedmd5sum, completepath, 10);
|
||||
|
||||
|
||||
+1
-8
@@ -28,18 +28,11 @@
|
||||
// To compile this as "ANSI C with classes" we will need to handle the various
|
||||
// action functions cleanly.
|
||||
//
|
||||
typedef void (*actionf_v)();
|
||||
typedef void (*actionf_p1)(void *);
|
||||
|
||||
typedef union
|
||||
{
|
||||
actionf_v acv;
|
||||
actionf_p1 acp1;
|
||||
} actionf_t;
|
||||
|
||||
// Historically, "think_t" is yet another function pointer to a routine
|
||||
// to handle an actor.
|
||||
typedef actionf_t think_t;
|
||||
typedef actionf_p1 think_t;
|
||||
|
||||
// Doubly linked list of actors.
|
||||
typedef struct thinker_s
|
||||
|
||||
@@ -152,3 +152,8 @@ boolean I_UseNativeKeyboard(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void I_SetBorderlessWindow(void)
|
||||
{
|
||||
|
||||
}
|
||||
+218
-217
@@ -1416,211 +1416,212 @@ static void readhuditem(MYFILE *f, INT32 num)
|
||||
// DO NOT FORGET TO SYNC THIS LIST WITH THE ACTIONNUM ENUM IN INFO.H
|
||||
actionpointer_t actionpointers[] =
|
||||
{
|
||||
{{A_Explode}, "A_EXPLODE"},
|
||||
{{A_Pain}, "A_PAIN"},
|
||||
{{A_Fall}, "A_FALL"},
|
||||
{{A_MonitorPop}, "A_MONITORPOP"},
|
||||
{{A_Look}, "A_LOOK"},
|
||||
{{A_Chase}, "A_CHASE"},
|
||||
{{A_FaceStabChase}, "A_FACESTABCHASE"},
|
||||
{{A_FaceTarget}, "A_FACETARGET"},
|
||||
{{A_FaceTracer}, "A_FACETRACER"},
|
||||
{{A_Scream}, "A_SCREAM"},
|
||||
{{A_BossDeath}, "A_BOSSDEATH"},
|
||||
{{A_CustomPower}, "A_CUSTOMPOWER"},
|
||||
{{A_GiveWeapon}, "A_GIVEWEAPON"},
|
||||
{{A_RingShield}, "A_RINGSHIELD"},
|
||||
{{A_RingBox}, "A_RINGBOX"},
|
||||
{{A_Invincibility}, "A_INVINCIBILITY"},
|
||||
{{A_SuperSneakers}, "A_SUPERSNEAKERS"},
|
||||
{{A_BunnyHop}, "A_BUNNYHOP"},
|
||||
{{A_BubbleSpawn}, "A_BUBBLESPAWN"},
|
||||
{{A_FanBubbleSpawn}, "A_FANBUBBLESPAWN"},
|
||||
{{A_BubbleRise}, "A_BUBBLERISE"},
|
||||
{{A_BubbleCheck}, "A_BUBBLECHECK"},
|
||||
{{A_AwardScore}, "A_AWARDSCORE"},
|
||||
{{A_ExtraLife}, "A_EXTRALIFE"},
|
||||
{{A_BombShield}, "A_BOMBSHIELD"},
|
||||
{{A_JumpShield}, "A_JUMPSHIELD"},
|
||||
{{A_WaterShield}, "A_WATERSHIELD"},
|
||||
{{A_ForceShield}, "A_FORCESHIELD"},
|
||||
{{A_PityShield}, "A_PITYSHIELD"},
|
||||
{{A_GravityBox}, "A_GRAVITYBOX"},
|
||||
{{A_ScoreRise}, "A_SCORERISE"},
|
||||
{{A_ParticleSpawn}, "A_PARTICLESPAWN"},
|
||||
{{A_AttractChase}, "A_ATTRACTCHASE"},
|
||||
{{A_DropMine}, "A_DROPMINE"},
|
||||
{{A_FishJump}, "A_FISHJUMP"},
|
||||
{{A_ThrownRing}, "A_THROWNRING"},
|
||||
{{A_GrenadeRing}, "A_GRENADERING"}, // SRB2kart
|
||||
{{A_SetSolidSteam}, "A_SETSOLIDSTEAM"},
|
||||
{{A_UnsetSolidSteam}, "A_UNSETSOLIDSTEAM"},
|
||||
{{A_SignPlayer}, "A_SIGNPLAYER"},
|
||||
{{A_OverlayThink}, "A_OVERLAYTHINK"},
|
||||
{{A_JetChase}, "A_JETCHASE"},
|
||||
{{A_JetbThink}, "A_JETBTHINK"},
|
||||
{{A_JetgThink}, "A_JETGTHINK"},
|
||||
{{A_JetgShoot}, "A_JETGSHOOT"},
|
||||
{{A_ShootBullet}, "A_SHOOTBULLET"},
|
||||
{{A_MinusDigging}, "A_MINUSDIGGING"},
|
||||
{{A_MinusPopup}, "A_MINUSPOPUP"},
|
||||
{{A_MinusCheck}, "A_MINUSCHECK"},
|
||||
{{A_ChickenCheck}, "A_CHICKENCHECK"},
|
||||
{{A_MouseThink}, "A_MOUSETHINK"},
|
||||
{{A_DetonChase}, "A_DETONCHASE"},
|
||||
{{A_CapeChase}, "A_CAPECHASE"},
|
||||
{{A_RotateSpikeBall}, "A_ROTATESPIKEBALL"},
|
||||
{{A_SlingAppear}, "A_SLINGAPPEAR"},
|
||||
{{A_MaceRotate}, "A_MACEROTATE"},
|
||||
{{A_UnidusBall}, "A_UNIDUSBALL"},
|
||||
{{A_RockSpawn}, "A_ROCKSPAWN"},
|
||||
{{A_SetFuse}, "A_SETFUSE"},
|
||||
{{A_CrawlaCommanderThink}, "A_CRAWLACOMMANDERTHINK"},
|
||||
{{A_SmokeTrailer}, "A_SMOKETRAILER"},
|
||||
{{A_RingExplode}, "A_RINGEXPLODE"},
|
||||
{{A_OldRingExplode}, "A_OLDRINGEXPLODE"},
|
||||
{{A_MixUp}, "A_MIXUP"},
|
||||
{{A_RecyclePowers}, "A_RECYCLEPOWERS"},
|
||||
{{A_Boss1Chase}, "A_BOSS1CHASE"},
|
||||
{{A_FocusTarget}, "A_FOCUSTARGET"},
|
||||
{{A_Boss2Chase}, "A_BOSS2CHASE"},
|
||||
{{A_Boss2Pogo}, "A_BOSS2POGO"},
|
||||
{{A_BossZoom}, "A_BOSSZOOM"},
|
||||
{{A_BossScream}, "A_BOSSSCREAM"},
|
||||
{{A_Boss2TakeDamage}, "A_BOSS2TAKEDAMAGE"},
|
||||
{{A_Boss7Chase}, "A_BOSS7CHASE"},
|
||||
{{A_GoopSplat}, "A_GOOPSPLAT"},
|
||||
{{A_Boss2PogoSFX}, "A_BOSS2POGOSFX"},
|
||||
{{A_Boss2PogoTarget}, "A_BOSS2POGOTARGET"},
|
||||
{{A_BossJetFume}, "A_BOSSJETFUME"},
|
||||
{{A_EggmanBox}, "A_EGGMANBOX"},
|
||||
{{A_TurretFire}, "A_TURRETFIRE"},
|
||||
{{A_SuperTurretFire}, "A_SUPERTURRETFIRE"},
|
||||
{{A_TurretStop}, "A_TURRETSTOP"},
|
||||
{{A_JetJawRoam}, "A_JETJAWROAM"},
|
||||
{{A_JetJawChomp}, "A_JETJAWCHOMP"},
|
||||
{{A_PointyThink}, "A_POINTYTHINK"},
|
||||
{{A_CheckBuddy}, "A_CHECKBUDDY"},
|
||||
{{A_HoodThink}, "A_HOODTHINK"},
|
||||
{{A_ArrowCheck}, "A_ARROWCHECK"},
|
||||
{{A_SnailerThink}, "A_SNAILERTHINK"},
|
||||
{{A_SharpChase}, "A_SHARPCHASE"},
|
||||
{{A_SharpSpin}, "A_SHARPSPIN"},
|
||||
{{A_VultureVtol}, "A_VULTUREVTOL"},
|
||||
{{A_VultureCheck}, "A_VULTURECHECK"},
|
||||
{{A_SkimChase}, "A_SKIMCHASE"},
|
||||
{{A_1upThinker}, "A_1UPTHINKER"},
|
||||
{{A_SkullAttack}, "A_SKULLATTACK"},
|
||||
{{A_LobShot}, "A_LOBSHOT"},
|
||||
{{A_FireShot}, "A_FIRESHOT"},
|
||||
{{A_SuperFireShot}, "A_SUPERFIRESHOT"},
|
||||
{{A_BossFireShot}, "A_BOSSFIRESHOT"},
|
||||
{{A_Boss7FireMissiles}, "A_BOSS7FIREMISSILES"},
|
||||
{{A_Boss1Laser}, "A_BOSS1LASER"},
|
||||
{{A_Boss4Reverse}, "A_BOSS4REVERSE"},
|
||||
{{A_Boss4SpeedUp}, "A_BOSS4SPEEDUP"},
|
||||
{{A_Boss4Raise}, "A_BOSS4RAISE"},
|
||||
{{A_SparkFollow}, "A_SPARKFOLLOW"},
|
||||
{{A_BuzzFly}, "A_BUZZFLY"},
|
||||
{{A_GuardChase}, "A_GUARDCHASE"},
|
||||
{{A_EggShield}, "A_EGGSHIELD"},
|
||||
{{A_SetReactionTime}, "A_SETREACTIONTIME"},
|
||||
{{A_Boss1Spikeballs}, "A_BOSS1SPIKEBALLS"},
|
||||
{{A_Boss3TakeDamage}, "A_BOSS3TAKEDAMAGE"},
|
||||
{{A_Boss3Path}, "A_BOSS3PATH"},
|
||||
{{A_LinedefExecute}, "A_LINEDEFEXECUTE"},
|
||||
{{A_PlaySeeSound}, "A_PLAYSEESOUND"},
|
||||
{{A_PlayAttackSound}, "A_PLAYATTACKSOUND"},
|
||||
{{A_PlayActiveSound}, "A_PLAYACTIVESOUND"},
|
||||
{{A_SpawnObjectAbsolute}, "A_SPAWNOBJECTABSOLUTE"},
|
||||
{{A_SpawnObjectRelative}, "A_SPAWNOBJECTRELATIVE"},
|
||||
{{A_ChangeAngleRelative}, "A_CHANGEANGLERELATIVE"},
|
||||
{{A_ChangeAngleAbsolute}, "A_CHANGEANGLEABSOLUTE"},
|
||||
{{A_PlaySound}, "A_PLAYSOUND"},
|
||||
{{A_FindTarget}, "A_FINDTARGET"},
|
||||
{{A_FindTracer}, "A_FINDTRACER"},
|
||||
{{A_SetTics}, "A_SETTICS"},
|
||||
{{A_SetRandomTics}, "A_SETRANDOMTICS"},
|
||||
{{A_ChangeColorRelative}, "A_CHANGECOLORRELATIVE"},
|
||||
{{A_ChangeColorAbsolute}, "A_CHANGECOLORABSOLUTE"},
|
||||
{{A_MoveRelative}, "A_MOVERELATIVE"},
|
||||
{{A_MoveAbsolute}, "A_MOVEABSOLUTE"},
|
||||
{{A_Thrust}, "A_THRUST"},
|
||||
{{A_ZThrust}, "A_ZTHRUST"},
|
||||
{{A_SetTargetsTarget}, "A_SETTARGETSTARGET"},
|
||||
{{A_SetObjectFlags}, "A_SETOBJECTFLAGS"},
|
||||
{{A_SetObjectFlags2}, "A_SETOBJECTFLAGS2"},
|
||||
{{A_RandomState}, "A_RANDOMSTATE"},
|
||||
{{A_RandomStateRange}, "A_RANDOMSTATERANGE"},
|
||||
{{A_DualAction}, "A_DUALACTION"},
|
||||
{{A_RemoteAction}, "A_REMOTEACTION"},
|
||||
{{A_ToggleFlameJet}, "A_TOGGLEFLAMEJET"},
|
||||
{{A_ItemPop}, "A_ITEMPOP"}, // SRB2kart
|
||||
{{A_JawzChase}, "A_JAWZCHASE"}, // SRB2kart
|
||||
{{A_JawzExplode}, "A_JAWZEXPLODE"}, // SRB2kart
|
||||
{{A_SPBChase}, "A_SPBCHASE"}, // SRB2kart
|
||||
{{A_MineExplode}, "A_MINEEXPLODE"}, // SRB2kart
|
||||
{{A_BallhogExplode}, "A_BALLHOGEXPLODE"}, // SRB2kart
|
||||
{{A_LightningFollowPlayer},"A_LIGHTNINGFOLLOWPLAYER"}, //SRB2kart
|
||||
{{A_FZBoomFlash}, "A_FZBOOMFLASH"}, //SRB2kart
|
||||
{{A_FZBoomSmoke}, "A_FZBOOMSMOKE"}, //SRB2kart
|
||||
{{A_RandomShadowFrame}, "A_RANDOMSHADOWFRAME"}, //SRB2kart
|
||||
{{A_RoamingShadowThinker}, "A_ROAMINGSHADOWTHINKER"}, //SRB2kart
|
||||
{{A_MayonakaArrow}, "A_MAYONAKAARROW"}, //SRB2kart
|
||||
{{A_ReaperThinker}, "A_REAPERTHINKER"}, //SRB2kart
|
||||
{{A_MementosTPParticles}, "A_MEMENTOSTPPARTICLES"}, //SRB2kart
|
||||
{{A_FlameParticle}, "A_FLAMEPARTICLE"}, // SRB2kart
|
||||
{{A_OrbitNights}, "A_ORBITNIGHTS"},
|
||||
{{A_GhostMe}, "A_GHOSTME"},
|
||||
{{A_SetObjectState}, "A_SETOBJECTSTATE"},
|
||||
{{A_SetObjectTypeState}, "A_SETOBJECTTYPESTATE"},
|
||||
{{A_KnockBack}, "A_KNOCKBACK"},
|
||||
{{A_PushAway}, "A_PUSHAWAY"},
|
||||
{{A_RingDrain}, "A_RINGDRAIN"},
|
||||
{{A_SplitShot}, "A_SPLITSHOT"},
|
||||
{{A_MissileSplit}, "A_MISSILESPLIT"},
|
||||
{{A_MultiShot}, "A_MULTISHOT"},
|
||||
{{A_InstaLoop}, "A_INSTALOOP"},
|
||||
{{A_Custom3DRotate}, "A_CUSTOM3DROTATE"},
|
||||
{{A_SearchForPlayers}, "A_SEARCHFORPLAYERS"},
|
||||
{{A_CheckRandom}, "A_CHECKRANDOM"},
|
||||
{{A_CheckTargetRings}, "A_CHECKTARGETRINGS"},
|
||||
{{A_CheckRings}, "A_CHECKRINGS"},
|
||||
{{A_CheckTotalRings}, "A_CHECKTOTALRINGS"},
|
||||
{{A_CheckHealth}, "A_CHECKHEALTH"},
|
||||
{{A_CheckRange}, "A_CHECKRANGE"},
|
||||
{{A_CheckHeight}, "A_CHECKHEIGHT"},
|
||||
{{A_CheckTrueRange}, "A_CHECKTRUERANGE"},
|
||||
{{A_CheckThingCount}, "A_CHECKTHINGCOUNT"},
|
||||
{{A_CheckAmbush}, "A_CHECKAMBUSH"},
|
||||
{{A_CheckCustomValue}, "A_CHECKCUSTOMVALUE"},
|
||||
{{A_CheckCusValMemo}, "A_CHECKCUSVALMEMO"},
|
||||
{{A_SetCustomValue}, "A_SETCUSTOMVALUE"},
|
||||
{{A_UseCusValMemo}, "A_USECUSVALMEMO"},
|
||||
{{A_RelayCustomValue}, "A_RELAYCUSTOMVALUE"},
|
||||
{{A_CusValAction}, "A_CUSVALACTION"},
|
||||
{{A_ForceStop}, "A_FORCESTOP"},
|
||||
{{A_ForceWin}, "A_FORCEWIN"},
|
||||
{{A_SpikeRetract}, "A_SPIKERETRACT"},
|
||||
{{A_InfoState}, "A_INFOSTATE"},
|
||||
{{A_Repeat}, "A_REPEAT"},
|
||||
{{A_SetScale}, "A_SETSCALE"},
|
||||
{{A_RemoteDamage}, "A_REMOTEDAMAGE"},
|
||||
{{A_HomingChase}, "A_HOMINGCHASE"},
|
||||
{{A_TrapShot}, "A_TRAPSHOT"},
|
||||
{{A_VileTarget}, "A_VILETARGET"},
|
||||
{{A_VileAttack}, "A_VILEATTACK"},
|
||||
{{A_VileFire}, "A_VILEFIRE"},
|
||||
{{A_BrakChase}, "A_BRAKCHASE"},
|
||||
{{A_BrakFireShot}, "A_BRAKFIRESHOT"},
|
||||
{{A_BrakLobShot}, "A_BRAKLOBSHOT"},
|
||||
{{A_NapalmScatter}, "A_NAPALMSCATTER"},
|
||||
{{A_SpawnFreshCopy}, "A_SPAWNFRESHCOPY"},
|
||||
{A_Explode, "A_EXPLODE"},
|
||||
{A_Pain, "A_PAIN"},
|
||||
{A_Fall, "A_FALL"},
|
||||
{A_MonitorPop, "A_MONITORPOP"},
|
||||
{A_Look, "A_LOOK"},
|
||||
{A_Chase, "A_CHASE"},
|
||||
{A_FaceStabChase, "A_FACESTABCHASE"},
|
||||
{A_FaceTarget, "A_FACETARGET"},
|
||||
{A_FaceTracer, "A_FACETRACER"},
|
||||
{A_Scream, "A_SCREAM"},
|
||||
{A_BossDeath, "A_BOSSDEATH"},
|
||||
{A_CustomPower, "A_CUSTOMPOWER"},
|
||||
{A_GiveWeapon, "A_GIVEWEAPON"},
|
||||
{A_RingShield, "A_RINGSHIELD"},
|
||||
{A_RingBox, "A_RINGBOX"},
|
||||
{A_Invincibility, "A_INVINCIBILITY"},
|
||||
{A_SuperSneakers, "A_SUPERSNEAKERS"},
|
||||
{A_BunnyHop, "A_BUNNYHOP"},
|
||||
{A_BubbleSpawn, "A_BUBBLESPAWN"},
|
||||
{A_FanBubbleSpawn, "A_FANBUBBLESPAWN"},
|
||||
{A_BubbleRise, "A_BUBBLERISE"},
|
||||
{A_BubbleCheck, "A_BUBBLECHECK"},
|
||||
{A_AwardScore, "A_AWARDSCORE"},
|
||||
{A_ExtraLife, "A_EXTRALIFE"},
|
||||
{A_BombShield, "A_BOMBSHIELD"},
|
||||
{A_JumpShield, "A_JUMPSHIELD"},
|
||||
{A_WaterShield, "A_WATERSHIELD"},
|
||||
{A_ForceShield, "A_FORCESHIELD"},
|
||||
{A_PityShield, "A_PITYSHIELD"},
|
||||
{A_GravityBox, "A_GRAVITYBOX"},
|
||||
{A_ScoreRise, "A_SCORERISE"},
|
||||
{A_ParticleSpawn, "A_PARTICLESPAWN"},
|
||||
{A_AttractChase, "A_ATTRACTCHASE"},
|
||||
{A_DropMine, "A_DROPMINE"},
|
||||
{A_FishJump, "A_FISHJUMP"},
|
||||
{A_ThrownRing, "A_THROWNRING"},
|
||||
{A_GrenadeRing, "A_GRENADERING"}, // SRB2kart
|
||||
{A_SetSolidSteam, "A_SETSOLIDSTEAM"},
|
||||
{A_UnsetSolidSteam, "A_UNSETSOLIDSTEAM"},
|
||||
{A_SignPlayer, "A_SIGNPLAYER"},
|
||||
{A_OverlayThink, "A_OVERLAYTHINK"},
|
||||
{A_JetChase, "A_JETCHASE"},
|
||||
{A_JetbThink, "A_JETBTHINK"},
|
||||
{A_JetgThink, "A_JETGTHINK"},
|
||||
{A_JetgShoot, "A_JETGSHOOT"},
|
||||
{A_ShootBullet, "A_SHOOTBULLET"},
|
||||
{A_MinusDigging, "A_MINUSDIGGING"},
|
||||
{A_MinusPopup, "A_MINUSPOPUP"},
|
||||
{A_MinusCheck, "A_MINUSCHECK"},
|
||||
{A_ChickenCheck, "A_CHICKENCHECK"},
|
||||
{A_MouseThink, "A_MOUSETHINK"},
|
||||
{A_DetonChase, "A_DETONCHASE"},
|
||||
{A_CapeChase, "A_CAPECHASE"},
|
||||
{A_RotateSpikeBall, "A_ROTATESPIKEBALL"},
|
||||
{A_SlingAppear, "A_SLINGAPPEAR"},
|
||||
{A_MaceRotate, "A_MACEROTATE"},
|
||||
{A_UnidusBall, "A_UNIDUSBALL"},
|
||||
{A_RockSpawn, "A_ROCKSPAWN"},
|
||||
{A_SetFuse, "A_SETFUSE"},
|
||||
{A_CrawlaCommanderThink, "A_CRAWLACOMMANDERTHINK"},
|
||||
{A_SmokeTrailer, "A_SMOKETRAILER"},
|
||||
{A_RingExplode, "A_RINGEXPLODE"},
|
||||
{A_OldRingExplode, "A_OLDRINGEXPLODE"},
|
||||
{A_MixUp, "A_MIXUP"},
|
||||
{A_RecyclePowers, "A_RECYCLEPOWERS"},
|
||||
{A_Boss1Chase, "A_BOSS1CHASE"},
|
||||
{A_FocusTarget, "A_FOCUSTARGET"},
|
||||
{A_Boss2Chase, "A_BOSS2CHASE"},
|
||||
{A_Boss2Pogo, "A_BOSS2POGO"},
|
||||
{A_BossZoom, "A_BOSSZOOM"},
|
||||
{A_BossScream, "A_BOSSSCREAM"},
|
||||
{A_Boss2TakeDamage, "A_BOSS2TAKEDAMAGE"},
|
||||
{A_Boss7Chase, "A_BOSS7CHASE"},
|
||||
{A_GoopSplat, "A_GOOPSPLAT"},
|
||||
{A_Boss2PogoSFX, "A_BOSS2POGOSFX"},
|
||||
{A_Boss2PogoTarget, "A_BOSS2POGOTARGET"},
|
||||
{A_BossJetFume, "A_BOSSJETFUME"},
|
||||
{A_EggmanBox, "A_EGGMANBOX"},
|
||||
{A_TurretFire, "A_TURRETFIRE"},
|
||||
{A_SuperTurretFire, "A_SUPERTURRETFIRE"},
|
||||
{A_TurretStop, "A_TURRETSTOP"},
|
||||
{A_JetJawRoam, "A_JETJAWROAM"},
|
||||
{A_JetJawChomp, "A_JETJAWCHOMP"},
|
||||
{A_PointyThink, "A_POINTYTHINK"},
|
||||
{A_CheckBuddy, "A_CHECKBUDDY"},
|
||||
{A_HoodThink, "A_HOODTHINK"},
|
||||
{A_ArrowCheck, "A_ARROWCHECK"},
|
||||
{A_SnailerThink, "A_SNAILERTHINK"},
|
||||
{A_SharpChase, "A_SHARPCHASE"},
|
||||
{A_SharpSpin, "A_SHARPSPIN"},
|
||||
{A_VultureVtol, "A_VULTUREVTOL"},
|
||||
{A_VultureCheck, "A_VULTURECHECK"},
|
||||
{A_SkimChase, "A_SKIMCHASE"},
|
||||
{A_1upThinker, "A_1UPTHINKER"},
|
||||
{A_SkullAttack, "A_SKULLATTACK"},
|
||||
{A_LobShot, "A_LOBSHOT"},
|
||||
{A_FireShot, "A_FIRESHOT"},
|
||||
{A_SuperFireShot, "A_SUPERFIRESHOT"},
|
||||
{A_BossFireShot, "A_BOSSFIRESHOT"},
|
||||
{A_Boss7FireMissiles, "A_BOSS7FIREMISSILES"},
|
||||
{A_Boss1Laser, "A_BOSS1LASER"},
|
||||
{A_Boss4Reverse, "A_BOSS4REVERSE"},
|
||||
{A_Boss4SpeedUp, "A_BOSS4SPEEDUP"},
|
||||
{A_Boss4Raise, "A_BOSS4RAISE"},
|
||||
{A_SparkFollow, "A_SPARKFOLLOW"},
|
||||
{A_BuzzFly, "A_BUZZFLY"},
|
||||
{A_GuardChase, "A_GUARDCHASE"},
|
||||
{A_EggShield, "A_EGGSHIELD"},
|
||||
{A_SetReactionTime, "A_SETREACTIONTIME"},
|
||||
{A_Boss1Spikeballs, "A_BOSS1SPIKEBALLS"},
|
||||
{A_Boss3TakeDamage, "A_BOSS3TAKEDAMAGE"},
|
||||
{A_Boss3Path, "A_BOSS3PATH"},
|
||||
{A_LinedefExecute, "A_LINEDEFEXECUTE"},
|
||||
{A_PlaySeeSound, "A_PLAYSEESOUND"},
|
||||
{A_PlayAttackSound, "A_PLAYATTACKSOUND"},
|
||||
{A_PlayActiveSound, "A_PLAYACTIVESOUND"},
|
||||
{A_SpawnObjectAbsolute, "A_SPAWNOBJECTABSOLUTE"},
|
||||
{A_SpawnObjectRelative, "A_SPAWNOBJECTRELATIVE"},
|
||||
{A_ChangeAngleRelative, "A_CHANGEANGLERELATIVE"},
|
||||
{A_ChangeAngleAbsolute, "A_CHANGEANGLEABSOLUTE"},
|
||||
{A_PlaySound, "A_PLAYSOUND"},
|
||||
{A_FindTarget, "A_FINDTARGET"},
|
||||
{A_FindTracer, "A_FINDTRACER"},
|
||||
{A_SetTics, "A_SETTICS"},
|
||||
{A_SetRandomTics, "A_SETRANDOMTICS"},
|
||||
{A_ChangeColorRelative, "A_CHANGECOLORRELATIVE"},
|
||||
{A_ChangeColorAbsolute, "A_CHANGECOLORABSOLUTE"},
|
||||
{A_MoveRelative, "A_MOVERELATIVE"},
|
||||
{A_MoveAbsolute, "A_MOVEABSOLUTE"},
|
||||
{A_Thrust, "A_THRUST"},
|
||||
{A_ZThrust, "A_ZTHRUST"},
|
||||
{A_SetTargetsTarget, "A_SETTARGETSTARGET"},
|
||||
{A_SetObjectFlags, "A_SETOBJECTFLAGS"},
|
||||
{A_SetObjectFlags2, "A_SETOBJECTFLAGS2"},
|
||||
{A_RandomState, "A_RANDOMSTATE"},
|
||||
{A_RandomStateRange, "A_RANDOMSTATERANGE"},
|
||||
{A_DualAction, "A_DUALACTION"},
|
||||
{A_RemoteAction, "A_REMOTEACTION"},
|
||||
{A_ToggleFlameJet, "A_TOGGLEFLAMEJET"},
|
||||
{A_ItemPop, "A_ITEMPOP"}, // SRB2kart
|
||||
{A_JawzChase, "A_JAWZCHASE"}, // SRB2kart
|
||||
{A_JawzExplode, "A_JAWZEXPLODE"}, // SRB2kart
|
||||
{A_SPBChase, "A_SPBCHASE"}, // SRB2kart
|
||||
{A_MineExplode, "A_MINEEXPLODE"}, // SRB2kart
|
||||
{A_BallhogExplode, "A_BALLHOGEXPLODE"}, // SRB2kart
|
||||
{A_LightningFollowPlayer,"A_LIGHTNINGFOLLOWPLAYER"}, //SRB2kart
|
||||
{A_FZBoomFlash, "A_FZBOOMFLASH"}, //SRB2kart
|
||||
{A_FZBoomSmoke, "A_FZBOOMSMOKE"}, //SRB2kart
|
||||
{A_RandomShadowFrame, "A_RANDOMSHADOWFRAME"}, //SRB2kart
|
||||
{A_RoamingShadowThinker, "A_ROAMINGSHADOWTHINKER"}, //SRB2kart
|
||||
{A_MayonakaArrow, "A_MAYONAKAARROW"}, //SRB2kart
|
||||
{A_ReaperThinker, "A_REAPERTHINKER"}, //SRB2kart
|
||||
{A_MementosTPParticles, "A_MEMENTOSTPPARTICLES"}, //SRB2kart
|
||||
{A_FlameParticle, "A_FLAMEPARTICLE"}, // SRB2kart
|
||||
{A_OrbitNights, "A_ORBITNIGHTS"},
|
||||
{A_GhostMe, "A_GHOSTME"},
|
||||
{A_SetObjectState, "A_SETOBJECTSTATE"},
|
||||
{A_SetObjectTypeState, "A_SETOBJECTTYPESTATE"},
|
||||
{A_KnockBack, "A_KNOCKBACK"},
|
||||
{A_PushAway, "A_PUSHAWAY"},
|
||||
{A_RingDrain, "A_RINGDRAIN"},
|
||||
{A_SplitShot, "A_SPLITSHOT"},
|
||||
{A_MissileSplit, "A_MISSILESPLIT"},
|
||||
{A_MultiShot, "A_MULTISHOT"},
|
||||
{A_InstaLoop, "A_INSTALOOP"},
|
||||
{A_Custom3DRotate, "A_CUSTOM3DROTATE"},
|
||||
{A_SearchForPlayers, "A_SEARCHFORPLAYERS"},
|
||||
{A_CheckRandom, "A_CHECKRANDOM"},
|
||||
{A_CheckTargetRings, "A_CHECKTARGETRINGS"},
|
||||
{A_CheckRings, "A_CHECKRINGS"},
|
||||
{A_CheckTotalRings, "A_CHECKTOTALRINGS"},
|
||||
{A_CheckHealth, "A_CHECKHEALTH"},
|
||||
{A_CheckRange, "A_CHECKRANGE"},
|
||||
{A_CheckHeight, "A_CHECKHEIGHT"},
|
||||
{A_CheckTrueRange, "A_CHECKTRUERANGE"},
|
||||
{A_CheckThingCount, "A_CHECKTHINGCOUNT"},
|
||||
{A_CheckAmbush, "A_CHECKAMBUSH"},
|
||||
{A_CheckCustomValue, "A_CHECKCUSTOMVALUE"},
|
||||
{A_CheckCusValMemo, "A_CHECKCUSVALMEMO"},
|
||||
{A_SetCustomValue, "A_SETCUSTOMVALUE"},
|
||||
{A_UseCusValMemo, "A_USECUSVALMEMO"},
|
||||
{A_RelayCustomValue, "A_RELAYCUSTOMVALUE"},
|
||||
{A_CusValAction, "A_CUSVALACTION"},
|
||||
{A_ForceStop, "A_FORCESTOP"},
|
||||
{A_ForceWin, "A_FORCEWIN"},
|
||||
{A_SpikeRetract, "A_SPIKERETRACT"},
|
||||
{A_InfoState, "A_INFOSTATE"},
|
||||
{A_Repeat, "A_REPEAT"},
|
||||
{A_SetScale, "A_SETSCALE"},
|
||||
{A_RemoteDamage, "A_REMOTEDAMAGE"},
|
||||
{A_HomingChase, "A_HOMINGCHASE"},
|
||||
{A_TrapShot, "A_TRAPSHOT"},
|
||||
{A_VileTarget, "A_VILETARGET"},
|
||||
{A_VileAttack, "A_VILEATTACK"},
|
||||
{A_VileFire, "A_VILEFIRE"},
|
||||
{A_BrakChase, "A_BRAKCHASE"},
|
||||
{A_BrakFireShot, "A_BRAKFIRESHOT"},
|
||||
{A_BrakLobShot, "A_BRAKLOBSHOT"},
|
||||
{A_NapalmScatter, "A_NAPALMSCATTER"},
|
||||
{A_SpawnFreshCopy, "A_SPAWNFRESHCOPY"},
|
||||
//{A_InvincSparkleRotate, "A_INVINCSPARKLEROTATE"},
|
||||
|
||||
{{NULL}, "NONE"},
|
||||
{NULL, "NONE"},
|
||||
|
||||
// This NULL entry must be the last in the list
|
||||
{{NULL}, NULL},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
static void readframe(MYFILE *f, INT32 num)
|
||||
@@ -1702,7 +1703,7 @@ static void readframe(MYFILE *f, INT32 num)
|
||||
|
||||
for (z = 0; actionpointers[z].name; z++)
|
||||
{
|
||||
if (actionpointers[z].action.acv == states[num].action.acv)
|
||||
if (actionpointers[z].action == states[num].action)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1711,17 +1712,17 @@ static void readframe(MYFILE *f, INT32 num)
|
||||
z = 0;
|
||||
found = LUA_SetLuaAction(&states[num], actiontocompare);
|
||||
if (!found)
|
||||
while (actionpointers[z].name)
|
||||
{
|
||||
if (fastcmp(actiontocompare, actionpointers[z].name))
|
||||
while (actionpointers[z].name)
|
||||
{
|
||||
states[num].action = actionpointers[z].action;
|
||||
states[num].action.acv = actionpointers[z].action.acv; // assign
|
||||
states[num].action.acp1 = actionpointers[z].action.acp1;
|
||||
found = true;
|
||||
break;
|
||||
if (fastcmp(actiontocompare, actionpointers[z].name))
|
||||
{
|
||||
states[num].action = actionpointers[z].action;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
z++;
|
||||
}
|
||||
z++;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
@@ -8524,13 +8525,13 @@ static inline int lib_freeslot(lua_State *L)
|
||||
// Arguments: mobj_t actor, int var1, int var2
|
||||
static inline int lib_action(lua_State *L)
|
||||
{
|
||||
actionf_t *action = lua_touserdata(L,lua_upvalueindex(1));
|
||||
actionf_p1 *action = lua_touserdata(L,lua_upvalueindex(1));
|
||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L,1,META_MOBJ));
|
||||
var1 = (INT32)luaL_optinteger(L,2,0);
|
||||
var2 = (INT32)luaL_optinteger(L,3,0);
|
||||
if (!actor)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
action->acp1(actor);
|
||||
(*action)(actor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -9344,13 +9345,15 @@ int LUA_SOCLib(lua_State *L)
|
||||
|
||||
const char *LUA_GetActionName(void *action)
|
||||
{
|
||||
actionf_t *act = (actionf_t *)action;
|
||||
actionf_p1 *act = (actionf_p1 *)action;
|
||||
size_t z;
|
||||
|
||||
for (z = 0; actionpointers[z].name; z++)
|
||||
{
|
||||
if (actionpointers[z].action.acv == act->acv)
|
||||
if (actionpointers[z].action == *act)
|
||||
return actionpointers[z].name;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -9363,8 +9366,6 @@ void LUA_SetActionByName(void *state, const char *actiontocompare)
|
||||
if (fasticmp(actiontocompare, actionpointers[z].name))
|
||||
{
|
||||
st->action = actionpointers[z].action;
|
||||
st->action.acv = actionpointers[z].action.acv; // assign
|
||||
st->action.acp1 = actionpointers[z].action.acp1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -111,8 +111,8 @@ extern char logfilename[1024];
|
||||
#else
|
||||
#define VERSION 1 // Game version
|
||||
#define SUBVERSION 6 // more precise version number
|
||||
#define VERSIONSTRING "Saturn v8.2"
|
||||
#define VERSIONSTRINGW L"Saturn v8.2"
|
||||
#define VERSIONSTRING "Saturn v8.3"
|
||||
#define VERSIONSTRINGW L"Saturn v8.3"
|
||||
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
||||
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
||||
// AND appveyor.yml, for the build bots!
|
||||
|
||||
+13
-13
@@ -446,19 +446,19 @@ extern UINT16 spacetimetics;
|
||||
extern UINT16 extralifetics;
|
||||
|
||||
// SRB2kart
|
||||
extern tic_t introtime;
|
||||
extern tic_t starttime;
|
||||
extern tic_t raceexittime;
|
||||
extern tic_t battleexittime;
|
||||
extern INT32 hyudorotime;
|
||||
extern INT32 stealtime;
|
||||
extern INT32 sneakertime;
|
||||
extern INT32 itemtime;
|
||||
extern INT32 comebacktime;
|
||||
extern INT32 bumptime;
|
||||
extern INT32 wipeoutslowtime;
|
||||
extern INT32 wantedreduce;
|
||||
extern INT32 wantedfrequency;
|
||||
extern const tic_t introtime;
|
||||
extern const tic_t starttime;
|
||||
extern const tic_t raceexittime;
|
||||
extern const tic_t battleexittime;
|
||||
extern const INT32 hyudorotime;
|
||||
extern const INT32 stealtime;
|
||||
extern const INT32 sneakertime;
|
||||
extern const INT32 itemtime;
|
||||
extern const INT32 comebacktime;
|
||||
extern const INT32 bumptime;
|
||||
extern const INT32 wipeoutslowtime;
|
||||
extern const INT32 wantedreduce;
|
||||
extern const INT32 wantedfrequency;
|
||||
|
||||
extern UINT8 introtoplay;
|
||||
extern UINT8 creditscutscene;
|
||||
|
||||
@@ -540,6 +540,8 @@ static const char *credits[] = {
|
||||
"\"Jin\"",
|
||||
"\"riomccloud\"",
|
||||
"\"chromaticpipe\"",
|
||||
"\"PAS\"",
|
||||
"\"$HOME\"",
|
||||
"\"Achii\"",
|
||||
"\"Anonimus\"",
|
||||
"\"scizor300\"",
|
||||
|
||||
+3987
-46
File diff suppressed because it is too large.
Load diff
+9
-19
@@ -114,8 +114,7 @@ INT32 mousex, mousey;
|
||||
INT32 mlooky; // like mousey but with a custom sensitivity for mlook
|
||||
|
||||
// joystick values are repeated
|
||||
INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET], joy2ymove[JOYAXISSET],
|
||||
joy3xmove[JOYAXISSET], joy3ymove[JOYAXISSET], joy4xmove[JOYAXISSET], joy4ymove[JOYAXISSET];
|
||||
INT32 joyxmove[MAXSPLITSCREENPLAYERS][JOYAXISSET], joyymove[MAXSPLITSCREENPLAYERS][JOYAXISSET];
|
||||
|
||||
// current state of the keys: true if pushed
|
||||
UINT8 gamekeydown[NUMINPUTS];
|
||||
@@ -187,32 +186,32 @@ void G_MapEventsToControls(event_t *ev)
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET || menuactive || CON_Ready() || chat_on)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[0][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[0][i] = ev->data3;
|
||||
break;
|
||||
|
||||
case ev_joystick2: // buttons are virtual keys
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET || menuactive)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joy2xmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joy2ymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[1][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[1][i] = ev->data3;
|
||||
break;
|
||||
|
||||
case ev_joystick3:
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joy3xmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joy3ymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[2][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[2][i] = ev->data3;
|
||||
break;
|
||||
|
||||
case ev_joystick4:
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joy4xmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joy4ymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[3][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[3][i] = ev->data3;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -258,15 +257,6 @@ void G_ResetControls(void)
|
||||
memset(joyxmove, 0, sizeof(joyxmove));
|
||||
memset(joyymove, 0, sizeof(joyymove));
|
||||
|
||||
memset(joy2xmove, 0, sizeof(joy2xmove));
|
||||
memset(joy2ymove, 0, sizeof(joy2ymove));
|
||||
|
||||
memset(joy3xmove, 0, sizeof(joy3xmove));
|
||||
memset(joy3ymove, 0, sizeof(joy3ymove));
|
||||
|
||||
memset(joy4xmove, 0, sizeof(joy4xmove));
|
||||
memset(joy4ymove, 0, sizeof(joy4ymove));
|
||||
|
||||
// reset those just in case the game missed the keyup event
|
||||
memset(dpadscrollstate, false, sizeof(dpadscrollstate));
|
||||
}
|
||||
|
||||
+8
-5
@@ -41,10 +41,12 @@ typedef enum
|
||||
KEY_DBLJOY1 = KEY_DBLMOUSE1 + MOUSEBUTTONS,
|
||||
KEY_DBLHAT1 = KEY_DBLJOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_2JOY1 = KEY_DBLHAT1 + MOUSEBUTTONS,
|
||||
KEY_2MOUSE1 = KEY_DBLHAT1 + JOYHATS*4,
|
||||
KEY_2JOY1 = KEY_2MOUSE1 + MOUSEBUTTONS,
|
||||
KEY_2HAT1 = KEY_2JOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_DBL2JOY1 = KEY_2HAT1 + MOUSEBUTTONS,
|
||||
KEY_DBL2MOUSE1 = KEY_2HAT1 + JOYHATS*4,
|
||||
KEY_DBL2JOY1 = KEY_DBL2MOUSE1 + MOUSEBUTTONS,
|
||||
KEY_DBL2HAT1 = KEY_DBL2JOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_3JOY1 = KEY_DBL2HAT1 + JOYHATS*4,
|
||||
@@ -61,8 +63,10 @@ typedef enum
|
||||
|
||||
KEY_MOUSEWHEELUP = KEY_DBL4HAT1 + JOYHATS*4,
|
||||
KEY_MOUSEWHEELDOWN = KEY_MOUSEWHEELUP + 1,
|
||||
KEY_2MOUSEWHEELUP = KEY_MOUSEWHEELDOWN + 1,
|
||||
KEY_2MOUSEWHEELDOWN = KEY_2MOUSEWHEELUP + 1,
|
||||
|
||||
NUMINPUTS = KEY_MOUSEWHEELDOWN + 1,
|
||||
NUMINPUTS = KEY_2MOUSEWHEELDOWN + 1, // FIXME: all the mouse 2 stuff should be removed, but it screws up mappings somehow
|
||||
} key_input_e;
|
||||
|
||||
typedef enum
|
||||
@@ -113,8 +117,7 @@ extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS];
|
||||
extern INT32 mousex, mousey;
|
||||
extern INT32 mlooky; //mousey with mlookSensitivity
|
||||
|
||||
extern INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET], joy2ymove[JOYAXISSET],
|
||||
joy3xmove[JOYAXISSET], joy3ymove[JOYAXISSET], joy4xmove[JOYAXISSET], joy4ymove[JOYAXISSET];
|
||||
extern INT32 joyxmove[MAXSPLITSCREENPLAYERS][JOYAXISSET], joyymove[MAXSPLITSCREENPLAYERS][JOYAXISSET];
|
||||
|
||||
// current state of the keys: true if pushed
|
||||
extern UINT8 gamekeydown[NUMINPUTS];
|
||||
|
||||
@@ -161,7 +161,7 @@ static boolean SameVertice (polyvertex_t *p1, polyvertex_t *p2)
|
||||
return false;
|
||||
#else
|
||||
#define DIVLINE_VERTEX_DIFF 0.45f
|
||||
float ep = DIVLINE_VERTEX_DIFF;
|
||||
static const float ep = DIVLINE_VERTEX_DIFF;
|
||||
if (fabsf( p2->x - p1->x ) > ep )
|
||||
return false;
|
||||
if (fabsf( p2->y - p1->y ) > ep )
|
||||
@@ -283,6 +283,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||
*backpoly = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (pe <= ps)
|
||||
I_Error("SplitPoly: invalid splitting line (%d %d)", ps, pe);
|
||||
|
||||
@@ -368,7 +369,7 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
|
||||
for (; count--; lseg++)
|
||||
{
|
||||
//x,y,dx,dy (like a divline)
|
||||
line_t *line = lseg->linedef;
|
||||
const line_t *line = lseg->linedef;
|
||||
|
||||
// portal check
|
||||
if (!gl_maphasportals && line->special == PORTALSPECIAL && lseg->side == 0)
|
||||
|
||||
@@ -792,7 +792,7 @@ static void HWR_PrecacheLevelSprites(void)
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo = (mobj_t *)th;
|
||||
|
||||
@@ -121,7 +121,7 @@ static clipnode_t * gld_clipnode_NewRange(angle_t start, angle_t end)
|
||||
|
||||
boolean gld_clipper_SafeCheckRange(angle_t startAngle, angle_t endAngle)
|
||||
{
|
||||
if(startAngle > endAngle)
|
||||
if (startAngle > endAngle)
|
||||
{
|
||||
return (gld_clipper_IsRangeVisible(startAngle, ANGLE_MAX) || gld_clipper_IsRangeVisible(0, endAngle));
|
||||
}
|
||||
|
||||
+107
-96
@@ -746,7 +746,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
|
||||
for (i = 0; i < subsector->numlines; i++, line++)
|
||||
{
|
||||
if (line->linedef->special != HORIZONSPECIAL)
|
||||
// this check sucks and is a hotspot lel
|
||||
if (LIKELY(line->linedef->special != HORIZONSPECIAL))
|
||||
continue;
|
||||
|
||||
if (R_PointOnSegSide(viewx, viewy, line) != 0)
|
||||
@@ -762,8 +763,7 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
}
|
||||
else
|
||||
{
|
||||
x1 = FixedToFloat(line->v1->x);
|
||||
y1 = FixedToFloat(line->v1->x);
|
||||
x1 = y1 = FixedToFloat(line->v1->x);
|
||||
}
|
||||
|
||||
if (line->pv2)
|
||||
@@ -1049,7 +1049,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
||||
if ((endtop < endrealbot) && (top < realbot))
|
||||
return;
|
||||
|
||||
lightlist_t *list = sector->lightlist;
|
||||
const lightlist_t *list = sector->lightlist;
|
||||
|
||||
if (!(list[i].flags & FF_NOSHADE))
|
||||
{
|
||||
@@ -1387,9 +1387,9 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
wallVerts[2].z = wallVerts[1].z = ve.y;
|
||||
|
||||
// x offset the texture
|
||||
fixed_t texturehpeg = gl_sidedef->textureoffset + gl_curline->offset;
|
||||
float cliplow = (float)texturehpeg;
|
||||
float cliphigh = (float)(texturehpeg + (gl_curline->flength*FRACUNIT));
|
||||
const fixed_t texturehpeg = gl_sidedef->textureoffset + gl_curline->offset;
|
||||
const float cliplow = (float)texturehpeg;
|
||||
const float cliphigh = (float)(texturehpeg + (gl_curline->flength*FRACUNIT));
|
||||
|
||||
FUINT lightnum = gl_frontsector->lightlevel;
|
||||
extracolormap_t *colormap = gl_frontsector->extra_colormap;
|
||||
@@ -1400,7 +1400,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
if (gl_frontsector)
|
||||
Surf.PolyColor.s.alpha = 255;
|
||||
|
||||
INT32 gl_midtexture = R_GetTextureNum(gl_sidedef->midtexture);
|
||||
const INT32 gl_midtexture = R_GetTextureNum(gl_sidedef->midtexture);
|
||||
GLMapTexture_t *glTex = NULL;
|
||||
|
||||
// two sided line
|
||||
@@ -1678,7 +1678,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
}
|
||||
|
||||
// Find the wall's coordinates
|
||||
fixed_t midtexheight = textureheight[gl_midtexture] * repeats;
|
||||
const fixed_t midtexheight = textureheight[gl_midtexture] * repeats;
|
||||
|
||||
if (gl_linedef->flags & ML_EFFECT2)
|
||||
{
|
||||
@@ -2004,6 +2004,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
wallVerts[0].s = wallVerts[3].s = cliplow * glTex->scaleX;
|
||||
wallVerts[2].s = wallVerts[1].s = cliphigh * glTex->scaleX;
|
||||
}
|
||||
|
||||
FBITFIELD blendmode;
|
||||
|
||||
if (roverflags & FF_FOG)
|
||||
@@ -3296,7 +3297,7 @@ static gl_vissprite_t gl_overflowsprite;
|
||||
|
||||
static gl_vissprite_t *HWR_GetVisSprite(UINT32 num)
|
||||
{
|
||||
UINT32 chunk = num >> VISSPRITECHUNKBITS;
|
||||
const UINT32 chunk = num >> VISSPRITECHUNKBITS;
|
||||
|
||||
// Allocate chunk if necessary
|
||||
if (!gl_visspritechunks[chunk])
|
||||
@@ -3316,7 +3317,7 @@ static gl_vissprite_t *HWR_NewVisSprite(void)
|
||||
// Finds a floor through which light does not pass.
|
||||
static fixed_t HWR_OpaqueFloorAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
|
||||
{
|
||||
const sector_t *sec = R_PointInSubsector(x, y)->sector;
|
||||
const sector_t *sec = R_PointInSubsectorFast(x, y)->sector;
|
||||
fixed_t floorz = sec->floorheight;
|
||||
|
||||
if (sec->ffloors)
|
||||
@@ -3358,13 +3359,6 @@ static void HWR_DrawSpriteShadow(gl_vissprite_t *spr, patch_t *gpatch, GLPatch_t
|
||||
fixed_t slopez;
|
||||
float offset = 0;
|
||||
|
||||
// technically this_scale gets multiplied and added to sprite y/x scale, but this thing needs it for some crap so ill just throw it in here again
|
||||
const boolean hires = (spr->mobj && spr->mobj->skin && K_GetMobjSkin(spr->mobj)->flags & SF_HIRES);
|
||||
if (spr->mobj)
|
||||
this_scale = FixedToFloat(spr->mobj->scale);
|
||||
if (hires)
|
||||
this_scale = this_scale * FixedToFloat(K_GetMobjSkin(spr->mobj)->highresscale);
|
||||
|
||||
R_GetShadowZ(spr->mobj, &floorslope);
|
||||
|
||||
mobjfloor = HWR_OpaqueFloorAtPos(
|
||||
@@ -3415,6 +3409,14 @@ static void HWR_DrawSpriteShadow(gl_vissprite_t *spr, patch_t *gpatch, GLPatch_t
|
||||
else
|
||||
floorheight = FixedInt(spr->mobj->z - mobjfloor);
|
||||
|
||||
// technically this_scale gets multiplied and added to sprite y/x scale, but this thing needs it for some crap so ill just throw it in here again
|
||||
const boolean hires = (spr->mobj && spr->mobj->skin && K_GetMobjSkin(spr->mobj)->flags & SF_HIRES);
|
||||
|
||||
if (spr->mobj)
|
||||
this_scale = FixedToFloat(spr->mobj->scale);
|
||||
if (hires)
|
||||
this_scale = this_scale * FixedToFloat(K_GetMobjSkin(spr->mobj)->highresscale);
|
||||
|
||||
// create the sprite billboard
|
||||
//
|
||||
// 3--2
|
||||
@@ -3732,6 +3734,9 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
||||
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
|
||||
}
|
||||
|
||||
if (cv_playerfade.value && spr->mobj->player)
|
||||
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
shader = SHADER_SPRITE;
|
||||
@@ -3886,11 +3891,13 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||
|
||||
INT32 shader = SHADER_NONE;
|
||||
|
||||
if (!spr->mobj || !spr->mobj->subsector)
|
||||
const mobj_t *sprmo = spr->mobj;
|
||||
|
||||
if (UNLIKELY(!sprmo || !sprmo->subsector))
|
||||
return;
|
||||
|
||||
const boolean papersprite = (spr->mobj->frame & FF_PAPERSPRITE);
|
||||
const sector_t *sector = spr->mobj->subsector->sector;
|
||||
const boolean papersprite = (sprmo->frame & FF_PAPERSPRITE);
|
||||
const sector_t *sector = sprmo->subsector->sector;
|
||||
|
||||
if (sector->numlights)
|
||||
{
|
||||
@@ -3956,9 +3963,9 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||
|
||||
// Draw shadow BEFORE sprite
|
||||
if (UNLIKELY(cv_shadow.value // Shadows enabled
|
||||
&& (spr->mobj->flags & (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY)) != (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY) // Ceiling scenery have no shadow.
|
||||
&& !(spr->mobj->flags2 & MF2_DEBRIS) // Debris have no corona or shadow.
|
||||
&& (spr->mobj->z >= spr->mobj->floorz))) // Without this, your shadow shows on the floor, even after you die and fall through the ground.
|
||||
&& (sprmo->flags & (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY)) != (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY) // Ceiling scenery have no shadow.
|
||||
&& !(sprmo->flags2 & MF2_DEBRIS) // Debris have no corona or shadow.
|
||||
&& (sprmo->z >= sprmo->floorz))) // Without this, your shadow shows on the floor, even after you die and fall through the ground.
|
||||
{
|
||||
////////////////////
|
||||
// SHADOW SPRITE! //
|
||||
@@ -3988,24 +3995,24 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||
HWR_Lighting(&Surf, lightlevel, colormap, P_SectorUsesDirectionalLighting(sector) && !fullbright);
|
||||
|
||||
INT32 blendmode;
|
||||
if (spr->mobj->frame & FF_BLENDMASK)
|
||||
blendmode = ((spr->mobj->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
|
||||
if (sprmo->frame & FF_BLENDMASK)
|
||||
blendmode = ((sprmo->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
|
||||
else
|
||||
blendmode = spr->mobj->blendmode;
|
||||
blendmode = sprmo->blendmode;
|
||||
|
||||
if (UNLIKELY(!cv_translucency.value)) // translucency disabled
|
||||
{
|
||||
Surf.PolyColor.s.alpha = 0xFF;
|
||||
blend = PF_Translucent|PF_Occlude;
|
||||
}
|
||||
else if (spr->mobj->flags2 & MF2_SHADOW)
|
||||
else if (sprmo->flags2 & MF2_SHADOW)
|
||||
{
|
||||
Surf.PolyColor.s.alpha = 0x40;
|
||||
blend = HWR_GetBlendModeFlag(blendmode);
|
||||
}
|
||||
else if (spr->mobj->frame & FF_TRANSMASK)
|
||||
else if (sprmo->frame & FF_TRANSMASK)
|
||||
{
|
||||
INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
|
||||
INT32 trans = (sprmo->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
|
||||
blend = HWR_SurfaceBlend(blendmode, trans, &Surf);
|
||||
}
|
||||
else
|
||||
@@ -4018,6 +4025,9 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
|
||||
}
|
||||
|
||||
if (cv_playerfade.value && sprmo->player)
|
||||
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
shader = SHADER_SPRITE;
|
||||
@@ -4038,7 +4048,9 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
|
||||
|
||||
INT32 shader = SHADER_NONE;
|
||||
|
||||
if (!spr->mobj || !spr->mobj->subsector)
|
||||
const mobj_t *sprmo = spr->mobj;
|
||||
|
||||
if (UNLIKELY(!sprmo || !sprmo->subsector))
|
||||
return;
|
||||
|
||||
// cache sprite graphics
|
||||
@@ -4076,7 +4088,7 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
|
||||
wallVerts[0].t = wallVerts[1].t = hwrpatch->max_t;
|
||||
|
||||
// colormap test
|
||||
sector_t *sector = spr->mobj->subsector->sector;
|
||||
sector_t *sector = sprmo->subsector->sector;
|
||||
UINT8 lightlevel = 255;
|
||||
extracolormap_t *colormap = sector->extra_colormap;
|
||||
|
||||
@@ -4084,9 +4096,9 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
|
||||
{
|
||||
INT32 light;
|
||||
|
||||
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
|
||||
light = R_GetPlaneLight(sector, sprmo->z + sprmo->height, false); // Always use the light at the top instead of whatever I was doing before
|
||||
|
||||
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
||||
if (!(sprmo->frame & FF_FULLBRIGHT))
|
||||
lightlevel = static_cast<UINT8>(CLAMP(*sector->lightlist[light].lightlevel, 0, 255));
|
||||
|
||||
if (sector->lightlist[light].extra_colormap)
|
||||
@@ -4094,7 +4106,7 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(spr->mobj->frame & FF_FULLBRIGHT))
|
||||
if (!(sprmo->frame & FF_FULLBRIGHT))
|
||||
lightlevel = static_cast<UINT8>(CLAMP(sector->lightlevel, 0, 255));
|
||||
|
||||
if (sector->extra_colormap)
|
||||
@@ -4103,9 +4115,9 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
|
||||
|
||||
HWR_Lighting(&Surf, lightlevel, colormap, P_SectorUsesDirectionalLighting(sector));
|
||||
|
||||
if (spr->mobj->frame & FF_TRANSMASK)
|
||||
if (sprmo->frame & FF_TRANSMASK)
|
||||
{
|
||||
INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
|
||||
INT32 trans = (sprmo->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
|
||||
blend = HWR_SurfaceBlend(AST_TRANSLUCENT, trans, &Surf);
|
||||
}
|
||||
else
|
||||
@@ -4137,8 +4149,8 @@ gl_vissprite_t* gl_vsprorder[MAXVISSPRITES];
|
||||
// sorted and drawn together with transparent surfaces.
|
||||
static int CompareVisSprites(const void *p1, const void *p2)
|
||||
{
|
||||
gl_vissprite_t* spr1 = *(gl_vissprite_t*const*)p1;
|
||||
gl_vissprite_t* spr2 = *(gl_vissprite_t*const*)p2;
|
||||
const gl_vissprite_t* spr1 = *(gl_vissprite_t*const*)p1;
|
||||
const gl_vissprite_t* spr2 = *(gl_vissprite_t*const*)p2;
|
||||
int idiff;
|
||||
float fdiff;
|
||||
|
||||
@@ -4316,8 +4328,8 @@ static void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *poly
|
||||
|
||||
static int CompareDrawNodePlanes(const void *p1, const void *p2)
|
||||
{
|
||||
INT32 n1 = *(const INT32*)p1;
|
||||
INT32 n2 = *(const INT32*)p2;
|
||||
const INT32 n1 = *(const INT32*)p1;
|
||||
const INT32 n2 = *(const INT32*)p2;
|
||||
|
||||
return ABS(drawnodes[n2].u.plane.fixedheight - viewz) - ABS(drawnodes[n1].u.plane.fixedheight - viewz);
|
||||
}
|
||||
@@ -4450,6 +4462,15 @@ static void HWR_RenderDrawNodes(void)
|
||||
// --------------------------------------------------------------------------
|
||||
// Draw all vissprites
|
||||
// --------------------------------------------------------------------------
|
||||
namespace
|
||||
{
|
||||
enum class DrawSpritesType
|
||||
{
|
||||
kSprites,
|
||||
kModels,
|
||||
};
|
||||
|
||||
template <DrawSpritesType Type>
|
||||
static void HWR_DrawSprites(void)
|
||||
{
|
||||
UINT32 i;
|
||||
@@ -4464,56 +4485,44 @@ static void HWR_DrawSprites(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
HWR_DrawSprite(spr);
|
||||
}
|
||||
}
|
||||
|
||||
static void HWR_DrawModels(void)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
for (i = 0; i < gl_visspritecount; i++)
|
||||
{
|
||||
gl_vissprite_t *spr = gl_vsprorder[i];
|
||||
|
||||
if (spr->precip)
|
||||
if constexpr (Type == DrawSpritesType::kModels)
|
||||
{
|
||||
HWR_DrawPrecipitationSprite(spr);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!spr->mobj)
|
||||
continue;
|
||||
|
||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||
{
|
||||
md2_t *md2;
|
||||
|
||||
if (spr->mobj->localskin)
|
||||
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||
{
|
||||
if (spr->mobj->skinlocal)
|
||||
md2 = &md2_localplayermodels[(skin_t *)spr->mobj->localskin - localskins];
|
||||
md2_t *md2;
|
||||
|
||||
if (spr->mobj->localskin)
|
||||
{
|
||||
if (spr->mobj->skinlocal)
|
||||
md2 = &md2_localplayermodels[(skin_t *)spr->mobj->localskin - localskins];
|
||||
else
|
||||
md2 = &md2_playermodels [(skin_t *)spr->mobj->localskin - skins];
|
||||
}
|
||||
else
|
||||
md2 = &md2_playermodels [(skin_t *)spr->mobj->localskin - skins];
|
||||
md2 = &md2_playermodels[(skin_t *)spr->mobj->skin - skins];
|
||||
|
||||
// 8/1/19: Only don't display player models if no default SPR_PLAY is found.
|
||||
if (((md2->notfound || md2->scale < 0.0f) && ((!cv_glfallbackplayermodel.value) || md2_models[SPR_PLAY].notfound || md2_models[SPR_PLAY].scale < 0.0f)) || spr->mobj->state == &states[S_PLAY_SIGN])
|
||||
HWR_DrawSprite(spr);
|
||||
else
|
||||
HWR_DrawMD2(spr);
|
||||
}
|
||||
else
|
||||
md2 = &md2_playermodels[(skin_t *)spr->mobj->skin - skins];
|
||||
|
||||
// 8/1/19: Only don't display player models if no default SPR_PLAY is found.
|
||||
if (((md2->notfound || md2->scale < 0.0f) && ((!cv_glfallbackplayermodel.value) || md2_models[SPR_PLAY].notfound || md2_models[SPR_PLAY].scale < 0.0f)) || spr->mobj->state == &states[S_PLAY_SIGN])
|
||||
HWR_DrawSprite(spr);
|
||||
else
|
||||
HWR_DrawMD2(spr);
|
||||
{
|
||||
if (md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f)
|
||||
HWR_DrawSprite(spr);
|
||||
else
|
||||
HWR_DrawMD2(spr);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if constexpr (Type == DrawSpritesType::kSprites)
|
||||
{
|
||||
if (md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f)
|
||||
HWR_DrawSprite(spr);
|
||||
else
|
||||
HWR_DrawMD2(spr);
|
||||
HWR_DrawSprite(spr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// HWR_AddSprites
|
||||
@@ -4666,8 +4675,6 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||
if (interp.spritexscale < 1 || interp.spriteyscale < 1)
|
||||
return;
|
||||
|
||||
const boolean papersprite = (thing->frame & FF_PAPERSPRITE);
|
||||
|
||||
INT32 blendmode;
|
||||
if (thing->frame & FF_BLENDMASK)
|
||||
blendmode = ((thing->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
|
||||
@@ -4681,6 +4688,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||
return;
|
||||
}
|
||||
|
||||
const boolean papersprite = (thing->frame & FF_PAPERSPRITE);
|
||||
|
||||
// transform the origin point
|
||||
tr_x = FixedToFloat(interp.x);
|
||||
tr_y = FixedToFloat(interp.y);
|
||||
@@ -4708,12 +4717,6 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||
|
||||
rot = (thing->frame & FF_FRAMEMASK);
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
// determine here if sprite should rotate for optimization
|
||||
const boolean sliprollrotate = (cv_sliptideroll.value && (thing->player && thing->player->sliproll));
|
||||
const boolean shouldrotate = (interp.sloperoll || interp.slopepitch || interp.roll || interp.pitch || thing->rollangle || sliprollrotate);
|
||||
#endif
|
||||
|
||||
//Fab : 02-08-98: 'skin' override spritedef currently used for skin
|
||||
if ((thing->skin || thing->localskin) && thing->sprite == SPR_PLAY)
|
||||
{
|
||||
@@ -4752,6 +4755,12 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||
I_Error("sprframes NULL for sprite %d\n", thing->sprite);
|
||||
#endif
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
// determine here if sprite should rotate for optimization
|
||||
const boolean sliprollrotate = (cv_sliptideroll.value && (thing->player && thing->player->sliproll));
|
||||
const boolean shouldrotate = (interp.sloperoll || interp.slopepitch || interp.roll || interp.pitch || thing->rollangle || sliprollrotate);
|
||||
#endif
|
||||
|
||||
if (sprframe->rotate != SRF_SINGLE || papersprite
|
||||
#ifdef ROTSPRITE
|
||||
|| (shouldrotate)
|
||||
@@ -5195,13 +5204,13 @@ void HWR_BuildSkyDome(void)
|
||||
{
|
||||
int c, r;
|
||||
signed char yflip;
|
||||
int row_count = 4;
|
||||
static constexpr int row_count = 4;
|
||||
int col_count = 4;
|
||||
float delta;
|
||||
|
||||
gl_sky_t *sky = &gl_sky;
|
||||
gl_skyvertex_t *vertex_p;
|
||||
texture_t *texture = textures[texturetranslation[skytexture]];
|
||||
const texture_t *texture = textures[texturetranslation[skytexture]];
|
||||
|
||||
sky->detail = 16;
|
||||
col_count *= sky->detail;
|
||||
@@ -5410,7 +5419,7 @@ void HWR_SetTransform(float fpov)
|
||||
|
||||
void HWR_ClearClipper(void)
|
||||
{
|
||||
angle_t a1 = gld_FrustumAngle(gl_aimingangle);
|
||||
const angle_t a1 = gld_FrustumAngle(gl_aimingangle);
|
||||
gld_clipper_Clear();
|
||||
gld_clipper_SafeAddClipRange(viewangle + a1, viewangle - a1);
|
||||
#ifdef HAVE_SPHEREFRUSTRUM
|
||||
@@ -5563,10 +5572,10 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, player_t *player, int stencil_
|
||||
HWR_SortVisSprites();
|
||||
PS_STOP_TIMING(ps_hw_spritesorttime);
|
||||
PS_START_TIMING(ps_hw_spritedrawtime);
|
||||
if (LIKELY(!cv_glmdls.value))
|
||||
HWR_DrawSprites();
|
||||
if (UNLIKELY(cv_glmdls.value))
|
||||
HWR_DrawSprites<DrawSpritesType::kModels>();
|
||||
else
|
||||
HWR_DrawModels();
|
||||
HWR_DrawSprites<DrawSpritesType::kSprites>();
|
||||
PS_STOP_TIMING(ps_hw_spritedrawtime);
|
||||
|
||||
ps_numdrawnodes.value.i = 0;
|
||||
@@ -5716,6 +5725,8 @@ void HWR_RenderPlayerView(void)
|
||||
HWR_RenderFrame(player, false);
|
||||
}
|
||||
|
||||
// Determine on mapload if current map has any Horizonlines present
|
||||
// so we can avoid rather hot checks in HWR_Subsector
|
||||
static void HWR_CheckForHorizonLines(void)
|
||||
{
|
||||
size_t i;
|
||||
@@ -5969,7 +5980,7 @@ void HWR_Shutdown(void)
|
||||
static void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap)
|
||||
{
|
||||
FBITFIELD blendmode = blend;
|
||||
UINT8 alpha = pSurf->PolyColor.s.alpha; // retain the alpha
|
||||
const UINT8 alpha = pSurf->PolyColor.s.alpha; // retain the alpha
|
||||
|
||||
INT32 shader = SHADER_NONE;
|
||||
|
||||
|
||||
@@ -1227,6 +1227,9 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
Surf.PolyFlags = HWR_GetBlendModeFlag(blendmode);
|
||||
}
|
||||
|
||||
if (cv_playerfade.value && spr->mobj->player)
|
||||
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
|
||||
|
||||
// dont forget to enabled the depth test because we can't do this like
|
||||
// before: polygons models are not sorted
|
||||
|
||||
@@ -1241,7 +1244,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
else
|
||||
{
|
||||
md2s = md2_playermodels;
|
||||
skinnum = (skin_t *)spr->mobj->localskin - skins;
|
||||
skinnum = (skin_t *)spr->mobj->localskin - skins;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1266,6 +1269,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
|
||||
if (md2->error)
|
||||
return; // we already failed loading this before :(
|
||||
|
||||
if (!md2->model)
|
||||
{
|
||||
CONS_Debug(DBG_RENDER, "Loading model... (%s, %s)", sprnames[spr->mobj->sprite], md2->filename);
|
||||
@@ -1284,6 +1288,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Hurdler: arf, I don't like that implementation at all... too much crappy
|
||||
gpatch = md2->glpatch;
|
||||
if (gpatch)
|
||||
|
||||
@@ -132,7 +132,7 @@ void HWR_PortalFrame(gl_portal_t* portal)
|
||||
{
|
||||
portalclipline = NULL;
|
||||
portalcullsector = NULL;
|
||||
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
||||
viewsector = R_PointInSubsectorFast(viewx, viewy)->sector;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -689,7 +689,7 @@ typedef enum
|
||||
gluniform_leveltime,
|
||||
|
||||
gluniform_scr_resolution,
|
||||
|
||||
|
||||
gluniform_max,
|
||||
} gluniform_t;
|
||||
|
||||
@@ -1729,6 +1729,114 @@ static void GL_AllocTextureBuffer(GLMipmap_t *pTexInfo)
|
||||
}
|
||||
}
|
||||
|
||||
#define PADDING_CHECK(offset, alphaCheck) { from = to + (offset); if ((alphaCheck)) from = NULL; else goto foundFrom; }
|
||||
|
||||
static void PadRGBABitmap(RGBA_t *tex, UINT16 w, UINT16 h)
|
||||
{
|
||||
INT32 i;
|
||||
boolean notLeft, notRight, notTop, notBottom;
|
||||
RGBA_t *to = tex - 1, *from;
|
||||
|
||||
for (i = 0; i < w * h; i++)
|
||||
{
|
||||
to++;
|
||||
if (to->rgba != 0)
|
||||
continue;
|
||||
from = NULL;
|
||||
|
||||
notLeft = i % w != 0;
|
||||
notRight = i % w != w - 1;
|
||||
notTop = i / w != 0;
|
||||
notBottom = i / w != h - 1;
|
||||
|
||||
if (notRight) PADDING_CHECK(1, from->s.alpha == 0) // Check +X
|
||||
if (notBottom) PADDING_CHECK(w, from->s.alpha == 0) // Check +Y
|
||||
if (notLeft) PADDING_CHECK(-1, from->s.alpha == 0) // Check -X
|
||||
if (notTop) PADDING_CHECK(-w, from->s.alpha == 0) // Check -Y
|
||||
if (notRight && notBottom) PADDING_CHECK(1 + w, from->s.alpha == 0) // Check +X+Y
|
||||
if (notLeft && notBottom) PADDING_CHECK(-1 + w, from->s.alpha == 0) // Check -X+Y
|
||||
if (notLeft && notTop) PADDING_CHECK(-1 - w, from->s.alpha == 0) // Check -X-Y
|
||||
if (notRight && notTop) PADDING_CHECK(1 - w, from->s.alpha == 0) // Check +X-Y
|
||||
|
||||
foundFrom:
|
||||
if (from != NULL)
|
||||
{
|
||||
*to = *from;
|
||||
to->s.alpha = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#undef PADDING_CHECK
|
||||
|
||||
static void GenerateMipmaps(INT32 w, INT32 h, RGBA_t *tex, INT32 maxLOD)
|
||||
{
|
||||
if (tex == NULL)
|
||||
{
|
||||
GL_MSG_Warning("GenerateMipmaps: attempted to generate mipmaps without texture data");
|
||||
return;
|
||||
}
|
||||
|
||||
RGBA_t samplePoint[4];
|
||||
boolean padTexture;
|
||||
INT32 pointsSampled = 0;
|
||||
INT32 m, j, i, p;
|
||||
UINT16 sumR, sumG, sumB, sumA;
|
||||
|
||||
for (m = 0; m < maxLOD; m++)
|
||||
{
|
||||
if (w <= 1 || h <= 1)
|
||||
return;
|
||||
|
||||
padTexture = false;
|
||||
|
||||
for (j = 0; j < h / 2; j++)
|
||||
{
|
||||
for (i = 0; i < w / 2; i++)
|
||||
{
|
||||
samplePoint[0] = tex[w*j*2 + i*2];
|
||||
samplePoint[1] = tex[w*j*2 + i*2+1];
|
||||
samplePoint[2] = tex[w*(j*2+1) + i*2];
|
||||
samplePoint[3] = tex[w*(j*2+1) + i*2+1];
|
||||
|
||||
pointsSampled = sumR = sumG = sumB = sumA = 0;
|
||||
|
||||
for (p = 0; p < 4; p++)
|
||||
{
|
||||
if (samplePoint[p].s.alpha == 0)
|
||||
continue;
|
||||
sumR += samplePoint[p].s.red;
|
||||
sumG += samplePoint[p].s.green;
|
||||
sumB += samplePoint[p].s.blue;
|
||||
sumA += samplePoint[p].s.alpha;
|
||||
pointsSampled++;
|
||||
}
|
||||
|
||||
if (pointsSampled > 0)
|
||||
{
|
||||
tex[(w/2)*j+i].s.red = sumR / pointsSampled;
|
||||
tex[(w/2)*j+i].s.green = sumG / pointsSampled;
|
||||
tex[(w/2)*j+i].s.blue = sumB / pointsSampled;
|
||||
tex[(w/2)*j+i].s.alpha = sumA / pointsSampled;
|
||||
}
|
||||
else
|
||||
{
|
||||
tex[(w/2)*j+i].rgba = 0;
|
||||
padTexture = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
w /= 2;
|
||||
h /= 2;
|
||||
|
||||
if (padTexture)
|
||||
PadRGBABitmap(tex, w, h);
|
||||
|
||||
pglTexSubImage2D(GL_TEXTURE_2D, m + 1, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, tex);
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
// UpdateTexture : Updates texture data.
|
||||
// -----------------+
|
||||
@@ -1737,6 +1845,7 @@ void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
// Upload a texture
|
||||
GLuint num = pTexInfo->downloaded;
|
||||
boolean update = true;
|
||||
const boolean applyPadding = mag_filter == GL_LINEAR || min_filter == GL_LINEAR;
|
||||
|
||||
INT32 w = pTexInfo->width, h = pTexInfo->height;
|
||||
INT32 i, j;
|
||||
@@ -1795,15 +1904,32 @@ void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
pImgData++;
|
||||
}
|
||||
}
|
||||
|
||||
if (applyPadding)
|
||||
PadRGBABitmap(tex, w, h);
|
||||
|
||||
break;
|
||||
case GL_TEXFMT_RGBA:
|
||||
// Directly upload the texture data without any kind of conversion.
|
||||
ptex = pImgData;
|
||||
|
||||
// However, it does need to be copied to a buffer for generating mipmaps and padding
|
||||
if (MipMap || applyPadding)
|
||||
{
|
||||
GL_AllocTextureBuffer(pTexInfo);
|
||||
tex = textureBuffer;
|
||||
memcpy(tex, ptex, w * h * 4);
|
||||
ptex = tex;
|
||||
|
||||
if (applyPadding)
|
||||
PadRGBABitmap(tex, w, h);
|
||||
}
|
||||
|
||||
break;
|
||||
case GL_TEXFMT_ALPHA_INTENSITY_88:
|
||||
GL_AllocTextureBuffer(pTexInfo);
|
||||
ptex = tex = textureBuffer;
|
||||
texformat = GL_LUMINANCE_ALPHA;
|
||||
texformat = GL_RGBA;
|
||||
|
||||
for (idx = 0, j = 0; j < h; j++)
|
||||
{
|
||||
@@ -1821,7 +1947,7 @@ void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
case GL_TEXFMT_ALPHA_8: // Used for fade masks
|
||||
GL_AllocTextureBuffer(pTexInfo);
|
||||
ptex = tex = textureBuffer;
|
||||
texformat = GL_ALPHA;
|
||||
texformat = GL_RGBA;
|
||||
|
||||
memset(&tex->s, 255, sizeof(byteColor_t)*w*h); // 255 because the fade mask is modulated with the screen texture, so alpha affects it while the colours don't
|
||||
|
||||
@@ -1857,8 +1983,6 @@ void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
|
||||
if (MipMap && !transparent) // No mipmaps on transparent stuff
|
||||
{
|
||||
int maxlod = (texformat == GL_LUMINANCE_ALPHA || texformat == GL_ALPHA) ? 4 : 5;
|
||||
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||
|
||||
if (update)
|
||||
@@ -1868,7 +1992,8 @@ void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
|
||||
// Control the mipmap level of detail
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, maxlod);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 5);
|
||||
GenerateMipmaps(w, h, tex, 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1892,7 +2017,6 @@ void GL_UpdateTexture(GLMipmap_t *pTexInfo)
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropic_filter);
|
||||
}
|
||||
|
||||
|
||||
// -----------------+
|
||||
// SetTexture : The mipmap becomes the current texture source
|
||||
// -----------------+
|
||||
@@ -2735,7 +2859,7 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics
|
||||
poly.green = byte2float[Surface->PolyColor.s.green];
|
||||
poly.blue = byte2float[Surface->PolyColor.s.blue];
|
||||
poly.alpha = byte2float[Surface->PolyColor.s.alpha];
|
||||
|
||||
|
||||
pglColor4ubv((GLubyte*)&Surface->PolyColor.s);
|
||||
|
||||
GL_SetBlend(((poly.alpha < 1) ? Surface->PolyFlags : (PF_Masked|PF_Occlude))|PF_Modulated);
|
||||
@@ -2749,7 +2873,7 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics
|
||||
fade.green = byte2float[Surface->FadeColor.s.green];
|
||||
fade.blue = byte2float[Surface->FadeColor.s.blue];
|
||||
fade.alpha = byte2float[Surface->FadeColor.s.alpha];
|
||||
|
||||
|
||||
if (Surface->LightTableId && Surface->LightTableId != lt_downloaded)
|
||||
{
|
||||
pglActiveTexture(GL_TEXTURE2);
|
||||
|
||||
+40
-10
@@ -310,7 +310,7 @@ void HU_LoadGraphics(void)
|
||||
lt_font[0] = (patch_t *)W_CachePatchName("LTFNT039", PU_HUDGFX); /// \note fake start hack
|
||||
|
||||
// Number support
|
||||
lt_font[9] = (patch_t *)W_CachePatchName("LTFNT048", PU_HUDGFX);
|
||||
lt_font[9] = (patch_t *)W_CachePatchName("LTFNT048", PU_HUDGFX);
|
||||
lt_font[10] = (patch_t *)W_CachePatchName("LTFNT049", PU_HUDGFX);
|
||||
lt_font[11] = (patch_t *)W_CachePatchName("LTFNT050", PU_HUDGFX);
|
||||
lt_font[12] = (patch_t *)W_CachePatchName("LTFNT051", PU_HUDGFX);
|
||||
@@ -701,7 +701,7 @@ static void Command_Sayto_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
target = nametonum(COM_Argv(1));
|
||||
target = D_LookupPlayer(COM_Argv(1));
|
||||
if (target == -1)
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("No player with that name!\n"));
|
||||
@@ -747,7 +747,7 @@ static void Command_CSay_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if(!server && !IsPlayerAdmin(consoleplayer))
|
||||
if (!server && !IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Only servers and admins can use csay.\n"));
|
||||
return;
|
||||
@@ -949,6 +949,9 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||
else
|
||||
stop_spamming[playernum] = 4; // you can hold off for 4 tics, can you?
|
||||
|
||||
if (player_muted[playernum])
|
||||
spam_eatmsg = 1; // Let lua know we're skipping this message
|
||||
|
||||
// run the lua hook even if we were supposed to eat the msg, netgame consistency goes first.
|
||||
|
||||
if (LUA_HookPlayerMsg(playernum, target, flags, msg, spam_eatmsg))
|
||||
@@ -1179,6 +1182,23 @@ static boolean HU_clearChatSpaces(void)
|
||||
return nothingbutspaces;
|
||||
}
|
||||
|
||||
static void DoMute(const char *name)
|
||||
{
|
||||
INT32 pnum = D_LookupPlayer(name);
|
||||
|
||||
if (pnum < 0)
|
||||
{
|
||||
HU_AddChatText("\x85""ERROR: \x80Player not found.", false);
|
||||
return;
|
||||
}
|
||||
|
||||
player_muted[pnum] = !player_muted[pnum];
|
||||
|
||||
HU_AddChatText(va("Player '%s' has been %smuted.", player_names[pnum], player_muted[pnum] ? "" : "un"), false);
|
||||
if (player_muted[pnum])
|
||||
HU_AddChatText("Use same command to unmute them.", false);
|
||||
}
|
||||
|
||||
static void HU_SendChatMessage(void)
|
||||
{
|
||||
char buf[2 + HU_MAXMSGLEN + 1];
|
||||
@@ -1205,7 +1225,19 @@ static void HU_SendChatMessage(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm
|
||||
size_t len = strlen(msg);
|
||||
|
||||
if (len >= 5 && strnicmp(msg, "/mute", 5) == 0) // Used /mute
|
||||
{
|
||||
if (len > 6)
|
||||
DoMute(msg+6);
|
||||
else
|
||||
HU_AddChatText("\x82NOTICE: \x80Usage: /mute <name|node>", false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (len > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm
|
||||
{
|
||||
INT32 spc = 1; // used if nodenum[1] is a space.
|
||||
char *nodenum = (char*) malloc(3);
|
||||
@@ -2849,13 +2881,11 @@ void HU_DoCEcho(const char *msg)
|
||||
*p = '\n';
|
||||
|
||||
CONS_Printf("%s\n", temp);
|
||||
|
||||
return;
|
||||
}
|
||||
else if (cv_cechotoggle.value)
|
||||
cechotimer = cechoduration;
|
||||
|
||||
I_OutputMsg("%s\n", msg); // print to log
|
||||
|
||||
if (!cv_cechotoggle.value)
|
||||
return;
|
||||
|
||||
cechotimer = cechoduration;
|
||||
I_OutputMsg("%s\n", msg); // ALWAYS print to log
|
||||
}
|
||||
+1
-7
@@ -1475,13 +1475,7 @@ static void AddBannedIndex(void)
|
||||
banned_size *= 2;
|
||||
}
|
||||
|
||||
banned = Z_ReallocAlign(
|
||||
(void*) banned,
|
||||
sizeof(banned_t) * banned_size,
|
||||
PU_STATIC,
|
||||
NULL,
|
||||
sizeof(banned_t) * 8
|
||||
);
|
||||
banned = Z_Realloc((void*) banned, sizeof(banned_t) * banned_size, PU_STATIC, NULL);
|
||||
}
|
||||
|
||||
numbans++;
|
||||
|
||||
@@ -145,6 +145,8 @@ boolean I_UseNativeKeyboard(void);
|
||||
|
||||
boolean I_CheckNativeRes(void);
|
||||
|
||||
void I_SetBorderlessWindow(void);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
|
||||
void RefreshOGLSDLSurface(void);
|
||||
|
||||
+2660
-2717
File diff suppressed because it is too large.
Load diff
+202
-205
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
actionf_t action; ///< Function pointer corresponding to the actual action.
|
||||
actionf_p1 action; ///< Function pointer corresponding to the actual action.
|
||||
const char *name; ///< Name of the action in ALL CAPS.
|
||||
} actionpointer_t;
|
||||
|
||||
@@ -246,209 +246,206 @@ struct mobj_s;
|
||||
|
||||
// IMPORTANT NOTE: If you add/remove from this list of action
|
||||
// functions, don't forget to update them in dehacked.c!
|
||||
void A_Explode(struct mobj_s *actor);
|
||||
void A_Pain(struct mobj_s *actor);
|
||||
void A_Fall(struct mobj_s *actor);
|
||||
void A_MonitorPop(struct mobj_s *actor);
|
||||
void A_Look(struct mobj_s *actor);
|
||||
void A_Chase(struct mobj_s *actor);
|
||||
void A_FaceStabChase(struct mobj_s *actor);
|
||||
void A_FaceTarget(struct mobj_s *actor);
|
||||
void A_FaceTracer(struct mobj_s *actor);
|
||||
void A_Scream(struct mobj_s *actor);
|
||||
void A_BossDeath(struct mobj_s *actor);
|
||||
void A_CustomPower(struct mobj_s *actor); // Use this for a custom power
|
||||
void A_GiveWeapon(struct mobj_s *actor); // Gives the player weapon(s)
|
||||
void A_JumpShield(struct mobj_s *actor); // Obtained Jump Shield
|
||||
void A_RingShield(struct mobj_s *actor); // Obtained Ring Shield
|
||||
void A_RingBox(struct mobj_s *actor); // Obtained Ring Box Tails
|
||||
void A_Invincibility(struct mobj_s *actor); // Obtained Invincibility Box
|
||||
void A_SuperSneakers(struct mobj_s *actor); // Obtained Super Sneakers Box
|
||||
void A_BunnyHop(struct mobj_s *actor); // have bunny hop tails
|
||||
void A_BubbleSpawn(struct mobj_s *actor); // Randomly spawn bubbles
|
||||
void A_FanBubbleSpawn(struct mobj_s *actor);
|
||||
void A_BubbleRise(struct mobj_s *actor); // Bubbles float to surface
|
||||
void A_BubbleCheck(struct mobj_s *actor); // Don't draw if not underwater
|
||||
void A_AwardScore(struct mobj_s *actor);
|
||||
void A_ExtraLife(struct mobj_s *actor); // Extra Life
|
||||
void A_BombShield(struct mobj_s *actor); // Obtained Bomb Shield
|
||||
void A_WaterShield(struct mobj_s *actor); // Obtained Water Shield
|
||||
void A_ForceShield(struct mobj_s *actor); // Obtained Force Shield
|
||||
void A_PityShield(struct mobj_s *actor); // Obtained Pity Shield. We're... sorry.
|
||||
void A_GravityBox(struct mobj_s *actor);
|
||||
void A_ScoreRise(struct mobj_s *actor); // Rise the score logo
|
||||
void A_ParticleSpawn(struct mobj_s *actor);
|
||||
void A_AttractChase(struct mobj_s *actor); // Ring Chase
|
||||
void A_DropMine(struct mobj_s *actor); // Drop Mine from Skim or Jetty-Syn Bomber
|
||||
void A_FishJump(struct mobj_s *actor); // Fish Jump
|
||||
void A_ThrownRing(struct mobj_s *actor); // Sparkle trail for red ring
|
||||
void A_GrenadeRing(struct mobj_s *actor); // SRB2kart
|
||||
void A_SetSolidSteam(struct mobj_s *actor);
|
||||
void A_UnsetSolidSteam(struct mobj_s *actor);
|
||||
void A_SignPlayer(struct mobj_s *actor);
|
||||
void A_OverlayThink(struct mobj_s *actor);
|
||||
void A_JetChase(struct mobj_s *actor);
|
||||
void A_JetbThink(struct mobj_s *actor); // Jetty-Syn Bomber Thinker
|
||||
void A_JetgThink(struct mobj_s *actor); // Jetty-Syn Gunner Thinker
|
||||
void A_JetgShoot(struct mobj_s *actor); // Jetty-Syn Shoot Function
|
||||
void A_ShootBullet(struct mobj_s *actor); // JetgShoot without reactiontime setting
|
||||
void A_MinusDigging(struct mobj_s *actor);
|
||||
void A_MinusPopup(struct mobj_s *actor);
|
||||
void A_MinusCheck(struct mobj_s *actor);
|
||||
void A_ChickenCheck(struct mobj_s *actor);
|
||||
void A_MouseThink(struct mobj_s *actor); // Mouse Thinker
|
||||
void A_DetonChase(struct mobj_s *actor); // Deton Chaser
|
||||
void A_CapeChase(struct mobj_s *actor); // Fake little Super Sonic cape
|
||||
void A_RotateSpikeBall(struct mobj_s *actor); // Spike ball rotation
|
||||
void A_SlingAppear(struct mobj_s *actor);
|
||||
void A_MaceRotate(struct mobj_s *actor);
|
||||
void A_UnidusBall(struct mobj_s *actor);
|
||||
void A_RockSpawn(struct mobj_s *actor);
|
||||
void A_SetFuse(struct mobj_s *actor);
|
||||
void A_CrawlaCommanderThink(struct mobj_s *actor); // Crawla Commander
|
||||
void A_SmokeTrailer(struct mobj_s *actor);
|
||||
void A_RingExplode(struct mobj_s *actor);
|
||||
void A_OldRingExplode(struct mobj_s *actor);
|
||||
void A_MixUp(struct mobj_s *actor);
|
||||
void A_RecyclePowers(struct mobj_s *actor);
|
||||
void A_BossScream(struct mobj_s *actor);
|
||||
void A_Boss2TakeDamage(struct mobj_s *actor);
|
||||
void A_GoopSplat(struct mobj_s *actor);
|
||||
void A_Boss2PogoSFX(struct mobj_s *actor);
|
||||
void A_Boss2PogoTarget(struct mobj_s *actor);
|
||||
void A_EggmanBox(struct mobj_s *actor);
|
||||
void A_TurretFire(struct mobj_s *actor);
|
||||
void A_SuperTurretFire(struct mobj_s *actor);
|
||||
void A_TurretStop(struct mobj_s *actor);
|
||||
void A_JetJawRoam(struct mobj_s *actor);
|
||||
void A_JetJawChomp(struct mobj_s *actor);
|
||||
void A_PointyThink(struct mobj_s *actor);
|
||||
void A_CheckBuddy(struct mobj_s *actor);
|
||||
void A_HoodThink(struct mobj_s *actor);
|
||||
void A_ArrowCheck(struct mobj_s *actor);
|
||||
void A_SnailerThink(struct mobj_s *actor);
|
||||
void A_SharpChase(struct mobj_s *actor);
|
||||
void A_SharpSpin(struct mobj_s *actor);
|
||||
void A_VultureVtol(struct mobj_s *actor);
|
||||
void A_VultureCheck(struct mobj_s *actor);
|
||||
void A_SkimChase(struct mobj_s *actor);
|
||||
void A_SkullAttack(struct mobj_s *actor);
|
||||
void A_LobShot(struct mobj_s *actor);
|
||||
void A_FireShot(struct mobj_s *actor);
|
||||
void A_SuperFireShot(struct mobj_s *actor);
|
||||
void A_BossFireShot(struct mobj_s *actor);
|
||||
void A_Boss7FireMissiles(struct mobj_s *actor);
|
||||
void A_Boss1Laser(struct mobj_s *actor);
|
||||
void A_FocusTarget(struct mobj_s *actor);
|
||||
void A_Boss4Reverse(struct mobj_s *actor);
|
||||
void A_Boss4SpeedUp(struct mobj_s *actor);
|
||||
void A_Boss4Raise(struct mobj_s *actor);
|
||||
void A_SparkFollow(struct mobj_s *actor);
|
||||
void A_BuzzFly(struct mobj_s *actor);
|
||||
void A_GuardChase(struct mobj_s *actor);
|
||||
void A_EggShield(struct mobj_s *actor);
|
||||
void A_SetReactionTime(struct mobj_s *actor);
|
||||
void A_Boss1Spikeballs(struct mobj_s *actor);
|
||||
void A_Boss3TakeDamage(struct mobj_s *actor);
|
||||
void A_Boss3Path(struct mobj_s *actor);
|
||||
void A_LinedefExecute(struct mobj_s *actor);
|
||||
void A_PlaySeeSound(struct mobj_s *actor);
|
||||
void A_PlayAttackSound(struct mobj_s *actor);
|
||||
void A_PlayActiveSound(struct mobj_s *actor);
|
||||
void A_1upThinker(struct mobj_s *actor);
|
||||
void A_BossZoom(struct mobj_s *actor); //Unused
|
||||
void A_Boss1Chase(struct mobj_s *actor);
|
||||
void A_Boss2Chase(struct mobj_s *actor);
|
||||
void A_Boss2Pogo(struct mobj_s *actor);
|
||||
void A_Boss7Chase(struct mobj_s *actor);
|
||||
void A_BossJetFume(struct mobj_s *actor);
|
||||
void A_SpawnObjectAbsolute(struct mobj_s *actor);
|
||||
void A_SpawnObjectRelative(struct mobj_s *actor);
|
||||
void A_ChangeAngleRelative(struct mobj_s *actor);
|
||||
void A_ChangeAngleAbsolute(struct mobj_s *actor);
|
||||
void A_RollAngle(struct mobj_s *actor);
|
||||
void A_ChangeRollAngleRelative(struct mobj_s *actor);
|
||||
void A_ChangeRollAngleAbsolute(struct mobj_s *actor);
|
||||
void A_PlaySound(struct mobj_s *actor);
|
||||
void A_FindTarget(struct mobj_s *actor);
|
||||
void A_FindTracer(struct mobj_s *actor);
|
||||
void A_SetTics(struct mobj_s *actor);
|
||||
void A_SetRandomTics(struct mobj_s *actor);
|
||||
void A_ChangeColorRelative(struct mobj_s *actor);
|
||||
void A_ChangeColorAbsolute(struct mobj_s *actor);
|
||||
void A_MoveRelative(struct mobj_s *actor);
|
||||
void A_MoveAbsolute(struct mobj_s *actor);
|
||||
void A_Thrust(struct mobj_s *actor);
|
||||
void A_ZThrust(struct mobj_s *actor);
|
||||
void A_SetTargetsTarget(struct mobj_s *actor);
|
||||
void A_SetObjectFlags(struct mobj_s *actor);
|
||||
void A_SetObjectFlags2(struct mobj_s *actor);
|
||||
void A_RandomState(struct mobj_s *actor);
|
||||
void A_RandomStateRange(struct mobj_s *actor);
|
||||
void A_DualAction(struct mobj_s *actor);
|
||||
void A_RemoteAction(struct mobj_s *actor);
|
||||
void A_ToggleFlameJet(struct mobj_s *actor);
|
||||
void A_ItemPop(struct mobj_s *actor); // SRB2kart
|
||||
void A_JawzChase(struct mobj_s *actor); // SRB2kart
|
||||
void A_JawzExplode(struct mobj_s *actor); // SRB2kart
|
||||
void A_SPBChase(struct mobj_s *actor); // SRB2kart
|
||||
void A_MineExplode(struct mobj_s *actor); // SRB2kart
|
||||
void A_BallhogExplode(struct mobj_s *actor); // SRB2kart
|
||||
void A_LightningFollowPlayer(struct mobj_s *actor); // SRB2kart: Lightning shield effect player chasing
|
||||
void A_FZBoomFlash(struct mobj_s *actor); // SRB2kart
|
||||
void A_FZBoomSmoke(struct mobj_s *actor); // SRB2kart
|
||||
void A_RandomShadowFrame(struct mobj_s *actor); //SRB2kart: Shadow spawner frame randomizer
|
||||
void A_RoamingShadowThinker(struct mobj_s *actor); // SRB2kart: Roaming Shadow moving + attacking players.
|
||||
void A_MayonakaArrow(struct mobj_s *actor); //SRB2kart: midnight channel arrow sign
|
||||
void A_ReaperThinker(struct mobj_s *actor); //SRB2kart: mementos reaper
|
||||
void A_MementosTPParticles(struct mobj_s *actor); //SRB2kart: mementos teleporter particles. Man that's a lot of actions for my shite.
|
||||
void A_FlameParticle(struct mobj_s *actor); // SRB2kart
|
||||
void A_OrbitNights(struct mobj_s *actor);
|
||||
void A_GhostMe(struct mobj_s *actor);
|
||||
void A_SetObjectState(struct mobj_s *actor);
|
||||
void A_SetObjectTypeState(struct mobj_s *actor);
|
||||
void A_KnockBack(struct mobj_s *actor);
|
||||
void A_PushAway(struct mobj_s *actor);
|
||||
void A_RingDrain(struct mobj_s *actor);
|
||||
void A_SplitShot(struct mobj_s *actor);
|
||||
void A_MissileSplit(struct mobj_s *actor);
|
||||
void A_MultiShot(struct mobj_s *actor);
|
||||
void A_InstaLoop(struct mobj_s *actor);
|
||||
void A_Custom3DRotate(struct mobj_s *actor);
|
||||
void A_SearchForPlayers(struct mobj_s *actor);
|
||||
void A_CheckRandom(struct mobj_s *actor);
|
||||
void A_CheckTargetRings(struct mobj_s *actor);
|
||||
void A_CheckRings(struct mobj_s *actor);
|
||||
void A_CheckTotalRings(struct mobj_s *actor);
|
||||
void A_CheckHealth(struct mobj_s *actor);
|
||||
void A_CheckRange(struct mobj_s *actor);
|
||||
void A_CheckHeight(struct mobj_s *actor);
|
||||
void A_CheckTrueRange(struct mobj_s *actor);
|
||||
void A_CheckThingCount(struct mobj_s *actor);
|
||||
void A_CheckAmbush(struct mobj_s *actor);
|
||||
void A_CheckCustomValue(struct mobj_s *actor);
|
||||
void A_CheckCusValMemo(struct mobj_s *actor);
|
||||
void A_SetCustomValue(struct mobj_s *actor);
|
||||
void A_UseCusValMemo(struct mobj_s *actor);
|
||||
void A_RelayCustomValue(struct mobj_s *actor);
|
||||
void A_CusValAction(struct mobj_s *actor);
|
||||
void A_ForceStop(struct mobj_s *actor);
|
||||
void A_ForceWin(struct mobj_s *actor);
|
||||
void A_SpikeRetract(struct mobj_s *actor);
|
||||
void A_InfoState(struct mobj_s *actor);
|
||||
void A_Repeat(struct mobj_s *actor);
|
||||
void A_SetScale(struct mobj_s *actor);
|
||||
void A_RemoteDamage(struct mobj_s *actor);
|
||||
void A_HomingChase(struct mobj_s *actor);
|
||||
void A_TrapShot(struct mobj_s *actor);
|
||||
void A_VileTarget(struct mobj_s *actor);
|
||||
void A_VileAttack(struct mobj_s *actor);
|
||||
void A_VileFire(struct mobj_s *actor);
|
||||
void A_BrakChase(struct mobj_s *actor);
|
||||
void A_BrakFireShot(struct mobj_s *actor);
|
||||
void A_BrakLobShot(struct mobj_s *actor);
|
||||
void A_NapalmScatter(struct mobj_s *actor);
|
||||
void A_SpawnFreshCopy(struct mobj_s *actor);
|
||||
void A_Explode(void *actor);
|
||||
void A_Pain(void *actor);
|
||||
void A_Fall(void *actor);
|
||||
void A_MonitorPop(void *actor);
|
||||
void A_Look(void *actor);
|
||||
void A_Chase(void *actor);
|
||||
void A_FaceStabChase(void *actor);
|
||||
void A_FaceTarget(void *actor);
|
||||
void A_FaceTracer(void *actor);
|
||||
void A_Scream(void *actor);
|
||||
void A_BossDeath(void *actor);
|
||||
void A_CustomPower(void *actor); // Use this for a custom power
|
||||
void A_GiveWeapon(void *actor); // Gives the player weapon(s)
|
||||
void A_JumpShield(void *actor); // Obtained Jump Shield
|
||||
void A_RingShield(void *actor); // Obtained Ring Shield
|
||||
void A_RingBox(void *actor); // Obtained Ring Box Tails
|
||||
void A_Invincibility(void *actor); // Obtained Invincibility Box
|
||||
void A_SuperSneakers(void *actor); // Obtained Super Sneakers Box
|
||||
void A_BunnyHop(void *actor); // have bunny hop tails
|
||||
void A_BubbleSpawn(void *actor); // Randomly spawn bubbles
|
||||
void A_FanBubbleSpawn(void *actor);
|
||||
void A_BubbleRise(void *actor); // Bubbles float to surface
|
||||
void A_BubbleCheck(void *actor); // Don't draw if not underwater
|
||||
void A_AwardScore(void *actor);
|
||||
void A_ExtraLife(void *actor); // Extra Life
|
||||
void A_BombShield(void *actor); // Obtained Bomb Shield
|
||||
void A_WaterShield(void *actor); // Obtained Water Shield
|
||||
void A_ForceShield(void *actor); // Obtained Force Shield
|
||||
void A_PityShield(void *actor); // Obtained Pity Shield. We're... sorry.
|
||||
void A_GravityBox(void *actor);
|
||||
void A_ScoreRise(void *actor); // Rise the score logo
|
||||
void A_ParticleSpawn(void *actor);
|
||||
void A_AttractChase(void *actor); // Ring Chase
|
||||
void A_DropMine(void *actor); // Drop Mine from Skim or Jetty-Syn Bomber
|
||||
void A_FishJump(void *actor); // Fish Jump
|
||||
void A_ThrownRing(void *actor); // Sparkle trail for red ring
|
||||
void A_GrenadeRing(void *actor); // SRB2kart
|
||||
void A_SetSolidSteam(void *actor);
|
||||
void A_UnsetSolidSteam(void *actor);
|
||||
void A_SignPlayer(void *actor);
|
||||
void A_OverlayThink(void *actor);
|
||||
void A_JetChase(void *actor);
|
||||
void A_JetbThink(void *actor); // Jetty-Syn Bomber Thinker
|
||||
void A_JetgThink(void *actor); // Jetty-Syn Gunner Thinker
|
||||
void A_JetgShoot(void *actor); // Jetty-Syn Shoot Function
|
||||
void A_ShootBullet(void *actor); // JetgShoot without reactiontime setting
|
||||
void A_MinusDigging(void *actor);
|
||||
void A_MinusPopup(void *actor);
|
||||
void A_MinusCheck(void *actor);
|
||||
void A_ChickenCheck(void *actor);
|
||||
void A_MouseThink(void *actor); // Mouse Thinker
|
||||
void A_DetonChase(void *actor); // Deton Chaser
|
||||
void A_CapeChase(void *actor); // Fake little Super Sonic cape
|
||||
void A_RotateSpikeBall(void *actor); // Spike ball rotation
|
||||
void A_SlingAppear(void *actor);
|
||||
void A_MaceRotate(void *actor);
|
||||
void A_UnidusBall(void *actor);
|
||||
void A_RockSpawn(void *actor);
|
||||
void A_SetFuse(void *actor);
|
||||
void A_CrawlaCommanderThink(void *actor); // Crawla Commander
|
||||
void A_SmokeTrailer(void *actor);
|
||||
void A_RingExplode(void *actor);
|
||||
void A_OldRingExplode(void *actor);
|
||||
void A_MixUp(void *actor);
|
||||
void A_RecyclePowers(void *actor);
|
||||
void A_BossScream(void *actor);
|
||||
void A_Boss2TakeDamage(void *actor);
|
||||
void A_GoopSplat(void *actor);
|
||||
void A_Boss2PogoSFX(void *actor);
|
||||
void A_Boss2PogoTarget(void *actor);
|
||||
void A_EggmanBox(void *actor);
|
||||
void A_TurretFire(void *actor);
|
||||
void A_SuperTurretFire(void *actor);
|
||||
void A_TurretStop(void *actor);
|
||||
void A_JetJawRoam(void *actor);
|
||||
void A_JetJawChomp(void *actor);
|
||||
void A_PointyThink(void *actor);
|
||||
void A_CheckBuddy(void *actor);
|
||||
void A_HoodThink(void *actor);
|
||||
void A_ArrowCheck(void *actor);
|
||||
void A_SnailerThink(void *actor);
|
||||
void A_SharpChase(void *actor);
|
||||
void A_SharpSpin(void *actor);
|
||||
void A_VultureVtol(void *actor);
|
||||
void A_VultureCheck(void *actor);
|
||||
void A_SkimChase(void *actor);
|
||||
void A_SkullAttack(void *actor);
|
||||
void A_LobShot(void *actor);
|
||||
void A_FireShot(void *actor);
|
||||
void A_SuperFireShot(void *actor);
|
||||
void A_BossFireShot(void *actor);
|
||||
void A_Boss7FireMissiles(void *actor);
|
||||
void A_Boss1Laser(void *actor);
|
||||
void A_FocusTarget(void *actor);
|
||||
void A_Boss4Reverse(void *actor);
|
||||
void A_Boss4SpeedUp(void *actor);
|
||||
void A_Boss4Raise(void *actor);
|
||||
void A_SparkFollow(void *actor);
|
||||
void A_BuzzFly(void *actor);
|
||||
void A_GuardChase(void *actor);
|
||||
void A_EggShield(void *actor);
|
||||
void A_SetReactionTime(void *actor);
|
||||
void A_Boss1Spikeballs(void *actor);
|
||||
void A_Boss3TakeDamage(void *actor);
|
||||
void A_Boss3Path(void *actor);
|
||||
void A_LinedefExecute(void *actor);
|
||||
void A_PlaySeeSound(void *actor);
|
||||
void A_PlayAttackSound(void *actor);
|
||||
void A_PlayActiveSound(void *actor);
|
||||
void A_1upThinker(void *actor);
|
||||
void A_BossZoom(void *actor); //Unused
|
||||
void A_Boss1Chase(void *actor);
|
||||
void A_Boss2Chase(void *actor);
|
||||
void A_Boss2Pogo(void *actor);
|
||||
void A_Boss7Chase(void *actor);
|
||||
void A_BossJetFume(void *actor);
|
||||
void A_SpawnObjectAbsolute(void *actor);
|
||||
void A_SpawnObjectRelative(void *actor);
|
||||
void A_ChangeAngleRelative(void *actor);
|
||||
void A_ChangeAngleAbsolute(void *actor);
|
||||
void A_PlaySound(void *actor);
|
||||
void A_FindTarget(void *actor);
|
||||
void A_FindTracer(void *actor);
|
||||
void A_SetTics(void *actor);
|
||||
void A_SetRandomTics(void *actor);
|
||||
void A_ChangeColorRelative(void *actor);
|
||||
void A_ChangeColorAbsolute(void *actor);
|
||||
void A_MoveRelative(void *actor);
|
||||
void A_MoveAbsolute(void *actor);
|
||||
void A_Thrust(void *actor);
|
||||
void A_ZThrust(void *actor);
|
||||
void A_SetTargetsTarget(void *actor);
|
||||
void A_SetObjectFlags(void *actor);
|
||||
void A_SetObjectFlags2(void *actor);
|
||||
void A_RandomState(void *actor);
|
||||
void A_RandomStateRange(void *actor);
|
||||
void A_DualAction(void *actor);
|
||||
void A_RemoteAction(void *actor);
|
||||
void A_ToggleFlameJet(void *actor);
|
||||
void A_ItemPop(void *actor); // SRB2kart
|
||||
void A_JawzChase(void *actor); // SRB2kart
|
||||
void A_JawzExplode(void *actor); // SRB2kart
|
||||
void A_SPBChase(void *actor); // SRB2kart
|
||||
void A_MineExplode(void *actor); // SRB2kart
|
||||
void A_BallhogExplode(void *actor); // SRB2kart
|
||||
void A_LightningFollowPlayer(void *actor); // SRB2kart: Lightning shield effect player chasing
|
||||
void A_FZBoomFlash(void *actor); // SRB2kart
|
||||
void A_FZBoomSmoke(void *actor); // SRB2kart
|
||||
void A_RandomShadowFrame(void *actor); //SRB2kart: Shadow spawner frame randomizer
|
||||
void A_RoamingShadowThinker(void *actor); // SRB2kart: Roaming Shadow moving + attacking players.
|
||||
void A_MayonakaArrow(void *actor); //SRB2kart: midnight channel arrow sign
|
||||
void A_ReaperThinker(void *actor); //SRB2kart: mementos reaper
|
||||
void A_MementosTPParticles(void *actor); //SRB2kart: mementos teleporter particles. Man that's a lot of actions for my shite.
|
||||
void A_FlameParticle(void *actor); // SRB2kart
|
||||
void A_OrbitNights(void *actor);
|
||||
void A_GhostMe(void *actor);
|
||||
void A_SetObjectState(void *actor);
|
||||
void A_SetObjectTypeState(void *actor);
|
||||
void A_KnockBack(void *actor);
|
||||
void A_PushAway(void *actor);
|
||||
void A_RingDrain(void *actor);
|
||||
void A_SplitShot(void *actor);
|
||||
void A_MissileSplit(void *actor);
|
||||
void A_MultiShot(void *actor);
|
||||
void A_InstaLoop(void *actor);
|
||||
void A_Custom3DRotate(void *actor);
|
||||
void A_SearchForPlayers(void *actor);
|
||||
void A_CheckRandom(void *actor);
|
||||
void A_CheckTargetRings(void *actor);
|
||||
void A_CheckRings(void *actor);
|
||||
void A_CheckTotalRings(void *actor);
|
||||
void A_CheckHealth(void *actor);
|
||||
void A_CheckRange(void *actor);
|
||||
void A_CheckHeight(void *actor);
|
||||
void A_CheckTrueRange(void *actor);
|
||||
void A_CheckThingCount(void *actor);
|
||||
void A_CheckAmbush(void *actor);
|
||||
void A_CheckCustomValue(void *actor);
|
||||
void A_CheckCusValMemo(void *actor);
|
||||
void A_SetCustomValue(void *actor);
|
||||
void A_UseCusValMemo(void *actor);
|
||||
void A_RelayCustomValue(void *actor);
|
||||
void A_CusValAction(void *actor);
|
||||
void A_ForceStop(void *actor);
|
||||
void A_ForceWin(void *actor);
|
||||
void A_SpikeRetract(void *actor);
|
||||
void A_InfoState(void *actor);
|
||||
void A_Repeat(void *actor);
|
||||
void A_SetScale(void *actor);
|
||||
void A_RemoteDamage(void *actor);
|
||||
void A_HomingChase(void *actor);
|
||||
void A_TrapShot(void *actor);
|
||||
void A_VileTarget(void *actor);
|
||||
void A_VileAttack(void *actor);
|
||||
void A_VileFire(void *actor);
|
||||
void A_BrakChase(void *actor);
|
||||
void A_BrakFireShot(void *actor);
|
||||
void A_BrakLobShot(void *actor);
|
||||
void A_NapalmScatter(void *actor);
|
||||
void A_SpawnFreshCopy(void *actor);
|
||||
|
||||
extern boolean actionsoverridden[NUMACTIONS];
|
||||
|
||||
@@ -4312,7 +4309,7 @@ typedef struct
|
||||
spritenum_t sprite;
|
||||
UINT32 frame; // we use the upper 16 bits for translucency and other shade effects
|
||||
INT32 tics;
|
||||
actionf_t action;
|
||||
actionf_p1 action;
|
||||
INT32 var1;
|
||||
INT32 var2;
|
||||
statenum_t nextstate;
|
||||
|
||||
+14
-3
@@ -96,8 +96,9 @@ consvar_t cv_showminimapnames = {"showminimapnames", "Off", CV_SAVE, CV_OnOff, N
|
||||
CV_PossibleValue_t minimapdot_cons_t[NUMMINIMAPDOTSTUFF];
|
||||
consvar_t cv_showminimapangle = {"showminimapangle", "Off", CV_SAVE, minimapdot_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_posanim = {"postitionanimation", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_smallposnum = {"smallpositionnumber", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t posanim_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Smooth"}, {0, NULL}};
|
||||
consvar_t cv_posanim = {"postitionanimation", "On", CV_SAVE, posanim_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_smallposnum = {"smallpositionnumber", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_showlapemblem = {"showlapemblem", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -1948,6 +1949,8 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UI
|
||||
}
|
||||
}
|
||||
|
||||
#define POS_DELAY_TIME 10
|
||||
|
||||
static void K_DrawKartPositionNum(INT32 num)
|
||||
{
|
||||
// POSI_X = BASEVIDWIDTH - 51; // 269
|
||||
@@ -1966,7 +1969,15 @@ static void K_DrawKartPositionNum(INT32 num)
|
||||
|
||||
if ((cv_posanim.value && stplyr->kartstuff[k_positiondelay]) || stplyr->exiting)
|
||||
{
|
||||
scale *= 2;
|
||||
if (cv_posanim.value == 2)
|
||||
{
|
||||
const UINT8 delay = (stplyr->exiting) ? POS_DELAY_TIME : stplyr->kartstuff[k_positiondelay];
|
||||
const fixed_t add = (scale * 3) >> ((splitscreen == 1) ? 1 : 2);
|
||||
scale = (scale + min((add * (delay * delay)) / (POS_DELAY_TIME * POS_DELAY_TIME), add));
|
||||
}
|
||||
else
|
||||
scale *= 2;
|
||||
|
||||
overtake = true; // this is used for splitscreen stuff in conjunction with flipdraw.
|
||||
}
|
||||
|
||||
|
||||
+66
-48
@@ -522,6 +522,7 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
|
||||
dest_colormap[i] = (UINT8)i;
|
||||
continue;
|
||||
}
|
||||
|
||||
color = V_GetColor(i);
|
||||
SETBRIGHTNESS(brightness, color.s.red, color.s.green, color.s.blue);
|
||||
brightdif = 256;
|
||||
@@ -2440,7 +2441,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto
|
||||
|
||||
static void K_RemoveGrowShrink(player_t *player)
|
||||
{
|
||||
if (player->mo && !P_MobjWasRemoved(player->mo))
|
||||
if (!P_MobjWasRemoved(player->mo))
|
||||
{
|
||||
if (player->kartstuff[k_growshrinktimer] > 0) // Play Shrink noise
|
||||
S_StartSound(player->mo, sfx_kc59);
|
||||
@@ -2853,7 +2854,7 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
|
||||
mobj->momy = FixedMul(FixedDiv(mobjy - y, dist), FixedDiv(dist, 6*FRACUNIT));
|
||||
mobj->momz = FixedMul(FixedDiv(mobjz - z, dist), FixedDiv(dist, 6*FRACUNIT));
|
||||
|
||||
if (source && !P_MobjWasRemoved(source))
|
||||
if (!P_MobjWasRemoved(source))
|
||||
P_SetTarget(&mobj->target, source);
|
||||
}
|
||||
}
|
||||
@@ -3081,14 +3082,12 @@ static void K_SpawnDriftSparks(player_t *player)
|
||||
if (leveltime % 2 == 1)
|
||||
return;
|
||||
|
||||
if (cv_airsparks.value)
|
||||
goto skipground;
|
||||
const boolean onground = P_IsObjectOnGround(player->mo);
|
||||
|
||||
if (!P_IsObjectOnGround(player->mo))
|
||||
// kinda sketchy
|
||||
if (!cv_airsparks.value && !onground)
|
||||
return;
|
||||
|
||||
skipground: // idk im sleepy
|
||||
|
||||
if (!player->kartstuff[k_drift] || player->kartstuff[k_driftcharge] < K_GetKartDriftSparkValue(player))
|
||||
return;
|
||||
|
||||
@@ -3105,6 +3104,8 @@ skipground: // idk im sleepy
|
||||
newy = player->mo->y + P_ReturnThrustY(player->mo, thrustangle, smolscale);
|
||||
spark = P_SpawnMobj(newx, newy, player->mo->z, MT_DRIFTSPARK);
|
||||
|
||||
spark->islocal = cv_airsparks.value && !onground;
|
||||
|
||||
P_SetTarget(&spark->target, player->mo);
|
||||
spark->angle = travelangle-(ANGLE_45/5)*player->kartstuff[k_drift];
|
||||
|
||||
@@ -3666,7 +3667,7 @@ static mobj_t *K_FindLastTrailMobj(player_t *player)
|
||||
if (!player || !(trail = player->mo) || !player->mo->hnext || !player->mo->hnext->health)
|
||||
return NULL;
|
||||
|
||||
while (trail->hnext && !P_MobjWasRemoved(trail->hnext) && trail->hnext->health)
|
||||
while (!P_MobjWasRemoved(trail->hnext) && trail->hnext->health)
|
||||
{
|
||||
trail = trail->hnext;
|
||||
}
|
||||
@@ -3903,7 +3904,7 @@ void K_PuntMine(mobj_t *thismine, mobj_t *punter)
|
||||
fixed_t spd;
|
||||
mobj_t *mine;
|
||||
|
||||
if (!thismine || P_MobjWasRemoved(thismine))
|
||||
if (P_MobjWasRemoved(thismine))
|
||||
return;
|
||||
|
||||
//This guarantees you hit a mine being dragged
|
||||
@@ -3932,7 +3933,7 @@ void K_PuntMine(mobj_t *thismine, mobj_t *punter)
|
||||
else
|
||||
mine = thismine;
|
||||
|
||||
if (!mine || P_MobjWasRemoved(mine))
|
||||
if (P_MobjWasRemoved(mine))
|
||||
return;
|
||||
|
||||
spd = K_GetProjectileSpeed();
|
||||
@@ -4099,7 +4100,8 @@ void K_DoSneaker(player_t *player, INT32 type)
|
||||
if (player->mo->hnext)
|
||||
{
|
||||
mobj_t *cur = player->mo->hnext;
|
||||
while (cur && !P_MobjWasRemoved(cur))
|
||||
|
||||
while (!P_MobjWasRemoved(cur))
|
||||
{
|
||||
if (!cur->tracer)
|
||||
{
|
||||
@@ -4163,7 +4165,7 @@ static void K_DoShrink(player_t *user)
|
||||
K_DropItems(&players[i]);
|
||||
players[i].kartstuff[k_growshrinktimer] = -(20*TICRATE);
|
||||
|
||||
if (players[i].mo && !P_MobjWasRemoved(players[i].mo))
|
||||
if (!P_MobjWasRemoved(players[i].mo))
|
||||
{
|
||||
players[i].mo->scalespeed = mapobjectscale/TICRATE;
|
||||
players[i].mo->destscale = (6*mapobjectscale)/8;
|
||||
@@ -4293,7 +4295,7 @@ void K_DropHnextList(player_t *player)
|
||||
mobjtype_t type;
|
||||
boolean orbit, ponground, dropall = true;
|
||||
|
||||
if (!work || P_MobjWasRemoved(work))
|
||||
if (P_MobjWasRemoved(work))
|
||||
return;
|
||||
|
||||
flip = P_MobjFlip(player->mo);
|
||||
@@ -4432,7 +4434,7 @@ void K_DropItems(player_t *player)
|
||||
|
||||
K_DropHnextList(player);
|
||||
|
||||
if (player->mo && !P_MobjWasRemoved(player->mo) && player->kartstuff[k_itemamount])
|
||||
if (!P_MobjWasRemoved(player->mo) && player->kartstuff[k_itemamount])
|
||||
{
|
||||
mobj_t *drop = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height/2, MT_FLOATINGITEM);
|
||||
P_SetScale(drop, drop->scale>>4);
|
||||
@@ -4461,7 +4463,7 @@ void K_DropRocketSneaker(player_t *player)
|
||||
fixed_t flingangle;
|
||||
boolean leftshoe = true; //left shoe is first
|
||||
|
||||
if (!(player->mo && !P_MobjWasRemoved(player->mo) && player->mo->hnext && !P_MobjWasRemoved(player->mo->hnext)))
|
||||
if (!(!P_MobjWasRemoved(player->mo) && player->mo->hnext && !P_MobjWasRemoved(player->mo->hnext)))
|
||||
return;
|
||||
|
||||
while ((shoe = shoe->hnext) && !P_MobjWasRemoved(shoe))
|
||||
@@ -4500,7 +4502,7 @@ void K_DropRocketSneaker(player_t *player)
|
||||
|
||||
void K_DropKitchenSink(player_t *player)
|
||||
{
|
||||
if (!(player->mo && !P_MobjWasRemoved(player->mo) && player->mo->hnext && !P_MobjWasRemoved(player->mo->hnext)))
|
||||
if (!(!P_MobjWasRemoved(player->mo) && player->mo->hnext && !P_MobjWasRemoved(player->mo->hnext)))
|
||||
return;
|
||||
|
||||
if (player->mo->hnext->type != MT_SINK_SHIELD)
|
||||
@@ -4517,13 +4519,13 @@ void K_RepairOrbitChain(mobj_t *orbit)
|
||||
mobj_t *cachenext = orbit->hnext;
|
||||
|
||||
// First, repair the chain
|
||||
if (orbit->hnext && orbit->hnext->health && !P_MobjWasRemoved(orbit->hnext))
|
||||
if (!P_MobjWasRemoved(orbit->hnext) && orbit->hnext->health)
|
||||
{
|
||||
P_SetTarget(&orbit->hnext->hprev, orbit->hprev);
|
||||
P_SetTarget(&orbit->hnext, NULL);
|
||||
}
|
||||
|
||||
if (orbit->hprev && orbit->hprev->health && !P_MobjWasRemoved(orbit->hprev))
|
||||
if (!P_MobjWasRemoved(orbit->hprev) && orbit->hprev->health)
|
||||
{
|
||||
P_SetTarget(&orbit->hprev->hnext, cachenext);
|
||||
P_SetTarget(&orbit->hprev, NULL);
|
||||
@@ -4538,7 +4540,7 @@ void K_RepairOrbitChain(mobj_t *orbit)
|
||||
mobj_t *cur = orbit->target->hnext;
|
||||
mobj_t *prev = NULL;
|
||||
|
||||
while (cur && !P_MobjWasRemoved(cur))
|
||||
while (!P_MobjWasRemoved(cur))
|
||||
{
|
||||
prev = cur;
|
||||
cur = cur->hnext;
|
||||
@@ -4600,7 +4602,7 @@ static void K_CalculateBananaSlope(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z
|
||||
//sec = R_PointInSubsector(x, y)->sector;
|
||||
|
||||
if (mobj->x != x || mobj->y != y || mobj->subsector == NULL)
|
||||
sec = R_PointInSubsector(x, y)->sector;
|
||||
sec = R_PointInSubsectorFast(x, y)->sector;
|
||||
else
|
||||
sec = mobj->subsector->sector;
|
||||
|
||||
@@ -4738,7 +4740,7 @@ static void K_MoveHeldObjects(player_t *player)
|
||||
|
||||
player->kartstuff[k_bananadrag] = 0; // Just to make sure
|
||||
|
||||
while (cur && !P_MobjWasRemoved(cur))
|
||||
while (!P_MobjWasRemoved(cur))
|
||||
{
|
||||
const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius); // mobj's distance from its Target, or Radius.
|
||||
fixed_t z;
|
||||
@@ -4816,7 +4818,7 @@ static void K_MoveHeldObjects(player_t *player)
|
||||
if (P_IsObjectOnGround(player->mo) && player->speed > 0)
|
||||
player->kartstuff[k_bananadrag]++;
|
||||
|
||||
while (cur && !P_MobjWasRemoved(cur))
|
||||
while (!P_MobjWasRemoved(cur))
|
||||
{
|
||||
const fixed_t radius = FixedHypot(targ->radius, targ->radius) + FixedHypot(cur->radius, cur->radius);
|
||||
angle_t ang;
|
||||
@@ -4844,7 +4846,7 @@ static void K_MoveHeldObjects(player_t *player)
|
||||
else
|
||||
dist = cur->extravalue1/2;
|
||||
|
||||
if (!targ || P_MobjWasRemoved(targ))
|
||||
if (P_MobjWasRemoved(targ))
|
||||
continue;
|
||||
|
||||
// Shrink your items if the player shrunk too.
|
||||
@@ -4902,7 +4904,7 @@ static void K_MoveHeldObjects(player_t *player)
|
||||
mobj_t *cur = player->mo->hnext;
|
||||
INT32 num = 0;
|
||||
|
||||
while (cur && !P_MobjWasRemoved(cur))
|
||||
while (!P_MobjWasRemoved(cur))
|
||||
{
|
||||
const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius);
|
||||
boolean vibrate = ((leveltime & 1) && !cur->tracer);
|
||||
@@ -4967,7 +4969,7 @@ static void K_MoveHeldObjects(player_t *player)
|
||||
|
||||
}
|
||||
|
||||
if (cur->tracer && !P_MobjWasRemoved(cur->tracer))
|
||||
if (!P_MobjWasRemoved(cur->tracer))
|
||||
{
|
||||
fixed_t diffx, diffy, diffz;
|
||||
|
||||
@@ -5361,6 +5363,7 @@ FUNCINLINE static ATTRINLINE void K_SpawnNormalSpeedLines(player_t *player, bool
|
||||
fast->momx = 3*player->mo->momx/4;
|
||||
fast->momy = 3*player->mo->momy/4;
|
||||
fast->momz = 3*player->mo->momz/4;
|
||||
fast->islocal = !synched;
|
||||
P_SetTarget(&fast->target, player->mo); // easier lua access
|
||||
|
||||
K_MatchGenericExtraFlags(fast, player->mo);
|
||||
@@ -5707,7 +5710,7 @@ void K_KartPlayerAfterThink(player_t *player)
|
||||
else
|
||||
targ = K_FindJawzTarget(player->mo, player);
|
||||
|
||||
if (!targ || !targ->mo || P_MobjWasRemoved(targ->mo))
|
||||
if (!targ || P_MobjWasRemoved(targ->mo))
|
||||
{
|
||||
player->kartstuff[k_lastjawztarget] = -1;
|
||||
player->kartstuff[k_jawztargetdelay] = 0;
|
||||
@@ -6062,32 +6065,47 @@ void K_KartUpdatePosition(player_t *player)
|
||||
// This checks every thing on the map, and looks for MT_BOSS3WAYPOINT (the thing we're using for checkpoint wp's, for now)
|
||||
for (mo = waypointcap; mo != NULL; mo = mo->tracer)
|
||||
{
|
||||
pmo = P_AproxDistance(P_AproxDistance( mo->x - player->mo->x,
|
||||
mo->y - player->mo->y),
|
||||
mo->z - player->mo->z) / FRACUNIT;
|
||||
imo = P_AproxDistance(P_AproxDistance( mo->x - players[i].mo->x,
|
||||
mo->y - players[i].mo->y),
|
||||
mo->z - players[i].mo->z) / FRACUNIT;
|
||||
const boolean isprevcheckpointp = mo->health == player->starpostnum;
|
||||
const boolean isnextcheckpointp = mo->health == (player->starpostnum + 1);
|
||||
|
||||
if (mo->health == player->starpostnum && (!mo->movecount || mo->movecount == player->laps+1))
|
||||
if ((isprevcheckpointp || isnextcheckpointp) && (!mo->movecount || mo->movecount == player->laps+1))
|
||||
{
|
||||
player->kartstuff[k_prevcheck] += pmo;
|
||||
ppcd++;
|
||||
pmo = P_AproxDistance(P_AproxDistance( mo->x - player->mo->x,
|
||||
mo->y - player->mo->y),
|
||||
mo->z - player->mo->z) / FRACUNIT;
|
||||
|
||||
if (isprevcheckpointp)
|
||||
{
|
||||
player->kartstuff[k_prevcheck] += pmo;
|
||||
ppcd++;
|
||||
}
|
||||
|
||||
if (isnextcheckpointp)
|
||||
{
|
||||
player->kartstuff[k_nextcheck] += pmo;
|
||||
pncd++;
|
||||
}
|
||||
}
|
||||
if (mo->health == (player->starpostnum + 1) && (!mo->movecount || mo->movecount == player->laps+1))
|
||||
|
||||
const boolean isprevcheckpointi = mo->health == players[i].starpostnum;
|
||||
const boolean isnextcheckpointi = mo->health == (players[i].starpostnum + 1);
|
||||
|
||||
if ((isprevcheckpointi || isnextcheckpointi) && (!mo->movecount || mo->movecount == players[i].laps+1))
|
||||
{
|
||||
player->kartstuff[k_nextcheck] += pmo;
|
||||
pncd++;
|
||||
}
|
||||
if (mo->health == players[i].starpostnum && (!mo->movecount || mo->movecount == players[i].laps+1))
|
||||
{
|
||||
players[i].kartstuff[k_prevcheck] += imo;
|
||||
ipcd++;
|
||||
}
|
||||
if (mo->health == (players[i].starpostnum + 1) && (!mo->movecount || mo->movecount == players[i].laps+1))
|
||||
{
|
||||
players[i].kartstuff[k_nextcheck] += imo;
|
||||
incd++;
|
||||
imo = P_AproxDistance(P_AproxDistance( mo->x - players[i].mo->x,
|
||||
mo->y - players[i].mo->y),
|
||||
mo->z - players[i].mo->z) / FRACUNIT;
|
||||
|
||||
if (isprevcheckpointi)
|
||||
{
|
||||
players[i].kartstuff[k_prevcheck] += imo;
|
||||
ipcd++;
|
||||
}
|
||||
if (isnextcheckpointi )
|
||||
{
|
||||
players[i].kartstuff[k_nextcheck] += imo;
|
||||
incd++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -181,7 +181,7 @@ static int lib_setState(lua_State *L)
|
||||
switch(lua_type(L, 3))
|
||||
{
|
||||
case LUA_TNIL: // Null? Set the action to nothing, then.
|
||||
state->action.acp1 = NULL;
|
||||
state->action = NULL;
|
||||
break;
|
||||
case LUA_TSTRING: // It's a string, expect the name of a built-in action
|
||||
LUA_SetActionByName(state, lua_tostring(L, 3));
|
||||
@@ -193,7 +193,7 @@ static int lib_setState(lua_State *L)
|
||||
lua_pushvalue(L, 3); // Bring it to the top of the stack
|
||||
lua_rawset(L, -3); // Set it in the registry
|
||||
lua_pop(L, 1); // pop LREG_STATEACTION
|
||||
state->action.acp1 = (actionf_p1)A_Lua; // Set the action for the userdata.
|
||||
state->action = (actionf_p1)A_Lua; // Set the action for the userdata.
|
||||
break;
|
||||
default: // ?!
|
||||
return luaL_typerror(L, 3, "function");
|
||||
@@ -251,7 +251,7 @@ boolean LUA_SetLuaAction(void *stv, const char *action)
|
||||
lua_pop(gL, 1); // pop LREG_STATEACTION
|
||||
|
||||
lua_pop(gL, 2); // pop the function and LREG_ACTIONS
|
||||
st->action.acp1 = (actionf_p1)A_Lua; // Set the action for the userdata.
|
||||
st->action = (actionf_p1)A_Lua; // Set the action for the userdata.
|
||||
return true; // action successfully set.
|
||||
}
|
||||
|
||||
@@ -350,9 +350,9 @@ static int state_get(lua_State *L)
|
||||
case state_action:
|
||||
{
|
||||
const char *name;
|
||||
if (!st->action.acp1) // Action is NULL.
|
||||
if (!st->action) // Action is NULL.
|
||||
return 0; // return nil.
|
||||
if (st->action.acp1 == (actionf_p1)A_Lua) { // This is a Lua function?
|
||||
if (st->action == (actionf_p1)A_Lua) { // This is a Lua function?
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, LREG_STATEACTION);
|
||||
I_Assert(lua_istable(L, -1));
|
||||
lua_pushlightuserdata(L, st); // Push the state pointer and
|
||||
@@ -428,7 +428,7 @@ static int state_set(lua_State *L)
|
||||
switch(lua_type(L, 3))
|
||||
{
|
||||
case LUA_TNIL: // Null? Set the action to nothing, then.
|
||||
st->action.acp1 = NULL;
|
||||
st->action = NULL;
|
||||
break;
|
||||
case LUA_TSTRING: // It's a string, expect the name of a built-in action
|
||||
LUA_SetActionByName(st, lua_tostring(L, 3));
|
||||
@@ -440,7 +440,7 @@ static int state_set(lua_State *L)
|
||||
lua_pushvalue(L, 3); // Bring it to the top of the stack
|
||||
lua_rawset(L, -3); // Set it in the registry
|
||||
lua_pop(L, 1); // pop LREG_STATEACTION
|
||||
st->action.acp1 = (actionf_p1)A_Lua; // Set the action for the userdata.
|
||||
st->action = (actionf_p1)A_Lua; // Set the action for the userdata.
|
||||
break;
|
||||
default: // ?!
|
||||
return luaL_typerror(L, 3, "function");
|
||||
|
||||
+1
-1
@@ -227,4 +227,4 @@ int LUA_MathLib(lua_State *L)
|
||||
lua_pushvalue(L, LUA_GLOBALSINDEX);
|
||||
luaL_register(L, NULL, lib);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -150,7 +150,8 @@ static const udata_field_t mobj_fields[] = {
|
||||
FIELD(mobj_t, cvmem, udatalib_getter_int32, udatalib_setter_int32),
|
||||
FIELD(mobj_t, standingslope, udatalib_getter_slope, mobj_standingslope_noset),
|
||||
FIELD(mobj_t, colorized, udatalib_getter_boolean, udatalib_setter_boolean),
|
||||
FIELD(mobj_t, mirrored, udatalib_getter_boolean, udatalib_setter_boolean),
|
||||
FIELD(mobj_t, mirrored, udatalib_getter_boolean, udatalib_setter_boolean),
|
||||
FIELD(mobj_t, islocal, udatalib_getter_boolean, udatalib_setter_boolean),
|
||||
{ NULL, 0, NULL, NULL },
|
||||
};
|
||||
#undef FIELD
|
||||
|
||||
+8
-5
@@ -1224,7 +1224,7 @@ void LUA_Archive(savebuffer_t *save, boolean network)
|
||||
{
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
// archive function will determine when to skip mobjs,
|
||||
@@ -1264,15 +1264,18 @@ void LUA_UnArchive(savebuffer_t *save, boolean network)
|
||||
{
|
||||
do {
|
||||
mobjnum = READUINT32(save->p); // read a mobjnum
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
if (((mobj_t *)th)->mobjnum == mobjnum) // find matching mobj
|
||||
UnArchiveExtVars(&save->p, th, network); // apply variables
|
||||
if (((mobj_t *)th)->mobjnum != mobjnum) // find matching mobj
|
||||
continue;
|
||||
UnArchiveExtVars(&save->p, th, network); // apply variables
|
||||
}
|
||||
} while(mobjnum != UINT32_MAX); // repeat until end of mobjs marker.
|
||||
|
||||
} while (mobjnum != UINT32_MAX); // repeat until end of mobjs marker.
|
||||
|
||||
LUA_HookNetArchive(NetUnArchive, save); // call the NetArchive hook in unarchive mode
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ struct iterationState {
|
||||
int next;
|
||||
};
|
||||
|
||||
static int iterationState_gc(lua_State *L)
|
||||
FUNCINLINE static ATTRINLINE int iterationState_gc(lua_State *L)
|
||||
{
|
||||
struct iterationState *it = luaL_checkudata(L, -1, META_ITERATIONSTATE);
|
||||
if (it->next != LUA_REFNIL)
|
||||
@@ -44,7 +44,7 @@ static int iterationState_gc(lua_State *L)
|
||||
}
|
||||
|
||||
#define push_thinker(th) {\
|
||||
if ((th)->function.acp1 == (actionf_p1)P_MobjThinker) \
|
||||
if ((th)->function == (actionf_p1)P_MobjThinker) \
|
||||
LUA_PushUserdata(L, (th), META_MOBJ); \
|
||||
else \
|
||||
lua_pushlightuserdata(L, (th)); \
|
||||
@@ -88,7 +88,7 @@ static int lib_iterateThinkers(lua_State *L)
|
||||
return luaL_error(L, "next thinker invalidated during iteration");
|
||||
|
||||
for (; next != &thinkercap; next = next->next)
|
||||
if (!it->filter || next->function.acp1 == it->filter)
|
||||
if (!it->filter || next->function == it->filter)
|
||||
{
|
||||
push_thinker(next);
|
||||
if (next->next != &thinkercap)
|
||||
@@ -130,4 +130,4 @@ int LUA_ThinkerLib(lua_State *L)
|
||||
lua_setfield(L, -2, "iterate");
|
||||
lua_setglobal(L, "thinkers");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -732,7 +732,7 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo = (mobj_t *)th;
|
||||
|
||||
+281
-188
@@ -107,7 +107,7 @@
|
||||
#define SMALLLINEHEIGHT 8
|
||||
#define SLIDER_RANGE 10
|
||||
#define SLIDER_WIDTH (8*SLIDER_RANGE+6)
|
||||
#define SERVERS_PER_PAGE 11
|
||||
#define SERVERS_PER_PAGE 10
|
||||
#define MAXSTAT 9 //Max number a stat can have
|
||||
|
||||
typedef enum
|
||||
@@ -183,6 +183,8 @@ static char joystickInfo[8][29];
|
||||
static UINT32 serverlistpage;
|
||||
static UINT32 oldserverlistpage;
|
||||
static float serverlistslidex;
|
||||
static INT32 serverlistsearched[MAXSERVERLIST] = {0};
|
||||
static UINT32 serverlistsearchedcount = 0;
|
||||
#endif
|
||||
|
||||
//static saveinfo_t savegameinfo[MAXSAVEGAMES]; // Extra info about the save games.
|
||||
@@ -211,6 +213,8 @@ static void M_StopMessage(INT32 choice);
|
||||
|
||||
#ifndef NONET
|
||||
static void M_HandleServerPage(INT32 choice);
|
||||
static void M_HandleServerSearch(INT32 choice);
|
||||
static void M_SearchServerList(void);
|
||||
#endif
|
||||
|
||||
// Prototyping is fun, innit?
|
||||
@@ -1110,11 +1114,11 @@ static menuitem_t MP_PlayerSetupMenu[] =
|
||||
#ifndef NONET
|
||||
static menuitem_t MP_ConnectMenu[] =
|
||||
{
|
||||
{IT_STRING | IT_CVAR, NULL, "Sort By", &cv_serversort, 4},
|
||||
{IT_STRING | IT_KEYHANDLER, NULL, "Page", M_HandleServerPage, 12},
|
||||
{IT_STRING | IT_CALL, NULL, "Refresh", M_Refresh, 20},
|
||||
{IT_STRING | IT_CVAR, NULL, "Sort By", &cv_serversort, 0},
|
||||
{IT_STRING | IT_KEYHANDLER, NULL, "Page", M_HandleServerPage, 8},
|
||||
{IT_STRING | IT_CALL, NULL, "Refresh", M_Refresh, 16},
|
||||
{IT_STRING | IT_KEYHANDLER, NULL, "", M_HandleServerSearch,25},
|
||||
|
||||
{IT_STRING | IT_SPACE, NULL, "", M_Connect, 36},
|
||||
{IT_STRING | IT_SPACE, NULL, "", M_Connect, 48},
|
||||
{IT_STRING | IT_SPACE, NULL, "", M_Connect, 60},
|
||||
{IT_STRING | IT_SPACE, NULL, "", M_Connect, 72},
|
||||
@@ -1132,6 +1136,7 @@ enum
|
||||
mp_connect_sort,
|
||||
mp_connect_page,
|
||||
mp_connect_refresh,
|
||||
mp_connect_search,
|
||||
FIRSTSERVERLINE
|
||||
};
|
||||
#endif
|
||||
@@ -1522,6 +1527,7 @@ enum
|
||||
//op_exp_dirlight,
|
||||
op_exp_skybox,
|
||||
op_exp_accuratefps,
|
||||
op_exp_votescrn,
|
||||
#ifdef HWRENDER
|
||||
op_exp_glscrtx,
|
||||
#ifdef USE_FBO_OGL
|
||||
@@ -2471,9 +2477,13 @@ static menuitem_t OP_HudOffsetMenu[] =
|
||||
{IT_STRING | IT_CVAR, NULL, "Vertical Offset", &cv_stat_yoffset, 185},
|
||||
};
|
||||
|
||||
// FIXME: WE EFFECTIVELY HAVE NO MORE SPACE FOR GREEN RES
|
||||
// i had to put multiple names into single lines at this point
|
||||
// we ought to really do something better for this at this point
|
||||
// absolutely crazy how many people put work into this at this point <3
|
||||
static menuitem_t OP_SaturnCreditsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "Thanks to all contributers <3", NULL, 0},
|
||||
{IT_HEADER, NULL, "Thanks to all contributers <3", NULL, 0},
|
||||
|
||||
{IT_STRING2+IT_SPACE, NULL, "Alug", NULL, 10},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Indev", NULL, 20},
|
||||
@@ -2482,20 +2492,21 @@ static menuitem_t OP_SaturnCreditsMenu[] =
|
||||
{IT_STRING2+IT_SPACE, NULL, "GenericHeroGuy", NULL, 50},
|
||||
{IT_STRING2+IT_SPACE, NULL, "xyzzy", NULL, 60},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Chearii", NULL, 70},
|
||||
{IT_STRING2+IT_SPACE, NULL, "riomccloud", NULL, 80},
|
||||
{IT_STRING2+IT_SPACE, NULL, "chromaticpipe", NULL, 90},
|
||||
{IT_STRING2+IT_SPACE, NULL, "PAS", NULL, 100},
|
||||
{IT_STRING2+IT_SPACE, NULL, "$HOME", NULL, 110},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Achii", NULL, 120},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Anonimus", NULL, 130},
|
||||
{IT_STRING2+IT_SPACE, NULL, "scizor300", NULL, 140},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Lugent", NULL, 150},
|
||||
|
||||
{IT_STRING2+IT_SPACE, NULL, "Sunflower", NULL, 80},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Yuz", NULL, 90},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Democrab", NULL, 100},
|
||||
{IT_STRING2+IT_SPACE, NULL, "EXpand", NULL, 110},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Nexit", NULL, 120},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Spee", NULL, 130},
|
||||
{IT_STRING2+IT_SPACE, NULL, "jin", NULL, 140},
|
||||
{IT_STRING2+IT_SPACE, NULL, "riomccloud", NULL, 150},
|
||||
{IT_STRING2+IT_SPACE, NULL, "chromaticpipe", NULL, 160},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Achii", NULL, 170},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Anonimus", NULL, 180},
|
||||
{IT_STRING2+IT_SPACE, NULL, "scizor300", NULL, 190},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Lugent", NULL, 200},
|
||||
{IT_HEADER, NULL, "", NULL, 124},
|
||||
|
||||
{IT_STRING2+IT_SPACE, NULL, "Sunflower Yuz", NULL, 180},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Democrab EXpand", NULL, 190},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Nexit Spee", NULL, 200},
|
||||
{IT_STRING2+IT_SPACE, NULL, "jin", NULL, 210},
|
||||
|
||||
{IT_HEADER, NULL, "Special Thanks <3", NULL, 168},
|
||||
|
||||
@@ -2507,7 +2518,7 @@ static menuitem_t OP_SaturnCreditsMenu[] =
|
||||
{IT_STRING, NULL, "", NULL, 258}, // dummy text II
|
||||
};
|
||||
|
||||
// sry we dont have space for this anymore :/
|
||||
// sry we dont have space for this anymore :c
|
||||
/*static const char* OP_CreditTooltips[] =
|
||||
{
|
||||
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||
@@ -2731,7 +2742,7 @@ menu_t MISC_AddonsDef =
|
||||
50, 28,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t MISC_ReplayHutDef =
|
||||
@@ -2744,7 +2755,7 @@ menu_t MISC_ReplayHutDef =
|
||||
30, 80,
|
||||
0,
|
||||
M_QuitReplayHut,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t MISC_ReplayOptionsDef =
|
||||
@@ -2757,7 +2768,7 @@ menu_t MISC_ReplayOptionsDef =
|
||||
27, 40,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t MISC_ReplayStartDef =
|
||||
@@ -2770,7 +2781,7 @@ menu_t MISC_ReplayStartDef =
|
||||
30, 90,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t PlaybackMenuDef = {
|
||||
@@ -2783,12 +2794,12 @@ menu_t PlaybackMenuDef = {
|
||||
BASEVIDWIDTH/2 - 88, 2,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t MAPauseDef = PAUSEMENUSTYLE(MAPauseMenu, 40, 72);
|
||||
menu_t SPauseDef = PAUSEMENUSTYLE(SPauseMenu, 40, 72);
|
||||
menu_t MPauseDef = PAUSEMENUSTYLE(MPauseMenu, 40, 72);
|
||||
menu_t SPauseDef = PAUSEMENUSTYLE(SPauseMenu, 40, 72);
|
||||
menu_t MPauseDef = PAUSEMENUSTYLE(MPauseMenu, 40, 72);
|
||||
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
menu_t MISC_DiscordRequestsDef = {
|
||||
@@ -2800,16 +2811,16 @@ menu_t MISC_DiscordRequestsDef = {
|
||||
0, 0,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
#endif
|
||||
|
||||
// Misc Main Menu
|
||||
menu_t MISC_ScrambleTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ScrambleTeamMenu, &MPauseDef, 27, 40);
|
||||
menu_t MISC_ChangeTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeTeamMenu, &MPauseDef, 27, 40);
|
||||
menu_t MISC_ChangeSpectateDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeSpectateMenu, &MPauseDef, 27, 40);
|
||||
menu_t MISC_ChangeLevelDef = MAPICONMENUSTYLE(NULL, MISC_ChangeLevelMenu, &MPauseDef);
|
||||
menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu);
|
||||
menu_t MISC_ScrambleTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ScrambleTeamMenu, &MPauseDef, 27, 40, NULL);
|
||||
menu_t MISC_ChangeTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeTeamMenu, &MPauseDef, 27, 40, NULL);
|
||||
menu_t MISC_ChangeSpectateDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeSpectateMenu, &MPauseDef, 27, 40, NULL);
|
||||
menu_t MISC_ChangeLevelDef = MAPICONMENUSTYLE(NULL, MISC_ChangeLevelMenu, &MPauseDef);
|
||||
menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu);
|
||||
|
||||
//
|
||||
// M_GetGametypeColor
|
||||
@@ -2896,7 +2907,7 @@ menu_t SR_PandoraDef =
|
||||
60, 40,
|
||||
0,
|
||||
M_ExitPandorasBox,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
menu_t SR_MainDef = CENTERMENUSTYLE(NULL, SR_MainMenu, &MainDef, 72);
|
||||
|
||||
@@ -2912,7 +2923,7 @@ menu_t SR_UnlockChecklistDef =
|
||||
280, 185,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t SR_MusicTestDef =
|
||||
@@ -2925,7 +2936,7 @@ menu_t SR_MusicTestDef =
|
||||
60, 150,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t SR_EmblemHintDef =
|
||||
@@ -2938,7 +2949,7 @@ menu_t SR_EmblemHintDef =
|
||||
60, 150,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
// Single Player
|
||||
@@ -2954,7 +2965,7 @@ menu_t SP_LevelStatsDef =
|
||||
280, 185,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
static menu_t SP_TimeAttackDef =
|
||||
@@ -2967,7 +2978,7 @@ static menu_t SP_TimeAttackDef =
|
||||
34, 40,
|
||||
0,
|
||||
M_QuitTimeAttackMenu,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
static menu_t SP_ReplayDef =
|
||||
{
|
||||
@@ -2979,7 +2990,7 @@ static menu_t SP_ReplayDef =
|
||||
34, 40,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
static menu_t SP_GuestReplayDef =
|
||||
{
|
||||
@@ -2991,7 +3002,7 @@ static menu_t SP_GuestReplayDef =
|
||||
34, 40,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
static menu_t SP_GhostDef =
|
||||
{
|
||||
@@ -3003,7 +3014,7 @@ static menu_t SP_GhostDef =
|
||||
34, 40,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
// Multiplayer
|
||||
@@ -3021,7 +3032,7 @@ menu_t MP_MainDef =
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t MP_OfflineServerDef = MAPICONMENUSTYLE("M_MULTI", MP_OfflineServerMenu, &MP_MainDef);
|
||||
@@ -3039,7 +3050,7 @@ menu_t MP_ConnectDef =
|
||||
27,24,
|
||||
0,
|
||||
M_CancelConnect,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
#endif
|
||||
menu_t MP_PlayerSetupDef =
|
||||
@@ -3052,7 +3063,7 @@ menu_t MP_PlayerSetupDef =
|
||||
36, 14,
|
||||
0,
|
||||
M_QuitMultiPlayerMenu,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
// Options
|
||||
@@ -3066,18 +3077,18 @@ menu_t OP_MainDef =
|
||||
60, 25,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30);
|
||||
menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30, OP_ControlsTooltips);
|
||||
//WTF
|
||||
menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_ControlsDef, 60, 30);
|
||||
menu_t OP_AllControlsDef = CONTROLMENUSTYLE(OP_AllControlsMenu, &OP_ControlsDef);
|
||||
menu_t OP_Joystick1Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_AllControlsDef, 30, 36);
|
||||
menu_t OP_Joystick2Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_AllControlsDef, 30, 36);
|
||||
menu_t OP_Joystick3Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_AllControlsDef, 30, 36);
|
||||
menu_t OP_Joystick4Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_AllControlsDef, 30, 36);
|
||||
menu_t OP_JoystickSetDef =
|
||||
menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_ControlsDef, 60, 30, OP_MouseTooltips);
|
||||
menu_t OP_AllControlsDef = CONTROLMENUSTYLE(OP_AllControlsMenu, &OP_ControlsDef);
|
||||
menu_t OP_Joystick1Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_AllControlsDef, 30, 36, NULL);
|
||||
menu_t OP_Joystick2Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_AllControlsDef, 30, 36, NULL);
|
||||
menu_t OP_Joystick3Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_AllControlsDef, 30, 36, NULL);
|
||||
menu_t OP_Joystick4Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_AllControlsDef, 30, 36, NULL);
|
||||
menu_t OP_JoystickSetDef =
|
||||
{
|
||||
"M_CONTRO",
|
||||
sizeof (OP_JoystickSetMenu)/sizeof (menuitem_t),
|
||||
@@ -3087,7 +3098,7 @@ menu_t OP_JoystickSetDef =
|
||||
50, 40,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t OP_VideoOptionsDef =
|
||||
@@ -3100,7 +3111,7 @@ menu_t OP_VideoOptionsDef =
|
||||
30, 15,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
OP_VideoTooltips
|
||||
};
|
||||
|
||||
menu_t OP_VideoModeDef =
|
||||
@@ -3113,7 +3124,7 @@ menu_t OP_VideoModeDef =
|
||||
48, 26,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t OP_ColorOptionsDef =
|
||||
@@ -3126,7 +3137,7 @@ menu_t OP_ColorOptionsDef =
|
||||
30, 30,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t OP_SoundOptionsDef =
|
||||
@@ -3139,7 +3150,7 @@ menu_t OP_SoundOptionsDef =
|
||||
30, 20,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
OP_SoundTooltips
|
||||
};
|
||||
|
||||
|
||||
@@ -3153,25 +3164,25 @@ menu_t OP_HUDOptionsDef =
|
||||
30, 20,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t OP_CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_CamOptionsMenu, &OP_MainDef, 30, 30);
|
||||
menu_t OP_Player1CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player1CamOptionsMenu, &OP_CamOptionsDef, 30, 30);
|
||||
menu_t OP_Player2CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player2CamOptionsMenu, &OP_CamOptionsDef, 30, 30);
|
||||
menu_t OP_Player3CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player3CamOptionsMenu, &OP_CamOptionsDef, 30, 30);
|
||||
menu_t OP_Player4CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player4CamOptionsMenu, &OP_CamOptionsDef, 30, 30);
|
||||
menu_t OP_CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_CamOptionsMenu, &OP_MainDef, 30, 30, OP_CamOptionsTooltips);
|
||||
menu_t OP_Player1CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player1CamOptionsMenu, &OP_CamOptionsDef, 30, 30, OP_PlayerCamOptionsTooltips);
|
||||
menu_t OP_Player2CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player2CamOptionsMenu, &OP_CamOptionsDef, 30, 30, OP_PlayerCamOptionsTooltips);
|
||||
menu_t OP_Player3CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player3CamOptionsMenu, &OP_CamOptionsDef, 30, 30, OP_PlayerCamOptionsTooltips);
|
||||
menu_t OP_Player4CamOptionsDef = DEFAULTMENUSTYLE(NULL, OP_Player4CamOptionsMenu, &OP_CamOptionsDef, 30, 30, OP_PlayerCamOptionsTooltips);
|
||||
|
||||
menu_t OP_ChatOptionsDef = DEFAULTMENUSTYLE("M_HUD", OP_ChatOptionsMenu, &OP_HUDOptionsDef, 30, 30);
|
||||
menu_t OP_ChatOptionsDef = DEFAULTMENUSTYLE("M_HUD", OP_ChatOptionsMenu, &OP_HUDOptionsDef, 30, 30, OP_ChatOptionsTooltips);
|
||||
|
||||
menu_t OP_SoundAdvancedDef = DEFAULTSCROLLSTYLE("M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30);
|
||||
menu_t OP_SoundAdvancedDef = DEFAULTSCROLLSTYLE("M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30, OP_SoundAdvancedTooltips);
|
||||
|
||||
menu_t OP_FocusOptionsDef = DEFAULTMENUSTYLE(NULL, OP_FocusOptionsMenu, &OP_MainDef, 17, 30);
|
||||
menu_t OP_FocusOptionsDef = DEFAULTMENUSTYLE(NULL, OP_FocusOptionsMenu, &OP_MainDef, 17, 30, OP_FocusOptionsTooltips);
|
||||
|
||||
menu_t OP_GameOptionsDef = DEFAULTMENUSTYLE("M_GAME", OP_GameOptionsMenu, &OP_MainDef, 30, 20);
|
||||
menu_t OP_ServerOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_ServerOptionsMenu, &OP_MainDef, 24, 20);
|
||||
menu_t OP_GameOptionsDef = DEFAULTMENUSTYLE("M_GAME", OP_GameOptionsMenu, &OP_MainDef, 30, 20, OP_GameTooltips);
|
||||
menu_t OP_ServerOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_ServerOptionsMenu, &OP_MainDef, 24, 20, OP_ServerOptionsTooltips);
|
||||
#ifndef NONET
|
||||
menu_t OP_AdvServerOptionsDef = DEFAULTSCROLLSTYLE("M_SERVER", OP_AdvServerOptionsMenu, &OP_ServerOptionsDef, 24, 30);
|
||||
menu_t OP_AdvServerOptionsDef = DEFAULTSCROLLSTYLE("M_SERVER", OP_AdvServerOptionsMenu, &OP_ServerOptionsDef, 24, 30, OP_AdvServerOptionsTooltips);
|
||||
#endif
|
||||
|
||||
//menu_t OP_NetgameOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_NetgameOptionsMenu, &OP_ServerOptionsDef, 30, 30);
|
||||
@@ -3187,38 +3198,38 @@ menu_t OP_MonitorToggleDef =
|
||||
47, 30,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
#ifdef HWRENDER
|
||||
menu_t OP_OpenGLOptionsDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_OpenGLOptionsMenu, &OP_VideoOptionsDef, 30, 30);
|
||||
menu_t OP_OpenGLOptionsDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_OpenGLOptionsMenu, &OP_VideoOptionsDef, 30, 30, OP_OpenGLTooltips);
|
||||
#endif
|
||||
|
||||
menu_t OP_ExpOptionsDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_ExpOptionsMenu, &OP_VideoOptionsDef, 30, 25);
|
||||
menu_t OP_ExpOptionsDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_ExpOptionsMenu, &OP_VideoOptionsDef, 30, 25, OP_ExpTooltips);
|
||||
|
||||
menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30);
|
||||
menu_t OP_ScreenshotOptionsDef = DEFAULTSCROLLSTYLE("M_SCSHOT", OP_ScreenshotOptionsMenu, &OP_DataOptionsDef, 30, 30);
|
||||
menu_t OP_AddonsOptionsDef = DEFAULTMENUSTYLE("M_ADDONS", OP_AddonsOptionsMenu, &OP_DataOptionsDef, 30, 30);
|
||||
menu_t OP_ProtocolDef = DEFAULTMENUSTYLE(NULL, OP_ProtocolMenu, &OP_DataOptionsDef, 30, 30);
|
||||
menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30, NULL);
|
||||
menu_t OP_ScreenshotOptionsDef = DEFAULTSCROLLSTYLE("M_SCSHOT", OP_ScreenshotOptionsMenu, &OP_DataOptionsDef, 30, 30, NULL);
|
||||
menu_t OP_AddonsOptionsDef = DEFAULTMENUSTYLE("M_ADDONS", OP_AddonsOptionsMenu, &OP_DataOptionsDef, 30, 30, NULL);
|
||||
menu_t OP_ProtocolDef = DEFAULTMENUSTYLE(NULL, OP_ProtocolMenu, &OP_DataOptionsDef, 30, 30, NULL);
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
menu_t OP_DiscordOptionsDef = DEFAULTMENUSTYLE(NULL, OP_DiscordOptionsMenu, &OP_DataOptionsDef, 30, 30);
|
||||
menu_t OP_DiscordOptionsDef = DEFAULTMENUSTYLE(NULL, OP_DiscordOptionsMenu, &OP_DataOptionsDef, 30, 30, NULL);
|
||||
#endif
|
||||
menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 30, 30);
|
||||
menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 30, 30, NULL);
|
||||
|
||||
menu_t OP_SaturnDef = DEFAULTSCROLLSTYLE(NULL, OP_SaturnMenu, &OP_MainDef, 30, 30);
|
||||
menu_t OP_PlayerDistortDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_PlayerDistortMenu, &OP_SaturnDef, 30, 30);
|
||||
menu_t OP_HudOffsetDef = DEFAULTSCROLLSTYLE(NULL, OP_HudOffsetMenu, &OP_SaturnHudDef, 30, 30);
|
||||
menu_t OP_SaturnHudDef = DEFAULTSCROLLSTYLE(NULL, OP_SaturnHudMenu, &OP_SaturnDef, 30, 30);
|
||||
menu_t OP_SaturnDef = DEFAULTSCROLLSTYLE(NULL, OP_SaturnMenu, &OP_MainDef, 30, 30, OP_SaturnTooltips);
|
||||
menu_t OP_SaturnCreditsDef = DEFAULTMENUSTYLE(NULL, OP_SaturnCreditsMenu, &OP_SaturnDef, 30, 0, NULL); // OP_CreditTooltips no space :c
|
||||
|
||||
menu_t OP_SaturnCreditsDef = DEFAULTMENUSTYLE(NULL, OP_SaturnCreditsMenu, &OP_SaturnDef, 30, 0);
|
||||
menu_t OP_SaturnHudDef = DEFAULTSCROLLSTYLE(NULL, OP_SaturnHudMenu, &OP_SaturnDef, 30, 30, OP_SaturnHudTooltips);
|
||||
menu_t OP_PlayerDistortDef = DEFAULTSCROLLSTYLE("M_VIDEO", OP_PlayerDistortMenu, &OP_SaturnDef, 30, 30, OP_PlayerDistortTooltips);
|
||||
menu_t OP_HudOffsetDef = DEFAULTSCROLLSTYLE(NULL, OP_HudOffsetMenu, &OP_SaturnHudDef, 30, 30, NULL);
|
||||
|
||||
menu_t OP_BirdDef = DEFAULTMENUSTYLE(NULL, OP_BirdMenu, &OP_MainDef, 30, 30);
|
||||
menu_t OP_BirdDef = DEFAULTMENUSTYLE(NULL, OP_BirdMenu, &OP_MainDef, 30, 30, OP_BirdTooltips);
|
||||
|
||||
menu_t OP_NametagDef = DEFAULTMENUSTYLE(NULL, OP_NametagMenu, &OP_SaturnHudDef, 30, 40);
|
||||
menu_t OP_DriftGaugeDef = DEFAULTMENUSTYLE(NULL, OP_DriftGaugeMenu, &OP_SaturnHudDef, 30, 40);
|
||||
menu_t OP_NametagDef = DEFAULTMENUSTYLE(NULL, OP_NametagMenu, &OP_SaturnHudDef, 30, 40, OP_NametagTooltips);
|
||||
menu_t OP_DriftGaugeDef = DEFAULTMENUSTYLE(NULL, OP_DriftGaugeMenu, &OP_SaturnHudDef, 30, 40, OP_DriftGaugeTooltips);
|
||||
|
||||
menu_t OP_TiltDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_BirdDef, 30, 60);
|
||||
menu_t OP_AdvancedBirdDef = DEFAULTMENUSTYLE(NULL, OP_AdvancedBirdMenu, &OP_BirdDef, 30, 60);
|
||||
menu_t OP_TiltDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_BirdDef, 30, 60, OP_TiltTooltips);
|
||||
menu_t OP_AdvancedBirdDef = DEFAULTMENUSTYLE(NULL, OP_AdvancedBirdMenu, &OP_BirdDef, 30, 60, OP_AdvancedBirdTooltips);
|
||||
|
||||
INT16 ccvarposition = 0;
|
||||
|
||||
@@ -3235,7 +3246,7 @@ static void M_CustomCvarMenu(INT32 choice)
|
||||
/*menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLMENUSTYLE(
|
||||
MTREE3(MN_OP_MAIN, MN_OP_DATA, MN_OP_ADDONS),
|
||||
"M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 30, 30);*/
|
||||
menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLSTYLE("M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 10, 30);
|
||||
menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLSTYLE("M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 10, 30, NULL);
|
||||
|
||||
menu_t OP_ForkedBirdDef = {
|
||||
NULL,
|
||||
@@ -3246,10 +3257,10 @@ menu_t OP_ForkedBirdDef = {
|
||||
30, 6,
|
||||
0,
|
||||
NULL,
|
||||
{NULL}
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t OP_LocalSkinDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_ForkedBirdDef, 30, 60);
|
||||
menu_t OP_LocalSkinDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_ForkedBirdDef, 30, 60, NULL);
|
||||
|
||||
|
||||
// ==========================================================================
|
||||
@@ -4870,6 +4881,9 @@ void M_Init(void)
|
||||
|
||||
//todo put this somewhere better...
|
||||
CV_RegisterVar(&cv_allcaps);
|
||||
|
||||
memset(menu_text_input_buf, 0, sizeof menu_text_input_buf);
|
||||
M_TextInputInit(&menuinput, menu_text_input_buf, sizeof menu_text_input_buf);
|
||||
}
|
||||
|
||||
void M_InitCharacterTables(void)
|
||||
@@ -5186,6 +5200,16 @@ static void M_DrawSplitText(INT32 x, INT32 y, INT32 option, const char* str, INT
|
||||
free(clines);
|
||||
}
|
||||
|
||||
static void M_DoToolTips(menu_t* menu)
|
||||
{
|
||||
if (!menu->tooltips || itemOn == -1 || !menu->tooltips[itemOn])
|
||||
return;
|
||||
|
||||
M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, menu->tooltips[itemOn], coolalphatimer);
|
||||
|
||||
if ((coolalphatimer > 0) && interpTimerHackAllow)
|
||||
coolalphatimer--;
|
||||
}
|
||||
|
||||
static void M_DrawGenericMenu(void)
|
||||
{
|
||||
@@ -5332,23 +5356,7 @@ static void M_DrawGenericMenu(void)
|
||||
|
||||
// dumb hack
|
||||
// tooltips
|
||||
// replaced with macro so it doesent look as terrible anymore lol
|
||||
DoToolTips(OP_ControlsDef, OP_ControlsTooltips);
|
||||
DoToolTips(OP_MouseOptionsDef, OP_MouseTooltips);
|
||||
DoToolTips(OP_VideoOptionsDef, OP_VideoTooltips);
|
||||
DoToolTips(OP_SoundOptionsDef, OP_SoundTooltips);
|
||||
DoToolTips(OP_FocusOptionsDef, OP_FocusOptionsTooltips);
|
||||
DoToolTips(OP_ChatOptionsDef, OP_ChatOptionsTooltips);
|
||||
DoToolTips(OP_GameOptionsDef, OP_GameTooltips);
|
||||
DoToolTips(OP_ServerOptionsDef, OP_ServerOptionsTooltips);
|
||||
//DoToolTips(OP_SaturnCreditsDef, OP_CreditTooltips); // C:
|
||||
DoToolTips(OP_BirdDef, OP_BirdTooltips);
|
||||
DoToolTips(OP_TiltDef, OP_TiltTooltips);
|
||||
DoToolTips(OP_AdvancedBirdDef, OP_AdvancedBirdTooltips);
|
||||
DoToolTips(OP_NametagDef, OP_NametagTooltips);
|
||||
DoToolTips(OP_DriftGaugeDef, OP_DriftGaugeTooltips);
|
||||
DoToolTips(OP_CamOptionsDef, OP_CamOptionsTooltips);
|
||||
DoToolTips(OP_Player1CamOptionsDef || currentMenu == &OP_Player2CamOptionsDef || currentMenu == &OP_Player3CamOptionsDef || currentMenu == &OP_Player4CamOptionsDef, OP_PlayerCamOptionsTooltips); // god this one is still terrible lmao
|
||||
M_DoToolTips(currentMenu);
|
||||
}
|
||||
|
||||
static void M_DrawGenericBackgroundMenu(void)
|
||||
@@ -5479,16 +5487,7 @@ static void M_DrawGenericScrollMenu(void)
|
||||
|
||||
// dumb hack
|
||||
// tooltips
|
||||
// same macro here
|
||||
DoToolTips(OP_ExpOptionsDef, OP_ExpTooltips);
|
||||
#ifdef HWRENDER
|
||||
DoToolTips(OP_OpenGLOptionsDef, OP_OpenGLTooltips);
|
||||
#endif
|
||||
DoToolTips(OP_SaturnDef, OP_SaturnTooltips);
|
||||
DoToolTips(OP_SaturnHudDef, OP_SaturnHudTooltips);
|
||||
DoToolTips(OP_AdvServerOptionsDef, OP_AdvServerOptionsTooltips);
|
||||
DoToolTips(OP_SoundAdvancedDef, OP_SoundAdvancedTooltips);
|
||||
DoToolTips(OP_PlayerDistortDef, OP_PlayerDistortTooltips);
|
||||
M_DoToolTips(currentMenu);
|
||||
}
|
||||
|
||||
static void M_DrawPauseMenu(void)
|
||||
@@ -5722,8 +5721,16 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
|
||||
{
|
||||
case LLM_CREATESERVER:
|
||||
// Should the map be hidden? <-- well imma wanna toggle it, its just annoying being unable to select hell maps in mapselect
|
||||
if ((mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU && mapnum+1 != gamemap) && (gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE))) // map hell
|
||||
return cv_showallmaps.value;
|
||||
|
||||
if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU && mapnum+1 != gamemap)
|
||||
{
|
||||
if (cv_showallmaps.value &&
|
||||
((gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE)) || // race map hell
|
||||
((gt == GT_MATCH || gt == GT_TEAMMATCH) && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH)))) // battle map hell
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
// same goes here, just show every map if i want to
|
||||
if (M_MapLocked(mapnum+1)) // not unlocked
|
||||
@@ -5803,7 +5810,7 @@ menu_t MessageDef =
|
||||
0, 0, // x, y (TO HACK)
|
||||
0, // lastOn, flags (TO HACK)
|
||||
NULL,
|
||||
{0},
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
||||
@@ -6065,8 +6072,8 @@ static void M_AddonsOptions(INT32 choice)
|
||||
M_SetupNextMenu(&OP_AddonsOptionsDef);
|
||||
}
|
||||
|
||||
#define LOCATIONSTRING1 "Visit \x83SRB2.ORG/MODS\x80 to get & make addons!"
|
||||
#define LOCATIONSTRING2 "Visit \x88SRB2.ORG/MODS\x80 to get & make addons!"
|
||||
#define LOCATIONSTRING1 "Visit \x83mb.srb2.org/addons\x80 to get & make addons!"
|
||||
#define LOCATIONSTRING2 "Visit \x88mb.srb2.org/addons\x80 to get & make addons!"
|
||||
|
||||
static void M_AddonsInternal(void)
|
||||
{
|
||||
@@ -6296,6 +6303,8 @@ static boolean M_AddonsRefresh(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
static tic_t addons_scrolltic = 0; // maybe not the best place but e
|
||||
|
||||
static void M_DrawAddons(void)
|
||||
{
|
||||
INT32 x, y;
|
||||
@@ -6303,6 +6312,8 @@ static void M_DrawAddons(void)
|
||||
const UINT8 *flashcol = NULL;
|
||||
UINT8 hilicol;
|
||||
|
||||
if (renderisnewtic) addons_scrolltic++;
|
||||
|
||||
// hack - need to refresh at end of frame to handle addfile...
|
||||
if (refreshdirmenu & M_AddonsRefresh())
|
||||
{
|
||||
@@ -6386,6 +6397,9 @@ static void M_DrawAddons(void)
|
||||
for (; i < m; i++)
|
||||
{
|
||||
UINT32 flags = V_ALLOWLOWERCASE;
|
||||
#define MAXADDONNAME 31
|
||||
char scrollbuf[MAXADDONNAME+1] = {0};
|
||||
|
||||
if (y > BASEVIDHEIGHT) break;
|
||||
if (dirmenu[i])
|
||||
#define type (UINT8)(dirmenu[i][DIR_TYPE])
|
||||
@@ -6406,11 +6420,22 @@ static void M_DrawAddons(void)
|
||||
}
|
||||
|
||||
#define charsonside 14
|
||||
if (dirmenu[i][DIR_LEN] > (charsonside*2 + 3))
|
||||
V_DrawString(x, y+4, flags, va("%.*s...%s", charsonside, dirmenu[i]+DIR_STRING, dirmenu[i]+DIR_STRING+dirmenu[i][DIR_LEN]-(charsonside+1)));
|
||||
if (dirmenu[i][DIR_LEN] > MAXADDONNAME)
|
||||
{
|
||||
if ((size_t)i == dir_on[menudepthleft])
|
||||
{
|
||||
M_ScrollString(dirmenu[i]+DIR_STRING, dirmenu[i][DIR_LEN]-1, scrollbuf, MAXADDONNAME, addons_scrolltic);
|
||||
}
|
||||
else
|
||||
strncpy(scrollbuf, va("%.*s...%s", charsonside, dirmenu[i]+DIR_STRING, dirmenu[i]+DIR_STRING+dirmenu[i][DIR_LEN]-(charsonside+1)), MAXADDONNAME);
|
||||
|
||||
V_DrawString(x, y+4, flags, scrollbuf);
|
||||
}
|
||||
#undef charsonside
|
||||
else
|
||||
V_DrawString(x, y+4, flags, dirmenu[i]+DIR_STRING);
|
||||
|
||||
#undef MAXADDONNAME
|
||||
}
|
||||
#undef type
|
||||
y += 16;
|
||||
@@ -6535,11 +6560,13 @@ static void M_HandleAddons(INT32 choice)
|
||||
case KEY_DOWNARROW:
|
||||
if (dir_on[menudepthleft] < sizedirmenu-1)
|
||||
dir_on[menudepthleft]++;
|
||||
addons_scrolltic = 0;
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
break;
|
||||
case KEY_UPARROW:
|
||||
if (dir_on[menudepthleft])
|
||||
dir_on[menudepthleft]--;
|
||||
addons_scrolltic = 0;
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
break;
|
||||
case KEY_PGDN:
|
||||
@@ -6548,6 +6575,7 @@ static void M_HandleAddons(INT32 choice)
|
||||
for (i = numaddonsshown; i && (dir_on[menudepthleft] < sizedirmenu-1); i--)
|
||||
dir_on[menudepthleft]++;
|
||||
}
|
||||
addons_scrolltic = 0;
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
break;
|
||||
case KEY_PGUP:
|
||||
@@ -6556,6 +6584,7 @@ static void M_HandleAddons(INT32 choice)
|
||||
for (i = numaddonsshown; i && (dir_on[menudepthleft]); i--)
|
||||
dir_on[menudepthleft]--;
|
||||
}
|
||||
addons_scrolltic = 0;
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
break;
|
||||
case KEY_ENTER:
|
||||
@@ -6695,6 +6724,7 @@ static void M_HandleAddons(INT32 choice)
|
||||
|
||||
case KEY_ESCAPE:
|
||||
exitmenu = true;
|
||||
addons_scrolltic = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -6867,6 +6897,32 @@ static void M_HutCheckReplays(size_t maxnum)
|
||||
}
|
||||
}
|
||||
|
||||
static int ReplayListSortComparator(const void *entry1, const void *entry2)
|
||||
{
|
||||
const menudemo_t *demo1 = (const menudemo_t*)entry1;
|
||||
const menudemo_t *demo2 = (const menudemo_t*)entry2;
|
||||
|
||||
char filepath1[sizeof(demo1->filepath)];
|
||||
char filepath2[sizeof(demo2->filepath)];
|
||||
|
||||
// First check for directories, they always should be at the top
|
||||
if (demo1->type == MD_SUBDIR && demo2->type != MD_SUBDIR)
|
||||
return -1;
|
||||
else if (demo2->type == MD_SUBDIR && demo1->type != MD_SUBDIR)
|
||||
return 1;
|
||||
else if (demo1->type == MD_SUBDIR && demo2->type == MD_SUBDIR)
|
||||
return 0;
|
||||
|
||||
memcpy(filepath1, demo1->filepath, sizeof(filepath1));
|
||||
memcpy(filepath2, demo2->filepath, sizeof(filepath2));
|
||||
|
||||
nameonly(filepath1);
|
||||
nameonly(filepath2);
|
||||
|
||||
// Comparing in opposite order to move new replays to the top
|
||||
return strncmp(filepath2, filepath1, sizeof(filepath1));
|
||||
}
|
||||
|
||||
static void PrepReplayList(boolean reset)
|
||||
{
|
||||
size_t i;
|
||||
@@ -6910,6 +6966,8 @@ static void PrepReplayList(boolean reset)
|
||||
}
|
||||
}
|
||||
|
||||
qs22j(demolist_all, sizedirmenu, sizeof(menudemo_t), ReplayListSortComparator);
|
||||
|
||||
Unlock_search_state();
|
||||
|
||||
LoadReplayNames();
|
||||
@@ -7710,7 +7768,10 @@ static void M_PlaybackRewind(INT32 choice)
|
||||
S_PauseAudio();
|
||||
}
|
||||
else
|
||||
demo.rewinding = paused = true;
|
||||
{
|
||||
demo.rewinding = true;
|
||||
paused = true;
|
||||
}
|
||||
}
|
||||
else if (lastconfirmtime + TICRATE/2 < I_GetTime())
|
||||
{
|
||||
@@ -8433,51 +8494,6 @@ static musicdef_t *curplaying = NULL;
|
||||
static INT32 st_sel = 0;
|
||||
static tic_t st_musictime = 0;
|
||||
|
||||
static void scrollMusicName(const char name[], size_t len, size_t maxlen, char result[])
|
||||
{
|
||||
// How much should we scroll. Not sure why +1 is needed, but without it this function skips 2
|
||||
// characters at once sometimes
|
||||
const size_t amount = len - maxlen + 1;
|
||||
|
||||
// Note: anything above 17 will cause zero division
|
||||
const size_t MAXSPEED = 6;
|
||||
const size_t t = st_musictime / (35/min(amount, MAXSPEED));
|
||||
|
||||
const size_t state = (t / amount) % 4;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
// Show beginning of the name
|
||||
case 0:
|
||||
memcpy(result, name, maxlen-1);
|
||||
break;
|
||||
|
||||
// Scroll towards end of the name
|
||||
case 1:
|
||||
{
|
||||
const size_t advance = t % amount;
|
||||
memcpy(result, name+advance, maxlen-1);
|
||||
}
|
||||
break;
|
||||
|
||||
// Show end of the name
|
||||
case 2:
|
||||
memcpy(result, name+len+1-maxlen, maxlen-1);
|
||||
break;
|
||||
|
||||
// Scroll towards start of the name
|
||||
case 3:
|
||||
{
|
||||
const size_t advance = t % amount;
|
||||
memcpy(result, name+len+1-maxlen-advance, maxlen-1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Technically not necessary, since it gets set again after function call, but just in case
|
||||
result[maxlen] = 0;
|
||||
}
|
||||
|
||||
static void M_MusicTest(INT32 choice)
|
||||
{
|
||||
(void)choice;
|
||||
@@ -8619,7 +8635,7 @@ static void M_DrawMusicTest(void)
|
||||
char buf[MAXLENGTH+1];
|
||||
|
||||
if (t == st_sel && namelength > MAXLENGTH)
|
||||
scrollMusicName(songname, namelength, MAXLENGTH, buf);
|
||||
M_ScrollString(songname, namelength, buf, MAXLENGTH, st_musictime);
|
||||
else
|
||||
strncpy(buf, songname, MAXLENGTH);
|
||||
buf[MAXLENGTH] = 0;
|
||||
@@ -9596,7 +9612,7 @@ Fetch_servers_thread (int *id)
|
||||
}
|
||||
#endif/*MASTERSERVER*/
|
||||
|
||||
#define SERVERHEADERHEIGHT 36
|
||||
#define SERVERHEADERHEIGHT 48
|
||||
#define SERVERLINEHEIGHT 12
|
||||
|
||||
#define S_LINEY(n) currentMenu->y + SERVERHEADERHEIGHT + (n * SERVERLINEHEIGHT)
|
||||
@@ -9604,6 +9620,57 @@ Fetch_servers_thread (int *id)
|
||||
#ifndef NONET
|
||||
static UINT32 localservercount;
|
||||
|
||||
static void M_SearchServerList(void)
|
||||
{
|
||||
char servername[MAXSERVERNAME+1] = {0};
|
||||
serverlistsearchedcount = 0;
|
||||
|
||||
for (UINT32 i = 0; i < serverlistcount; ++i)
|
||||
{
|
||||
StripColors(servername, serverlist[i].info.servername, MAXSERVERNAME);
|
||||
if (menuinput.length == 0 || strcasestr(servername, menuinput.buffer) != NULL)
|
||||
serverlistsearched[serverlistsearchedcount++] = i;
|
||||
}
|
||||
|
||||
if (menuinput.length > 0)
|
||||
serverlistpage = 0;
|
||||
}
|
||||
|
||||
static void M_HandleServerSearch(INT32 choice)
|
||||
{
|
||||
boolean exitmenu = false; // exit to previous menu
|
||||
|
||||
switch (choice)
|
||||
{
|
||||
case KEY_DOWNARROW:
|
||||
M_NextOpt();
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
break;
|
||||
case KEY_UPARROW:
|
||||
M_PrevOpt();
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
break;
|
||||
case KEY_ESCAPE:
|
||||
exitmenu = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (M_TextInputHandle(&menuinput, choice))
|
||||
{
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
M_SearchServerList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (exitmenu)
|
||||
{
|
||||
if (currentMenu->prevMenu)
|
||||
M_SetupNextMenu(currentMenu->prevMenu);
|
||||
else
|
||||
M_ClearMenus(true);
|
||||
}
|
||||
}
|
||||
|
||||
static void M_HandleServerPage(INT32 choice)
|
||||
{
|
||||
boolean exitmenu = false; // exit to previous menu
|
||||
@@ -9626,7 +9693,7 @@ static void M_HandleServerPage(INT32 choice)
|
||||
case KEY_ENTER:
|
||||
case KEY_RIGHTARROW:
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
if ((serverlistpage + 1) * SERVERS_PER_PAGE < serverlistcount)
|
||||
if ((serverlistpage + 1) * SERVERS_PER_PAGE < serverlistsearchedcount)
|
||||
{
|
||||
oldserverlistpage = serverlistpage++;
|
||||
serverlistslidex = BASEVIDWIDTH;
|
||||
@@ -9657,7 +9724,7 @@ static void M_Connect(INT32 choice)
|
||||
{
|
||||
// do not call menuexitfunc
|
||||
M_ClearMenus(false);
|
||||
COM_BufAddText(va("connect node %d\n", serverlist[choice-FIRSTSERVERLINE + serverlistpage * SERVERS_PER_PAGE].node));
|
||||
COM_BufAddText(va("connect node %d\n", serverlist[serverlistsearched[choice-FIRSTSERVERLINE + serverlistpage * SERVERS_PER_PAGE]].node));
|
||||
}
|
||||
|
||||
static void M_Refresh(INT32 choice)
|
||||
@@ -9715,11 +9782,11 @@ static void M_DrawServerCountAndHorizontalBar(void)
|
||||
|
||||
radius = V_StringWidth(text, 0) / 2;
|
||||
|
||||
V_DrawCenteredString(center, currentMenu->y+28, 0, text);
|
||||
V_DrawCenteredString(center, currentMenu->y+40, 0, text);
|
||||
|
||||
// Horizontal line!
|
||||
V_DrawFill(1, currentMenu->y+32, center - radius - 2, 1, 0);
|
||||
V_DrawFill(center + radius + 2, currentMenu->y+32, BASEVIDWIDTH - 1, 1, 0);
|
||||
V_DrawFill(1, currentMenu->y+44, center - radius - 2, 1, 0);
|
||||
V_DrawFill(center + radius + 2, currentMenu->y+44, BASEVIDWIDTH - 1, 1, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -9729,9 +9796,9 @@ static void M_DrawServerLines(INT32 x, INT32 page)
|
||||
const char *gt = "Unknown";
|
||||
const char *spd = "";
|
||||
|
||||
for (i = 0; i < min(serverlistcount - page * SERVERS_PER_PAGE, SERVERS_PER_PAGE); i++)
|
||||
for (i = 0; i < min(serverlistsearchedcount - page * SERVERS_PER_PAGE, SERVERS_PER_PAGE); i++)
|
||||
{
|
||||
INT32 slindex = i + page * SERVERS_PER_PAGE;
|
||||
INT32 slindex = serverlistsearched[i + page * SERVERS_PER_PAGE];
|
||||
UINT32 globalflags = ((serverlist[slindex].info.numberofplayer >= serverlist[slindex].info.maxplayer) ? V_TRANSLUCENT : 0)
|
||||
|((itemOn == FIRSTSERVERLINE+i) ? highlightflags : 0)|V_ALLOWLOWERCASE;
|
||||
|
||||
@@ -9770,7 +9837,7 @@ static void M_DrawServerLines(INT32 x, INT32 page)
|
||||
static void M_DrawConnectMenu(void)
|
||||
{
|
||||
UINT16 i;
|
||||
INT32 numPages = (serverlistcount+(SERVERS_PER_PAGE-1))/SERVERS_PER_PAGE;
|
||||
INT32 numPages = (serverlistsearchedcount+(SERVERS_PER_PAGE-1))/SERVERS_PER_PAGE;
|
||||
INT32 mservflags = V_ALLOWLOWERCASE;
|
||||
|
||||
for (i = FIRSTSERVERLINE; i < min(localservercount, SERVERS_PER_PAGE)+FIRSTSERVERLINE; i++)
|
||||
@@ -9820,6 +9887,17 @@ static void M_DrawConnectMenu(void)
|
||||
M_DrawServerLines(currentMenu->x, serverlistpage);
|
||||
}
|
||||
|
||||
INT32 input_y = currentMenu->menuitems[mp_connect_search].alphaKey;
|
||||
|
||||
V_DrawFill(currentMenu->x, currentMenu->y+input_y, MAXSTRINGLENGTH*8+6, 8+6, 239);
|
||||
|
||||
const INT32 xoff = 3, yoff = 3;
|
||||
|
||||
if (itemOn != mp_connect_search)
|
||||
V_DrawString(currentMenu->x+xoff, currentMenu->y+yoff+input_y, V_ALLOWLOWERCASE, menuinput.buffer);
|
||||
else
|
||||
M_DrawTextInput(currentMenu->x+xoff, currentMenu->y+yoff+input_y, &menuinput, 0);
|
||||
|
||||
localservercount = serverlistcount;
|
||||
|
||||
M_DrawGenericMenu();
|
||||
@@ -9899,6 +9977,7 @@ void M_SortServerList(void)
|
||||
qs22j(serverlist, serverlistcount, sizeof(serverelem_t), ServerListEntryComparator_gametype);
|
||||
break;
|
||||
}
|
||||
M_SearchServerList();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -9957,6 +10036,9 @@ static void M_ConnectMenu(INT32 choice)
|
||||
|
||||
CL_UpdateServerList();
|
||||
|
||||
// Reset
|
||||
M_TextInputSetString(&menuinput, "");
|
||||
|
||||
M_SetupNextMenu(&MP_ConnectDef);
|
||||
itemOn = 0;
|
||||
|
||||
@@ -10212,17 +10294,28 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade)
|
||||
|
||||
if (cv_nextmap.value && cv_showtrackaddon.value)
|
||||
{
|
||||
static tic_t namescroll = 0;
|
||||
static INT32 namescrollmap = 0;
|
||||
char namescrollbuf[64]= {0};
|
||||
|
||||
if (cv_nextmap.value != namescrollmap)
|
||||
{
|
||||
namescrollmap = cv_nextmap.value;
|
||||
namescroll = 0;
|
||||
}
|
||||
|
||||
if (renderisnewtic) namescroll++;
|
||||
|
||||
char *addonname = wadfiles[mapwads[cv_nextmap.value-1]]->filename;
|
||||
INT32 len;
|
||||
INT32 charlimit = 21 + (dupadjust/5);
|
||||
INT32 charlimit = min((size_t)(21 + (dupadjust/5)), sizeof(namescrollbuf)-1);
|
||||
nameonly(addonname);
|
||||
len = strlen(addonname);
|
||||
#define charsonside 14
|
||||
if (len > charlimit)
|
||||
V_DrawThinString(x+w+5, y+i-8, V_TRANSLUCENT|MENUCAPS, va("%.*s...%s", charsonside, addonname, addonname+((len-charlimit) + charsonside))); // variable reuse...
|
||||
#undef charsonside
|
||||
M_ScrollString(addonname, len, namescrollbuf, charlimit, namescroll);
|
||||
else
|
||||
V_DrawThinString(x+w+5, y+i-8, V_TRANSLUCENT|MENUCAPS, addonname); // variable reuse...
|
||||
strncpy(namescrollbuf, addonname, sizeof(namescrollbuf));
|
||||
V_DrawThinString(x+w+5, y+i-8, V_TRANSLUCENT|MENUCAPS, namescrollbuf); // variable reuse...
|
||||
}
|
||||
|
||||
if (!cv_kartencore.value || gamestate == GS_TIMEATTACK || cv_newgametype.value != GT_RACE)
|
||||
|
||||
+17
-28
@@ -212,14 +212,14 @@ extern menuitem_t PlayerMenu[MAXSKINS];
|
||||
typedef struct menu_s
|
||||
{
|
||||
const char *menutitlepic;
|
||||
INT16 numitems; // # of menu items
|
||||
struct menu_s *prevMenu; // previous menu
|
||||
menuitem_t *menuitems; // menu items
|
||||
void (*drawroutine)(void); // draw routine
|
||||
INT16 x, y; // x, y of menu
|
||||
INT16 lastOn; // last item user was on in menu
|
||||
boolean (*quitroutine)(void); // called before quit a menu return true if we can
|
||||
const char* tooltips[MAXTOOLTIPS]; // tooltips! give me that info bitch
|
||||
INT16 numitems; // # of menu items
|
||||
struct menu_s *prevMenu; // previous menu
|
||||
menuitem_t *menuitems; // menu items
|
||||
void (*drawroutine)(void); // draw routine
|
||||
INT16 x, y; // x, y of menu
|
||||
INT16 lastOn; // last item user was on in menu
|
||||
boolean (*quitroutine)(void); // called before quit a menu return true if we can
|
||||
const char* *tooltips; // tooltips! give me that info bitch
|
||||
} menu_t;
|
||||
|
||||
void M_SetupNextMenu(menu_t *menudef);
|
||||
@@ -335,7 +335,7 @@ void M_PopupMasterServerConnectError(void);
|
||||
void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* name);
|
||||
|
||||
// These defines make it a little easier to make menus
|
||||
#define DEFAULTMENUSTYLE(header, source, prev, x, y)\
|
||||
#define DEFAULTMENUSTYLE(header, source, prev, x, y, tooltip)\
|
||||
{\
|
||||
header,\
|
||||
sizeof(source)/sizeof(menuitem_t),\
|
||||
@@ -345,10 +345,10 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
|
||||
x, y,\
|
||||
0,\
|
||||
NULL,\
|
||||
{NULL}\
|
||||
tooltip\
|
||||
}
|
||||
|
||||
#define DEFAULTSCROLLSTYLE(header, source, prev, x, y)\
|
||||
#define DEFAULTSCROLLSTYLE(header, source, prev, x, y, tooltip)\
|
||||
{\
|
||||
header,\
|
||||
sizeof(source)/sizeof(menuitem_t),\
|
||||
@@ -358,7 +358,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
|
||||
x, y,\
|
||||
0,\
|
||||
NULL,\
|
||||
{NULL}\
|
||||
tooltip\
|
||||
}
|
||||
|
||||
|
||||
@@ -372,7 +372,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
|
||||
x, y,\
|
||||
0,\
|
||||
NULL,\
|
||||
{NULL}\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define CENTERMENUSTYLE(header, source, prev, y)\
|
||||
@@ -385,7 +385,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
|
||||
BASEVIDWIDTH/2, y,\
|
||||
0,\
|
||||
NULL,\
|
||||
{NULL}\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define MAPICONMENUSTYLE(header, source, prev)\
|
||||
@@ -398,7 +398,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
|
||||
24,40,\
|
||||
0,\
|
||||
NULL,\
|
||||
{NULL}\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define CONTROLMENUSTYLE(source, prev)\
|
||||
@@ -411,7 +411,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
|
||||
26, 40,\
|
||||
0,\
|
||||
NULL,\
|
||||
{NULL}\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define IMAGEDEF(source)\
|
||||
@@ -424,18 +424,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na
|
||||
0, 0,\
|
||||
0,\
|
||||
NULL,\
|
||||
{NULL}\
|
||||
}
|
||||
|
||||
#define DoToolTips(menu, tooltip)\
|
||||
if (currentMenu == &menu)\
|
||||
{\
|
||||
if (!(tooltip[itemOn] == NULL))\
|
||||
{\
|
||||
M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, tooltip[itemOn], coolalphatimer);\
|
||||
if (coolalphatimer > 0 && interpTimerHackAllow)\
|
||||
coolalphatimer--;\
|
||||
}\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+127
@@ -1604,6 +1604,52 @@ boolean M_ScreenshotResponder(event_t *ev)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void M_ScrollString(const char name[], size_t len, char result[], size_t maxlen, tic_t timer)
|
||||
{
|
||||
// How much should we scroll. Not sure why +1 is needed, but without it this function skips 2
|
||||
// characters at once sometimes
|
||||
const size_t amount = len - maxlen + 1;
|
||||
|
||||
// Note: anything above 17 will cause zero division
|
||||
const size_t MAXSPEED = 6;
|
||||
const tic_t t = timer / (35/min(amount, MAXSPEED));
|
||||
|
||||
const size_t state = (t / amount) % 4;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
// Show beginning of the name
|
||||
case 0:
|
||||
memcpy(result, name, maxlen-1);
|
||||
break;
|
||||
|
||||
// Scroll towards end of the name
|
||||
case 1:
|
||||
{
|
||||
const size_t advance = t % amount;
|
||||
memcpy(result, name+advance, maxlen-1);
|
||||
}
|
||||
break;
|
||||
|
||||
// Show end of the name
|
||||
case 2:
|
||||
memcpy(result, name+len+1-maxlen, maxlen-1);
|
||||
break;
|
||||
|
||||
// Scroll towards start of the name
|
||||
case 3:
|
||||
{
|
||||
const size_t advance = t % amount;
|
||||
memcpy(result, name+len+1-maxlen-advance, maxlen-1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Technically not necessary, since it gets set again after function call, but just in case
|
||||
result[maxlen] = 0;
|
||||
}
|
||||
|
||||
void M_MinimapGenerate(void)
|
||||
{
|
||||
#ifdef USE_PNG
|
||||
@@ -1762,6 +1808,87 @@ INT32 axtoi(const char *hexStg)
|
||||
return intValue;
|
||||
}
|
||||
|
||||
void CopyCaretColors(char *p, const char *s, int n)
|
||||
{
|
||||
char *t;
|
||||
int m;
|
||||
int c;
|
||||
|
||||
if (!n)
|
||||
return;
|
||||
|
||||
while (( t = strchr(s, '^') ))
|
||||
{
|
||||
m = ( t - s );
|
||||
|
||||
if (m >= n)
|
||||
{
|
||||
memcpy(p, s, n);
|
||||
return;
|
||||
}
|
||||
else
|
||||
memcpy(p, s, m);
|
||||
|
||||
p += m;
|
||||
n -= m;
|
||||
s += m;
|
||||
|
||||
if (!n)
|
||||
return;
|
||||
|
||||
if (s[1])
|
||||
{
|
||||
c = toupper(s[1]);
|
||||
if (isdigit(c))
|
||||
c = 0x80 + ( c - '0' );
|
||||
else if (c >= 'A' && c <= 'F')
|
||||
c = 0x80 + ( c - 'A' );
|
||||
else
|
||||
c = 0;
|
||||
|
||||
if (c)
|
||||
{
|
||||
*p++ = c;
|
||||
n--;
|
||||
|
||||
if (!n)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (n < 2)
|
||||
break;
|
||||
|
||||
memcpy(p, s, 2);
|
||||
|
||||
p += 2;
|
||||
n -= 2;
|
||||
}
|
||||
|
||||
s += 2;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
strncpy(p, s, n);
|
||||
}
|
||||
|
||||
void StripColors(char *dst, char *src, size_t n)
|
||||
{
|
||||
size_t j = 0;
|
||||
|
||||
for (size_t i = 0; j < n && src[i] != 0; ++i)
|
||||
{
|
||||
char c = src[i];
|
||||
|
||||
if ((c & 0x80) == 0)
|
||||
dst[j++] = c;
|
||||
}
|
||||
|
||||
dst[j] = 0;
|
||||
}
|
||||
|
||||
/** Token parser for TEXTURES, ANIMDEFS, and potentially other lumps later down the line.
|
||||
* Was originally R_GetTexturesToken when I was coding up the TEXTURES parser, until I realized I needed it for ANIMDEFS too.
|
||||
* Parses up to the next whitespace character or comma. When finding the start of the next token, whitespace is skipped.
|
||||
|
||||
@@ -73,6 +73,8 @@ void M_ScreenShot(void);
|
||||
void M_DoScreenShot(void);
|
||||
boolean M_ScreenshotResponder(event_t *ev);
|
||||
|
||||
void M_ScrollString(const char name[], size_t len, char result[], size_t maxlen, tic_t timer);
|
||||
|
||||
void M_MinimapGenerate(void);
|
||||
|
||||
void Command_SaveConfig_f(void);
|
||||
@@ -85,6 +87,11 @@ void M_SaveConfig(const char *filename);
|
||||
|
||||
INT32 axtoi(const char *hexStg);
|
||||
|
||||
void CopyCaretColors(char *p, const char *s, int n);
|
||||
|
||||
// Remove color codes from string
|
||||
void StripColors(char *dst, char *src, size_t n);
|
||||
|
||||
const char *GetRevisionString(void);
|
||||
|
||||
// Vector/matrix math
|
||||
|
||||
+8
-8
@@ -590,9 +590,9 @@ static void PS_CountThinkers(void)
|
||||
{
|
||||
ps_thinkercount.value.i++;
|
||||
|
||||
if (thinker->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
if (thinker->function == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
ps_removecount.value.i++;
|
||||
else if (thinker->function.acp1 == (actionf_p1)P_MobjThinker)
|
||||
else if (thinker->function == (actionf_p1)P_MobjThinker)
|
||||
{
|
||||
mobj_t *mobj = (mobj_t*)thinker;
|
||||
ps_mobjcount.value.i++;
|
||||
@@ -609,7 +609,7 @@ static void PS_CountThinkers(void)
|
||||
|
||||
for (thinker = precipcap.next; thinker != &precipcap; thinker = thinker->next)
|
||||
{
|
||||
if (thinker->function.acp1 != (actionf_p1)P_NullPrecipThinker)
|
||||
if (thinker->function != (actionf_p1)P_NullPrecipThinker)
|
||||
continue; // not a precipmobj thinker
|
||||
|
||||
ps_precipcount.value.i++;
|
||||
@@ -620,7 +620,7 @@ static void PS_CountThinkers(void)
|
||||
for (thinker = thlist[i].next; thinker != &thlist[i]; thinker = thinker->next)
|
||||
{
|
||||
ps_thinkercount.value.i++;
|
||||
if (thinker->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
if (thinker->function == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
ps_removecount.value.i++;
|
||||
else if (i == THINK_POLYOBJ)
|
||||
ps_polythcount.value.i++;
|
||||
@@ -628,7 +628,7 @@ static void PS_CountThinkers(void)
|
||||
ps_mainthcount.value.i++;
|
||||
else if (i == THINK_MOBJ)
|
||||
{
|
||||
if (thinker->function.acp1 == (actionf_p1)P_MobjThinker)
|
||||
if (thinker->function == (actionf_p1)P_MobjThinker)
|
||||
{
|
||||
mobj_t *mobj = (mobj_t*)thinker;
|
||||
ps_mobjcount.value.i++;
|
||||
@@ -739,7 +739,7 @@ static void PS_DrawDescriptorHeader(void)
|
||||
int samples_left = max(ps_frame_samples_left, ps_tick_samples_left);
|
||||
int x, y;
|
||||
|
||||
if (cv_perfstats.value >= 3)
|
||||
if (cv_perfstats.value >= 3)
|
||||
{
|
||||
x = 2;
|
||||
y = 0;
|
||||
@@ -892,7 +892,7 @@ static void draw_think_frame_stats(int hook_length, ps_hookinfo_t *hook)
|
||||
|
||||
PS_DrawDescriptorHeader();
|
||||
|
||||
for (i = 0; i < hook_length; i++)
|
||||
for (i = 0; i < hook_length; i++)
|
||||
{
|
||||
#define NEXT_ROW() y += HEIGHT;
|
||||
|
||||
@@ -1010,7 +1010,7 @@ void M_DrawPerfStats(void)
|
||||
// tics when frame skips happen
|
||||
PS_DrawGameLogicStats();
|
||||
}
|
||||
else if (cv_perfstats.value >= 3) // lua thinkframe
|
||||
else if (cv_perfstats.value >= 3) // lua thinkframe
|
||||
{
|
||||
if (!PS_IsLevelActive())
|
||||
return;
|
||||
|
||||
+2
-2
@@ -412,7 +412,7 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
|
||||
ceiling = Z_Calloc(sizeof (*ceiling), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&ceiling->thinker);
|
||||
sec->ceilingdata = ceiling;
|
||||
ceiling->thinker.function.acp1 = (actionf_p1)T_MoveCeiling;
|
||||
ceiling->thinker.function = (actionf_p1)T_MoveCeiling;
|
||||
ceiling->sector = sec;
|
||||
ceiling->crush = false;
|
||||
ceiling->sourceline = (INT32)(line-lines);
|
||||
@@ -635,7 +635,7 @@ INT32 EV_DoCrush(line_t *line, ceiling_e type)
|
||||
ceiling = Z_Calloc(sizeof (*ceiling), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&ceiling->thinker);
|
||||
sec->ceilingdata = ceiling;
|
||||
ceiling->thinker.function.acp1 = (actionf_p1)T_CrushCeiling;
|
||||
ceiling->thinker.function = (actionf_p1)T_CrushCeiling;
|
||||
ceiling->sector = sec;
|
||||
ceiling->crush = true;
|
||||
ceiling->sourceline = (INT32)(line-lines);
|
||||
|
||||
+1007
-884
File diff suppressed because it is too large.
Load diff
+7
-7
@@ -2483,7 +2483,7 @@ void T_CameraScanner(elevator_t *elevator)
|
||||
|
||||
for (UINT8 i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (!players[displayplayers[i]].mo || P_MobjWasRemoved(players[displayplayers[i]].mo))
|
||||
if (P_MobjWasRemoved(players[displayplayers[i]].mo))
|
||||
continue;
|
||||
|
||||
if (players[displayplayers[i]].mo->subsector->sector == elevator->actionsector)
|
||||
@@ -2545,7 +2545,7 @@ INT32 EV_DoFloor(line_t *line, floor_e floortype)
|
||||
sec->floordata = dofloor;
|
||||
|
||||
// set up some generic aspects of the floormove_t
|
||||
dofloor->thinker.function.acp1 = (actionf_p1)T_MoveFloor;
|
||||
dofloor->thinker.function = (actionf_p1)T_MoveFloor;
|
||||
dofloor->type = floortype;
|
||||
dofloor->crush = false; // default: types that crush will change this
|
||||
dofloor->sector = sec;
|
||||
@@ -2766,7 +2766,7 @@ INT32 EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed)
|
||||
P_AddThinker(&elevator->thinker);
|
||||
sec->floordata = elevator;
|
||||
sec->ceilingdata = elevator;
|
||||
elevator->thinker.function.acp1 = (actionf_p1)T_MoveElevator;
|
||||
elevator->thinker.function = (actionf_p1)T_MoveElevator;
|
||||
elevator->type = elevtype;
|
||||
elevator->sourceline = line;
|
||||
elevator->distance = 1; // Always crush unless otherwise
|
||||
@@ -2954,7 +2954,7 @@ INT32 EV_BounceSector(sector_t *sec, fixed_t momz, line_t *sourceline)
|
||||
bouncer = Z_Calloc(sizeof (*bouncer), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&bouncer->thinker);
|
||||
sec->ceilingdata = bouncer;
|
||||
bouncer->thinker.function.acp1 = (actionf_p1)T_BounceCheese;
|
||||
bouncer->thinker.function = (actionf_p1)T_BounceCheese;
|
||||
|
||||
// set up the fields according to the type of elevator action
|
||||
bouncer->sector = sec;
|
||||
@@ -2991,7 +2991,7 @@ INT32 EV_DoContinuousFall(sector_t *sec, sector_t *backsector, fixed_t spd, bool
|
||||
// create and initialize new thinker
|
||||
faller = Z_Calloc(sizeof (*faller), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&faller->thinker);
|
||||
faller->thinker.function.acp1 = (actionf_p1)T_ContinuousFalling;
|
||||
faller->thinker.function = (actionf_p1)T_ContinuousFalling;
|
||||
|
||||
// set up the fields
|
||||
faller->sector = sec;
|
||||
@@ -3044,7 +3044,7 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating,
|
||||
// create and initialize new elevator thinker
|
||||
elevator = Z_Calloc(sizeof (*elevator), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&elevator->thinker);
|
||||
elevator->thinker.function.acp1 = (actionf_p1)T_StartCrumble;
|
||||
elevator->thinker.function = (actionf_p1)T_StartCrumble;
|
||||
|
||||
// Does this crumbler return?
|
||||
if (crumblereturn)
|
||||
@@ -3123,7 +3123,7 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob
|
||||
P_AddThinker(&block->thinker);
|
||||
sec->floordata = block;
|
||||
sec->ceilingdata = block;
|
||||
block->thinker.function.acp1 = (actionf_p1)T_MarioBlock;
|
||||
block->thinker.function = (actionf_p1)T_MarioBlock;
|
||||
|
||||
// Set up the fields
|
||||
block->sector = sec;
|
||||
|
||||
+11
-9
@@ -473,7 +473,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
if (player->spectator)
|
||||
return;
|
||||
|
||||
if (special->tracer && !P_MobjWasRemoved(special->tracer) && toucher == special->tracer)
|
||||
if (!P_MobjWasRemoved(special->tracer) && toucher == special->tracer)
|
||||
{
|
||||
mobj_t *spbexplode;
|
||||
|
||||
@@ -487,7 +487,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
|
||||
spbexplode = P_SpawnMobj(toucher->x, toucher->y, toucher->z, MT_SPBEXPLOSION);
|
||||
spbexplode->extravalue1 = 1; // Tell K_ExplodePlayer to use extra knockback
|
||||
if (special->target && !P_MobjWasRemoved(special->target))
|
||||
if (!P_MobjWasRemoved(special->target))
|
||||
P_SetTarget(&spbexplode->target, special->target);
|
||||
|
||||
P_RemoveMobj(special);
|
||||
@@ -496,7 +496,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
K_SpinPlayer(player, special->target, 0, special, false);
|
||||
return;
|
||||
case MT_SMK_MOLE:
|
||||
if (special->target && !P_MobjWasRemoved(special->target))
|
||||
if (!P_MobjWasRemoved(special->target))
|
||||
return;
|
||||
|
||||
if (special->health <= 0 || toucher->health <= 0)
|
||||
@@ -961,7 +961,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
// scan the remaining thinkers to find koopa
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
@@ -1542,15 +1542,17 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
{
|
||||
if (target->target->hnext)
|
||||
K_KillBananaChain(target->target->hnext, inflictor, source);
|
||||
|
||||
target->target->player->kartstuff[k_itemamount] = 0;
|
||||
}
|
||||
else if (target->target->player->kartstuff[k_itemamount])
|
||||
else
|
||||
target->target->player->kartstuff[k_itemamount]--;
|
||||
}
|
||||
else if ((target->type == MT_ORBINAUT_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) // orbit items
|
||||
|| (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ))
|
||||
{
|
||||
target->target->player->kartstuff[k_itemamount]--;
|
||||
|
||||
if (target->lastlook != 0)
|
||||
{
|
||||
K_RepairOrbitChain(target);
|
||||
@@ -1763,7 +1765,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
case MT_SMK_ICEBLOCK:
|
||||
{
|
||||
mobj_t *cur = target->hnext;
|
||||
while (cur && !P_MobjWasRemoved(cur))
|
||||
while (!P_MobjWasRemoved(cur))
|
||||
{
|
||||
P_SetMobjState(cur, S_SMK_ICEBLOCK2);
|
||||
cur = cur->hnext;
|
||||
@@ -1814,7 +1816,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
// this can happen if the boss was hurt earlier than expected
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo = (mobj_t *)th;
|
||||
@@ -1836,14 +1838,14 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
// kill tracer
|
||||
if (target->type == MT_FROGGER)
|
||||
{
|
||||
if (target->tracer && !P_MobjWasRemoved(target->tracer))
|
||||
if (!P_MobjWasRemoved(target->tracer))
|
||||
P_KillMobj(target->tracer, inflictor, source);
|
||||
}
|
||||
|
||||
if (target->type == MT_FROGGER || target->type == MT_ROBRA_HEAD || target->type == MT_BLUEROBRA_HEAD) // clean hnext list
|
||||
{
|
||||
mobj_t *cur = target->hnext;
|
||||
while (cur && !P_MobjWasRemoved(cur))
|
||||
while (!P_MobjWasRemoved(cur))
|
||||
{
|
||||
P_KillMobj(cur, inflictor, source);
|
||||
cur = cur->hnext;
|
||||
|
||||
+6
-6
@@ -78,7 +78,7 @@ fireflicker_t *P_SpawnAdjustableFireFlicker(sector_t *minsector, sector_t *maxse
|
||||
|
||||
P_AddThinker(&flick->thinker);
|
||||
|
||||
flick->thinker.function.acp1 = (actionf_p1)T_FireFlicker;
|
||||
flick->thinker.function = (actionf_p1)T_FireFlicker;
|
||||
flick->sector = maxsector;
|
||||
flick->maxlight = maxsector->lightlevel;
|
||||
flick->minlight = minsector->lightlevel;
|
||||
@@ -140,7 +140,7 @@ void P_SpawnLightningFlash(sector_t *sector)
|
||||
|
||||
if (sector->lightingdata)
|
||||
{
|
||||
if (((lightflash_t *)sector->lightingdata)->thinker.function.acp1
|
||||
if (((lightflash_t *)sector->lightingdata)->thinker.function
|
||||
== (actionf_p1)T_LightningFlash)
|
||||
{
|
||||
// lightning was already flashing in this sector
|
||||
@@ -157,7 +157,7 @@ void P_SpawnLightningFlash(sector_t *sector)
|
||||
|
||||
P_AddThinker(&flash->thinker);
|
||||
|
||||
flash->thinker.function.acp1 = (actionf_p1)T_LightningFlash;
|
||||
flash->thinker.function = (actionf_p1)T_LightningFlash;
|
||||
flash->sector = sector;
|
||||
flash->maxlight = 255;
|
||||
flash->minlight = minlight;
|
||||
@@ -219,7 +219,7 @@ strobe_t *P_SpawnAdjustableStrobeFlash(sector_t *minsector, sector_t *maxsector,
|
||||
flash->sector = maxsector;
|
||||
flash->darktime = darktime;
|
||||
flash->brighttime = brighttime;
|
||||
flash->thinker.function.acp1 = (actionf_p1)T_StrobeFlash;
|
||||
flash->thinker.function = (actionf_p1)T_StrobeFlash;
|
||||
flash->maxlight = maxsector->lightlevel;
|
||||
flash->minlight = minsector->lightlevel;
|
||||
|
||||
@@ -301,7 +301,7 @@ glow_t *P_SpawnAdjustableGlowingLight(sector_t *minsector, sector_t *maxsector,
|
||||
g->minlight = g->maxlight;
|
||||
g->maxlight = oops;
|
||||
}
|
||||
g->thinker.function.acp1 = (actionf_p1)T_Glow;
|
||||
g->thinker.function = (actionf_p1)T_Glow;
|
||||
g->direction = 1;
|
||||
g->speed = length/4;
|
||||
if (g->speed > (g->maxlight - g->minlight)/2) // don't make it ridiculous speed
|
||||
@@ -347,7 +347,7 @@ void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed)
|
||||
|
||||
P_RemoveLighting(sector); // remove the old lighting effect first
|
||||
ll = Z_Calloc(sizeof (*ll), PU_LEVSPEC, NULL);
|
||||
ll->thinker.function.acp1 = (actionf_p1)T_LightFade;
|
||||
ll->thinker.function = (actionf_p1)T_LightFade;
|
||||
sector->lightingdata = ll; // set it to the lightlevel_t
|
||||
|
||||
P_AddThinker(&ll->thinker); // add thinker
|
||||
|
||||
+3
-1
@@ -158,6 +158,8 @@ extern consvar_t cv_tiltsmoothing;
|
||||
|
||||
extern consvar_t cv_actionmovie;
|
||||
|
||||
extern consvar_t cv_screenquake;
|
||||
|
||||
extern consvar_t cv_lookbackmom[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern consvar_t cv_verticallook[MAXSPLITSCREENPLAYERS];
|
||||
@@ -277,7 +279,7 @@ void P_SceneryThinker(mobj_t *mobj);
|
||||
// To test it in Lua, check mobj.valid
|
||||
FUNCINLINE static ATTRINLINE boolean P_MobjWasRemoved(const mobj_t *mobj)
|
||||
{
|
||||
return (!mobj || mobj->thinker.function.acp1 != (actionf_p1)P_MobjThinker);
|
||||
return (!mobj || mobj->thinker.function != (actionf_p1)P_MobjThinker);
|
||||
}
|
||||
|
||||
fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect);
|
||||
|
||||
+39
-37
@@ -321,7 +321,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||
return true;
|
||||
|
||||
// Ignore... things.
|
||||
if (!tmthing || !thing || P_MobjWasRemoved(thing))
|
||||
if (!tmthing || P_MobjWasRemoved(thing))
|
||||
return true;
|
||||
|
||||
I_Assert(!P_MobjWasRemoved(tmthing));
|
||||
@@ -1691,7 +1691,7 @@ static boolean PIT_CheckLine(line_t *ld)
|
||||
boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||
{
|
||||
INT32 xl, xh, yl, yh, bx, by;
|
||||
subsector_t *newsubsec;
|
||||
sector_t *newsec;
|
||||
boolean blockval = true;
|
||||
|
||||
ps_checkposition_calls.value.i++;
|
||||
@@ -1714,9 +1714,9 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||
tmbbox[BOXLEFT] = x - tmthing->radius;
|
||||
|
||||
if (thing->x != x || thing->y != y || thing->subsector == NULL)
|
||||
newsubsec = R_PointInSubsector(x, y);
|
||||
newsec = R_PointInSubsector(x, y)->sector;
|
||||
else
|
||||
newsubsec = thing->subsector;
|
||||
newsec = thing->subsector->sector;
|
||||
|
||||
ceilingline = blockingline = NULL;
|
||||
|
||||
@@ -1724,33 +1724,34 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
||||
// that contains the point.
|
||||
// Any contacted lines the step closer together
|
||||
// will adjust them.
|
||||
tmfloorz = tmdropoffz = P_GetFloorZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->floorheight;
|
||||
tmceilingz = P_GetCeilingZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->ceilingheight;
|
||||
tmfloorslope = newsubsec->sector->f_slope;
|
||||
tmceilingslope = newsubsec->sector->c_slope;
|
||||
tmfloorz = tmdropoffz = P_GetFloorZ(thing, newsec, x, y, NULL); //newsec->floorheight;
|
||||
tmceilingz = P_GetCeilingZ(thing, newsec, x, y, NULL); //newsec->ceilingheight;
|
||||
tmfloorslope = newsec->f_slope;
|
||||
tmceilingslope = newsec->c_slope;
|
||||
|
||||
// Check list of fake floors and see if tmfloorz/tmceilingz need to be altered.
|
||||
if (newsubsec->sector->ffloors)
|
||||
if (newsec->ffloors)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
fixed_t delta1, delta2;
|
||||
INT32 thingtop = thing->z + thing->height;
|
||||
|
||||
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
|
||||
for (rover = newsec->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
fixed_t topheight, bottomheight, midheight;
|
||||
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
topheight = P_GetFOFTopZ(thing, newsubsec->sector, rover, x, y, NULL);
|
||||
bottomheight = P_GetFOFBottomZ(thing, newsubsec->sector, rover, x, y, NULL);
|
||||
topheight = P_GetFOFTopZ(thing, newsec, rover, x, y, NULL);
|
||||
bottomheight = P_GetFOFBottomZ(thing, newsec, rover, x, y, NULL);
|
||||
|
||||
if ((rover->flags & (FF_SWIMMABLE|FF_GOOWATER)) == (FF_SWIMMABLE|FF_GOOWATER) && !(thing->flags & MF_NOGRAVITY))
|
||||
{
|
||||
// If you're inside goowater and slowing down
|
||||
fixed_t sinklevel = FixedMul(thing->info->height/6, thing->scale);
|
||||
fixed_t minspeed = FixedMul(thing->info->height/9, thing->scale);
|
||||
|
||||
if (thing->z < topheight && bottomheight < thingtop
|
||||
&& abs(thing->momz) < minspeed)
|
||||
{
|
||||
@@ -1984,7 +1985,7 @@ void P_CheckHoopPosition(mobj_t *hoopthing, fixed_t x, fixed_t y, fixed_t z, fix
|
||||
boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
{
|
||||
INT32 xl, xh, yl, yh, bx, by;
|
||||
subsector_t *newsubsec;
|
||||
sector_t *newsec;
|
||||
|
||||
tmx = x;
|
||||
tmy = y;
|
||||
@@ -1995,15 +1996,15 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
tmbbox[BOXLEFT] = x - thiscam->radius;
|
||||
|
||||
if (thiscam->x != x || thiscam->y != y || thiscam->subsector == NULL)
|
||||
newsubsec = R_PointInSubsector(x, y);
|
||||
newsec = R_PointInSubsectorFast(x, y)->sector;
|
||||
else
|
||||
newsubsec = thiscam->subsector;
|
||||
newsec = thiscam->subsector->sector;
|
||||
|
||||
ceilingline = blockingline = NULL;
|
||||
|
||||
mapcampointer = thiscam;
|
||||
|
||||
if (GETSECSPECIAL(newsubsec->sector->special, 4) == 12)
|
||||
if (GETSECSPECIAL(newsec->special, 4) == 12)
|
||||
{ // Camera noclip on entire sector.
|
||||
tmfloorz = tmdropoffz = thiscam->z;
|
||||
tmceilingz = tmdrpoffceilz = thiscam->z + thiscam->height;
|
||||
@@ -2014,45 +2015,47 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
// that contains the point.
|
||||
// Any contacted lines the step closer together
|
||||
// will adjust them.
|
||||
tmfloorz = tmdropoffz = P_CameraGetFloorZ(thiscam, newsubsec->sector, x, y, NULL);
|
||||
tmfloorz = tmdropoffz = P_CameraGetFloorZ(thiscam, newsec, x, y, NULL);
|
||||
|
||||
tmceilingz = P_CameraGetCeilingZ(thiscam, newsubsec->sector, x, y, NULL);
|
||||
tmceilingz = P_CameraGetCeilingZ(thiscam, newsec, x, y, NULL);
|
||||
|
||||
// Cameras use the heightsec's heights rather then the actual sector heights.
|
||||
// If you can see through it, why not move the camera through it too?
|
||||
if (newsubsec->sector->heightsec >= 0)
|
||||
if (newsec->heightsec >= 0)
|
||||
{
|
||||
tmfloorz = tmdropoffz = sectors[newsubsec->sector->heightsec].floorheight;
|
||||
tmceilingz = tmdrpoffceilz = sectors[newsubsec->sector->heightsec].ceilingheight;
|
||||
tmfloorz = tmdropoffz = sectors[newsec->heightsec].floorheight;
|
||||
tmceilingz = tmdrpoffceilz = sectors[newsec->heightsec].ceilingheight;
|
||||
}
|
||||
|
||||
// Use preset camera clipping heights if set with Sector Special Parameters whose control sector has Camera Intangible special -Red
|
||||
if (newsubsec->sector->camsec >= 0)
|
||||
if (newsec->camsec >= 0)
|
||||
{
|
||||
tmfloorz = tmdropoffz = sectors[newsubsec->sector->camsec].floorheight;
|
||||
tmceilingz = tmdrpoffceilz = sectors[newsubsec->sector->camsec].ceilingheight;
|
||||
tmfloorz = tmdropoffz = sectors[newsec->camsec].floorheight;
|
||||
tmceilingz = tmdrpoffceilz = sectors[newsec->camsec].ceilingheight;
|
||||
}
|
||||
|
||||
// Check list of fake floors and see if tmfloorz/tmceilingz need to be altered.
|
||||
if (newsubsec->sector->ffloors)
|
||||
if (newsec->ffloors)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
fixed_t delta1, delta2;
|
||||
INT32 thingtop = thiscam->z + thiscam->height;
|
||||
|
||||
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
|
||||
for (rover = newsec->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
fixed_t topheight, bottomheight;
|
||||
|
||||
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
|
||||
continue;
|
||||
|
||||
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, x, y, NULL);
|
||||
bottomheight = P_CameraGetFOFBottomZ(thiscam, newsubsec->sector, rover, x, y, NULL);
|
||||
topheight = P_CameraGetFOFTopZ(thiscam, newsec, rover, x, y, NULL);
|
||||
bottomheight = P_CameraGetFOFBottomZ(thiscam, newsec, rover, x, y, NULL);
|
||||
|
||||
delta1 = thiscam->z - (bottomheight
|
||||
+ ((topheight - bottomheight)/2));
|
||||
delta2 = thingtop - (bottomheight
|
||||
+ ((topheight - bottomheight)/2));
|
||||
|
||||
if (topheight > tmfloorz && abs(delta1) < abs(delta2))
|
||||
{
|
||||
tmfloorz = tmdropoffz = topheight;
|
||||
@@ -2171,8 +2174,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
{
|
||||
subsector_t *s;
|
||||
|
||||
boolean retval = true;
|
||||
UINT8 i;
|
||||
|
||||
floatok = false;
|
||||
@@ -2181,7 +2182,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
return false;
|
||||
|
||||
if (thiscam->x != x || thiscam->y != y || thiscam->subsector == NULL)
|
||||
s = R_PointInSubsector(x, y);
|
||||
s = R_PointInSubsectorFast(x, y);
|
||||
else
|
||||
s = thiscam->subsector;
|
||||
|
||||
@@ -2222,12 +2223,12 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
else
|
||||
tryy = y;
|
||||
|
||||
if (!P_CheckCameraPosition(tryx, tryy, thiscam))
|
||||
return false; // solid wall or thing
|
||||
|
||||
if (tmceilingz - tmfloorz < thiscam->height)
|
||||
return false; // doesn't fit
|
||||
|
||||
if (!P_CheckCameraPosition(tryx, tryy, thiscam))
|
||||
return false; // solid wall or thing
|
||||
|
||||
floatok = true;
|
||||
|
||||
if (tmceilingz - thiscam->z < thiscam->height)
|
||||
@@ -2248,7 +2249,8 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
|
||||
if ((tmfloorz - thiscam->z > MAXCAMERASTEPMOVE))
|
||||
return false; // too big a step up
|
||||
} while(tryx != x || tryy != y);
|
||||
|
||||
} while (tryx != x || tryy != y);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2265,7 +2267,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||
thiscam->y = y;
|
||||
thiscam->subsector = s;
|
||||
|
||||
return retval;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -3624,7 +3626,7 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
|
||||
|
||||
for (think = thinkercap.next; think != &thinkercap; think = think->next)
|
||||
{
|
||||
if (think->function.acp1 != (actionf_p1)T_StartCrumble)
|
||||
if (think->function != (actionf_p1)T_StartCrumble)
|
||||
continue;
|
||||
|
||||
crumbler = (elevator_t *)think;
|
||||
|
||||
+1
-1
@@ -908,7 +908,7 @@ void P_SetUnderlayPosition(mobj_t *thing)
|
||||
|
||||
void P_SetPrecipitationThingPosition(precipmobj_t *thing)
|
||||
{
|
||||
thing->subsector = R_PointInSubsector(thing->x, thing->y);
|
||||
thing->subsector = R_PointInSubsectorFast(thing->x, thing->y);
|
||||
|
||||
// NOTE: this works because bnext/bprev are at the same
|
||||
// offsets in precipmobj_t and mobj_t
|
||||
|
||||
+1606
-1550
File diff suppressed because it is too large.
Load diff
@@ -414,6 +414,7 @@ typedef struct mobj_s
|
||||
boolean init_salty;
|
||||
|
||||
// WARNING: New fields must be added separately to savegame and Lua.
|
||||
boolean islocal; // BEWARE: islocal does not exist in vanilla, strictly to be used for locally loaded addons to not cause desynchs with the mobj linedef trigger check. DO NOT USE THIS IN ACTUAL ADDONS YOU INTEND TO USE ON YOUR SERVER
|
||||
} mobj_t;
|
||||
|
||||
//
|
||||
|
||||
+13
-13
@@ -1557,7 +1557,7 @@ void Polyobj_InitLevel(void)
|
||||
// the mobj_t pointers on a queue for use below.
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mobj_t *mo = (mobj_t *)th;
|
||||
@@ -1832,7 +1832,7 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
|
||||
// We redo this each tic to make savegame compatibility easier.
|
||||
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
|
||||
{
|
||||
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
if (wp->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)wp;
|
||||
@@ -1916,7 +1916,7 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
|
||||
// Find next waypoint
|
||||
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
|
||||
{
|
||||
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
if (wp->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)wp;
|
||||
@@ -1955,7 +1955,7 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
|
||||
|
||||
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
|
||||
{
|
||||
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
if (wp->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)wp;
|
||||
@@ -1992,7 +1992,7 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
|
||||
|
||||
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
|
||||
{
|
||||
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
if (wp->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)wp;
|
||||
@@ -2357,7 +2357,7 @@ INT32 EV_DoPolyObjRotate(polyrotdata_t *prdata)
|
||||
|
||||
// create a new thinker
|
||||
th = Z_Malloc(sizeof(polyrotate_t), PU_LEVSPEC, NULL);
|
||||
th->thinker.function.acp1 = (actionf_p1)T_PolyObjRotate;
|
||||
th->thinker.function = (actionf_p1)T_PolyObjRotate;
|
||||
PolyObj_AddThinker(&th->thinker);
|
||||
po->thinker = &th->thinker;
|
||||
|
||||
@@ -2425,7 +2425,7 @@ INT32 EV_DoPolyObjMove(polymovedata_t *pmdata)
|
||||
|
||||
// create a new thinker
|
||||
th = Z_Malloc(sizeof(polymove_t), PU_LEVSPEC, NULL);
|
||||
th->thinker.function.acp1 = (actionf_p1)T_PolyObjMove;
|
||||
th->thinker.function = (actionf_p1)T_PolyObjMove;
|
||||
PolyObj_AddThinker(&th->thinker);
|
||||
po->thinker = &th->thinker;
|
||||
|
||||
@@ -2491,7 +2491,7 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
|
||||
|
||||
// create a new thinker
|
||||
th = Z_Malloc(sizeof(polywaypoint_t), PU_LEVSPEC, NULL);
|
||||
th->thinker.function.acp1 = (actionf_p1)T_PolyObjWaypoint;
|
||||
th->thinker.function = (actionf_p1)T_PolyObjWaypoint;
|
||||
PolyObj_AddThinker(&th->thinker);
|
||||
po->thinker = &th->thinker;
|
||||
|
||||
@@ -2512,7 +2512,7 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
|
||||
// Find the first waypoint we need to use
|
||||
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
|
||||
{
|
||||
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
if (wp->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)wp;
|
||||
@@ -2627,7 +2627,7 @@ static void Polyobj_doSlideDoor(polyobj_t *po, polydoordata_t *doordata)
|
||||
|
||||
// allocate and add a new slide door thinker
|
||||
th = Z_Malloc(sizeof(polyslidedoor_t), PU_LEVSPEC, NULL);
|
||||
th->thinker.function.acp1 = (actionf_p1)T_PolyDoorSlide;
|
||||
th->thinker.function = (actionf_p1)T_PolyDoorSlide;
|
||||
PolyObj_AddThinker(&th->thinker);
|
||||
|
||||
// point the polyobject to this thinker
|
||||
@@ -2678,7 +2678,7 @@ static void Polyobj_doSwingDoor(polyobj_t *po, polydoordata_t *doordata)
|
||||
|
||||
// allocate and add a new swing door thinker
|
||||
th = Z_Malloc(sizeof(polyswingdoor_t), PU_LEVSPEC, NULL);
|
||||
th->thinker.function.acp1 = (actionf_p1)T_PolyDoorSwing;
|
||||
th->thinker.function = (actionf_p1)T_PolyDoorSwing;
|
||||
PolyObj_AddThinker(&th->thinker);
|
||||
|
||||
// point the polyobject to this thinker
|
||||
@@ -2763,7 +2763,7 @@ INT32 EV_DoPolyObjDisplace(polydisplacedata_t *prdata)
|
||||
|
||||
// create a new thinker
|
||||
th = Z_Malloc(sizeof(polydisplace_t), PU_LEVSPEC, NULL);
|
||||
th->thinker.function.acp1 = (actionf_p1)T_PolyObjDisplace;
|
||||
th->thinker.function = (actionf_p1)T_PolyObjDisplace;
|
||||
PolyObj_AddThinker(&th->thinker);
|
||||
po->thinker = &th->thinker;
|
||||
|
||||
@@ -2867,7 +2867,7 @@ INT32 EV_DoPolyObjFlag(line_t *pfdata)
|
||||
|
||||
// create a new thinker
|
||||
th = Z_Malloc(sizeof(polymove_t), PU_LEVSPEC, NULL);
|
||||
th->thinker.function.acp1 = (actionf_p1)T_PolyObjFlag;
|
||||
th->thinker.function = (actionf_p1)T_PolyObjFlag;
|
||||
PolyObj_AddThinker(&th->thinker);
|
||||
po->thinker = &th->thinker;
|
||||
|
||||
|
||||
+67
-67
@@ -1677,194 +1677,194 @@ static void P_NetArchiveThinkers(savebuffer_t *save)
|
||||
// save off the current thinkers
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
if (th->function == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
continue;
|
||||
|
||||
numsaved++;
|
||||
|
||||
if (th->function.acp1 == (actionf_p1)P_MobjThinker)
|
||||
if (th->function == (actionf_p1)P_MobjThinker)
|
||||
{
|
||||
SaveMobjThinker(save, th, tc_mobj);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_MoveCeiling)
|
||||
else if (th->function == (actionf_p1)T_MoveCeiling)
|
||||
{
|
||||
SaveCeilingThinker(save, th, tc_ceiling);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_CrushCeiling)
|
||||
else if (th->function == (actionf_p1)T_CrushCeiling)
|
||||
{
|
||||
SaveCeilingThinker(save, th, tc_crushceiling);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_MoveFloor)
|
||||
else if (th->function == (actionf_p1)T_MoveFloor)
|
||||
{
|
||||
SaveFloormoveThinker(save, th, tc_floor);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_LightningFlash)
|
||||
else if (th->function == (actionf_p1)T_LightningFlash)
|
||||
{
|
||||
SaveLightflashThinker(save, th, tc_flash);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_StrobeFlash)
|
||||
else if (th->function == (actionf_p1)T_StrobeFlash)
|
||||
{
|
||||
SaveStrobeThinker(save, th, tc_strobe);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_Glow)
|
||||
else if (th->function == (actionf_p1)T_Glow)
|
||||
{
|
||||
SaveGlowThinker(save, th, tc_glow);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_FireFlicker)
|
||||
else if (th->function == (actionf_p1)T_FireFlicker)
|
||||
{
|
||||
SaveFireflickerThinker(save, th, tc_fireflicker);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_MoveElevator)
|
||||
else if (th->function == (actionf_p1)T_MoveElevator)
|
||||
{
|
||||
SaveElevatorThinker(save, th, tc_elevator);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_ContinuousFalling)
|
||||
else if (th->function == (actionf_p1)T_ContinuousFalling)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_continuousfalling);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_ThwompSector)
|
||||
else if (th->function == (actionf_p1)T_ThwompSector)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_thwomp);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_NoEnemiesSector)
|
||||
else if (th->function == (actionf_p1)T_NoEnemiesSector)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_noenemies);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_EachTimeThinker)
|
||||
else if (th->function == (actionf_p1)T_EachTimeThinker)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_eachtime);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_RaiseSector)
|
||||
else if (th->function == (actionf_p1)T_RaiseSector)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_raisesector);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_CameraScanner)
|
||||
else if (th->function == (actionf_p1)T_CameraScanner)
|
||||
{
|
||||
SaveElevatorThinker(save, th, tc_camerascanner);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_Scroll)
|
||||
else if (th->function == (actionf_p1)T_Scroll)
|
||||
{
|
||||
SaveScrollThinker(save, th, tc_scroll);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_Friction)
|
||||
else if (th->function == (actionf_p1)T_Friction)
|
||||
{
|
||||
SaveFrictionThinker(save, th, tc_friction);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_Pusher)
|
||||
else if (th->function == (actionf_p1)T_Pusher)
|
||||
{
|
||||
SavePusherThinker(save, th, tc_pusher);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_BounceCheese)
|
||||
else if (th->function == (actionf_p1)T_BounceCheese)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_bouncecheese);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_StartCrumble)
|
||||
else if (th->function == (actionf_p1)T_StartCrumble)
|
||||
{
|
||||
SaveElevatorThinker(save, th, tc_startcrumble);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_MarioBlock)
|
||||
else if (th->function == (actionf_p1)T_MarioBlock)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_marioblock);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_MarioBlockChecker)
|
||||
else if (th->function == (actionf_p1)T_MarioBlockChecker)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_marioblockchecker);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_SpikeSector)
|
||||
else if (th->function == (actionf_p1)T_SpikeSector)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_spikesector);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_FloatSector)
|
||||
else if (th->function == (actionf_p1)T_FloatSector)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_floatsector);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_BridgeThinker)
|
||||
else if (th->function == (actionf_p1)T_BridgeThinker)
|
||||
{
|
||||
SaveSpecialLevelThinker(save, th, tc_bridgethinker);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_LaserFlash)
|
||||
else if (th->function == (actionf_p1)T_LaserFlash)
|
||||
{
|
||||
SaveLaserThinker(save, th, tc_laserflash);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_LightFade)
|
||||
else if (th->function == (actionf_p1)T_LightFade)
|
||||
{
|
||||
SaveLightlevelThinker(save, th, tc_lightfade);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_ExecutorDelay)
|
||||
else if (th->function == (actionf_p1)T_ExecutorDelay)
|
||||
{
|
||||
SaveExecutorThinker(save, th, tc_executor);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_Disappear)
|
||||
else if (th->function == (actionf_p1)T_Disappear)
|
||||
{
|
||||
SaveDisappearThinker(save, th, tc_disappear);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_PolyObjRotate)
|
||||
else if (th->function == (actionf_p1)T_PolyObjRotate)
|
||||
{
|
||||
SavePolyrotatetThinker(save, th, tc_polyrotate);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_PolyObjMove)
|
||||
else if (th->function == (actionf_p1)T_PolyObjMove)
|
||||
{
|
||||
SavePolymoveThinker(save, th, tc_polymove);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_PolyObjWaypoint)
|
||||
else if (th->function == (actionf_p1)T_PolyObjWaypoint)
|
||||
{
|
||||
SavePolywaypointThinker(save, th, tc_polywaypoint);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_PolyDoorSlide)
|
||||
else if (th->function == (actionf_p1)T_PolyDoorSlide)
|
||||
{
|
||||
SavePolyslidedoorThinker(save, th, tc_polyslidedoor);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_PolyDoorSwing)
|
||||
else if (th->function == (actionf_p1)T_PolyDoorSwing)
|
||||
{
|
||||
SavePolyswingdoorThinker(save, th, tc_polyswingdoor);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_PolyObjFlag)
|
||||
else if (th->function == (actionf_p1)T_PolyObjFlag)
|
||||
{
|
||||
SavePolymoveThinker(save, th, tc_polyflag);
|
||||
continue;
|
||||
}
|
||||
else if (th->function.acp1 == (actionf_p1)T_PolyObjDisplace)
|
||||
else if (th->function == (actionf_p1)T_PolyObjDisplace)
|
||||
{
|
||||
SavePolydisplaceThinker(save, th, tc_polydisplace);
|
||||
continue;
|
||||
}
|
||||
#ifdef PARANOIA
|
||||
else if (th->function.acp1 != (actionf_p1)P_RemoveThinkerDelayed) // wait garbage collection
|
||||
I_Error("unknown thinker type %p", th->function.acp1);
|
||||
else if (th->function != (actionf_p1)P_RemoveThinkerDelayed) // wait garbage collection
|
||||
I_Error("unknown thinker type %p", th->function);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1884,7 +1884,7 @@ mobj_t *P_FindNewPosition(UINT32 oldposition)
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mobj = (mobj_t *)th;
|
||||
@@ -1983,7 +1983,7 @@ static void LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
mobj = AllocMobj();
|
||||
|
||||
// declare this as a valid mobj as soon as possible.
|
||||
mobj->thinker.function.acp1 = thinker;
|
||||
mobj->thinker.function = thinker;
|
||||
|
||||
mobj->z = z;
|
||||
mobj->floorz = floorz;
|
||||
@@ -2216,7 +2216,7 @@ static void LoadSpecialLevelThinker(savebuffer_t *save, actionf_p1 thinker, UINT
|
||||
{
|
||||
levelspecthink_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
size_t i;
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
ht->vars[i] = READFIXED(save->p); //var[16]
|
||||
@@ -2244,7 +2244,7 @@ static void LoadSpecialLevelThinker(savebuffer_t *save, actionf_p1 thinker, UINT
|
||||
static void LoadCeilingThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
ceiling_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->type = READUINT8(save->p);
|
||||
ht->sector = LoadSector(READUINT32(save->p));
|
||||
ht->bottomheight = READFIXED(save->p);
|
||||
@@ -2273,7 +2273,7 @@ static void LoadCeilingThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static void LoadFloormoveThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
floormove_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->type = READUINT8(save->p);
|
||||
ht->crush = READUINT8(save->p);
|
||||
ht->sector = LoadSector(READUINT32(save->p));
|
||||
@@ -2297,7 +2297,7 @@ static void LoadFloormoveThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static void LoadLightflashThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
lightflash_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->sector = LoadSector(READUINT32(save->p));
|
||||
ht->maxlight = READINT32(save->p);
|
||||
ht->minlight = READINT32(save->p);
|
||||
@@ -2314,7 +2314,7 @@ static void LoadLightflashThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static void LoadStrobeThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
strobe_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->sector = LoadSector(READUINT32(save->p));
|
||||
ht->count = READINT32(save->p);
|
||||
ht->minlight = READINT32(save->p);
|
||||
@@ -2334,7 +2334,7 @@ static void LoadStrobeThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static void LoadGlowThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
glow_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->sector = LoadSector(READUINT32(save->p));
|
||||
ht->minlight = READINT32(save->p);
|
||||
ht->maxlight = READINT32(save->p);
|
||||
@@ -2353,7 +2353,7 @@ static void LoadGlowThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static void LoadFireflickerThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
fireflicker_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->sector = LoadSector(READUINT32(save->p));
|
||||
ht->count = READINT32(save->p);
|
||||
ht->resetcount = READINT32(save->p);
|
||||
@@ -2372,7 +2372,7 @@ static void LoadFireflickerThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static void LoadElevatorThinker(savebuffer_t *save, actionf_p1 thinker, UINT8 floorOrCeiling)
|
||||
{
|
||||
elevator_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->type = READUINT8(save->p);
|
||||
ht->sector = LoadSector(READUINT32(save->p));
|
||||
ht->actionsector = LoadSector(READUINT32(save->p));
|
||||
@@ -2410,7 +2410,7 @@ static void LoadElevatorThinker(savebuffer_t *save, actionf_p1 thinker, UINT8 fl
|
||||
static void LoadScrollThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
scroll_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->dx = READFIXED(save->p);
|
||||
ht->dy = READFIXED(save->p);
|
||||
ht->affectee = READINT32(save->p);
|
||||
@@ -2432,7 +2432,7 @@ static void LoadScrollThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static inline void LoadFrictionThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
friction_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->friction = READINT32(save->p);
|
||||
ht->movefactor = READINT32(save->p);
|
||||
ht->affectee = READINT32(save->p);
|
||||
@@ -2449,7 +2449,7 @@ static inline void LoadFrictionThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static void LoadPusherThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
pusher_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->type = READUINT8(save->p);
|
||||
ht->x_mag = READINT32(save->p);
|
||||
ht->y_mag = READINT32(save->p);
|
||||
@@ -2476,7 +2476,7 @@ static inline void LoadLaserThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
laserthink_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ffloor_t *rover = NULL;
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->sector = LoadSector(READUINT32(save->p));
|
||||
ht->sec = LoadSector(READUINT32(save->p));
|
||||
ht->sourceline = LoadLine(READUINT32(save->p));
|
||||
@@ -2495,7 +2495,7 @@ static inline void LoadLaserThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
FUNCINLINE static ATTRINLINE void LoadLightlevelThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
lightlevel_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->sector = LoadSector(READUINT32(save->p));
|
||||
ht->destlevel = READINT32(save->p);
|
||||
ht->speed = READINT32(save->p);
|
||||
@@ -2512,7 +2512,7 @@ FUNCINLINE static ATTRINLINE void LoadLightlevelThinker(savebuffer_t *save, acti
|
||||
static inline void LoadExecutorThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
executor_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->line = LoadLine(READUINT32(save->p));
|
||||
ht->caller = LoadMobj(READUINT32(save->p));
|
||||
ht->sector = LoadSector(READUINT32(save->p));
|
||||
@@ -2528,7 +2528,7 @@ static inline void LoadExecutorThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static inline void LoadDisappearThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
disappear_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->appeartime = READUINT32(save->p);
|
||||
ht->disappeartime = READUINT32(save->p);
|
||||
ht->offset = READUINT32(save->p);
|
||||
@@ -2547,7 +2547,7 @@ static inline void LoadDisappearThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static inline void LoadPolyrotatetThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
polyrotate_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->polyObjNum = READINT32(save->p);
|
||||
ht->speed = READINT32(save->p);
|
||||
ht->distance = READINT32(save->p);
|
||||
@@ -2563,7 +2563,7 @@ static inline void LoadPolyrotatetThinker(savebuffer_t *save, actionf_p1 thinker
|
||||
static void LoadPolymoveThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
polymove_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->polyObjNum = READINT32(save->p);
|
||||
ht->speed = READINT32(save->p);
|
||||
ht->momx = READFIXED(save->p);
|
||||
@@ -2581,7 +2581,7 @@ static void LoadPolymoveThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
static inline void LoadPolywaypointThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
polywaypoint_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->polyObjNum = READINT32(save->p);
|
||||
ht->speed = READINT32(save->p);
|
||||
ht->sequence = READINT32(save->p);
|
||||
@@ -2605,7 +2605,7 @@ static inline void LoadPolywaypointThinker(savebuffer_t *save, actionf_p1 thinke
|
||||
static inline void LoadPolyslidedoorThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
polyslidedoor_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->polyObjNum = READINT32(save->p);
|
||||
ht->delay = READINT32(save->p);
|
||||
ht->delayCount = READINT32(save->p);
|
||||
@@ -2630,7 +2630,7 @@ static inline void LoadPolyslidedoorThinker(savebuffer_t *save, actionf_p1 think
|
||||
static inline void LoadPolyswingdoorThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
polyswingdoor_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->polyObjNum = READINT32(save->p);
|
||||
ht->delay = READINT32(save->p);
|
||||
ht->delayCount = READINT32(save->p);
|
||||
@@ -2650,7 +2650,7 @@ static inline void LoadPolyswingdoorThinker(savebuffer_t *save, actionf_p1 think
|
||||
static inline void LoadPolydisplaceThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
{
|
||||
polydisplace_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
|
||||
ht->thinker.function.acp1 = thinker;
|
||||
ht->thinker.function = thinker;
|
||||
ht->polyObjNum = READINT32(save->p);
|
||||
ht->controlSector = LoadSector(READUINT32(save->p));
|
||||
ht->dx = READFIXED(save->p);
|
||||
@@ -2680,7 +2680,7 @@ static void P_NetUnArchiveThinkers(savebuffer_t *save)
|
||||
{
|
||||
next = currentthinker->next;
|
||||
|
||||
if (currentthinker->function.acp1 == (actionf_p1)P_MobjThinker)
|
||||
if (currentthinker->function == (actionf_p1)P_MobjThinker)
|
||||
P_RemoveSavegameMobj((mobj_t *)currentthinker); // item isn't saved, don't remove it
|
||||
else
|
||||
{
|
||||
@@ -2874,7 +2874,7 @@ static void P_NetUnArchiveThinkers(savebuffer_t *save)
|
||||
for (currentthinker = thinkercap.next; currentthinker != &thinkercap;
|
||||
currentthinker = currentthinker->next)
|
||||
{
|
||||
if (currentthinker->function.acp1 != (actionf_p1)T_ExecutorDelay)
|
||||
if (currentthinker->function != (actionf_p1)T_ExecutorDelay)
|
||||
continue;
|
||||
|
||||
delay = (void *)currentthinker;
|
||||
@@ -2989,7 +2989,7 @@ static inline void P_FinishMobjs(void)
|
||||
for (currentthinker = thinkercap.next; currentthinker != &thinkercap;
|
||||
currentthinker = currentthinker->next)
|
||||
{
|
||||
if (currentthinker->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (currentthinker->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mobj = (mobj_t *)currentthinker;
|
||||
@@ -3014,7 +3014,7 @@ static void P_RelinkPointers(void)
|
||||
for (currentthinker = thinkercap.next; currentthinker != &thinkercap;
|
||||
currentthinker = currentthinker->next)
|
||||
{
|
||||
if (currentthinker->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (currentthinker->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mobj = (mobj_t *)currentthinker;
|
||||
@@ -3431,7 +3431,7 @@ void P_SaveNetGame(savebuffer_t *save, boolean resending)
|
||||
{
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mobj = (mobj_t *)th;
|
||||
|
||||
+2
-2
@@ -2510,7 +2510,6 @@ static void P_SetupCamera(UINT8 pnum, camera_t *cam)
|
||||
cam->y = players[pnum].mo->y;
|
||||
cam->z = players[pnum].mo->z;
|
||||
cam->angle = players[pnum].mo->angle;
|
||||
cam->subsector = R_PointInSubsector(cam->x, cam->y); // make sure camera has a subsector set -- Monster Iestyn (12/11/18)
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2535,9 +2534,10 @@ static void P_SetupCamera(UINT8 pnum, camera_t *cam)
|
||||
cam->y = thing->y;
|
||||
cam->z = thing->z;
|
||||
cam->angle = FixedAngle((fixed_t)thing->angle << FRACBITS);
|
||||
cam->subsector = R_PointInSubsector(cam->x, cam->y); // make sure camera has a subsector set -- Monster Iestyn (12/11/18)
|
||||
}
|
||||
|
||||
cam->subsector = R_PointInSubsectorFast(cam->x, cam->y); // make sure camera has a subsector set -- Monster Iestyn (12/11/18)
|
||||
|
||||
cam->chase = false; // tell camera to reset its position next tic
|
||||
}
|
||||
|
||||
|
||||
+35
-34
@@ -1302,7 +1302,7 @@ static void P_AddExecutorDelay(line_t *line, mobj_t *mobj, sector_t *sector)
|
||||
|
||||
e = Z_Calloc(sizeof (*e), PU_LEVSPEC, NULL);
|
||||
|
||||
e->thinker.function.acp1 = (actionf_p1)T_ExecutorDelay;
|
||||
e->thinker.function = (actionf_p1)T_ExecutorDelay;
|
||||
e->line = line;
|
||||
e->sector = sector;
|
||||
e->timer = (line->backsector->ceilingheight>>FRACBITS)+(line->backsector->floorheight>>FRACBITS);
|
||||
@@ -2022,7 +2022,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||
camera[i].y += y;
|
||||
camera[i].z += z;
|
||||
camera[i].reset = true;
|
||||
camera[i].subsector = R_PointInSubsector(camera[i].x, camera[i].y);
|
||||
camera[i].subsector = R_PointInSubsectorFast(camera[i].x, camera[i].y);
|
||||
R_RelativeTeleportViewInterpolation(i, x, y, z, 0);
|
||||
break;
|
||||
}
|
||||
@@ -2602,7 +2602,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)T_Scroll)
|
||||
if (th->function != (actionf_p1)T_Scroll)
|
||||
continue;
|
||||
|
||||
scroller = (scroll_t *)th;
|
||||
@@ -2937,7 +2937,7 @@ void P_SetupSignExit(player_t *player)
|
||||
// spin all signposts in the level then.
|
||||
for (think = thinkercap.next; think != &thinkercap; think = think->next)
|
||||
{
|
||||
if (think->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (think->function != (actionf_p1)P_MobjThinker)
|
||||
continue; // not a mobj thinker
|
||||
|
||||
thing = (mobj_t *)think;
|
||||
@@ -2986,7 +2986,7 @@ boolean P_IsFlagAtBase(mobjtype_t flag)
|
||||
|
||||
for (think = thinkercap.next; think != &thinkercap; think = think->next)
|
||||
{
|
||||
if (think->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (think->function != (actionf_p1)P_MobjThinker)
|
||||
continue; // not a mobj thinker
|
||||
|
||||
mo = (mobj_t *)think;
|
||||
@@ -3419,7 +3419,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
|
||||
// The chimps are my friends.. heeheeheheehehee..... - LouisJM
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
@@ -3760,7 +3760,7 @@ DoneSection2:
|
||||
// to find the first waypoint
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
@@ -3833,7 +3833,7 @@ DoneSection2:
|
||||
// to find the last waypoint
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
@@ -3889,6 +3889,7 @@ DoneSection2:
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
continue;
|
||||
|
||||
nump++;
|
||||
}
|
||||
|
||||
@@ -4044,7 +4045,7 @@ DoneSection2:
|
||||
// to find the first waypoint
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
@@ -4082,7 +4083,7 @@ DoneSection2:
|
||||
// Find waypoint before this one (waypointlow)
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
@@ -4109,7 +4110,7 @@ DoneSection2:
|
||||
// Find waypoint after this one (waypointhigh)
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
@@ -4799,7 +4800,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||
break;
|
||||
|
||||
// Should this FOF have spikeness?
|
||||
if (th->function.acp1 == (actionf_p1)T_SpikeSector)
|
||||
if (th->function == (actionf_p1)T_SpikeSector)
|
||||
{
|
||||
lst = (levelspecthink_t *)th;
|
||||
|
||||
@@ -4807,7 +4808,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||
P_AddSpikeThinker(sec, (INT32)sec2num);
|
||||
}
|
||||
// Should this FOF have friction?
|
||||
else if(th->function.acp1 == (actionf_p1)T_Friction)
|
||||
else if(th->function == (actionf_p1)T_Friction)
|
||||
{
|
||||
f = (friction_t *)th;
|
||||
|
||||
@@ -4815,7 +4816,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||
Add_Friction(f->friction, f->movefactor, (INT32)(sec-sectors), f->affectee);
|
||||
}
|
||||
// Should this FOF have wind/current/pusher?
|
||||
else if(th->function.acp1 == (actionf_p1)T_Pusher)
|
||||
else if(th->function == (actionf_p1)T_Pusher)
|
||||
{
|
||||
p = (pusher_t *)th;
|
||||
|
||||
@@ -4906,7 +4907,7 @@ static void P_AddSpikeThinker(sector_t *sec, INT32 referrer)
|
||||
spikes = Z_Calloc(sizeof (*spikes), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&spikes->thinker);
|
||||
|
||||
spikes->thinker.function.acp1 = (actionf_p1)T_SpikeSector;
|
||||
spikes->thinker.function = (actionf_p1)T_SpikeSector;
|
||||
|
||||
spikes->sector = sec;
|
||||
spikes->vars[0] = referrer;
|
||||
@@ -4928,7 +4929,7 @@ static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline)
|
||||
floater = Z_Calloc(sizeof (*floater), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&floater->thinker);
|
||||
|
||||
floater->thinker.function.acp1 = (actionf_p1)T_FloatSector;
|
||||
floater->thinker.function = (actionf_p1)T_FloatSector;
|
||||
|
||||
floater->sector = sec;
|
||||
floater->vars[0] = tag;
|
||||
@@ -4957,7 +4958,7 @@ static void P_AddBlockThinker(sector_t *sec, line_t *sourceline)
|
||||
block = Z_Calloc(sizeof (*block), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&block->thinker);
|
||||
|
||||
block->thinker.function.acp1 = (actionf_p1)T_MarioBlockChecker;
|
||||
block->thinker.function = (actionf_p1)T_MarioBlockChecker;
|
||||
block->sourceline = sourceline;
|
||||
|
||||
block->sector = sec;
|
||||
@@ -4986,7 +4987,7 @@ static void P_AddRaiseThinker(sector_t *sec, line_t *sourceline)
|
||||
raise = Z_Calloc(sizeof (*raise), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&raise->thinker);
|
||||
|
||||
raise->thinker.function.acp1 = (actionf_p1)T_RaiseSector;
|
||||
raise->thinker.function = (actionf_p1)T_RaiseSector;
|
||||
|
||||
if (sourceline->flags & ML_BLOCKMONSTERS)
|
||||
raise->vars[0] = 1;
|
||||
@@ -5029,7 +5030,7 @@ static void P_AddOldAirbob(sector_t *sec, line_t *sourceline, boolean noadjust)
|
||||
airbob = Z_Calloc(sizeof (*airbob), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&airbob->thinker);
|
||||
|
||||
airbob->thinker.function.acp1 = (actionf_p1)T_RaiseSector;
|
||||
airbob->thinker.function = (actionf_p1)T_RaiseSector;
|
||||
|
||||
// set up the fields
|
||||
airbob->sector = sec;
|
||||
@@ -5094,7 +5095,7 @@ static inline void P_AddThwompThinker(sector_t *sec, sector_t *actionsector, lin
|
||||
thwomp = Z_Calloc(sizeof (*thwomp), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&thwomp->thinker);
|
||||
|
||||
thwomp->thinker.function.acp1 = (actionf_p1)T_ThwompSector;
|
||||
thwomp->thinker.function = (actionf_p1)T_ThwompSector;
|
||||
|
||||
// set up the fields according to the type of elevator action
|
||||
thwomp->sector = sec;
|
||||
@@ -5135,7 +5136,7 @@ static inline void P_AddNoEnemiesThinker(sector_t *sec, line_t *sourceline)
|
||||
nobaddies = Z_Calloc(sizeof (*nobaddies), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&nobaddies->thinker);
|
||||
|
||||
nobaddies->thinker.function.acp1 = (actionf_p1)T_NoEnemiesSector;
|
||||
nobaddies->thinker.function = (actionf_p1)T_NoEnemiesSector;
|
||||
|
||||
nobaddies->sector = sec;
|
||||
nobaddies->sourceline = sourceline;
|
||||
@@ -5157,7 +5158,7 @@ static inline void P_AddEachTimeThinker(sector_t *sec, line_t *sourceline)
|
||||
eachtime = Z_Calloc(sizeof (*eachtime), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&eachtime->thinker);
|
||||
|
||||
eachtime->thinker.function.acp1 = (actionf_p1)T_EachTimeThinker;
|
||||
eachtime->thinker.function = (actionf_p1)T_EachTimeThinker;
|
||||
|
||||
eachtime->sector = sec;
|
||||
eachtime->sourceline = sourceline;
|
||||
@@ -5179,7 +5180,7 @@ static inline void P_AddCameraScanner(sector_t *sourcesec, sector_t *actionsecto
|
||||
elevator = Z_Calloc(sizeof (*elevator), PU_LEVSPEC, NULL);
|
||||
P_AddThinker(&elevator->thinker);
|
||||
|
||||
elevator->thinker.function.acp1 = (actionf_p1)T_CameraScanner;
|
||||
elevator->thinker.function = (actionf_p1)T_CameraScanner;
|
||||
elevator->type = elevateBounce;
|
||||
|
||||
// set up the fields according to the type of elevator action
|
||||
@@ -5268,7 +5269,7 @@ static inline void EV_AddLaserThinker(sector_t *sec, sector_t *sec2, line_t *lin
|
||||
|
||||
P_AddThinker(&flash->thinker);
|
||||
|
||||
flash->thinker.function.acp1 = (actionf_p1)T_LaserFlash;
|
||||
flash->thinker.function = (actionf_p1)T_LaserFlash;
|
||||
flash->ffloor = ffloor;
|
||||
flash->sector = sec; // For finding mobjs
|
||||
flash->sec = sec2;
|
||||
@@ -5382,11 +5383,11 @@ void P_SpawnSpecials(INT32 fromnetsave, boolean reloadinggamestate)
|
||||
// Firstly, find out how many there are in each sector
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 == (actionf_p1)T_SpikeSector)
|
||||
if (th->function == (actionf_p1)T_SpikeSector)
|
||||
secthinkers[((levelspecthink_t *)th)->sector - sectors].count++;
|
||||
else if (th->function.acp1 == (actionf_p1)T_Friction)
|
||||
else if (th->function == (actionf_p1)T_Friction)
|
||||
secthinkers[((friction_t *)th)->affectee].count++;
|
||||
else if (th->function.acp1 == (actionf_p1)T_Pusher)
|
||||
else if (th->function == (actionf_p1)T_Pusher)
|
||||
secthinkers[((pusher_t *)th)->affectee].count++;
|
||||
}
|
||||
|
||||
@@ -5404,11 +5405,11 @@ void P_SpawnSpecials(INT32 fromnetsave, boolean reloadinggamestate)
|
||||
{
|
||||
size_t secnum = (size_t)-1;
|
||||
|
||||
if (th->function.acp1 == (actionf_p1)T_SpikeSector)
|
||||
if (th->function == (actionf_p1)T_SpikeSector)
|
||||
secnum = ((levelspecthink_t *)th)->sector - sectors;
|
||||
else if (th->function.acp1 == (actionf_p1)T_Friction)
|
||||
else if (th->function == (actionf_p1)T_Friction)
|
||||
secnum = ((friction_t *)th)->affectee;
|
||||
else if (th->function.acp1 == (actionf_p1)T_Pusher)
|
||||
else if (th->function == (actionf_p1)T_Pusher)
|
||||
secnum = ((pusher_t *)th)->affectee;
|
||||
|
||||
if (secnum != (size_t)-1)
|
||||
@@ -6632,7 +6633,7 @@ void T_Scroll(scroll_t *s)
|
||||
static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT32 affectee, INT32 accel, INT32 exclusive)
|
||||
{
|
||||
scroll_t *s = Z_Calloc(sizeof *s, PU_LEVSPEC, NULL);
|
||||
s->thinker.function.acp1 = (actionf_p1)T_Scroll;
|
||||
s->thinker.function = (actionf_p1)T_Scroll;
|
||||
s->type = type;
|
||||
s->dx = dx;
|
||||
s->dy = dy;
|
||||
@@ -6802,7 +6803,7 @@ static void Add_MasterDisappearer(tic_t appeartime, tic_t disappeartime, tic_t o
|
||||
{
|
||||
disappear_t *d = Z_Malloc(sizeof *d, PU_LEVSPEC, NULL);
|
||||
|
||||
d->thinker.function.acp1 = (actionf_p1)T_Disappear;
|
||||
d->thinker.function = (actionf_p1)T_Disappear;
|
||||
d->appeartime = appeartime;
|
||||
d->disappeartime = disappeartime;
|
||||
d->offset = offset;
|
||||
@@ -6887,7 +6888,7 @@ static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32
|
||||
{
|
||||
friction_t *f = Z_Calloc(sizeof *f, PU_LEVSPEC, NULL);
|
||||
|
||||
f->thinker.function.acp1 = (actionf_p1)T_Friction;
|
||||
f->thinker.function = (actionf_p1)T_Friction;
|
||||
f->friction = friction;
|
||||
f->movefactor = movefactor;
|
||||
f->affectee = affectee;
|
||||
@@ -7042,7 +7043,7 @@ static void Add_Pusher(pushertype_e type, fixed_t x_mag, fixed_t y_mag, mobj_t *
|
||||
{
|
||||
pusher_t *p = Z_Calloc(sizeof *p, PU_LEVSPEC, NULL);
|
||||
|
||||
p->thinker.function.acp1 = (actionf_p1)T_Pusher;
|
||||
p->thinker.function = (actionf_p1)T_Pusher;
|
||||
p->source = source;
|
||||
p->type = type;
|
||||
p->x_mag = x_mag>>FRACBITS;
|
||||
|
||||
+20
-16
@@ -115,7 +115,7 @@ void Command_Numthinkers_f(void)
|
||||
|
||||
for (think = listtype->next; think != listtype; think = think->next)
|
||||
{
|
||||
if (think->function.acp1 != action)
|
||||
if (think->function != action)
|
||||
continue;
|
||||
|
||||
count++;
|
||||
@@ -152,7 +152,7 @@ void Command_CountMobjs_f(void)
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
if (((mobj_t *)th)->type == i)
|
||||
@@ -172,7 +172,7 @@ void Command_CountMobjs_f(void)
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
if (((mobj_t *)th)->type == i)
|
||||
@@ -207,7 +207,7 @@ void P_AddThinker(thinker_t *thinker)
|
||||
|
||||
thinker->references = 0; // killough 11/98: init reference counter to 0
|
||||
|
||||
thinker->cachable = (thinker->function.acp1 == (actionf_p1)P_MobjThinker);
|
||||
thinker->cachable = (thinker->function == (actionf_p1)P_MobjThinker);
|
||||
#ifdef PARANOIA
|
||||
thinker->debug_mobjtype = MT_NULL;
|
||||
#endif
|
||||
@@ -235,7 +235,7 @@ void P_AddPrecipThinker(thinker_t *thinker)
|
||||
#ifdef PARANOIA
|
||||
static const char *MobjTypeName(const mobj_t *mobj)
|
||||
{
|
||||
actionf_p1 p1 = mobj->thinker.function.acp1;
|
||||
actionf_p1 p1 = mobj->thinker.function;
|
||||
|
||||
if (p1 == (actionf_p1)P_MobjThinker)
|
||||
{
|
||||
@@ -254,7 +254,7 @@ static const char *MobjTypeName(const mobj_t *mobj)
|
||||
|
||||
static const char *MobjThinkerName(const mobj_t *mobj)
|
||||
{
|
||||
actionf_p1 p1 = mobj->thinker.function.acp1;
|
||||
actionf_p1 p1 = mobj->thinker.function;
|
||||
|
||||
if (p1 == (actionf_p1)P_MobjThinker)
|
||||
{
|
||||
@@ -371,7 +371,7 @@ void P_UnlinkThinker(thinker_t *thinker)
|
||||
void P_RemoveThinker(thinker_t *thinker)
|
||||
{
|
||||
LUA_InvalidateUserdata(thinker);
|
||||
thinker->function.acp1 = (actionf_p1)P_RemoveThinkerDelayed;
|
||||
thinker->function = (actionf_p1)P_RemoveThinkerDelayed;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -455,9 +455,9 @@ static inline void P_RunThinkers(void)
|
||||
for (currentthinker = thinkercap.next; currentthinker != &thinkercap; currentthinker = currentthinker->next)
|
||||
{
|
||||
#ifdef PARANOIA
|
||||
I_Assert(currentthinker->function.acp1 != NULL);
|
||||
I_Assert(currentthinker->function != NULL);
|
||||
#endif
|
||||
currentthinker->function.acp1(currentthinker);
|
||||
currentthinker->function(currentthinker);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -573,7 +573,7 @@ static void P_RunQuakes(void)
|
||||
{
|
||||
fixed_t ir;
|
||||
|
||||
if (quake.time <= 0)
|
||||
if (!cv_screenquake.value || quake.time <= 0)
|
||||
{
|
||||
quake.x = quake.y = quake.z = quake.roll = 0;
|
||||
return;
|
||||
@@ -610,7 +610,7 @@ static inline void P_ResetSpriteStuff(void)
|
||||
{
|
||||
mobj_t *mo;
|
||||
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // not a mobj
|
||||
if (th->function != (actionf_p1)P_MobjThinker) // not a mobj
|
||||
continue;
|
||||
|
||||
mo = (mobj_t *)th;
|
||||
@@ -618,8 +618,8 @@ static inline void P_ResetSpriteStuff(void)
|
||||
if (!mo || (mo->sprite == SPR_NULL) || (mo->flags2 & MF2_DONTDRAW) || (mo->type == MT_SHADOW))
|
||||
continue;
|
||||
|
||||
mo->spritexscale = mo->realxscale;
|
||||
mo->spriteyscale = mo->realyscale;
|
||||
mo->spritexscale = mo->realxscale;
|
||||
mo->spriteyscale = mo->realyscale;
|
||||
mo->spritexoffset = mo->realxoffset;
|
||||
mo->spriteyoffset = mo->realyoffset;
|
||||
}
|
||||
@@ -734,8 +734,10 @@ void P_Ticker(boolean run)
|
||||
|
||||
PS_START_TIMING(ps_playerthink_time);
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
|
||||
{
|
||||
if (playeringame[i] && !P_MobjWasRemoved(players[i].mo))
|
||||
P_PlayerThink(&players[i]);
|
||||
}
|
||||
PS_STOP_TIMING(ps_playerthink_time);
|
||||
}
|
||||
|
||||
@@ -754,8 +756,10 @@ void P_Ticker(boolean run)
|
||||
|
||||
// Run any "after all the other thinkers" stuff
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
|
||||
{
|
||||
if (playeringame[i] && !P_MobjWasRemoved(players[i].mo))
|
||||
P_PlayerAfterThink(&players[i]);
|
||||
}
|
||||
|
||||
// Apply rumble to local players
|
||||
if (!demo.playback)
|
||||
@@ -957,7 +961,7 @@ void P_PreTicker(INT32 frames)
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
if (!players[i].mo || P_MobjWasRemoved(players[i].mo))
|
||||
if (P_MobjWasRemoved(players[i].mo))
|
||||
continue;
|
||||
|
||||
P_PlayerAfterThink(&players[i]);
|
||||
|
||||
+20
-14
@@ -552,9 +552,13 @@ static UINT8 getPlayerPos(player_t *player)
|
||||
{
|
||||
UINT8 pos = 1;
|
||||
|
||||
for (int i = 0; i < MAXPLAYERS; ++i) {
|
||||
if (!playeringame[i] || players[i].spectator) continue;
|
||||
if (players[i].marescore > player->marescore) ++pos;
|
||||
for (UINT8 i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
continue;
|
||||
|
||||
if (players[i].marescore > player->marescore)
|
||||
++pos;
|
||||
}
|
||||
|
||||
return pos;
|
||||
@@ -1064,7 +1068,7 @@ void P_SpawnShieldOrb(player_t *player)
|
||||
// blaze through the thinkers to see if an orb already exists!
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
shieldobj = (mobj_t *)th;
|
||||
@@ -1780,7 +1784,7 @@ void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range)
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
@@ -2506,7 +2510,7 @@ static void P_DoZoomTube(player_t *player)
|
||||
// Find next waypoint
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
if (th->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
@@ -2596,7 +2600,7 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius)
|
||||
|
||||
for (think = thinkercap.next; think != &thinkercap; think = think->next)
|
||||
{
|
||||
if (think->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (think->function != (actionf_p1)P_MobjThinker)
|
||||
continue; // not a mobj thinker
|
||||
|
||||
mo = (mobj_t *)think;
|
||||
@@ -2673,7 +2677,7 @@ boolean P_LookForEnemies(player_t *player)
|
||||
|
||||
for (think = thinkercap.next; think != &thinkercap; think = think->next)
|
||||
{
|
||||
if (think->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (think->function != (actionf_p1)P_MobjThinker)
|
||||
continue; // not a mobj thinker
|
||||
|
||||
mo = (mobj_t *)think;
|
||||
@@ -2797,7 +2801,7 @@ void P_FindEmerald(void)
|
||||
// to find all emeralds
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
@@ -3044,6 +3048,8 @@ consvar_t cv_tiltsmoothing = {"tiltsmoothing", "32", CV_SAVE, CV_Natural, NULL,
|
||||
|
||||
consvar_t cv_actionmovie = {"actionmovie", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_screenquake = {"quakescreenshake", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t lookbackmom_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Double"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_lookbackmom[MAXSPLITSCREENPLAYERS] = {
|
||||
@@ -3402,7 +3408,7 @@ static void P_DemoCameraMovement(camera_t *cam, UINT8 num)
|
||||
}
|
||||
|
||||
// update subsector to avoid crashes;
|
||||
cam->subsector = R_PointInSubsector(cam->x, cam->y);
|
||||
cam->subsector = R_PointInSubsectorFast(cam->x, cam->y);
|
||||
}
|
||||
|
||||
void P_ResetCamera(player_t *player, camera_t *thiscam)
|
||||
@@ -3446,7 +3452,7 @@ void P_ResetCamera(player_t *player, camera_t *thiscam)
|
||||
|
||||
thiscam->relativex = 0;
|
||||
|
||||
thiscam->subsector = R_PointInSubsector(thiscam->x,thiscam->y);
|
||||
thiscam->subsector = R_PointInSubsectorFast(thiscam->x,thiscam->y);
|
||||
|
||||
thiscam->radius = 20*FRACUNIT;
|
||||
thiscam->height = 16*FRACUNIT;
|
||||
@@ -3682,7 +3688,7 @@ static void P_MoveCameraToSpawn(UINT8 playernum)
|
||||
thiscam->angle = player->mo->angle;
|
||||
thiscam->aiming = 0;
|
||||
|
||||
thiscam->subsector = R_PointInSubsector(thiscam->x,thiscam->y);
|
||||
thiscam->subsector = R_PointInSubsectorFast(thiscam->x,thiscam->y);
|
||||
|
||||
thiscam->reset_aiming = true;
|
||||
|
||||
@@ -4243,7 +4249,7 @@ static void P_CalcPostImg(player_t *player, camera_t *thiscam)
|
||||
else
|
||||
pviewheight = player->mo->z + player->viewheight;
|
||||
|
||||
if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj))
|
||||
if (player->awayviewtics && !P_MobjWasRemoved(player->awayviewmobj))
|
||||
{
|
||||
sector = player->awayviewmobj->subsector->sector;
|
||||
pviewheight = player->awayviewmobj->z + 20*FRACUNIT;
|
||||
@@ -4774,7 +4780,7 @@ void P_PlayerThink(player_t *player)
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
|
||||
+5
-5
@@ -196,12 +196,12 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
|
||||
mobj_t *pviewmobj = viewplayer->mo;
|
||||
INT32 heightsec;
|
||||
boolean underwater;
|
||||
UINT8 i = R_GetViewNumber();
|
||||
camera_t *thiscam = &camera[R_GetViewNumber()];
|
||||
|
||||
if (viewplayer == &players[displayplayers[i]] && camera[i].chase)
|
||||
heightsec = R_PointInSubsector(camera[i].x, camera[i].y)->sector->heightsec;
|
||||
else if (i > splitscreen && viewmobj)
|
||||
heightsec = R_PointInSubsector(pviewmobj->x, pviewmobj->y)->sector->heightsec;
|
||||
if (thiscam->chase)
|
||||
heightsec = thiscam->subsector->sector->heightsec;
|
||||
else if (viewmobj)
|
||||
heightsec = pviewmobj->subsector->sector->heightsec;
|
||||
else
|
||||
return sec;
|
||||
|
||||
|
||||
+38
-8
@@ -103,7 +103,7 @@ static UINT32 **texturecolumnofs; // column offset lookup table for each texture
|
||||
UINT8 **texturecache; // graphics data for each generated full-size texture
|
||||
|
||||
// texture width is a power of 2, so it can easily repeat along sidedefs using a simple mask
|
||||
INT32 *texturewidthmask;
|
||||
static INT32 *texturewidthmask;
|
||||
|
||||
fixed_t *textureheight; // needed for texture pegging
|
||||
|
||||
@@ -473,11 +473,28 @@ UINT8 *R_GetColumn(fixed_t tex, INT32 col)
|
||||
{
|
||||
UINT8 *data;
|
||||
|
||||
col &= texturewidthmask[tex];
|
||||
data = texturecache[tex];
|
||||
|
||||
if (texturewidthmask[tex])
|
||||
col &= texturewidthmask[tex]; // set by load textures
|
||||
else
|
||||
{
|
||||
const INT16 texwidth = textures[tex]->width;
|
||||
|
||||
// Odd width texture, cannot just mask.
|
||||
// Sometime gets colnum = -1 or = width, even without tiling.
|
||||
// Test LostCiv, Map 20, crates.
|
||||
col = ( col < 0 ) ?
|
||||
texwidth - (((-col - 1) % texwidth) + 1)
|
||||
: col % texwidth;
|
||||
}
|
||||
|
||||
if (!data)
|
||||
{
|
||||
// This must be here because cache can be freed by other operations.
|
||||
// To prevent must lock individual texture cache on every draw.
|
||||
data = R_GenerateTexture(tex);
|
||||
}
|
||||
|
||||
return data + LONG(texturecolumnofs[tex][col]);
|
||||
}
|
||||
@@ -662,9 +679,23 @@ void R_LoadTextures(void)
|
||||
|
||||
Z_Free(patchlump);
|
||||
|
||||
// determine width power of 2
|
||||
#if 1
|
||||
// [WDJ] only need to determine if exact power of 2.
|
||||
k = 1;
|
||||
while (k < texture->width)
|
||||
k<<=1;
|
||||
#else
|
||||
// Largest power of 2 that fits within width.
|
||||
k = 1;
|
||||
while (k << 1 <= texture->width)
|
||||
k <<= 1;
|
||||
#endif
|
||||
if (k != texture->width)
|
||||
{
|
||||
// Odd width
|
||||
k = 1; // make texturewidthmask = 0
|
||||
}
|
||||
|
||||
texturewidthmask[i] = k - 1;
|
||||
textureheight[i] = texture->height << FRACBITS;
|
||||
@@ -1223,8 +1254,7 @@ static void R_InitColormaps(void)
|
||||
|
||||
// Load in the light tables
|
||||
lump = W_GetNumForName("COLORMAP");
|
||||
//Z_MallocAlign(W_LumpLength (lump), PU_STATIC, NULL, 8);
|
||||
colormaps = Z_MallocAlign((256 * 64), PU_STATIC, NULL, 8);
|
||||
colormaps = Z_Malloc((256 * 64), PU_STATIC, NULL);
|
||||
W_ReadLump(lump, colormaps);
|
||||
// no need to init encoremap at this stage
|
||||
|
||||
@@ -1265,7 +1295,7 @@ void R_ReInitColormaps(UINT16 num, lumpnum_t newencoremap)
|
||||
lighttable_t *colormap_p, *colormap_p2;
|
||||
size_t p, i;
|
||||
|
||||
encoremap = Z_MallocAlign(256 + 10, PU_LEVEL, NULL, 8);
|
||||
encoremap = Z_Malloc(256 + 10, PU_LEVEL, NULL);
|
||||
W_ReadLump(newencoremap, encoremap);
|
||||
colormap_p = colormap_p2 = colormaps;
|
||||
colormap_p += (256 * 32);
|
||||
@@ -1324,7 +1354,7 @@ void R_ClearColormaps(void)
|
||||
foundcolormaps[num_extra_colormaps] = lump;
|
||||
|
||||
// aligned on 8 bit for asm code
|
||||
extra_colormaps[num_extra_colormaps].colormap = Z_MallocAlign(W_LumpLength(lump), PU_LEVEL, NULL, 16);
|
||||
extra_colormaps[num_extra_colormaps].colormap = Z_Malloc(W_LumpLength(lump), PU_LEVEL, NULL);
|
||||
W_ReadLump(lump, extra_colormaps[num_extra_colormaps].colormap);
|
||||
|
||||
// We set all params of the colormap to normal because there
|
||||
@@ -1520,7 +1550,7 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
|
||||
}
|
||||
|
||||
// Now allocate memory for the actual colormap array itself!
|
||||
colormap_p = Z_MallocAlign((256 * (encoremap ? 64 : 32)) + 10, PU_LEVEL, NULL, 8);
|
||||
colormap_p = Z_Malloc((256 * (encoremap ? 64 : 32)) + 10, PU_LEVEL, NULL);
|
||||
extra_colormaps[mapnum].colormap = (UINT8 *)colormap_p;
|
||||
|
||||
// Calculate the palette index for each palette index, for each light level
|
||||
@@ -1835,7 +1865,7 @@ static void R_PrecacheLevelSprites(void)
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
if (th->function != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
spritepresent[((mobj_t *)th)->sprite] = 1;
|
||||
|
||||
@@ -55,7 +55,6 @@ typedef struct
|
||||
UINT8 type; // TEXTURETYPE_
|
||||
INT16 width, height;
|
||||
boolean holes;
|
||||
|
||||
// All the patches[patchcount] are drawn back to front into the cached texture.
|
||||
INT16 patchcount;
|
||||
texpatch_t patches[0];
|
||||
@@ -65,9 +64,6 @@ typedef struct
|
||||
extern texture_t **textures;
|
||||
extern UINT8 **texturecache; // graphics data for each generated full-size texture
|
||||
|
||||
// texture width is a power of 2, so it can easily repeat along sidedefs using a simple mask
|
||||
extern INT32 *texturewidthmask;
|
||||
|
||||
extern fixed_t *textureheight; // needed for texture pegging
|
||||
|
||||
UINT32 ASTBlendPixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alpha);
|
||||
|
||||
+3
-3
@@ -119,7 +119,7 @@ void R_InitTranslucencyTables(void)
|
||||
// Load here the transparency lookup tables 'TRANSx0'
|
||||
// NOTE: the TRANSx0 resources MUST BE aligned on 64k for the asm
|
||||
// optimised code (in other words, transtables pointer low word is 0)
|
||||
transtables = static_cast<UINT8*>(Z_MallocAlign(NUMTRANSTABLES*0x10000, PU_STATIC, NULL, 16));
|
||||
transtables = static_cast<UINT8*>(Z_Malloc(NUMTRANSTABLES*0x10000, PU_STATIC, NULL));
|
||||
|
||||
W_ReadLump(W_GetNumForName("TRANS10"), transtables);
|
||||
W_ReadLump(W_GetNumForName("TRANS20"), transtables+0x10000);
|
||||
@@ -246,7 +246,7 @@ static void R_GenerateBlendTables(void)
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < NUMBLENDMAPS; i++)
|
||||
blendtables[i] = static_cast<UINT8*>(Z_MallocAlign(BlendTab_Count[i] * 0x10000, PU_STATIC, NULL, 16));
|
||||
blendtables[i] = static_cast<UINT8*>(Z_Malloc(BlendTab_Count[i] * 0x10000, PU_STATIC, NULL));
|
||||
|
||||
InitColorLUT(&transtab_lut, pLocalPalette, false);
|
||||
|
||||
@@ -365,7 +365,7 @@ static UINT8* RGetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 f
|
||||
// Generate the colormap if necessary
|
||||
if (!ret)
|
||||
{
|
||||
ret = static_cast<UINT8*>(Z_MallocAlign(NUM_PALETTE_ENTRIES, (flags & GTC_CACHE) ? PU_LEVEL : PU_STATIC, NULL, 8));
|
||||
ret = static_cast<UINT8*>(Z_Malloc(NUM_PALETTE_ENTRIES, (flags & GTC_CACHE) ? PU_LEVEL : PU_STATIC, NULL));
|
||||
K_GenerateKartColormap(ret, skinnum, color, local); //R_GenerateTranslationColormap(ret, skinnum, color); // SRB2kart
|
||||
|
||||
// Cache the colormap if desired
|
||||
|
||||
+14
-1
@@ -46,10 +46,23 @@ enum DrawSpanType
|
||||
DS_RIPPLE = 0x0008,
|
||||
};
|
||||
|
||||
template<DrawSpanType Type>
|
||||
static constexpr UINT8 R_GetSpanTranslated(drawspandata_t* ds, UINT8 col)
|
||||
{
|
||||
if constexpr (Type & DrawSpanType::DS_COLORMAP)
|
||||
{
|
||||
return ds->translation[col];
|
||||
}
|
||||
else
|
||||
{
|
||||
return col;
|
||||
}
|
||||
}
|
||||
|
||||
template<DrawSpanType Type>
|
||||
static constexpr UINT8 R_GetSpanTranslucent(drawspandata_t* ds, UINT8 *dsrc, const UINT8 *colormap, UINT8 col)
|
||||
{
|
||||
col = colormap[col];
|
||||
col = colormap[R_GetSpanTranslated<Type>(ds, col)];
|
||||
|
||||
if constexpr (Type & DrawSpanType::DS_TRANSMAP)
|
||||
{
|
||||
|
||||
+9
-21
@@ -42,13 +42,13 @@ static CV_PossibleValue_t fpscap_cons_t[] = {
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_fpscap = {"fpscap", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fpscap = {"fpscap", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fpscapbg = {"fpscapbackground", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_precipinterp = {"precipinterpolation", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
ps_metric_t ps_interp_frac = {0};
|
||||
ps_metric_t ps_interp_lag = {0};
|
||||
ps_metric_t ps_interp_lag = {0};
|
||||
|
||||
static boolean R_UseBackgroundFramerateCap(void)
|
||||
{
|
||||
@@ -67,21 +67,21 @@ static boolean R_UseBackgroundFramerateCap(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
static UINT32 R_GetBackgroundFramerateCap(void)
|
||||
static UINT32 R_GetFrameCap(INT32 val)
|
||||
{
|
||||
if (cv_fpscapbg.value == 0)
|
||||
if (val == 0)
|
||||
{
|
||||
// 0: Match refresh rate
|
||||
return I_GetRefreshRate();
|
||||
}
|
||||
|
||||
if (cv_fpscapbg.value < 0)
|
||||
if (val < 0)
|
||||
{
|
||||
// -1: Unlimited
|
||||
return 0;
|
||||
}
|
||||
|
||||
return cv_fpscapbg.value;
|
||||
return val;
|
||||
}
|
||||
|
||||
UINT32 R_GetFramerateCap(void)
|
||||
@@ -95,22 +95,10 @@ UINT32 R_GetFramerateCap(void)
|
||||
|
||||
if (R_UseBackgroundFramerateCap())
|
||||
{
|
||||
return R_GetBackgroundFramerateCap();
|
||||
return R_GetFrameCap(cv_fpscapbg.value);
|
||||
}
|
||||
|
||||
if (cv_fpscap.value == 0)
|
||||
{
|
||||
// 0: Match refresh rate
|
||||
return I_GetRefreshRate();
|
||||
}
|
||||
|
||||
if (cv_fpscap.value < 0)
|
||||
{
|
||||
// -1: Unlimited
|
||||
return 0;
|
||||
}
|
||||
|
||||
return cv_fpscap.value;
|
||||
return R_GetFrameCap(cv_fpscap.value);
|
||||
}
|
||||
|
||||
boolean R_UsingFrameInterpolation(void)
|
||||
@@ -232,7 +220,7 @@ void R_InterpolateView(fixed_t frac, boolean forceinvalid)
|
||||
viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
|
||||
|
||||
viewplayer = newview->player;
|
||||
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
||||
viewsector = R_PointInSubsectorFast(viewx, viewy)->sector;
|
||||
|
||||
R_SetupFreelook();
|
||||
}
|
||||
|
||||
+79
-48
@@ -141,10 +141,10 @@ static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
||||
#endif
|
||||
|
||||
static CV_PossibleValue_t maxinterpdist_cons_t[] = {
|
||||
/*{256, "256"},*/ {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{3072, "3072"}, {4096, "4096"}, {6144, "6144"},
|
||||
{8192, "8192"}, {0, "Infinite"}, {0, NULL}};
|
||||
/*{256, "256"},*/ {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{3072, "3072"}, {4096, "4096"}, {6144, "6144"},
|
||||
{8192, "8192"}, {0, "Infinite"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t fov_cons_t[] = {{MINFOV*FRACUNIT, "MIN"}, {MAXFOV*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
|
||||
@@ -170,14 +170,14 @@ consvar_t cv_tailspickup = {"tailspickup", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnO
|
||||
consvar_t cv_precachetextures = {"precachetextures", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_chasecam[MAXSPLITSCREENPLAYERS] = {
|
||||
{"chasecam", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam2", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam3", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam4", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_flipcam[MAXSPLITSCREENPLAYERS] = {
|
||||
{"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam2", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam2_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam3", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam3_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam4", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam4_OnChange, 0, NULL, NULL, 0, 0, NULL}
|
||||
@@ -195,6 +195,7 @@ consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE|CV_CALL|CV_NO
|
||||
consvar_t cv_lessprecip = {"lessweathereffects", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Precipstuff_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_mobjscaleprecip = {"scaleprecipmobjscale", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Precipstuff_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_maxinterpdist = {"maxinterpdist", "Infinite", CV_SAVE, maxinterpdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_playerfade = {"playerfade", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_ripplewater = {"waterripples", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Okay, whoever said homremoval causes a performance hit should be shot.
|
||||
@@ -211,6 +212,7 @@ consvar_t cv_randomdirlight = {"randomdirectionallight", "Off", CV_SAVE|CV_CALL
|
||||
|
||||
consvar_t cv_showhud = {"showhud", "Yes", CV_CALL, CV_YesNo, R_SetViewSize, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_translucenthud = {"translucenthud", "10", CV_SAVE, translucenthud_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_uncappedhud = {"uncappedhud", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_soniccd = {"soniccd", "Off", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_allowmlook = {"allowmlook", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -400,7 +402,8 @@ angle_t R_PlayerSliptideAngle(player_t *player)
|
||||
sprframe = &sprdef->spriteframes[rot];
|
||||
|
||||
// No sprite frame? I guess it is possible
|
||||
if (!sprframe) return 0;
|
||||
if (!sprframe)
|
||||
return 0;
|
||||
|
||||
if (sprframe->rotate != SRF_SINGLE || (mo->frame & FF_PAPERSPRITE))
|
||||
ang = R_PointToAngle(mo->x, mo->y) - mo->angle;
|
||||
@@ -460,6 +463,7 @@ boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixe
|
||||
return false;
|
||||
|
||||
cullplane = cullheight->frontsector->floorheight;
|
||||
|
||||
if (cullheight->flags & ML_NOCLIMB) // Group culling
|
||||
{
|
||||
if (!viewcullheight)
|
||||
@@ -579,8 +583,6 @@ static void R_InitTextureMapping(void)
|
||||
doubleclipangle = clipangle*2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// R_InitLightTables
|
||||
// Only inits the zlight table,
|
||||
@@ -1047,6 +1049,33 @@ void R_Init(void)
|
||||
framecount = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// R_IsPointInSubsector, same as above but returns 0 if not in subsector
|
||||
//
|
||||
subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y)
|
||||
{
|
||||
node_t *node;
|
||||
INT32 side, i;
|
||||
size_t nodenum;
|
||||
subsector_t *ret;
|
||||
|
||||
nodenum = numnodes - 1;
|
||||
|
||||
while (!(nodenum & NF_SUBSECTOR))
|
||||
{
|
||||
node = &nodes[nodenum];
|
||||
side = R_PointOnSide(x, y, node);
|
||||
nodenum = node->children[side];
|
||||
}
|
||||
|
||||
ret = &subsectors[nodenum & ~NF_SUBSECTOR];
|
||||
for (i = 0; i < ret->numlines; i++)
|
||||
if (P_PointOnLineSide(x, y, segs[ret->firstline + i].linedef) != segs[ret->firstline + i].side)
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
//
|
||||
// R_SetupFrame
|
||||
//
|
||||
@@ -1066,7 +1095,7 @@ static void R_SetupCommonFrame(player_t * player, sector_t * sector)
|
||||
if (sector != NULL)
|
||||
newview->sector = sector;
|
||||
else
|
||||
newview->sector = R_PointInSubsector(newview->x, newview->y)->sector;
|
||||
newview->sector = R_PointInSubsectorFast(newview->x, newview->y)->sector;
|
||||
|
||||
R_InterpolateView(rendertimefrac_unpaused, false);
|
||||
}
|
||||
@@ -1104,7 +1133,6 @@ static void R_SetupSkyScale(player_t *player, camera_t *thiscam, mapheader_t *mh
|
||||
{
|
||||
if (skyboxmo[1])
|
||||
{
|
||||
angle_t ang;
|
||||
fixed_t x = 0, y = 0;
|
||||
|
||||
if (mh->skybox_scalex > 0)
|
||||
@@ -1136,8 +1164,8 @@ static void R_SetupSkyScale(player_t *player, camera_t *thiscam, mapheader_t *mh
|
||||
newview->y -= x;
|
||||
break;
|
||||
default:
|
||||
ang = viewmobj->angle>>ANGLETOFINESHIFT;
|
||||
newview->x += FixedMul(x,FINECOSINE(ang)) - FixedMul(y, FINESINE(ang));
|
||||
angle_t ang = viewmobj->angle>>ANGLETOFINESHIFT;
|
||||
newview->x += FixedMul(x,FINECOSINE(ang)) - FixedMul(y, FINESINE(ang));
|
||||
newview->y += FixedMul(x, FINESINE(ang)) + FixedMul(y,FINECOSINE(ang));
|
||||
break;
|
||||
}
|
||||
@@ -1163,14 +1191,14 @@ static void R_SetupSkyScale(player_t *player, camera_t *thiscam, mapheader_t *mh
|
||||
}
|
||||
}
|
||||
|
||||
void R_SkyboxFrame(int s)
|
||||
void R_SkyboxFrame(UINT8 pnum)
|
||||
{
|
||||
player_t *player = &players[displayplayers[s]];
|
||||
camera_t *thiscam = &camera[s];
|
||||
subsector_t * subsector = NULL;
|
||||
player_t *player = &players[displayplayers[pnum]];
|
||||
camera_t *thiscam = &camera[pnum];
|
||||
sector_t *viewsec = NULL;
|
||||
mapheader_t *mh = mapheaderinfo[gamemap-1];
|
||||
|
||||
R_SetViewContext(static_cast<viewcontext_e>(VIEWCONTEXT_SKY1 + s));
|
||||
R_SetViewContext(static_cast<viewcontext_e>(VIEWCONTEXT_SKY1 + pnum));
|
||||
|
||||
// cut-away view stuff
|
||||
newview->sky = true;
|
||||
@@ -1186,35 +1214,38 @@ void R_SkyboxFrame(int s)
|
||||
|
||||
R_SetupAimingFrame(player, thiscam);
|
||||
|
||||
newview->angle += viewmobj->angle;
|
||||
if (!P_MobjWasRemoved(viewmobj))
|
||||
{
|
||||
newview->angle += viewmobj->angle;
|
||||
|
||||
newview->x = viewmobj->x;
|
||||
newview->y = viewmobj->y;
|
||||
newview->z = (viewmobj->spawnpoint) ? (((fixed_t)viewmobj->spawnpoint->angle)<<FRACBITS) : 0;
|
||||
newview->x = viewmobj->x;
|
||||
newview->y = viewmobj->y;
|
||||
newview->z = (viewmobj->spawnpoint) ? (((fixed_t)viewmobj->spawnpoint->angle) << FRACBITS) : 0;
|
||||
|
||||
if (viewmobj->subsector)
|
||||
viewsec = viewmobj->subsector->sector;
|
||||
}
|
||||
|
||||
if (mh)
|
||||
{
|
||||
R_SetupSkyScale(player, thiscam, mh);
|
||||
}
|
||||
|
||||
if (!P_MobjWasRemoved(viewmobj) && viewmobj->subsector && viewmobj->subsector->sector)
|
||||
subsector = viewmobj->subsector;
|
||||
|
||||
R_SetupCommonFrame(player, subsector->sector);
|
||||
R_SetupCommonFrame(player, viewsec);
|
||||
}
|
||||
|
||||
void R_SetupFrame(int s, boolean skybox)
|
||||
void R_SetupFrame(UINT8 pnum, boolean skybox)
|
||||
{
|
||||
player_t *player = &players[displayplayers[s]];
|
||||
camera_t *thiscam = &camera[s];
|
||||
boolean chasecam = (cv_chasecam[s].value);
|
||||
sector_t * sector = NULL;
|
||||
player_t *player = &players[displayplayers[pnum]];
|
||||
camera_t *thiscam = &camera[pnum];
|
||||
boolean chasecam = (cv_chasecam[pnum].value);
|
||||
sector_t *viewsec = NULL;
|
||||
|
||||
R_SetViewContext(static_cast<viewcontext_e>(VIEWCONTEXT_PLAYER1 + s));
|
||||
R_SetViewContext(static_cast<viewcontext_e>(VIEWCONTEXT_PLAYER1 + pnum));
|
||||
|
||||
if (thiscam->reset)
|
||||
{
|
||||
R_ResetViewInterpolation(s);
|
||||
R_ResetViewInterpolation(pnum);
|
||||
thiscam->reset = false;
|
||||
}
|
||||
|
||||
@@ -1249,10 +1280,10 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
newview->y = viewmobj->y;
|
||||
newview->z = viewmobj->z + 20*FRACUNIT;
|
||||
|
||||
if (viewmobj->subsector && viewmobj->subsector->sector)
|
||||
sector = viewmobj->subsector->sector;
|
||||
if (viewmobj->subsector)
|
||||
viewsec = viewmobj->subsector->sector;
|
||||
|
||||
R_SetupCommonFrame(player, sector);
|
||||
R_SetupCommonFrame(player, viewsec);
|
||||
}
|
||||
else if (thiscam && chasecam) // use outside cam view
|
||||
{
|
||||
@@ -1263,10 +1294,10 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
newview->y = thiscam->y;
|
||||
newview->z = thiscam->z + (thiscam->height>>1);
|
||||
|
||||
if (thiscam->subsector && thiscam->subsector->sector)
|
||||
sector = thiscam->subsector->sector;
|
||||
if (thiscam->subsector)
|
||||
viewsec = thiscam->subsector->sector;
|
||||
|
||||
R_SetupCommonFrame(player, sector);
|
||||
R_SetupCommonFrame(player, viewsec);
|
||||
}
|
||||
else if (player->mo) // use the player's eyes view
|
||||
{
|
||||
@@ -1277,10 +1308,10 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
newview->y = viewmobj->y;
|
||||
newview->z = player->viewz;
|
||||
|
||||
if (viewmobj->subsector && viewmobj->subsector->sector)
|
||||
sector = viewmobj->subsector->sector;
|
||||
if (viewmobj->subsector)
|
||||
viewsec = viewmobj->subsector->sector;
|
||||
|
||||
R_SetupCommonFrame(player, sector);
|
||||
R_SetupCommonFrame(player, viewsec);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1306,7 +1337,7 @@ static void R_PortalFrame(portal_t *portal)
|
||||
{
|
||||
portalclipline = NULL;
|
||||
portalcullsector = NULL;
|
||||
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
||||
viewsector = R_PointInSubsectorFast(viewx, viewy)->sector;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1522,11 +1553,6 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_fovchange);
|
||||
CV_RegisterVar(&cv_fov);
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_chasecam[i]);
|
||||
}
|
||||
|
||||
CV_RegisterVar(&cv_shadow);
|
||||
CV_RegisterVar(&cv_shadowoffs);
|
||||
CV_RegisterVar(&cv_skybox);
|
||||
@@ -1536,6 +1562,8 @@ void R_RegisterEngineStuff(void)
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_chasecam[i]);
|
||||
|
||||
CV_RegisterVar(&cv_cam_dist[i]);
|
||||
CV_RegisterVar(&cv_cam_still[i]);
|
||||
CV_RegisterVar(&cv_cam_height[i]);
|
||||
@@ -1552,6 +1580,8 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_tiltsmoothing);
|
||||
CV_RegisterVar(&cv_actionmovie);
|
||||
|
||||
CV_RegisterVar(&cv_screenquake);
|
||||
|
||||
CV_RegisterVar(&cv_driftsparkpulse);
|
||||
CV_RegisterVar(&cv_gravstretch);
|
||||
CV_RegisterVar(&cv_sloperoll);
|
||||
@@ -1569,6 +1599,7 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_randomdirlight);
|
||||
|
||||
CV_RegisterVar(&cv_maxinterpdist);
|
||||
CV_RegisterVar(&cv_playerfade);
|
||||
|
||||
CV_RegisterVar(&cv_ripplewater);
|
||||
|
||||
|
||||
+18
-40
@@ -88,7 +88,7 @@ extern lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ];
|
||||
//
|
||||
// killough 5/2/98: reformatted
|
||||
//
|
||||
FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t * restrict node)
|
||||
FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t* restrict node)
|
||||
{
|
||||
if (!node->dx)
|
||||
return x <= node->x ? node->dy > 0 : node->dy < 0;
|
||||
@@ -117,10 +117,10 @@ FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSideFast(fixed_t x, fixed_t
|
||||
|
||||
FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line)
|
||||
{
|
||||
fixed_t lx = line->v1->x;
|
||||
fixed_t ly = line->v1->y;
|
||||
fixed_t ldx = line->v2->x - lx;
|
||||
fixed_t ldy = line->v2->y - ly;
|
||||
fixed_t lx = line->v1->x;
|
||||
fixed_t ly = line->v1->y;
|
||||
fixed_t ldx = line->v2->x - lx;
|
||||
fixed_t ldy = line->v2->y - ly;
|
||||
|
||||
// use cross product to determine side quickly
|
||||
INT64 v = ((INT64)y - ly) * ldx - ((INT64)x - lx) * ldy;
|
||||
@@ -137,42 +137,19 @@ fixed_t R_ScaleFromGlobalAngle(angle_t visangle);
|
||||
//
|
||||
// R_PointInSubsector
|
||||
//
|
||||
FUNCINLINE static ATTRINLINE subsector_t *R_PointInSubsector(fixed_t x, fixed_t y)
|
||||
{
|
||||
size_t nodenum = numnodes-1;
|
||||
|
||||
while (!(nodenum & NF_SUBSECTOR))
|
||||
nodenum = nodes[nodenum].children[R_PointOnSide(x, y, nodes+nodenum)];
|
||||
|
||||
return &subsectors[nodenum & ~NF_SUBSECTOR];
|
||||
#define R_POINTINSUBSECTOR(FUNCNAME, SIDEFUNC)\
|
||||
FUNCINLINE static ATTRINLINE subsector_t *FUNCNAME(fixed_t x, fixed_t y)\
|
||||
{\
|
||||
size_t nodenum = numnodes-1;\
|
||||
while (!(nodenum & NF_SUBSECTOR))\
|
||||
nodenum = nodes[nodenum].children[SIDEFUNC(x, y, nodes+nodenum)];\
|
||||
return &subsectors[nodenum & ~NF_SUBSECTOR];\
|
||||
}
|
||||
|
||||
//
|
||||
// R_IsPointInSubsector, same as above but returns 0 if not in subsector
|
||||
//
|
||||
FUNCINLINE static ATTRINLINE subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y)
|
||||
{
|
||||
node_t *node;
|
||||
INT32 side, i;
|
||||
size_t nodenum;
|
||||
subsector_t *ret;
|
||||
R_POINTINSUBSECTOR(R_PointInSubsector, R_PointOnSide)
|
||||
R_POINTINSUBSECTOR(R_PointInSubsectorFast, R_PointOnSideFast)
|
||||
|
||||
nodenum = numnodes - 1;
|
||||
|
||||
while (!(nodenum & NF_SUBSECTOR))
|
||||
{
|
||||
node = &nodes[nodenum];
|
||||
side = R_PointOnSide(x, y, node);
|
||||
nodenum = node->children[side];
|
||||
}
|
||||
|
||||
ret = &subsectors[nodenum & ~NF_SUBSECTOR];
|
||||
for (i = 0; i < ret->numlines; i++)
|
||||
if (P_PointOnLineSide(x, y, segs[ret->firstline + i].linedef) != segs[ret->firstline + i].side)
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y);
|
||||
|
||||
#define R_PointToDist(x, y) R_PointToDist2(viewx, viewy, x, y)
|
||||
#define R_PointToDist2(px2, py2, px1, py1) FixedHypot((px1) - (px2), (py1) - (py2))
|
||||
@@ -218,6 +195,7 @@ extern consvar_t cv_fov, cv_fovchange;
|
||||
extern consvar_t cv_skybox;
|
||||
extern consvar_t cv_tailspickup;
|
||||
extern consvar_t cv_maxinterpdist;
|
||||
extern consvar_t cv_playerfade;
|
||||
extern consvar_t cv_ripplewater;
|
||||
|
||||
extern consvar_t cv_randomdirlight;
|
||||
@@ -237,8 +215,8 @@ void R_SetViewSize(void);
|
||||
void R_ExecuteSetViewSize(void);
|
||||
|
||||
fixed_t R_GetPlayerFov(player_t *player);
|
||||
void R_SkyboxFrame(int s);
|
||||
void R_SetupFrame(int s, boolean skybox);
|
||||
void R_SkyboxFrame(UINT8 pnum);
|
||||
void R_SetupFrame(UINT8 pnum, boolean skybox);
|
||||
|
||||
// Called by G_Drawer.
|
||||
void R_RenderPlayerView(player_t *player);
|
||||
|
||||
+51
-49
@@ -247,9 +247,7 @@ static void R_MapPlane(drawspandata_t *ds, spandrawfunc_t *localspanfunc, INT32
|
||||
ds->bgofs = -y;
|
||||
}
|
||||
|
||||
pindex = distance >> LIGHTZSHIFT;
|
||||
if (pindex >= MAXLIGHTZ)
|
||||
pindex = MAXLIGHTZ - 1;
|
||||
pindex = std::min<size_t>(distance >> LIGHTZSHIFT, MAXLIGHTZ - 1);
|
||||
|
||||
ds->colormap = ds->planezlight[pindex];
|
||||
|
||||
@@ -352,8 +350,8 @@ void R_ClearPlanes(void)
|
||||
angle = (viewangle-ANGLE_90)>>ANGLETOFINESHIFT;
|
||||
|
||||
// scale will be unit scale at SCREENWIDTH/2 distance
|
||||
basexscale = FixedDiv (FINECOSINE(angle), centerxfrac);
|
||||
baseyscale = -FixedDiv (FINESINE(angle), centerxfrac);
|
||||
basexscale = FixedDiv (FINECOSINE(angle), centerxfrac);
|
||||
baseyscale = -FixedDiv (FINESINE(angle), centerxfrac);
|
||||
}
|
||||
|
||||
static visplane_t *new_visplane(unsigned hash)
|
||||
@@ -442,26 +440,20 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||
}
|
||||
}
|
||||
|
||||
// This appears to fix the Nimbus Ruins sky bug.
|
||||
if (picnum == skyflatnum && pfloor)
|
||||
{
|
||||
height = 0; // all skies map together
|
||||
lightlevel = 0;
|
||||
}
|
||||
else if (slope != NULL && P_ApplyLightOffset(lightlevel >> LIGHTSEGSHIFT, lighting_sector))
|
||||
{
|
||||
if (reverseLight)
|
||||
{
|
||||
lightlevel -= slope->lightOffset * 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
lightlevel += slope->lightOffset * 8;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pfloor)
|
||||
{
|
||||
if (slope != NULL && P_ApplyLightOffset(lightlevel >> LIGHTSEGSHIFT, lighting_sector))
|
||||
{
|
||||
if (reverseLight)
|
||||
{
|
||||
lightlevel -= slope->lightOffset * 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
lightlevel += slope->lightOffset * 8;
|
||||
}
|
||||
}
|
||||
|
||||
hash = visplane_hash(picnum, lightlevel, height);
|
||||
|
||||
for (check = visplanes[hash]; check; check = check->next)
|
||||
@@ -485,6 +477,13 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||
}
|
||||
else
|
||||
{
|
||||
// This appears to fix the Nimbus Ruins sky bug.
|
||||
if (picnum == skyflatnum)
|
||||
{
|
||||
height = 0; // all skies map together
|
||||
lightlevel = 0;
|
||||
}
|
||||
|
||||
hash = MAXVISPLANES - 1;
|
||||
}
|
||||
|
||||
@@ -592,6 +591,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop)
|
||||
memset(pl->top, 0xff, sizeof(*pl->top) * viewwidth);
|
||||
memset(pl->bottom, 0x00, sizeof(*pl->bottom) * viewwidth);
|
||||
}
|
||||
|
||||
return pl;
|
||||
}
|
||||
|
||||
@@ -628,14 +628,13 @@ static void R_MakeSpans(void (*mapfunc)(drawspandata_t* ds, void(*spanfunc)(draw
|
||||
if (b2 >= vidheight) b2 = vidheight-1;
|
||||
if (x-1 >= vid.width) x = vid.width;
|
||||
|
||||
drawspandata_t dc_copy = *ds;
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
// We want to draw N spans per subtask to ensure the work is
|
||||
// coarse enough to not be too slow due to task scheduling overhead.
|
||||
// To safely do this, we need to copy part of spanstart to a local.
|
||||
// This is essentially loop unrolling across threads.
|
||||
constexpr const int kSpanTaskGranularity = 8;
|
||||
drawspandata_t ds_copy = *ds;
|
||||
while (t1 < t2 && t1 <= b1)
|
||||
{
|
||||
INT32 spanstartcopy[kSpanTaskGranularity] = {0};
|
||||
@@ -652,7 +651,7 @@ static void R_MakeSpans(void (*mapfunc)(drawspandata_t* ds, void(*spanfunc)(draw
|
||||
auto task = [=]() mutable -> void {
|
||||
for (int i = 0; i < taskspans; i++)
|
||||
{
|
||||
mapfunc(&dc_copy, localspanfunc, t1 + i, spanstartcopy[i], x - 1, false);
|
||||
mapfunc(&ds_copy, localspanfunc, t1 + i, spanstartcopy[i], x - 1, false);
|
||||
}
|
||||
};
|
||||
if (allow_parallel)
|
||||
@@ -681,7 +680,7 @@ static void R_MakeSpans(void (*mapfunc)(drawspandata_t* ds, void(*spanfunc)(draw
|
||||
auto task = [=]() mutable -> void {
|
||||
for (int i = 0; i < taskspans; i++)
|
||||
{
|
||||
mapfunc(&dc_copy, localspanfunc, b1 - i, spanstartcopy[i], x - 1, false);
|
||||
mapfunc(&ds_copy, localspanfunc, b1 - i, spanstartcopy[i], x - 1, false);
|
||||
}
|
||||
};
|
||||
if (allow_parallel)
|
||||
@@ -699,12 +698,12 @@ static void R_MakeSpans(void (*mapfunc)(drawspandata_t* ds, void(*spanfunc)(draw
|
||||
|
||||
while (t1 < t2 && t1 <= b1)
|
||||
{
|
||||
mapfunc(&dc_copy, localspanfunc, t1, spanstart[t1], x - 1, false);
|
||||
mapfunc(ds, localspanfunc, t1, spanstart[t1], x - 1, false);
|
||||
t1++;
|
||||
}
|
||||
while (b1 > b2 && b1 >= t1)
|
||||
{
|
||||
mapfunc(&dc_copy, localspanfunc, b1, spanstart[b1], x - 1, false);
|
||||
mapfunc(ds, localspanfunc, b1, spanstart[b1], x - 1, false);
|
||||
b1--;
|
||||
}
|
||||
#endif
|
||||
@@ -1020,13 +1019,12 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
|
||||
size_t size;
|
||||
INT32 spanfunctype = BASEDRAWFUNC;
|
||||
ffloor_t *rover;
|
||||
levelflat_t *levelflat;
|
||||
void (*mapfunc)(drawspandata_t*, void(*)(drawspandata_t*), INT32, INT32, INT32, boolean) = R_MapPlane;
|
||||
|
||||
if (!(pl->minx <= pl->maxx))
|
||||
if (pl->minx > pl->maxx)
|
||||
return;
|
||||
|
||||
R_UpdatePlaneRipple(ds);
|
||||
|
||||
// sky flat
|
||||
if (pl->picnum == skyflatnum)
|
||||
{
|
||||
@@ -1039,6 +1037,8 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
|
||||
return;
|
||||
}
|
||||
|
||||
R_UpdatePlaneRipple(ds);
|
||||
|
||||
ds->planeripple.active = false;
|
||||
R_SetSpanFunc(BASEDRAWFUNC);
|
||||
|
||||
@@ -1175,16 +1175,17 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
|
||||
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
}
|
||||
|
||||
// Don't mess with angle on slopes! We'll handle this ourselves later
|
||||
if (!pl->slope && viewangle != pl->viewangle+pl->plangle)
|
||||
{
|
||||
viewangle = pl->viewangle+pl->plangle;
|
||||
}
|
||||
|
||||
ds->currentplane = pl;
|
||||
|
||||
ds->source = (UINT8 *)W_CacheLumpNum(levelflats[pl->picnum].lumpnum, PU_STATIC); // Stay here until Z_ChangeTag
|
||||
size = W_LumpLength(levelflats[pl->picnum].lumpnum);
|
||||
levelflat = &levelflats[pl->picnum];
|
||||
|
||||
// Get the texture
|
||||
ds->source = (UINT8 *)W_CacheLumpNum(levelflat->lumpnum, PU_STATIC); // Stay here until Z_ChangeTag
|
||||
|
||||
if (ds->source == NULL)
|
||||
return;
|
||||
|
||||
size = W_LumpLength(levelflat->lumpnum);
|
||||
|
||||
switch (size)
|
||||
{
|
||||
@@ -1235,11 +1236,7 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
|
||||
ds->xoffs = pl->xoffs;
|
||||
ds->yoffs = pl->yoffs;
|
||||
|
||||
if (light >= LIGHTLEVELS)
|
||||
light = LIGHTLEVELS-1;
|
||||
|
||||
if (light < 0)
|
||||
light = 0;
|
||||
light = CLAMP(light, 0, LIGHTLEVELS-1);
|
||||
|
||||
if (pl->slope)
|
||||
{
|
||||
@@ -1292,6 +1289,12 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't mess with angle on slopes! We'll handle this ourselves later
|
||||
if (viewangle != pl->viewangle + pl->plangle)
|
||||
{
|
||||
viewangle = pl->viewangle + pl->plangle;
|
||||
}
|
||||
|
||||
ds->planeheight = abs(pl->height - pl->viewz);
|
||||
ds->planezlight = zlight[light];
|
||||
}
|
||||
@@ -1299,10 +1302,8 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
|
||||
R_SetSpanFunc(spanfunctype);
|
||||
|
||||
// set the maximum value for unsigned
|
||||
pl->top[pl->maxx+1] = 0xffff;
|
||||
pl->top[pl->minx-1] = 0xffff;
|
||||
pl->bottom[pl->maxx+1] = 0x0000;
|
||||
pl->bottom[pl->minx-1] = 0x0000;
|
||||
pl->top[pl->maxx+1] = pl->top[pl->minx-1] = 0xffff;
|
||||
pl->bottom[pl->maxx+1] = pl->bottom[pl->minx-1] = 0x0000;
|
||||
|
||||
stop = pl->maxx + 1;
|
||||
|
||||
@@ -1403,6 +1404,7 @@ void R_PlaneBounds(visplane_t *plane)
|
||||
if (plane->bottom[i] > low)
|
||||
low = plane->bottom[i];
|
||||
}
|
||||
|
||||
plane->high = hi;
|
||||
plane->low = low;
|
||||
}
|
||||
+9
-5
@@ -306,8 +306,10 @@ static void R_RenderMaskedSegLoop(drawcolumndata_t* dc, drawseg_t *drawseg, INT3
|
||||
else
|
||||
dc->texturemid -= (textureheight[texnum])*times;
|
||||
|
||||
const INT16 colnum = maskedtexturecol[dc->x];
|
||||
|
||||
// calculate lighting
|
||||
if (maskedtexturecol[dc->x] != INT16_MAX)
|
||||
if (colnum != INT16_MAX)
|
||||
{
|
||||
// Check for overflows first
|
||||
if (R_OverflowTest(dc))
|
||||
@@ -337,7 +339,7 @@ static void R_RenderMaskedSegLoop(drawcolumndata_t* dc, drawseg_t *drawseg, INT3
|
||||
dc->iscale = 0xffffffffu / (unsigned)spryscale;
|
||||
|
||||
// draw the texture
|
||||
col = (column_t *)((UINT8 *)R_GetColumn(texnum, maskedtexturecol[dc->x]) - 3);
|
||||
col = (column_t *)((UINT8 *)R_GetColumn(texnum, colnum) - 3);
|
||||
|
||||
auto set_light_vars = [&](INT32 k)
|
||||
{
|
||||
@@ -434,7 +436,7 @@ static void R_RenderMaskedSegLoop(drawcolumndata_t* dc, drawseg_t *drawseg, INT3
|
||||
dc->iscale = 0xffffffffu / (unsigned)spryscale;
|
||||
|
||||
// draw the texture
|
||||
col = (column_t *)((UINT8 *)R_GetColumn(texnum, maskedtexturecol[dc->x]) - 3);
|
||||
col = (column_t *)((UINT8 *)R_GetColumn(texnum, colnum) - 3);
|
||||
|
||||
colfunc_2s(dc, col);
|
||||
}
|
||||
@@ -1164,7 +1166,7 @@ static void R_DrawWallColumn(drawcolumndata_t* dc, INT32 yl, INT32 yh, fixed_t m
|
||||
dc->source = R_GetColumn(texture, texturecolumn);
|
||||
dc->texheight = textureheight[texture] >> FRACBITS;
|
||||
dc->sourcelength = dc->texheight;
|
||||
R_SetColumnFunc(colfunctype);
|
||||
//R_SetColumnFunc(colfunctype);
|
||||
coldrawfunc_t* colfunccopy = colfunc;
|
||||
drawcolumndata_t dc_copy = *dc;
|
||||
if (remap)
|
||||
@@ -1190,6 +1192,7 @@ static void R_RenderSegLoop(drawcolumndata_t* dc)
|
||||
INT32 bottom;
|
||||
INT32 i;
|
||||
|
||||
// Loop over width
|
||||
for (; rw_x < rw_stopx; rw_x++)
|
||||
{
|
||||
// mark floor / ceiling areas
|
||||
@@ -1563,6 +1566,7 @@ static void R_MarkSegBounds(void)
|
||||
INT32 top, bottom;
|
||||
INT16 topclip, bottomclip;
|
||||
|
||||
// Loop over width
|
||||
for (; rw_x < rw_stopx; rw_x++)
|
||||
{
|
||||
// mark floor / ceiling areas
|
||||
@@ -2884,7 +2888,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||
|
||||
didsolidcol = false;
|
||||
|
||||
if (!segtextured && !numffloors)
|
||||
if (!segtextured && !numffloors && !numbackffloors)
|
||||
{
|
||||
if (markfloor || markceiling)
|
||||
R_MarkSegBounds();
|
||||
|
||||
+51
-2
@@ -737,6 +737,13 @@ static void R_DrawFlippedMaskedColumn(drawcolumndata_t* dc, column_t *column)
|
||||
dc->texturemid = basetexturemid;
|
||||
}
|
||||
|
||||
|
||||
// Based off of R_GetLinedefTransTable
|
||||
transnum_t R_GetThingTransTable(fixed_t alpha, transnum_t transmap)
|
||||
{
|
||||
return static_cast<transnum_t>((20*(FRACUNIT - ((alpha * (10 - transmap))/10) - 1) + FRACUNIT) >> (FRACBITS+1));
|
||||
}
|
||||
|
||||
//
|
||||
// R_DrawVisSprite
|
||||
// mfloorclip and mceilingclip should also be set.
|
||||
@@ -1596,6 +1603,9 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||
else
|
||||
trans = 0;
|
||||
|
||||
if (cv_playerfade.value && oldthing->player)
|
||||
trans = static_cast<INT32>(R_GetThingTransTable(R_DoPlayerFade(oldthing), static_cast<transnum_t>(trans)));
|
||||
|
||||
//SoM: 3/17/2000: Disregard sprites that are out of view..
|
||||
if (vflip)
|
||||
{
|
||||
@@ -2931,6 +2941,32 @@ boolean R_ThingWithinDist(mobj_t *thing, INT32 limit_dist)
|
||||
return true;
|
||||
}
|
||||
|
||||
fixed_t R_DoPlayerFade(mobj_t *thing)
|
||||
{
|
||||
fixed_t fadealpha = FRACUNIT;
|
||||
static constexpr tic_t countdownstarttime = (15 * TICRATE) / 4; // starttime - (3*TICRATE)
|
||||
|
||||
if (thing->player == viewplayer || viewplayer->exiting || camera[R_GetViewNumber()].freecam || leveltime < countdownstarttime)
|
||||
return fadealpha;
|
||||
|
||||
const INT32 playerdist = (FixedMul((thing->x - viewx), viewcos) + FixedMul((thing->y - viewy), viewsin)) >> FRACBITS;
|
||||
const INT32 viewplayerdist = (FixedMul((viewplayer->mo->x - viewx), viewcos) + FixedMul((viewplayer->mo->y - viewy), viewsin)) >> FRACBITS;
|
||||
|
||||
if (playerdist < viewplayerdist)
|
||||
{
|
||||
if (playerdist < viewplayerdist / 2) // stronger fade when very close
|
||||
{
|
||||
fadealpha = (playerdist * FRACUNIT) / (viewplayerdist / 2) / 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
fadealpha = (playerdist * FRACUNIT) / viewplayerdist;
|
||||
}
|
||||
}
|
||||
|
||||
return fadealpha;
|
||||
}
|
||||
|
||||
boolean R_CheckInterpDist(mobj_t *thing)
|
||||
{
|
||||
if (!cv_maxinterpdist.value)
|
||||
@@ -2970,8 +3006,21 @@ static void R_DrawMaskedList(drawnode_t* head)
|
||||
{
|
||||
drawspandata_t ds = {};
|
||||
next = r2->prev;
|
||||
// Force disable multithreading since it is usually slower because of waiting for each plane to render
|
||||
R_DrawSinglePlane(&ds, r2->plane, false);
|
||||
boolean parallel = cv_parallelsoftware.value && cv_paralleldrawmasked.value;
|
||||
#ifdef HAVE_THREADS
|
||||
srb2::ThreadPool::Sema tp_sema;
|
||||
if (parallel)
|
||||
srb2::g_main_threadpool->begin_sema();
|
||||
#endif
|
||||
R_DrawSinglePlane(&ds, r2->plane, parallel);
|
||||
#ifdef HAVE_THREADS
|
||||
if (parallel)
|
||||
{
|
||||
tp_sema = srb2::g_main_threadpool->end_sema();
|
||||
srb2::g_main_threadpool->notify_sema(tp_sema);
|
||||
srb2::g_main_threadpool->wait_sema(tp_sema);
|
||||
}
|
||||
#endif
|
||||
R_DoneWithNode(r2);
|
||||
r2 = next;
|
||||
}
|
||||
|
||||
@@ -87,9 +87,12 @@ typedef struct
|
||||
|
||||
void R_DrawMasked(maskcount_t* masks, INT32 nummasks);
|
||||
|
||||
transnum_t R_GetThingTransTable(fixed_t alpha, transnum_t transmap);
|
||||
|
||||
boolean R_ThingVisible(mobj_t *thing);
|
||||
boolean R_ThingWithinDist(mobj_t *thing, INT32 limit_dist);
|
||||
boolean R_CheckInterpDist(mobj_t *thing);
|
||||
fixed_t R_DoPlayerFade(mobj_t *thing);
|
||||
|
||||
boolean R_ThingIsFullBright(mobj_t *thing);
|
||||
boolean R_ThingIsSemiBright(mobj_t *thing);
|
||||
|
||||
+15
-14
@@ -957,7 +957,7 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32
|
||||
INT64 x, y, yl, yh, xl, xh;
|
||||
fixed_t newdist;
|
||||
|
||||
if (R_PointInSubsector(listensource.x, listensource.y)->sector->ceilingpic == skyflatnum)
|
||||
if (R_PointInSubsectorFast(listensource.x, listensource.y)->sector->ceilingpic == skyflatnum)
|
||||
approx_dist = 0;
|
||||
else
|
||||
{
|
||||
@@ -970,7 +970,7 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32
|
||||
for (y = yl; y <= yh; y += FRACUNIT*64)
|
||||
for (x = xl; x <= xh; x += FRACUNIT*64)
|
||||
{
|
||||
if (R_PointInSubsector(x, y)->sector->ceilingpic == skyflatnum)
|
||||
if (R_PointInSubsectorFast(x, y)->sector->ceilingpic == skyflatnum)
|
||||
{
|
||||
// Found the outdoors!
|
||||
newdist = S_CalculateSoundDistance(listensource.x, listensource.y, 0, x, y, 0);
|
||||
@@ -1718,15 +1718,15 @@ static boolean S_PlayMusic(boolean looping, UINT32 fadeinms)
|
||||
static void S_QueueMusic(const char *mmusic, UINT16 mflags, boolean looping, UINT32 position, UINT32 fadeinms)
|
||||
{
|
||||
strncpy(queue.name, mmusic, 7);
|
||||
queue.flags = mflags;
|
||||
queue.looping = looping;
|
||||
queue.flags = mflags;
|
||||
queue.looping = looping;
|
||||
queue.position = position;
|
||||
queue.fadeinms = fadeinms;
|
||||
}
|
||||
|
||||
static void S_ClearQueue(void)
|
||||
{
|
||||
queue.name[0] = queue.flags = queue.looping = queue.position = queue.fadeinms = 0;
|
||||
memset(&queue, 0, sizeof(music_t));
|
||||
}
|
||||
|
||||
static void S_ChangeMusicToQueue(void)
|
||||
@@ -1757,7 +1757,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
||||
|| demo.title) // SRB2Kart: Demos don't interrupt title screen music
|
||||
return;
|
||||
|
||||
strncpy(newmusic, mmusic, 6);
|
||||
strncpy(newmusic, mmusic, 6);
|
||||
strncpy(checkmusic, mmusic, 6);
|
||||
|
||||
if (LUA_HookMusicChange(music.name, &hook_param))
|
||||
@@ -2030,7 +2030,7 @@ void S_KeepMusic(void)
|
||||
}
|
||||
|
||||
// Sets up the map music in case it should be reloaded
|
||||
// Special case for keep music
|
||||
// Special case for keepmusic
|
||||
void S_HandleReloadResetMusic(void)
|
||||
{
|
||||
if (!(mapmusic.flags & MUSIC_RELOADRESET))
|
||||
@@ -2055,23 +2055,24 @@ void S_HandleReloadResetMusic(void)
|
||||
|
||||
static boolean S_SkipIntroMusic(void)
|
||||
{
|
||||
boolean skip = cv_skipintromusic.value;
|
||||
if (!cv_skipintromusic.value)
|
||||
return false;
|
||||
|
||||
if (!skip)
|
||||
// check if menu music is playing, otherwise it may continue playing
|
||||
if (!stricmp(music.name, "titles"))
|
||||
return false;
|
||||
|
||||
char *maptitle = G_BuildMapTitle(gamemap); // Zzz...
|
||||
|
||||
if (maptitle)
|
||||
if (maptitle && !stricmp(maptitle, "Wandering Falls")) // wandering balls changes its song when the race starts Zzz...
|
||||
{
|
||||
// check if menu music is playing, otherwise it may continue playing
|
||||
if (!stricmp(music.name, "titles") || (maptitle && (!stricmp(maptitle, "Wandering Falls")))) // wandering balls changes its song when the race starts Zzz...
|
||||
skip = false;
|
||||
Z_Free(maptitle);
|
||||
return false;
|
||||
}
|
||||
|
||||
Z_Free(maptitle);
|
||||
|
||||
return skip;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
+7
-2
@@ -49,6 +49,7 @@ consvar_t cv_vhseffect = {"vhspause", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NU
|
||||
consvar_t cv_shittyscreen = {"televisionsignal", "Okay", CV_NOSHOWHELP, shittyscreen_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_parallelsoftware = {"parallelsoftware", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_paralleldrawmasked = {"paralleldrawmasked", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t votescale_cons_t[] = {{0, "Vanilla"}, {1, "Adaptive"}, {2, "VerticalFill"}, {3, "HorizontalFill"}, {0, NULL}};
|
||||
consvar_t cv_votebgscaling = {"votebgscaling", "Adaptive", CV_SAVE, votescale_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -65,7 +66,9 @@ static void Highreshudscale_OnChange(void)
|
||||
|
||||
static void SCR_ChangeFullscreen (void);
|
||||
|
||||
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, CV_YesNo, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t fullscreen_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Borderless Window"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, fullscreen_cons_t, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t accuratefps_cons_t[] = {{0, "Inaccurate"}, {1, "Accurate"}, {0, NULL}};
|
||||
consvar_t cv_accuratefps = {"fpssampling", "1", CV_SAVE, accuratefps_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -324,6 +327,8 @@ void SCR_SetDefaultMode(void)
|
||||
void SCR_ChangeFullscreen(void)
|
||||
{
|
||||
#ifdef DIRECTFULLSCREEN
|
||||
I_SetBorderlessWindow(); // Running this here so we can have borderless window at startup
|
||||
|
||||
// allow_fullscreen is set by VID_PrepareModeList
|
||||
// it is used to prevent switching to fullscreen during startup
|
||||
if (!allow_fullscreen)
|
||||
@@ -349,7 +354,7 @@ double averageFPS = 0.0f;
|
||||
|
||||
#ifdef USE_FPS_SAMPLES
|
||||
#define MAX_FRAME_TIME (0.05)
|
||||
#define NUM_FPS_SAMPLES (16) // Number of samples to store
|
||||
#define NUM_FPS_SAMPLES (32) // Number of samples to store
|
||||
|
||||
static double total_frame_time = 0.0;
|
||||
static int frame_index;
|
||||
|
||||
@@ -88,6 +88,7 @@ extern UINT8 *scr_borderpatch; // patch used to fill the view borders
|
||||
|
||||
extern consvar_t cv_scr_width, cv_scr_height, cv_renderview, cv_fullscreen, cv_vhseffect, cv_shittyscreen;
|
||||
extern consvar_t cv_parallelsoftware;
|
||||
extern consvar_t cv_paralleldrawmasked;
|
||||
|
||||
extern consvar_t cv_highreshudscale;
|
||||
// wait for page flipping to end or not
|
||||
|
||||
+399
-513
File diff suppressed because it is too large.
Load diff
@@ -80,7 +80,7 @@ write netcode into the sound code, OKAY?
|
||||
#define GME_BASS 1.0f
|
||||
#endif // HAVE_GME
|
||||
|
||||
|
||||
|
||||
//static UINT16 BUFFERSIZE = 2048;
|
||||
static UINT16 SAMPLERATE = 44100;
|
||||
|
||||
@@ -710,7 +710,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
|
||||
|
||||
// play gme into stream
|
||||
gme_play(gme, len/2, (short *)stream);
|
||||
|
||||
|
||||
// Limiter to prevent music from being disorted with some formats
|
||||
if (music_volume >= 18)
|
||||
music_volume = 18;
|
||||
@@ -726,7 +726,7 @@ static void mix_openmpt(void *udata, Uint8 *stream, int len)
|
||||
{
|
||||
int i;
|
||||
short *p;
|
||||
|
||||
|
||||
(void)udata;
|
||||
|
||||
if (!openmpt_mhandle || songpaused)
|
||||
@@ -734,7 +734,7 @@ static void mix_openmpt(void *udata, Uint8 *stream, int len)
|
||||
|
||||
// Play module into stream
|
||||
openmpt_module_read_interleaved_stereo(openmpt_mhandle, SAMPLERATE, cv_audbuffersize.value, (short *)stream);
|
||||
|
||||
|
||||
// Limiter to prevent music from being disorted with some formats
|
||||
if (music_volume >= 18)
|
||||
music_volume = 18;
|
||||
@@ -823,7 +823,7 @@ boolean I_SetSongSpeed(float speed)
|
||||
#endif
|
||||
#ifdef HAVE_OPENMPT
|
||||
if (openmpt_mhandle)
|
||||
{
|
||||
{
|
||||
if (speed > 4.0f)
|
||||
speed = 4.0f; // Limit this to 4x to prevent crashing, stupid fix but... ~SteelT 27/9/19
|
||||
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR < 5
|
||||
|
||||
@@ -1037,6 +1037,7 @@ sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean
|
||||
S_sfx[i].data = I_GetSfx(&S_sfx[i]);
|
||||
else
|
||||
S_sfx[i].data = NULL;
|
||||
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
+17
-16
@@ -419,27 +419,28 @@ static void ST_drawDebugInfo(void)
|
||||
|
||||
static void ST_drawLevelTitle(void)
|
||||
{
|
||||
char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
|
||||
char *subttl = mapheaderinfo[gamemap-1]->subttl;
|
||||
char *zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
|
||||
char *actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
INT32 lvlttlxpos;
|
||||
INT32 ttlnumxpos;
|
||||
INT32 zonexpos;
|
||||
INT32 dupcalc = (vid.width/vid.dupx);
|
||||
UINT8 gtc = G_GetGametypeColor(gametype);
|
||||
char *lvlttl, *subttl, *zonttl, *actnum;
|
||||
INT32 lvlttlxpos, ttlnumxpos, zonexpos;
|
||||
INT32 dupcalc;
|
||||
UINT8 gtc;
|
||||
INT32 sub = 0;
|
||||
INT32 bary = (splitscreen)
|
||||
? BASEVIDHEIGHT/2
|
||||
: 163;
|
||||
INT32 bary;
|
||||
INT32 lvlw;
|
||||
|
||||
if (!cv_stagetitle.value)
|
||||
if (!cv_stagetitle.value || (timeinmap > 113))
|
||||
return;
|
||||
|
||||
if (timeinmap > 113)
|
||||
if (*mapheaderinfo[gamemap-1]->lvlttl == '\0')
|
||||
return;
|
||||
|
||||
lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
|
||||
subttl = mapheaderinfo[gamemap-1]->subttl;
|
||||
zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
|
||||
actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
dupcalc = (vid.width/vid.dupx);
|
||||
gtc = G_GetGametypeColor(gametype);
|
||||
bary = (splitscreen) ? BASEVIDHEIGHT/2 : 163;
|
||||
|
||||
lvlw = V_LevelNameWidth(lvlttl);
|
||||
|
||||
if (actnum[0])
|
||||
@@ -603,7 +604,7 @@ static void ST_overlayDrawer(void)
|
||||
}
|
||||
|
||||
// draw level title Tails
|
||||
if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer) && !mapreset) && LUA_HudEnabled(hud_stagetitle) && !forceshowhud)
|
||||
if (!(hu_showscores && (netgame || multiplayer) && !mapreset) && LUA_HudEnabled(hud_stagetitle) && !forceshowhud)
|
||||
ST_drawLevelTitle();
|
||||
|
||||
if (!hu_showscores && netgame && !mapreset)
|
||||
@@ -740,7 +741,7 @@ void ST_Drawer(void)
|
||||
UINT8 i;
|
||||
|
||||
#ifdef SEENAMES
|
||||
if (cv_seenames.value && cv_allowseenames.value && displayplayers[0] == consoleplayer && seenplayer && seenplayer->mo && !mapreset)
|
||||
if (UNLIKELY(cv_seenames.value && cv_allowseenames.value && displayplayers[0] == consoleplayer && seenplayer && seenplayer->mo && !mapreset))
|
||||
{
|
||||
if (cv_seenames.value == 1)
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, player_names[seenplayer-players]);
|
||||
|
||||
+1
-1
@@ -611,7 +611,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
|
||||
|
||||
fseek(handle, LONG(zend.cdiroffset), SEEK_SET);
|
||||
|
||||
char *cdir = (Z_MallocAlign(LONG(zend.cdirsize), PU_STATIC, &cdir, 7));
|
||||
char *cdir = Z_Malloc(LONG(zend.cdirsize), PU_STATIC, &cdir);
|
||||
|
||||
if (fread(cdir, 1, LONG(zend.cdirsize), handle) < (UINT32)(LONG(zend.cdirsize)))
|
||||
{
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#include <winuser.h>
|
||||
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
+85
-37
@@ -149,9 +149,12 @@ void Z_Free(void *ptr)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ZDEBUG
|
||||
#ifdef ZDEBUG2
|
||||
// Write every Z_Free call to a debug file.
|
||||
CONS_Debug(DBG_MEMORY, "Z_Free at %s:%d\n", file, line);
|
||||
#elif defined(ZDEBUG)
|
||||
(void)file;
|
||||
(void)line;
|
||||
#endif
|
||||
|
||||
// anything that isn't by lua gets passed to lua just in case.
|
||||
@@ -202,7 +205,7 @@ static void *xm(size_t size)
|
||||
return p;
|
||||
}
|
||||
|
||||
/** The Z_MallocAlign function.
|
||||
/** The Z_Malloc function.
|
||||
* Allocates a block of memory, adds it to a linked list so we can keep track of it.
|
||||
*
|
||||
* \param size Amount of memory to be allocated, in bytes.
|
||||
@@ -210,22 +213,19 @@ static void *xm(size_t size)
|
||||
* \param user The address of a pointer to the memory to be allocated.
|
||||
* When the memory is freed by Z_Free later,
|
||||
* the pointer at this address will then be automatically set to NULL.
|
||||
* \param alignbits The alignment of the memory to be allocated, in bits. Can be 0.
|
||||
* \note You can pass Z_Malloc() a NULL user if the tag is less than PU_PURGELEVEL.
|
||||
* \sa Z_CallocAlign, Z_ReallocAlign
|
||||
* \sa Z_Calloc, Z_Realloc
|
||||
*/
|
||||
#ifdef ZDEBUG
|
||||
void *Z_Malloc2(size_t size, INT32 tag, void *user, INT32 alignbits,
|
||||
void *Z_Malloc2(size_t size, INT32 tag, void *user,
|
||||
const char *file, INT32 line)
|
||||
#else
|
||||
void *Z_MallocAlign(size_t size, INT32 tag, void *user, INT32 alignbits)
|
||||
void *Z_Malloc(size_t size, INT32 tag, void *user)
|
||||
#endif
|
||||
{
|
||||
memblock_t *block;
|
||||
void *ptr;
|
||||
|
||||
(void)(alignbits); // no longer used, so silence warnings. TODO we should figure out a solution for this
|
||||
|
||||
#ifdef ZDEBUG2
|
||||
CONS_Debug(DBG_MEMORY, "Z_Malloc %s:%d\n", file, line);
|
||||
#endif
|
||||
@@ -270,55 +270,53 @@ void *Z_MallocAlign(size_t size, INT32 tag, void *user, INT32 alignbits)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/** The Z_CallocAlign function.
|
||||
/** The Z_Calloc function.
|
||||
* Allocates a block of memory, adds it to a linked list so we can keep track of it.
|
||||
* Unlike Z_MallocAlign, this also initialises the bytes to zero.
|
||||
* Unlike Z_Malloc, this also initialises the bytes to zero.
|
||||
*
|
||||
* \param size Amount of memory to be allocated, in bytes.
|
||||
* \param tag Purge tag.
|
||||
* \param user The address of a pointer to the memory to be allocated.
|
||||
* When the memory is freed by Z_Free later,
|
||||
* the pointer at this address will then be automatically set to NULL.
|
||||
* \param alignbits The alignment of the memory to be allocated, in bits. Can be 0.
|
||||
* \note You can pass Z_Calloc() a NULL user if the tag is less than PU_PURGELEVEL.
|
||||
* \sa Z_MallocAlign, Z_ReallocAlign
|
||||
* \sa Z_Malloc, Z_Realloc
|
||||
*/
|
||||
#ifdef ZDEBUG
|
||||
void *Z_Calloc2(size_t size, INT32 tag, void *user, INT32 alignbits, const char *file, INT32 line)
|
||||
void *Z_Calloc2(size_t size, INT32 tag, void *user, const char *file, INT32 line)
|
||||
#else
|
||||
void *Z_CallocAlign(size_t size, INT32 tag, void *user, INT32 alignbits)
|
||||
void *Z_Calloc(size_t size, INT32 tag, void *user)
|
||||
#endif
|
||||
{
|
||||
#ifdef VALGRIND_MEMPOOL_ALLOC
|
||||
Z_calloc = true;
|
||||
#endif
|
||||
#ifdef ZDEBUG
|
||||
return memset(Z_Malloc2 (size, tag, user, alignbits, file, line), 0, size);
|
||||
return memset(Z_Malloc2(size, tag, user, file, line), 0, size);
|
||||
#else
|
||||
return memset(Z_MallocAlign(size, tag, user, alignbits ), 0, size);
|
||||
return memset(Z_Malloc (size, tag, user ), 0, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** The Z_ReallocAlign function.
|
||||
/** The Z_Realloc function.
|
||||
* Reallocates a block of memory with a new size.
|
||||
*
|
||||
* \param ptr A pointer to allocated memory,
|
||||
* assumed to have been allocated with Z_Malloc/Z_Calloc.
|
||||
* If NULL, this function instead acts as a wrapper for Z_CallocAlign.
|
||||
* If NULL, this function instead acts as a wrapper for Z_Calloc.
|
||||
* \param size New size of memory block, in bytes.
|
||||
* If zero, then the memory is freed and NULL is returned.
|
||||
* \param tag New purge tag.
|
||||
* \param user The address of a pointer to the memory to be reallocated.
|
||||
* This can be a different user to the one originally assigned to the memory block.
|
||||
* \param alignbits The alignment of the memory to be allocated, in bits. Can be 0.
|
||||
* \return A pointer to the reallocated memory. Can be NULL if memory was freed.
|
||||
* \note You can pass Z_Realloc() a NULL user if the tag is less than PU_PURGELEVEL.
|
||||
* \sa Z_MallocAlign, Z_CallocAlign
|
||||
* \sa Z_Malloc, Z_Calloc
|
||||
*/
|
||||
#ifdef ZDEBUG
|
||||
void *Z_Realloc2(void *ptr, size_t size, INT32 tag, void *user, INT32 alignbits, const char *file, INT32 line)
|
||||
void *Z_Realloc2(void *ptr, size_t size, INT32 tag, void *user, const char *file, INT32 line)
|
||||
#else
|
||||
void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignbits)
|
||||
void *Z_Realloc(void *ptr, size_t size, INT32 tag, void *user)
|
||||
#endif
|
||||
{
|
||||
void *rez;
|
||||
@@ -338,9 +336,9 @@ void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignb
|
||||
if (!ptr)
|
||||
{
|
||||
#ifdef ZDEBUG
|
||||
return Z_Calloc2(size, tag, user, alignbits, file , line);
|
||||
return Z_Calloc2(size, tag, user, file, line);
|
||||
#else
|
||||
return Z_CallocAlign(size, tag, user, alignbits);
|
||||
return Z_Calloc(size, tag, user);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -348,9 +346,9 @@ void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignb
|
||||
#ifdef PARANOIA
|
||||
if (block->id != ZONEID)
|
||||
#ifdef ZDEBUG
|
||||
I_Error("Z_ReallocAlign at %s:%d: wrong id", file, line);
|
||||
I_Error("Z_Realloc at %s:%d: wrong id", file, line);
|
||||
#else
|
||||
I_Error("Z_ReallocAlign: wrong id");
|
||||
I_Error("Z_Realloc: wrong id");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -358,11 +356,13 @@ void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignb
|
||||
return NULL;
|
||||
|
||||
#ifdef ZDEBUG
|
||||
#ifdef ZDEBUG2
|
||||
// Write every Z_Realloc call to a debug file.
|
||||
DEBFILE(va("Z_Realloc at %s:%d\n", file, line));
|
||||
rez = Z_Malloc2(size, tag, user, alignbits, file, line);
|
||||
#endif
|
||||
rez = Z_Malloc2(size, tag, user, file, line);
|
||||
#else
|
||||
rez = Z_MallocAlign(size, tag, user, alignbits);
|
||||
rez = Z_Malloc(size, tag, user);
|
||||
#endif
|
||||
|
||||
if (size < block->realsize)
|
||||
@@ -394,11 +394,19 @@ void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignb
|
||||
* \param lowtag The lowest tag to consider.
|
||||
* \param hightag The highest tag to consider.
|
||||
*/
|
||||
#ifdef ZDEBUG
|
||||
void Z_FreeTags2(INT32 lowtag, INT32 hightag, const char *file, INT32 line)
|
||||
#else
|
||||
void Z_FreeTags(INT32 lowtag, INT32 hightag)
|
||||
#endif
|
||||
{
|
||||
memblock_t *block, *next;
|
||||
|
||||
#ifdef ZDEBUG
|
||||
Z_CheckHeap2(file, line);
|
||||
#else
|
||||
Z_CheckHeap(420);
|
||||
#endif
|
||||
for (block = head.next; block != &head; block = next)
|
||||
{
|
||||
next = block->next; // get link before freeing
|
||||
@@ -468,12 +476,20 @@ void Z_CheckMemCleanup(void)
|
||||
* \param i Identifies from where in the code Z_CheckHeap was called.
|
||||
* \author Graue <graue@oceanbase.org>
|
||||
*/
|
||||
void Z_CheckHeap(INT32 i)
|
||||
#ifdef ZDEBUG
|
||||
void Z_CheckHeap2(const char *file, INT32 line)
|
||||
#else
|
||||
void Z_CheckHeap(INT32 tag)
|
||||
#endif
|
||||
{
|
||||
memblock_t *block;
|
||||
UINT32 blocknumon = 0;
|
||||
void *given;
|
||||
|
||||
#ifndef ZDEBUG
|
||||
(void)tag;
|
||||
#endif
|
||||
|
||||
for (block = head.next; block != &head; block = block->next)
|
||||
{
|
||||
blocknumon++;
|
||||
@@ -498,11 +514,19 @@ void Z_CheckHeap(INT32 i)
|
||||
#endif
|
||||
if (block->user != NULL && *(block->user) != given)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" doesn't have a proper user", i, blocknumon
|
||||
" doesn't have a proper user"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
@@ -510,11 +534,19 @@ void Z_CheckHeap(INT32 i)
|
||||
}
|
||||
if (block->next->prev != block)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" lacks proper backlink", i, blocknumon
|
||||
" lacks proper backlink"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
@@ -522,11 +554,19 @@ void Z_CheckHeap(INT32 i)
|
||||
}
|
||||
if (block->prev->next != block)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" lacks proper forward link", i, blocknumon
|
||||
" lacks proper forward link"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
@@ -534,11 +574,19 @@ void Z_CheckHeap(INT32 i)
|
||||
}
|
||||
if (block->id != ZONEID)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" have the wrong ID", i, blocknumon
|
||||
" have the wrong ID"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
|
||||
+23
-16
@@ -32,7 +32,7 @@ extern "C" {
|
||||
#define FUNCALLOC(x)
|
||||
#endif
|
||||
|
||||
//#define ZDEBUG
|
||||
#define ZDEBUG
|
||||
|
||||
//
|
||||
// Purge tags
|
||||
@@ -92,30 +92,31 @@ void Z_Init(void);
|
||||
// Z_Free and alloc with alignment
|
||||
#ifdef ZDEBUG
|
||||
#define Z_Free(p) Z_Free2(p, __FILE__, __LINE__)
|
||||
#define Z_MallocAlign(s,t,u,a) Z_Malloc2(s, t, u, a, __FILE__, __LINE__)
|
||||
#define Z_CallocAlign(s,t,u,a) Z_Calloc2(s, t, u, a, __FILE__, __LINE__)
|
||||
#define Z_ReallocAlign(p,s,t,u,a) Z_Realloc2(p,s, t, u, a, __FILE__, __LINE__)
|
||||
#define Z_Malloc(s,t,u) Z_Malloc2(s, t, u, __FILE__, __LINE__)
|
||||
#define Z_Calloc(s,t,u) Z_Calloc2(s, t, u, __FILE__, __LINE__)
|
||||
#define Z_Realloc(p,s,t,u) Z_Realloc2(p,s, t, u, __FILE__, __LINE__)
|
||||
void Z_Free2(void *ptr, const char *file, INT32 line);
|
||||
void *Z_Malloc2(size_t size, INT32 tag, void *user, INT32 alignbits, const char *file, INT32 line) FUNCALLOC(1);
|
||||
void *Z_Calloc2(size_t size, INT32 tag, void *user, INT32 alignbits, const char *file, INT32 line) FUNCALLOC(1);
|
||||
void *Z_Realloc2(void *ptr, size_t size, INT32 tag, void *user, INT32 alignbits, const char *file, INT32 line) FUNCALLOC(2);
|
||||
void *Z_Malloc2(size_t size, INT32 tag, void *user, const char *file, INT32 line) FUNCALLOC(1);
|
||||
void *Z_Calloc2(size_t size, INT32 tag, void *user, const char *file, INT32 line) FUNCALLOC(1);
|
||||
void *Z_Realloc2(void *ptr, size_t size, INT32 tag, void *user, const char *file, INT32 line) FUNCALLOC(2);
|
||||
#else
|
||||
void Z_Free(void *ptr);
|
||||
void *Z_MallocAlign(size_t size, INT32 tag, void *user, INT32 alignbits) FUNCALLOC(1);
|
||||
void *Z_CallocAlign(size_t size, INT32 tag, void *user, INT32 alignbits) FUNCALLOC(1);
|
||||
void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignbits) FUNCALLOC(2);
|
||||
void *Z_Malloc(size_t size, INT32 tag, void *user) FUNCALLOC(1);
|
||||
void *Z_Calloc(size_t size, INT32 tag, void *user) FUNCALLOC(1);
|
||||
void *Z_Realloc(void *ptr, size_t size, INT32 tag, void *user) FUNCALLOC(2);
|
||||
#endif
|
||||
|
||||
// Alloc with standard alignment
|
||||
#define Z_Malloc(s,t,u) Z_MallocAlign(s, t, u, sizeof(void *))
|
||||
#define Z_Calloc(s,t,u) Z_CallocAlign(s, t, u, sizeof(void *))
|
||||
#define Z_Realloc(p,s,t,u) Z_ReallocAlign(p, s, t, u, sizeof(void *))
|
||||
|
||||
// Free all memory by tag
|
||||
// these don't give line numbers for ZDEBUG currently though
|
||||
// (perhaps this should be changed in future?)
|
||||
#ifdef ZDEBUG
|
||||
#define Z_FreeTag(tagnum) Z_FreeTags2(tagnum, tagnum, __FILE__, __LINE__)
|
||||
#define Z_FreeTags(tagnum, tagnum2) Z_FreeTags2(tagnum, tagnum2, __FILE__, __LINE__)
|
||||
void Z_FreeTags2(INT32 lowtag, INT32 hightag, const char *file, INT32 line);
|
||||
#else
|
||||
#define Z_FreeTag(tagnum) Z_FreeTags(tagnum, tagnum)
|
||||
void Z_FreeTags(INT32 lowtag, INT32 hightag);
|
||||
#endif
|
||||
|
||||
// Iterate memory by tag
|
||||
#define Z_IterateTag(tagnum, func) Z_IterateTags(tagnum, tagnum, func)
|
||||
@@ -125,7 +126,13 @@ void Z_IterateTags(INT32 lowtag, INT32 hightag, boolean (*iterfunc)(void *));
|
||||
// Utility functions
|
||||
//
|
||||
void Z_CheckMemCleanup(void);
|
||||
void Z_CheckHeap(INT32 i);
|
||||
|
||||
#ifdef ZDEBUG
|
||||
#define Z_CheckHeap(tag) Z_CheckHeap2(__FILE__, __LINE__)
|
||||
void Z_CheckHeap2(const char *file, INT32 line);
|
||||
#else
|
||||
void Z_CheckHeap(INT32 tag);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Zone memory modification
|
||||
|
||||
Reference in new issue
Block a user