mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 21:31:04 +00:00
Merge branch 'master' into sw_planefixes
This commit is contained in:
commit
f3956ffb4c
5 changed files with 136 additions and 132 deletions
3
debian/rules
vendored
3
debian/rules
vendored
|
@ -59,6 +59,7 @@ DBGNAME = debug/$(EXENAME)
|
||||||
|
|
||||||
PKGDIR = usr/games/SRB2
|
PKGDIR = usr/games/SRB2
|
||||||
DBGDIR = usr/lib/debug/$(PKGDIR)
|
DBGDIR = usr/lib/debug/$(PKGDIR)
|
||||||
|
LINKDIR = usr/games
|
||||||
PIXMAPS_DIR = usr/share/pixmaps
|
PIXMAPS_DIR = usr/share/pixmaps
|
||||||
DESKTOP_DIR = usr/share/applications
|
DESKTOP_DIR = usr/share/applications
|
||||||
PREFIX = $(shell test "$(CROSS_COMPILE_BUILD)" != "$(CROSS_COMPILE_HOST)" && echo "PREFIX=$(CROSS_COMPILE_HOST)")
|
PREFIX = $(shell test "$(CROSS_COMPILE_BUILD)" != "$(CROSS_COMPILE_HOST)" && echo "PREFIX=$(CROSS_COMPILE_HOST)")
|
||||||
|
@ -133,7 +134,7 @@ binary-arch:
|
||||||
# dh_installcron
|
# dh_installcron
|
||||||
# dh_installinfo
|
# dh_installinfo
|
||||||
# dh_installman
|
# dh_installman
|
||||||
# dh_link
|
dh_link $(PKGDIR)/$(EXENAME) $(LINKDIR)/$(EXENAME)
|
||||||
dh_compress
|
dh_compress
|
||||||
dh_fixperms
|
dh_fixperms
|
||||||
# dh_perl
|
# dh_perl
|
||||||
|
|
|
@ -8303,6 +8303,7 @@ static inline int lib_getenum(lua_State *L)
|
||||||
LUA_PushUserdata(L, &players[serverplayer], META_PLAYER);
|
LUA_PushUserdata(L, &players[serverplayer], META_PLAYER);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (fastcmp(word,"admin")) { // BACKWARDS COMPATIBILITY HACK: This was replaced with IsPlayerAdmin(), but some 2.1 Lua scripts still use the admin variable. It now points to the first admin player in the array.
|
} else if (fastcmp(word,"admin")) { // BACKWARDS COMPATIBILITY HACK: This was replaced with IsPlayerAdmin(), but some 2.1 Lua scripts still use the admin variable. It now points to the first admin player in the array.
|
||||||
|
LUA_Deprecated(L, "admin", "IsPlayerAdmin(player)");
|
||||||
if (!playeringame[adminplayers[0]] || IsPlayerAdmin(serverplayer))
|
if (!playeringame[adminplayers[0]] || IsPlayerAdmin(serverplayer))
|
||||||
return 0;
|
return 0;
|
||||||
LUA_PushUserdata(L, &players[adminplayers[0]], META_PLAYER);
|
LUA_PushUserdata(L, &players[adminplayers[0]], META_PLAYER);
|
||||||
|
|
|
@ -193,14 +193,14 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
|
||||||
v2dy = bsp->dy;
|
v2dy = bsp->dy;
|
||||||
|
|
||||||
den = v2dy*v1dx - v2dx*v1dy;
|
den = v2dy*v1dx - v2dx*v1dy;
|
||||||
if (den == 0)
|
if (fabs(den) < 1.0E-36f) // avoid checking exactly for 0.0
|
||||||
return NULL; // parallel
|
return NULL; // parallel
|
||||||
|
|
||||||
// first check the frac along the polygon segment,
|
// first check the frac along the polygon segment,
|
||||||
// (do not accept hit with the extensions)
|
// (do not accept hit with the extensions)
|
||||||
num = (v2x - v1x)*v2dy + (v1y - v2y)*v2dx;
|
num = (v2x - v1x)*v2dy + (v1y - v2y)*v2dx;
|
||||||
frac = num / den;
|
frac = num / den;
|
||||||
if (frac < 0 || frac > 1)
|
if (frac < 0.0 || frac > 1.0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// now get the frac along the BSP line
|
// now get the frac along the BSP line
|
||||||
|
@ -217,29 +217,6 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
|
||||||
return &pt;
|
return &pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
//Hurdler: it's not used anymore
|
|
||||||
static boolean NearVertice (polyvertex_t *p1, polyvertex_t *p2)
|
|
||||||
{
|
|
||||||
#if 1
|
|
||||||
float diff;
|
|
||||||
diff = p2->x - p1->x;
|
|
||||||
if (diff < -1.5f || diff > 1.5f)
|
|
||||||
return false;
|
|
||||||
diff = p2->y - p1->y;
|
|
||||||
if (diff < -1.5f || diff > 1.5f)
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
if (p1->x != p2->x)
|
|
||||||
return false;
|
|
||||||
if (p1->y != p2->y)
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
// p1 and p2 are considered the same vertex
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// if two vertice coords have a x and/or y difference
|
// if two vertice coords have a x and/or y difference
|
||||||
// of less or equal than 1 FRACUNIT, they are considered the same
|
// of less or equal than 1 FRACUNIT, they are considered the same
|
||||||
// point. Note: hardcoded value, 1.0f could be anything else.
|
// point. Note: hardcoded value, 1.0f could be anything else.
|
||||||
|
@ -253,11 +230,18 @@ static boolean SameVertice (polyvertex_t *p1, polyvertex_t *p2)
|
||||||
diff = p2->y - p1->y;
|
diff = p2->y - p1->y;
|
||||||
if (diff < -1.5f || diff > 1.5f)
|
if (diff < -1.5f || diff > 1.5f)
|
||||||
return false;
|
return false;
|
||||||
#else
|
#elif 0
|
||||||
if (p1->x != p2->x)
|
if (p1->x != p2->x)
|
||||||
return false;
|
return false;
|
||||||
if (p1->y != p2->y)
|
if (p1->y != p2->y)
|
||||||
return false;
|
return false;
|
||||||
|
#else
|
||||||
|
#define DIVLINE_VERTEX_DIFF 0.45f
|
||||||
|
float ep = DIVLINE_VERTEX_DIFF;
|
||||||
|
if (fabsf( p2->x - p1->x ) > ep )
|
||||||
|
return false;
|
||||||
|
if (fabsf( p2->y - p1->y ) > ep )
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
// p1 and p2 are considered the same vertex
|
// p1 and p2 are considered the same vertex
|
||||||
return true;
|
return true;
|
||||||
|
@ -294,8 +278,9 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||||
// start & end points
|
// start & end points
|
||||||
pv = fracdivline(bsp, &poly->pts[i], &poly->pts[j]);
|
pv = fracdivline(bsp, &poly->pts[i], &poly->pts[j]);
|
||||||
|
|
||||||
if (pv)
|
if (pv == NULL)
|
||||||
{
|
continue;
|
||||||
|
|
||||||
if (ps < 0)
|
if (ps < 0)
|
||||||
{
|
{
|
||||||
// first point
|
// first point
|
||||||
|
@ -345,7 +330,6 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||||
// remember last point intercept to detect identical points
|
// remember last point intercept to detect identical points
|
||||||
lastpv = *pv;
|
lastpv = *pv;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// no split: the partition line is either parallel and
|
// no split: the partition line is either parallel and
|
||||||
// aligned with one of the poly segments, or the line is totally
|
// aligned with one of the poly segments, or the line is totally
|
||||||
|
@ -368,7 +352,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps >= 0 && pe < 0)
|
if (pe < 0)
|
||||||
{
|
{
|
||||||
//I_Error("SplitPoly: only one point for split line (%d %d)", ps, pe);
|
//I_Error("SplitPoly: only one point for split line (%d %d)", ps, pe);
|
||||||
*frontpoly = poly;
|
*frontpoly = poly;
|
||||||
|
@ -387,7 +371,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||||
*backpoly = HWR_AllocPoly(2 + nptback);
|
*backpoly = HWR_AllocPoly(2 + nptback);
|
||||||
else
|
else
|
||||||
*backpoly = NULL;
|
*backpoly = NULL;
|
||||||
if (nptfront)
|
if (nptfront > 0)
|
||||||
*frontpoly = HWR_AllocPoly(2 + nptfront);
|
*frontpoly = HWR_AllocPoly(2 + nptfront);
|
||||||
else
|
else
|
||||||
*frontpoly = NULL;
|
*frontpoly = NULL;
|
||||||
|
@ -482,8 +466,9 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
|
||||||
|
|
||||||
pv = fracdivline(&cutseg, &poly->pts[i], &poly->pts[j]);
|
pv = fracdivline(&cutseg, &poly->pts[i], &poly->pts[j]);
|
||||||
|
|
||||||
if (pv)
|
if (pv == NULL)
|
||||||
{
|
continue;
|
||||||
|
|
||||||
if (ps < 0)
|
if (ps < 0)
|
||||||
{
|
{
|
||||||
ps = i;
|
ps = i;
|
||||||
|
@ -519,7 +504,6 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// there was a split
|
// there was a split
|
||||||
if (ps >= 0)
|
if (ps >= 0)
|
||||||
|
@ -581,18 +565,42 @@ static inline void HWR_SubsecPoly(INT32 num, poly_t *poly)
|
||||||
// search for the segs source of this divline
|
// search for the segs source of this divline
|
||||||
static inline void SearchDivline(node_t *bsp, fdivline_t *divline)
|
static inline void SearchDivline(node_t *bsp, fdivline_t *divline)
|
||||||
{
|
{
|
||||||
#if 0 // MAR - If you don't use the same partition line that the BSP uses, the front/back polys won't match the subsectors in the BSP!
|
|
||||||
#endif
|
|
||||||
divline->x = FIXED_TO_FLOAT(bsp->x);
|
divline->x = FIXED_TO_FLOAT(bsp->x);
|
||||||
divline->y = FIXED_TO_FLOAT(bsp->y);
|
divline->y = FIXED_TO_FLOAT(bsp->y);
|
||||||
divline->dx = FIXED_TO_FLOAT(bsp->dx);
|
divline->dx = FIXED_TO_FLOAT(bsp->dx);
|
||||||
divline->dy = FIXED_TO_FLOAT(bsp->dy);
|
divline->dy = FIXED_TO_FLOAT(bsp->dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HWR_LOADING_SCREEN
|
||||||
//Hurdler: implement a loading status
|
//Hurdler: implement a loading status
|
||||||
static size_t ls_count = 0;
|
static size_t ls_count = 0;
|
||||||
static UINT8 ls_percent = 0;
|
static UINT8 ls_percent = 0;
|
||||||
|
|
||||||
|
static void loading_status(void)
|
||||||
|
{
|
||||||
|
char s[16];
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
I_OsPolling();
|
||||||
|
CON_Drawer();
|
||||||
|
sprintf(s, "%d%%", (++ls_percent)<<1);
|
||||||
|
x = BASEVIDWIDTH/2;
|
||||||
|
y = BASEVIDHEIGHT/2;
|
||||||
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // Black background to match fade in effect
|
||||||
|
//V_DrawPatchFill(W_CachePatchName("SRB2BACK",PU_CACHE)); // SRB2 background, ehhh too bright.
|
||||||
|
M_DrawTextBox(x-58, y-8, 13, 1);
|
||||||
|
V_DrawString(x-50, y, V_YELLOWMAP, "Loading...");
|
||||||
|
V_DrawRightAlignedString(x+50, y, V_YELLOWMAP, s);
|
||||||
|
|
||||||
|
// Is this really necessary at this point..?
|
||||||
|
V_DrawCenteredString(BASEVIDWIDTH/2, 40, V_YELLOWMAP, "OPENGL MODE IS INCOMPLETE AND MAY");
|
||||||
|
V_DrawCenteredString(BASEVIDWIDTH/2, 50, V_YELLOWMAP, "NOT DISPLAY SOME SURFACES.");
|
||||||
|
V_DrawCenteredString(BASEVIDWIDTH/2, 70, V_YELLOWMAP, "USE AT SONIC'S RISK.");
|
||||||
|
|
||||||
|
I_UpdateNoVsync();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// poly : the convex polygon that encloses all child subsectors
|
// poly : the convex polygon that encloses all child subsectors
|
||||||
static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *bbox)
|
static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *bbox)
|
||||||
{
|
{
|
||||||
|
@ -630,33 +638,14 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HWR_SubsecPoly(bspnum&(~NF_SUBSECTOR), poly);
|
HWR_SubsecPoly(bspnum & ~NF_SUBSECTOR, poly);
|
||||||
//Hurdler: implement a loading status
|
|
||||||
|
|
||||||
|
//Hurdler: implement a loading status
|
||||||
#ifdef HWR_LOADING_SCREEN
|
#ifdef HWR_LOADING_SCREEN
|
||||||
if (ls_count-- <= 0)
|
if (ls_count-- <= 0)
|
||||||
{
|
{
|
||||||
char s[16];
|
|
||||||
int x, y;
|
|
||||||
|
|
||||||
I_OsPolling();
|
|
||||||
ls_count = numsubsectors/50;
|
ls_count = numsubsectors/50;
|
||||||
CON_Drawer();
|
loading_status();
|
||||||
sprintf(s, "%d%%", (++ls_percent)<<1);
|
|
||||||
x = BASEVIDWIDTH/2;
|
|
||||||
y = BASEVIDHEIGHT/2;
|
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // Black background to match fade in effect
|
|
||||||
//V_DrawPatchFill(W_CachePatchName("SRB2BACK",PU_CACHE)); // SRB2 background, ehhh too bright.
|
|
||||||
M_DrawTextBox(x-58, y-8, 13, 1);
|
|
||||||
V_DrawString(x-50, y, V_YELLOWMAP, "Loading...");
|
|
||||||
V_DrawRightAlignedString(x+50, y, V_YELLOWMAP, s);
|
|
||||||
|
|
||||||
// Is this really necessary at this point..?
|
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, 40, V_YELLOWMAP, "OPENGL MODE IS INCOMPLETE AND MAY");
|
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, 50, V_YELLOWMAP, "NOT DISPLAY SOME SURFACES.");
|
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, 70, V_YELLOWMAP, "USE AT SONIC'S RISK.");
|
|
||||||
|
|
||||||
I_UpdateNoVsync();
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -693,10 +682,9 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
|
||||||
if (backpoly)
|
if (backpoly)
|
||||||
{
|
{
|
||||||
// Correct back bbox to include floor/ceiling convex polygon
|
// Correct back bbox to include floor/ceiling convex polygon
|
||||||
WalkBSPNode(bsp->children[1], backpoly, &bsp->children[1],
|
WalkBSPNode(bsp->children[1], backpoly, &bsp->children[1], bsp->bbox[1]);
|
||||||
bsp->bbox[1]);
|
|
||||||
|
|
||||||
// enlarge bbox with seconde child
|
// enlarge bbox with second child
|
||||||
M_AddToBox(bbox, bsp->bbox[1][BOXLEFT ],
|
M_AddToBox(bbox, bsp->bbox[1][BOXLEFT ],
|
||||||
bsp->bbox[1][BOXTOP ]);
|
bsp->bbox[1][BOXTOP ]);
|
||||||
M_AddToBox(bbox, bsp->bbox[1][BOXRIGHT ],
|
M_AddToBox(bbox, bsp->bbox[1][BOXRIGHT ],
|
||||||
|
@ -968,7 +956,9 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
|
||||||
fixed_t rootbbox[4];
|
fixed_t rootbbox[4];
|
||||||
|
|
||||||
CONS_Debug(DBG_RENDER, "Creating polygons, please wait...\n");
|
CONS_Debug(DBG_RENDER, "Creating polygons, please wait...\n");
|
||||||
|
#ifdef HWR_LOADING_SCREEN
|
||||||
ls_count = ls_percent = 0; // reset the loading status
|
ls_count = ls_percent = 0; // reset the loading status
|
||||||
|
#endif
|
||||||
CON_Drawer(); //let the user know what we are doing
|
CON_Drawer(); //let the user know what we are doing
|
||||||
I_FinishUpdate(); // page flip or blit buffer
|
I_FinishUpdate(); // page flip or blit buffer
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,12 @@ void I_StartupSound(void)
|
||||||
{
|
{
|
||||||
I_Assert(!sound_started);
|
I_Assert(!sound_started);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
// Force DirectSound instead of WASAPI
|
||||||
|
// SDL 2.0.6+ defaults to the latter and it screws up our sound effects
|
||||||
|
SDL_setenv("SDL_AUDIODRIVER", "directsound", 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
// EE inits audio first so we're following along.
|
// EE inits audio first so we're following along.
|
||||||
if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
|
if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1186,6 +1186,12 @@ void I_StartupSound(void)
|
||||||
// Configure sound device
|
// Configure sound device
|
||||||
CONS_Printf("I_StartupSound:\n");
|
CONS_Printf("I_StartupSound:\n");
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
// Force DirectSound instead of WASAPI
|
||||||
|
// SDL 2.0.6+ defaults to the latter and it screws up our sound effects
|
||||||
|
SDL_setenv("SDL_AUDIODRIVER", "directsound", 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
// EE inits audio first so we're following along.
|
// EE inits audio first so we're following along.
|
||||||
if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
|
if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
|
||||||
CONS_Printf("SDL Audio already started\n");
|
CONS_Printf("SDL Audio already started\n");
|
||||||
|
|
Loading…
Reference in a new issue