Merge remote-tracking branch 'origin/Saturn' into localskins

This commit is contained in:
alufolie91 committed 2023-09-18 14:47:56 +02:00
commit 5196f1c5b9
25 files changed
+1409 -1337

No files matched your search

+22 -16
View File
@@ -6,29 +6,34 @@
- Sprites player rotation on slopes; going on hills, levitate, going down, and so on alters your sprites (configurable)
- You can alter all the base kart HUD element offsets on the fly in the Saturn Options settings menu
- "addfilelocal" Command, for those who want to use things like their custom hud in netgames (Same as addfile but completely client sided)
- OpenMPT for Tracker module playback (Complete with filters) fixed looping issues while even sounding better than the old GME playback
- `addfilelocal` Command, for those who want to use things like their custom hud in netgames (Same as addfile but completely client sided)
- OpenMPT for Tracker module playback instead of GME
- Fixes looping and sounds better
- Allows filter configuration
- The minimal brightness with Shaders can be configured, now you can seeeee in dark areas (0-255 , uses Sector brightness values)
- Lua hooks for Intermission (ex: You can make hostmod votes still visible during intermission!)
- Lua hooks for Vote Screen (ex: You can make hostmod votes still visible during map vote screen!)
- Lua HUD hooks for Intermission (ex: You can make hostmod votes still visible during intermission!)
- Lua HUD hooks for Vote Screen (ex: You can make hostmod votes still visible during map vote screen!)
- Saltyhop! do a funny hop
- Smaller Speedometer (optional / requieres extra.kart file)
- Record Attack input display can now be used everywhere
- Smaller minimap icons and also show player names on the minimap (toggable)
- "showmusiccredits" command, shows you the current music track again
- "listskins" show a list of all skins currently loaded
- Visual Portals from Haya´s HEP Client
- Toggable lowercase menu´s also from Haya´s HEP client
- `showmusiccredit` command, shows you the current music track again
- `listskins` show a list of all skins currently loaded
- Visual Portals from Haya's HEP Client
- Toggable lowercase menu's also from Haya's HEP client
- Everything that Galaxy has
## Improvements / Bug fixes
- Replay size has been increased to 10MiB minimum, to make replay overflows very unlikely to happen (can be set to 100MiB max with "maxdemosize" command in console)
- Music changes now properly show the music credits (ex: Kart maps with easter eggs that alter the music) *The mapper still has to provide a MusicDEF for this to work.
- Replay size has been increased to 10MiB minimum, to make replay overflows very unlikely to happen
- can be set to 100MiB max with `maxdemosize` command in console
- Music changes now properly show the music credits (ex: Kart maps with easter eggs that alter the music)
- The mapper still has to provide a MusicDEF for this to work.
- Configurable chatlog length (yay can read those messages from 30 mins ago without opening log.txt)
- Configurable timeout for waiting to join a full server (in vanilla this is capped to 5 minutes before it boots you out)
- Characters now spin in skin selection menu (configurable)
- HTTP Addon download speed has been raised dramatically (configurable with "downloadspeed" command)
- HTTP Addon download speed has been raised dramatically
- configurable with `downloadspeed` command
- HWR Drawnodes have been refactored, this should fix a few rare crashes esp in regards to OpenGL Visportals
- The Position Number in the corner is alot smaller now (half the size!)
- Toggable Lap animation
@@ -40,17 +45,18 @@
- Access for `mobj_t` and `player_t` fields from Lua has been completely rewritten, for much better performance with many Lua scripts
- Lua shows Tracebacks whenever an error occurs
- The Lua Perfstats page now has multiple pages and is more organized (ps_thinkframe_page X in console)
- People with lower end hardware can disable "screen textures" with "gr_screentextures" command, huge performance gain with minimal visual loss (Note intermission screen background is broken with this)
- Software mode has gotten "ffloorclip", which boosts performance on maps with many Floor over Floor roads
- People with lower end hardware can disable "screen textures" with "gr_screentextures" command, huge performance gain with minimal visual loss
- Intermission backgrounds, heat wave effects and etc are broken with this
- `ffloorclip`, exclusive to Software, which boosts performance on maps with many Floor over Floor sectors
## Technical fixes
- ZFigthing Textures in Opengl mode have been fixed in engine (well almost all of it)
- Fof's intersecting with slopes have less issues and now render correctly in Opengl
- FOFs intersecting with slopes have less issues and now render correctly in Opengl
- Midtextures on slopes in Opengl are fixed, many weird guardrails and fences, aswell as some of those sticking out textures from the ground on some maps should be gone
- The annoying depraction messages for "P_TeleportMove" and "P_AproxDistance" have been silenced
- The annoying depraction messages for `P_TeleportMove` and `P_AproxDistance` have been silenced
- Silenced the annoying "cant find next map..." messages as theyre super useless and annoying anyways
- Added a small cooldown on "map" command due to spamming causing a SIGSEGV
- Added a small cooldown on `map` command due to spamming causing a SIGSEGV
## MISC
- Bird's Camara Tilting feature is no longer turned on by default
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

+1 -1
View File
@@ -24,7 +24,7 @@ static INT64 start_time; // as microseconds since the epoch
// I should probably return how much memory is remaining
// for this process, considering Android's process memory limit.
UINT32 I_GetFreeMem(UINT32 *total)
size_t I_GetFreeMem(size_t *total)
{
// what the heck? sysinfo() is partially missing in bionic?
/* struct sysinfo si; */
+4 -1
View File
@@ -519,7 +519,7 @@ consvar_t cv_ps_descriptor = {"ps_descriptor", "Average", 0, ps_descriptor_cons_
consvar_t cv_showtrackaddon = {"showtrackaddon", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t skinselectmenu_t[] = {{SKINMENUTYPE_SCROLL, "Scoll"}, {SKINMENUTYPE_2D, "2d"}, {SKINMENUTYPE_GRID, "Grid"}, {0, NULL}};
static CV_PossibleValue_t skinselectmenu_t[] = {{SKINMENUTYPE_SCROLL, "Scroll"}, {SKINMENUTYPE_2D, "2d"}, {SKINMENUTYPE_GRID, "Grid"}, {0, NULL}};
consvar_t cv_skinselectmenu = {"skinselectmenu", "Grid", CV_SAVE, skinselectmenu_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t skinselectgridsort_t[] ={
@@ -989,6 +989,9 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_saltyhop);
CV_RegisterVar(&cv_saltyhopsfx);
CV_RegisterVar(&cv_saltysquish);
CV_RegisterVar(&cv_growmusic);
CV_RegisterVar(&cv_supermusic);
//CV_RegisterVar(&cv_crosshair);
//CV_RegisterVar(&cv_crosshair2);
+1
View File
@@ -371,6 +371,7 @@ typedef struct player_s
angle_t viewrollangle;
angle_t tilt;
angle_t tilt_sprite;
// Mouse aiming, where the guy is looking at!
// It is updated with cmd->aiming.
+2 -2
View File
@@ -149,8 +149,8 @@ extern char logfilename[1024];
#else
#define VERSION 1 // Game version
#define SUBVERSION 6 // more precise version number
#define VERSIONSTRING "Saturn v2 "
#define VERSIONSTRINGW L"Saturn v2"
#define VERSIONSTRING "Saturn v2.1 "
#define VERSIONSTRINGW L"Saturn v2.1"
// 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!
+1 -1
View File
@@ -5,7 +5,7 @@ UINT8 graphics_started = 0;
UINT8 keyboard_started = 0;
UINT32 I_GetFreeMem(UINT32 *total)
size_t I_GetFreeMem(size_t *total)
{
*total = 0;
return 0;
+4
View File
@@ -468,6 +468,10 @@ consvar_t cv_songcredits = {"songcredits", "On", CV_SAVE, CV_OnOff, NULL, 0, NUL
// Show "FREE PLAY" when you're alone. :(
consvar_t cv_showfreeplay = { "showfreeplay", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
// We can disable special tunes!
consvar_t cv_growmusic = {"growmusic", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_supermusic = {"supermusic", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
/*consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair2 = {"crosshair2", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair3 = {"crosshair3", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
+1
View File
@@ -113,6 +113,7 @@ extern INT16 rw_maximums[NUM_WEAPONS];
extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatbacktint, cv_chatspamprotection/*, cv_compactscoreboard*/;
extern consvar_t cv_songcredits;
extern consvar_t cv_showfreeplay;
extern consvar_t cv_growmusic, cv_supermusic;
extern consvar_t cv_pauseifunfocused;
//extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4;
extern consvar_t cv_invertmouse/*, cv_alwaysfreelook, cv_chasefreelook, cv_mousemove*/;
+11 -11
View File
@@ -122,7 +122,7 @@ void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option)
flags |= PF_ForceWrapY;
// clip it since it is used for bunny scroll in doom I
HWD.pfnDrawPolygon(NULL, v, 4, flags);
HWD.pfnDrawPolygon(NULL, v, 4, flags, false);
}
void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap)
@@ -300,10 +300,10 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[hudtrans];
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
flags |= PF_Modulated;
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
HWD.pfnDrawPolygon(&Surf, v, 4, flags, false);
}
else
HWD.pfnDrawPolygon(NULL, v, 4, flags);
HWD.pfnDrawPolygon(NULL, v, 4, flags, false);
}
void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h)
@@ -454,10 +454,10 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value];
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
flags |= PF_Modulated;
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
HWD.pfnDrawPolygon(&Surf, v, 4, flags, false);
}
else
HWD.pfnDrawPolygon(NULL, v, 4, flags);
HWD.pfnDrawPolygon(NULL, v, 4, flags, false);
}
// ==========================================================================
@@ -533,7 +533,7 @@ void HWR_DrawFlatFill (INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum
// BTW, I see we put 0 for PFs, and If I'm right, that
// means we take the previous PFs as default
// how can we be sure they are ok?
HWD.pfnDrawPolygon(NULL, v, 4, PF_NoDepthTest); //PF_Translucent);
HWD.pfnDrawPolygon(NULL, v, 4, PF_NoDepthTest, false); //PF_Translucent);
}
@@ -570,7 +570,7 @@ void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength)
Surf.PolyColor.rgba = pLocalPalette[color].rgba;
Surf.PolyColor.s.alpha = (UINT8)(strength*25.5f);
}
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest, false);
}
// Draw the console background with translucency support
@@ -597,7 +597,7 @@ void HWR_DrawConsoleBack(UINT32 color, INT32 height)
Surf.PolyColor.rgba = UINT2RGBA(color);
Surf.PolyColor.s.alpha = 0x80;
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest, false);
}
@@ -846,7 +846,7 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
Surf.PolyColor = V_GetColor(color);
HWD.pfnDrawPolygon(&Surf, v, 4,
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
PF_Modulated|PF_NoTexture|PF_NoDepthTest, false);
}
// -------------------+
@@ -954,7 +954,7 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
Surf.PolyColor.rgba = UINT2RGBA(color);
Surf.PolyColor.s.alpha = 0x80;
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest, false);
}
// -----------------+
@@ -1062,7 +1062,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
Surf.PolyColor = V_GetColor(color);
HWD.pfnDrawPolygon(&Surf, v, 4,
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
PF_Modulated|PF_NoTexture|PF_NoDepthTest, false);
}
#ifdef HAVE_PNG
+2 -1
View File
@@ -21,6 +21,7 @@
#include "hw_md2.h"
#include "hw_dll.h"
#include "../doomdef.h"
// ==========================================================================
// STANDARD DLL EXPORTS
@@ -34,7 +35,7 @@ EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal, RGBA_t *pgamma);
#endif
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags);
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, boolean horizonSpecial);
EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags);
EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FBOOLEAN StencilMask, FRGBAFloat *ClearColor);
EXPORT void HWRAPI(SetTexture) (FTextureInfo *TexInfo);
+187 -82
View File
@@ -725,7 +725,80 @@ void HWR_RenderPlane(extrasubsector_t *xsub, boolean isceiling, fixed_t fixedhei
else
HWD.pfnSetShader(1); // floor shader
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, PolyFlags);
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, PolyFlags, false);
if (subsector)
{
// Horizon lines
FOutVector horizonpts[6];
float dist, vx, vy;
float x1, y1, xd, yd;
UINT8 numplanes, j;
vertex_t v; // For determining the closest distance from the line to the camera, to split render planes for minimum distortion;
const float renderdist = 27000.0f; // How far out to properly render the plane
const float farrenderdist = 32768.0f; // From here, raise plane to horizon level to fill in the line with some texture distortion
seg_t *line = &segs[subsector->firstline];
for (i = 0; i < subsector->numlines; i++, line++)
{
if (line->linedef->special == 41 && R_PointOnSegSide(dup_viewx, dup_viewy, line) == 0)
{
P_ClosestPointOnLine(viewx, viewy, line->linedef, &v);
dist = FIXED_TO_FLOAT(R_PointToDist(v.x, v.y));
x1 = ((polyvertex_t *)line->pv1)->x;
y1 = ((polyvertex_t *)line->pv1)->y;
xd = ((polyvertex_t *)line->pv2)->x - x1;
yd = ((polyvertex_t *)line->pv2)->y - y1;
// Based on the seg length and the distance from the line, split horizon into multiple poly sets to reduce distortion
dist = sqrtf((xd*xd) + (yd*yd)) / dist / 16.0f;
if (dist > 100.0f)
numplanes = 100;
else
numplanes = (UINT8)dist + 1;
for (j = 0; j < numplanes; j++)
{
// Left side
vx = x1 + xd * j / numplanes;
vy = y1 + yd * j / numplanes;
SETUP3DVERT((&horizonpts[1]), vx, vy);
dist = sqrtf(powf(vx - gr_viewx, 2) + powf(vy - gr_viewy, 2));
vx = (vx - gr_viewx) * renderdist / dist + gr_viewx;
vy = (vy - gr_viewy) * renderdist / dist + gr_viewy;
SETUP3DVERT((&horizonpts[0]), vx, vy);
// Right side
vx = x1 + xd * (j+1) / numplanes;
vy = y1 + yd * (j+1) / numplanes;
SETUP3DVERT((&horizonpts[2]), vx, vy);
dist = sqrtf(powf(vx - gr_viewx, 2) + powf(vy - gr_viewy, 2));
vx = (vx - gr_viewx) * renderdist / dist + gr_viewx;
vy = (vy - gr_viewy) * renderdist / dist + gr_viewy;
SETUP3DVERT((&horizonpts[3]), vx, vy);
// Horizon fills
vx = (horizonpts[0].x - gr_viewx) * farrenderdist / renderdist + gr_viewx;
vy = (horizonpts[0].z - gr_viewy) * farrenderdist / renderdist + gr_viewy;
SETUP3DVERT((&horizonpts[5]), vx, vy);
horizonpts[5].y = gr_viewz;
vx = (horizonpts[3].x - gr_viewx) * farrenderdist / renderdist + gr_viewx;
vy = (horizonpts[3].z - gr_viewy) * farrenderdist / renderdist + gr_viewy;
SETUP3DVERT((&horizonpts[4]), vx, vy);
horizonpts[4].y = gr_viewz;
// Draw
HWD.pfnDrawPolygon(&Surf, horizonpts, 6, PolyFlags, true);
}
}
}
}
}
#ifdef WALLSPLATS
@@ -789,7 +862,7 @@ static void HWR_DrawSegsSplats(FSurfaceInfo * pSurf)
}
HWD.pfnSetShader(2); // wall shader
HWD.pfnDrawPolygon(&pSurf, wallVerts, 4, i|PF_Modulated|PF_Decal);
HWD.pfnDrawPolygon(&pSurf, wallVerts, 4, i|PF_Modulated|PF_Decal, false);
}
}
#endif
@@ -831,7 +904,7 @@ void HWR_ProjectWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend
blendmode &= ~PF_Masked;
}
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blendmode|PF_Modulated|PF_Occlude);
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blendmode|PF_Modulated|PF_Occlude, false);
#ifdef WALLSPLATS
if (gr_curline->linedef->splats && cv_splats.value)
@@ -878,9 +951,6 @@ void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfa
pegb = wallVerts[0].t;
pegmul = (pegb - pegt) / (top - bot);
if (fpclassify(pegmul) == FP_NAN)
pegmul = 0.0;
#ifdef ESLOPE
endrealtop = endtop = wallVerts[2].y;
endrealbot = endbot = wallVerts[1].y;
@@ -889,8 +959,6 @@ void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfa
endpegmul = (endpegb - endpegt) / (endtop - endbot);
#endif
if (fpclassify(endpegmul) == FP_NAN)
endpegmul = 0.0;
for (i = 0; i < sector->numlights; i++)
{
@@ -1001,10 +1069,24 @@ void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfa
}
#endif
// Found a break
bot = min(max(bheight, realbot), top);
endbot = min(max(endbheight, endrealbot), endtop);
#ifdef ESLOPE
if (endbheight >= endtop)
#endif
if (bheight >= top)
continue;
//Found a break;
bot = bheight;
if (bot < realbot)
bot = realbot;
#ifdef ESLOPE
endbot = endbheight;
if (endbot < endrealbot)
endbot = endrealbot;
#endif
Surf->PolyColor.s.alpha = alpha;
#ifdef ESLOPE
@@ -1125,7 +1207,7 @@ void HWR_DrawSkyWallList()
HWD.pfnUnSetShader();
for (i = 0; i < skyWallVertexArraySize; i++)
{
HWD.pfnDrawPolygon(&surf, skyWallVertexArray + i * 4, 4, PF_Occlude|PF_Invisible|PF_NoTexture);
HWD.pfnDrawPolygon(&surf, skyWallVertexArray + i * 4, 4, PF_Occlude|PF_Invisible|PF_NoTexture, false);
}
}
@@ -1598,7 +1680,10 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
gr_midtexture = R_GetTextureNum(gr_sidedef->midtexture);
if (gr_midtexture || gr_portal == GRPORTAL_STENCIL || gr_portal == GRPORTAL_DEPTH || gl_drawing_stencil)
{
FBITFIELD blendmode;
sector_t *front, *back;
fixed_t popentop, popenbottom, polytop, polybottom, lowcut, highcut;
fixed_t texturevpeg = 0;
INT32 repeats;
if (gr_linedef->frontsector->heightsec != -1)
@@ -1634,10 +1719,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
else
repeats = 1;
fixed_t midtexheight = textureheight[gr_midtexture] * repeats;
fixed_t popentop, popenbottom, polytop, polybottom, lowcut, highcut;
fixed_t popentopslope, popenbottomslope, polytopslope, polybottomslope, lowcutslope, highcutslope;
// SoM: a little note: This code re-arranging will
// fix the bug in Nimrod map02. popentop and popenbottom
// record the limits the texture can be displayed in.
@@ -1651,8 +1732,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
// From CB
if (gr_curline->polyseg)
{
popentop = popentopslope = back->ceilingheight;
popenbottom = popenbottomslope = back->floorheight;
popentop = back->ceilingheight;
popenbottom = back->floorheight;
}
else
#endif
@@ -1660,9 +1741,10 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
#ifdef ESLOPE
popentop = min(worldtop, worldhigh);
popenbottom = max(worldbottom, worldlow);
popentopslope = min(worldtopslope, worldhighslope);
popenbottomslope = max(worldbottomslope, worldlowslope);
#else
popentop = min(front->ceilingheight, back->ceilingheight);
popenbottom = max(front->floorheight, back->floorheight);
#endif
}
#ifdef ESLOPE
@@ -1671,16 +1753,12 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3))
{
polybottom = max(front->floorheight, back->floorheight) + gr_sidedef->rowoffset;
polybottomslope = polybottom;
polytop = polybottom + midtexheight;
polytopslope = polytop;
polytop = polybottom + textureheight[gr_midtexture]*repeats;
}
else
{
polytop = min(front->ceilingheight, back->ceilingheight) + gr_sidedef->rowoffset;
polytopslope = polytop;
polybottom = polytop - midtexheight;
polybottomslope = polybottom;
polybottom = polytop - textureheight[gr_midtexture]*repeats;
}
}
else if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3))
@@ -1689,17 +1767,12 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
#endif
{
polybottom = popenbottom + gr_sidedef->rowoffset;
polytop = polybottom + midtexheight;
polybottomslope = popenbottomslope + gr_sidedef->rowoffset;
polytopslope = polybottomslope + midtexheight;
polytop = polybottom + textureheight[gr_midtexture]*repeats;
}
else
{
polytop = popentop + gr_sidedef->rowoffset;
polybottom = polytop - textureheight[gr_midtexture]*repeats;
polybottom = polytop - midtexheight;
polytopslope = popentopslope + gr_sidedef->rowoffset;
polybottomslope = polytopslope - midtexheight;
}
// CB
@@ -1710,8 +1783,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
{
lowcut = polybottom;
highcut = polytop;
lowcutslope = polybottomslope;
highcutslope = polytopslope;
}
#endif
else
@@ -1719,49 +1790,83 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
// The cut-off values of a linedef can always be constant, since every line has an absoulute front and or back sector
lowcut = popenbottom;
highcut = popentop;
lowcutslope = popenbottomslope;
highcutslope = popentopslope;
}
h = min(highcut, polytop);
l = max(polybottom, lowcut);
hS = min(highcutslope, polytopslope);
lS = max(polybottomslope, lowcutslope);
// PEGGING
fixed_t texturevpeg, texturevpegslope;
if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3))
{
texturevpeg = midtexheight - h + polybottom;
texturevpegslope = midtexheight - hS + polybottomslope;
}
else
{
texturevpeg = polytop - h;
texturevpegslope = polytopslope - hS;
}
// PEGGING
#ifdef ESLOPE
if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3))
#else
if (gr_linedef->flags & ML_DONTPEGBOTTOM)
#endif
texturevpeg = textureheight[gr_sidedef->midtexture]*repeats - h + polybottom;
else
texturevpeg = polytop - h;
grTex = HWR_GetTexture(gr_midtexture);
wallVerts[3].t = texturevpeg * grTex->scaleY;
wallVerts[0].t = (h - l + texturevpeg) * grTex->scaleY;
wallVerts[2].t = texturevpegslope * grTex->scaleY;
wallVerts[1].t = (hS - lS + texturevpegslope) * grTex->scaleY;
wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
wallVerts[3].t = wallVerts[2].t = texturevpeg * grTex->scaleY;
wallVerts[0].t = wallVerts[1].t = (h - l + texturevpeg) * grTex->scaleY;
wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
}
// set top/bottom coords
// Take the texture peg into account, rather than changing the offsets past
// where the polygon might not be.
wallVerts[3].y = FIXED_TO_FLOAT(h);
wallVerts[0].y = FIXED_TO_FLOAT(l);
wallVerts[2].y = FIXED_TO_FLOAT(hS);
wallVerts[1].y = FIXED_TO_FLOAT(lS);
wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(h);
wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(l);
#ifdef ESLOPE
// Correct to account for slopes
{
fixed_t midtextureslant;
if (gr_linedef->flags & ML_EFFECT2)
midtextureslant = 0;
else if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3))
midtextureslant = worldlow < worldbottom
? worldbottomslope-worldbottom
: worldlowslope-worldlow;
else
midtextureslant = worldtop < worldhigh
? worldtopslope-worldtop
: worldhighslope-worldhigh;
polytop += midtextureslant;
polybottom += midtextureslant;
highcut += worldtop < worldhigh
? worldtopslope-worldtop
: worldhighslope-worldhigh;
lowcut += worldlow < worldbottom
? worldbottomslope-worldbottom
: worldlowslope-worldlow;
// Texture stuff
h = min(highcut, polytop);
l = max(polybottom, lowcut);
{
// PEGGING
if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3))
texturevpeg = textureheight[gr_sidedef->midtexture]*repeats - h + polybottom;
else
texturevpeg = polytop - h;
wallVerts[2].t = texturevpeg * grTex->scaleY;
wallVerts[1].t = (h - l + texturevpeg) * grTex->scaleY;
}
wallVerts[2].y = FIXED_TO_FLOAT(h);
wallVerts[1].y = FIXED_TO_FLOAT(l);
}
#endif
// set alpha for transparent walls (new boom and legacy linedef types)
FBITFIELD blendmode;
// ooops ! this do not work at all because render order we should render it in backtofront order
switch (gr_linedef->special)
{
@@ -2951,7 +3056,7 @@ void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t
blendmode |= PF_Masked|PF_Modulated;
HWD.pfnSetShader(1); // floor shader
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, blendmode);
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, blendmode, false);
}
void HWR_AddPolyObjectPlanes(void)
@@ -3750,7 +3855,7 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t
{
sSurf.PolyColor.s.alpha = (UINT8)(sSurf.PolyColor.s.alpha - floorheight/4);
HWD.pfnSetShader(1); // floor shader
HWD.pfnDrawPolygon(&sSurf, swallVerts, 4, PF_Translucent|PF_Modulated);
HWD.pfnDrawPolygon(&sSurf, swallVerts, 4, PF_Translucent|PF_Modulated, false);
}
}
@@ -4117,7 +4222,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
Surf.PolyColor.s.alpha = alpha;
HWD.pfnSetShader(3); // sprite shader
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, false);
top = bot;
#ifdef ESLOPE
@@ -4157,7 +4262,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
Surf.PolyColor.s.alpha = alpha;
HWD.pfnSetShader(3); // sprite shader
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, false);
}
// -----------------+
@@ -4310,7 +4415,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
}
HWD.pfnSetShader(3); // sprite shader
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, false);
}
}
@@ -4404,7 +4509,7 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
}
HWD.pfnSetShader(3); // sprite shader
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, false);
}
// --------------------------------------------------------------------------
@@ -5076,7 +5181,7 @@ void HWR_ProjectSprite(mobj_t *thing)
rollsum = (thing->rollangle)+(thing->sloperoll);
rollangle = R_GetRollAngle(rollsum);
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, sprinfo, rollangle);
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle);
if (rotsprite != NULL)
{
@@ -5704,8 +5809,18 @@ void RecursivePortalRendering(portal_t *rootportal, const float fpov, player_t *
HWR_SetTransform(fpov, player);// restore transform
}
gr_collect_skywalls = false;
ps_numsprites.value.i = gr_visspritecount;
PS_START_TIMING(ps_hw_spritesorttime);
HWR_SortVisSprites();
PS_STOP_TIMING(ps_hw_spritesorttime);
PS_START_TIMING(ps_hw_spritedrawtime);
HWR_DrawSprites();
PS_STOP_TIMING(ps_hw_spritedrawtime);
ps_numdrawnodes.value.i = 0;
ps_hw_nodesorttime.value.p = 0;
ps_hw_nodedrawtime.value.p = 0;
HWR_RenderDrawNodes();
}
// free memory from portal list allocated by calls to Add2Lines
@@ -5721,6 +5836,7 @@ void RecursivePortalRendering(portal_t *rootportal, const float fpov, player_t *
// TODO: is it okay if stencil test is on all the time even when its not needed?
}
// ==========================================================================
// Render the current frame.
// ==========================================================================
@@ -5841,7 +5957,6 @@ void HWR_RenderFrame(INT32 viewnumber, player_t *player, boolean skybox)
HWD.pfnSetSpecialState(HWD_SET_SHADERS, cv_grshaders.value);
HWD.pfnSetShader(0);
//drawcount = 0;
validcount++;
portalclipline = NULL;
@@ -5879,18 +5994,8 @@ void HWR_RenderSinglePortal(portal_t *portal, size_t portalnum, float fpov, play
portalcullsector = gr_portalcullsectors[portalnum];
HWR_RenderBSPNode((INT32)numnodes - 1);
// Draw MD2 and sprites
ps_numsprites.value.i = gr_visspritecount;
PS_START_TIMING(ps_hw_spritesorttime);
HWR_SortVisSprites();
PS_STOP_TIMING(ps_hw_spritesorttime);
PS_START_TIMING(ps_hw_spritedrawtime);
HWR_DrawSprites();
PS_STOP_TIMING(ps_hw_spritedrawtime);
ps_numdrawnodes.value.i = 0;
ps_hw_nodesorttime.value.p = 0;
ps_hw_nodedrawtime.value.p = 0;
HWR_RenderDrawNodes();
}
@@ -6035,7 +6140,7 @@ void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend,
blendmode |= PF_Modulated; // No PF_Occlude means overlapping (incorrect) transparency
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blendmode);
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blendmode, false);
#ifdef WALLSPLATS
if (gr_curline->linedef->splats && cv_splats.value)
@@ -6086,7 +6191,7 @@ void HWR_DoPostProcessor(player_t *player)
Surf.PolyColor.s.alpha = 0xc0; // match software mode
HWD.pfnDrawPolygon(&Surf, v, 4, PF_Modulated|PF_Translucent|PF_NoTexture|PF_NoDepthTest);
HWD.pfnDrawPolygon(&Surf, v, 4, PF_Modulated|PF_Translucent|PF_NoTexture|PF_NoDepthTest, false);
}
if (!cv_grscreentextures.value) // screen textures are needed for the rest of the effects
+25 -10
View File
@@ -1822,6 +1822,8 @@ typedef struct
FBITFIELD polyFlags;
GLuint texNum;
GLuint shader;
// this tells batching that the plane belongs to a horizon line and must be drawn in correct order with the skywalls
boolean horizonSpecial;
} PolygonArrayEntry;
FOutVector* finalVertexArray = NULL;// contains subset of sorted vertices and texture coordinates to be sent to gpu
@@ -1861,21 +1863,27 @@ EXPORT void HWRAPI(StartBatching) (void)
static int comparePolygons(const void *p1, const void *p2)
{
PolygonArrayEntry* poly1 = &polygonArray[*(const unsigned int*)p1];
PolygonArrayEntry* poly2 = &polygonArray[*(const unsigned int*)p2];
unsigned int index1 = *(const unsigned int*)p1;
unsigned int index2 = *(const unsigned int*)p2;
PolygonArrayEntry* poly1 = &polygonArray[index1];
PolygonArrayEntry* poly2 = &polygonArray[index2];
int diff;
INT64 diff64;
int shader1 = poly1->shader;
int shader2 = poly2->shader;
// make skywalls first in order
if (poly1->polyFlags & PF_NoTexture)
// make skywalls and horizon lines first in order
if (poly1->polyFlags & PF_NoTexture || poly1->horizonSpecial)
shader1 = -1;
if (poly2->polyFlags & PF_NoTexture)
if (poly2->polyFlags & PF_NoTexture || poly2->horizonSpecial)
shader2 = -1;
diff = shader1 - shader2;
if (diff != 0) return diff;
// skywalls and horizon lines must retain their order for horizon lines to work
if (shader1 == -1 && shader2 == -1)
return index1 - index2;
diff = poly1->texNum - poly2->texNum;
if (diff != 0) return diff;
@@ -1899,20 +1907,26 @@ static int comparePolygons(const void *p1, const void *p2)
static int comparePolygonsNoShaders(const void *p1, const void *p2)
{
PolygonArrayEntry* poly1 = &polygonArray[*(const unsigned int*)p1];
PolygonArrayEntry* poly2 = &polygonArray[*(const unsigned int*)p2];
unsigned int index1 = *(const unsigned int*)p1;
unsigned int index2 = *(const unsigned int*)p2;
PolygonArrayEntry* poly1 = &polygonArray[index1];
PolygonArrayEntry* poly2 = &polygonArray[index2];
int diff;
INT64 diff64;
GLuint texNum1 = poly1->texNum;
GLuint texNum2 = poly2->texNum;
if (poly1->polyFlags & PF_NoTexture)
if (poly1->polyFlags & PF_NoTexture || poly1->horizonSpecial)
texNum1 = 0;
if (poly2->polyFlags & PF_NoTexture)
if (poly2->polyFlags & PF_NoTexture || poly2->horizonSpecial)
texNum2 = 0;
diff = texNum1 - texNum2;
if (diff != 0) return diff;
// skywalls and horizon lines must retain their order for horizon lines to work
if (texNum1 == 0 && texNum2 == 0)
return index1 - index2;
diff = poly1->polyFlags - poly2->polyFlags;
if (diff != 0) return diff;
@@ -2269,7 +2283,7 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i
// -----------------+
// DrawPolygon : Render a polygon, set the texture, set render mode
// -----------------+
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags)
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, boolean horizonSpecial)
{
if (gl_batching)
{
@@ -2309,6 +2323,7 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI
polygonArray[polygonArraySize].polyFlags = PolyFlags;
polygonArray[polygonArraySize].texNum = tex_downloaded;
polygonArray[polygonArraySize].shader = gl_currentshaderprogram;
polygonArray[polygonArraySize].horizonSpecial = horizonSpecial;
polygonArraySize++;
memcpy(&unsortedVertexArray[unsortedVertexArraySize], pOutVerts, iNumPts * sizeof(FOutVector));
+1 -1
View File
@@ -40,7 +40,7 @@ extern UINT8 keyboard_started;
\return free memory in the system
*/
UINT32 I_GetFreeMem(UINT32 *total);
size_t I_GetFreeMem(size_t *total);
/** \brief Returns precise time value for performance measurement. The precise
time should be a monotonically increasing counter, and will wrap.
+18 -10
View File
@@ -3100,7 +3100,7 @@ static void K_QuiteSaltyHop(player_t *p)
p->mo->spriteyscale += (mos/8);
p->mo->spritexscale -= (mos/8);
}
p->mo->spriteyoffset = p->mo->salty_zoffset*P_MobjFlip(p->mo);
p->mo->spriteyoffset = p->mo->salty_zoffset;
if (S_SoundPlaying(p->mo, sfx_screec))
S_StopSoundByID(p->mo, sfx_screec);
if (S_SoundPlaying(p->mo, sfx_drift))
@@ -3132,6 +3132,7 @@ static angle_t K_GetSlopeRollAngle(player_t *p, boolean dontflip, boolean useRes
angle_t zangle = 0;
angle_t xydirection = 0;
angle_t an;
angle_t final_slope;
INT32 pNum = K_FindPlayerNum(p);
I_Assert(p != NULL);
@@ -3171,7 +3172,14 @@ static angle_t K_GetSlopeRollAngle(player_t *p, boolean dontflip, boolean useRes
zangle = InvAngle(zangle);
an = (lookAngle - xydirection);
return FixedMul(zangle, FINESINE(an>>ANGLETOFINESHIFT));
final_slope = -(FixedMul(FINESINE(an>>ANGLETOFINESHIFT), zangle));
an = (INT32)(final_slope - p->tilt_sprite) / 3; // instead of just a direct snap
if (an)
p->tilt_sprite += an;
else
p->tilt_sprite = final_slope;
return -p->tilt_sprite;
}
static void K_RollPlayerBySlopes(player_t *p, boolean usedistance)
@@ -6647,7 +6655,7 @@ void K_CheckBumpers(void)
if (winnernum > -1 && playeringame[winnernum])
{
players[winnernum].marescore += winnerscoreadd;
CONS_Printf(M_GetText("%s recieved %d point%s for winning!\n"), player_names[winnernum], winnerscoreadd, (winnerscoreadd == 1 ? "" : "s"));
CONS_Printf(M_GetText("%s received %d point%s for winning!\n"), player_names[winnernum], winnerscoreadd, (winnerscoreadd == 1 ? "" : "s"));
}
for (i = 0; i < MAXPLAYERS; i++) // This can't go in the earlier loop because winning adds points
@@ -8329,11 +8337,11 @@ static void K_drawKartSpeedometer(void)
speedtype = 1;
break;
case 2:
convSpeed = FixedDiv(FixedMul(stplyr->speed, 142371), mapobjectscale)/FRACUNIT; // 2.172409058
convSpeed = FixedDiv(FixedMul(stplyr->speed, 88465), mapobjectscale)/FRACUNIT; // 1.349868774
speedtype = 2;
break;
case 3:
convSpeed = FixedDiv(FixedMul(stplyr->speed, 88465), mapobjectscale)/FRACUNIT; // 1.349868774
convSpeed = FixedDiv(stplyr->speed, mapobjectscale)/FRACUNIT;
speedtype = 3;
break;
case 4:
@@ -8350,19 +8358,19 @@ static void K_drawKartSpeedometer(void)
{
switch (speedtype) {
case 1:
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%03d km/h", convSpeed));
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d km/h", convSpeed));
break;
case 2:
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%03d mph", convSpeed));
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d mph", convSpeed));
break;
case 3:
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%03d fu/t", convSpeed));
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d fu/t", convSpeed));
break;
case 4: // if extra.kart is found, use its included % symbol
if (!found_extra_kart)
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%03d P", convSpeed));
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%4d P", convSpeed));
else
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%03d %%", convSpeed));
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%4d %%", convSpeed));
}
}
else if (cv_newspeedometer.value && found_extra_kart) { // why bother if we dont?
+3 -1
View File
@@ -293,6 +293,8 @@ static void Lua_OnChange(void)
//lua_settop(gL, 0); // Just in case...
lua_pushcfunction(gL, LUA_GetErrorMessage);
int error_handler_i = abs_index(gL, -1);
// From CV_OnChange registry field, get the function for this cvar by name.
lua_getfield(gL, LUA_REGISTRYINDEX, "CV_OnChange");
I_Assert(lua_istable(gL, -1));
@@ -304,7 +306,7 @@ static void Lua_OnChange(void)
lua_getfield(gL, -1, cvname); // get consvar_t* userdata.
lua_remove(gL, -2); // pop the CV_Vars table.
LUA_Call(gL, 1, 0, 1); // call function(cvar)
LUA_Call(gL, 1, 0, error_handler_i); // call function(cvar)
lua_pop(gL, 2); // pop CV_OnChange table and error handler
}
+12 -8
View File
@@ -1419,24 +1419,28 @@ static menuitem_t OP_SoundOptionsMenu[] =
{IT_STRING|IT_CVAR, NULL, "Play Music While Unfocused", &cv_playmusicifunfocused, 125},
{IT_STRING|IT_CVAR, NULL, "Play SFX While Unfocused", &cv_playsoundifunfocused, 135},
#ifdef HAVE_OPENMPT
{IT_STRING|IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 155}
#endif
};
#ifdef HAVE_OPENMPT
static menuitem_t OP_SoundAdvancedMenu[] =
{
#ifdef HAVE_OPENMPT
{IT_HEADER, NULL, "Tracker Module Options", NULL, 10},
{IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 42},
{IT_STRING | IT_CVAR, NULL, "Amiga Resampler", &cv_amigafilter, 62},
{IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 22},
{IT_STRING | IT_CVAR, NULL, "Amiga Resampler", &cv_amigafilter, 42},
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4
{IT_STRING | IT_CVAR, NULL, "Amiga Type", &cv_amigatype, 82},
{IT_STRING | IT_CVAR, NULL, "Amiga Type", &cv_amigatype, 62},
#endif
{IT_STRING | IT_CVAR, NULL, "Stereo Seperation", &cv_stereosep, 102},
{IT_STRING | IT_CVAR, NULL, "Stereo Seperation", &cv_stereosep, 82},
#endif
{IT_HEADER, NULL, "Misc", NULL, 105},
{IT_STRING | IT_CVAR, NULL, "Grow Music", &cv_growmusic, 117},
{IT_STRING | IT_CVAR, NULL, "Invulnerability Music", &cv_supermusic, 137},
};
#endif
static menuitem_t OP_DataOptionsMenu[] =
{
+6 -6
View File
@@ -7457,10 +7457,10 @@ void A_RollAngle(mobj_t *actor)
INT32 locvar2 = var2;
const angle_t angle = FixedAngle(locvar1*FRACUNIT);
/*#ifdef HAVE_BLUA
#ifdef HAVE_BLUA
if (LUA_CallAction("A_RollAngle", actor))
return;
#endif*/
#endif
// relative (default)
if (!locvar2)
@@ -7483,10 +7483,10 @@ void A_ChangeRollAngleRelative(mobj_t *actor)
INT32 locvar2 = var2;
const fixed_t amin = locvar1*FRACUNIT;
const fixed_t amax = locvar2*FRACUNIT;
/*#ifdef HAVE_BLUA
#ifdef HAVE_BLUA
if (LUA_CallAction("A_ChangeRollAngleRelative", actor))
return;
#endif*/
#endif
#ifdef PARANOIA
if (amin > amax)
@@ -7509,10 +7509,10 @@ void A_ChangeRollAngleAbsolute(mobj_t *actor)
INT32 locvar2 = var2;
const fixed_t amin = locvar1*FRACUNIT;
const fixed_t amax = locvar2*FRACUNIT;
/*#ifdef HAVE_BLUA
#ifdef HAVE_BLUA
if (LUA_CallAction("A_ChangeRollAngleAbsolute", actor))
return;
#endif*/
#endif
#ifdef PARANOIA
if (amin > amax)
+2 -2
View File
@@ -1278,13 +1278,13 @@ void P_RestoreMusic(player_t *player)
}
// Item - Grow
if (wantedmus == 2)
if (wantedmus == 2 && cv_growmusic.value)
{
S_ChangeMusicInternal("kgrow", true);
S_SetRestoreMusicFadeInCvar(&cv_growmusicfade);
}
// Item - Invincibility
else if (wantedmus == 1)
else if (wantedmus == 1 && cv_supermusic.value)
{
S_ChangeMusicInternal("kinvnc", true);
S_SetRestoreMusicFadeInCvar(&cv_invincmusicfade);
+1018 -1102
View File
File diff suppressed because it is too large. Load diff
+68 -69
View File
@@ -1,69 +1,68 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 2018-2019 by Jaime "Lactozilla" Passos.
// Copyright (C) 2019 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file r_patch.h
/// \brief Patch generation.
#ifndef __R_PATCH__
#define __R_PATCH__
#include "r_defs.h"
#include "doomdef.h"
// Structs
typedef enum
{
ROTAXIS_X, // Roll (the default)
ROTAXIS_Y, // Pitch
ROTAXIS_Z // Yaw
} rotaxis_t;
typedef struct
{
INT32 x, y;
rotaxis_t rotaxis;
} spriteframepivot_t;
typedef struct
{
spriteframepivot_t pivot[64];
boolean available;
} spriteinfo_t;
// Conversions between patches / flats / textures...
boolean R_CheckIfPatch(lumpnum_t lump);
void R_TextureToFlat(size_t tex, UINT8 *flat);
void R_PatchToFlat(patch_t *patch, UINT8 *flat);
void R_PatchToMaskedFlat(patch_t *patch, UINT16 *raw, boolean flip);
patch_t *R_FlatToPatch(UINT8 *raw, UINT16 width, UINT16 height, UINT16 leftoffset, UINT16 topoffset, size_t *destsize, boolean transparency);
patch_t *R_MaskedFlatToPatch(UINT16 *raw, UINT16 width, UINT16 height, UINT16 leftoffset, UINT16 topoffset, size_t *destsize);
// SpriteInfo
extern spriteinfo_t spriteinfo[NUMSPRITES];
void R_LoadSpriteInfoLumps(UINT16 wadnum, UINT16 numlumps);
void R_ParseSPRTINFOLump(UINT16 wadNum, UINT16 lumpNum);
// Sprite rotation
#ifdef ROTSPRITE
INT32 R_GetRollAngle(angle_t rollangle);
patch_t *Patch_GetRotatedSprite(
spriteframe_t *sprite,
size_t frame, size_t spriteangle,
boolean flip, void *info,
INT32 rotationangle);
rotsprite_t *RotatedPatch_Create(INT32 numangles);
void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, UINT8 flip);
//void R_FreeSkinRotSprite(size_t skinnum);
extern fixed_t rollcosang[ROTANGLES];
extern fixed_t rollsinang[ROTANGLES];
void R_FreeAllRotSprite(void);
#endif
#endif // __R_PATCH__
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 2018-2019 by Jaime "Lactozilla" Passos.
// Copyright (C) 2019 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file r_patch.h
/// \brief Patch generation.
#ifndef __R_PATCH__
#define __R_PATCH__
#include "r_defs.h"
#include "doomdef.h"
// Structs
typedef enum
{
ROTAXIS_X, // Roll (the default)
ROTAXIS_Y, // Pitch
ROTAXIS_Z // Yaw
} rotaxis_t;
typedef struct
{
INT32 x, y;
rotaxis_t rotaxis;
} spriteframepivot_t;
typedef struct
{
spriteframepivot_t pivot[64];
boolean available;
} spriteinfo_t;
// Conversions between patches / flats / textures...
boolean R_CheckIfPatch(lumpnum_t lump);
void R_TextureToFlat(size_t tex, UINT8 *flat);
void R_PatchToFlat(patch_t *patch, UINT8 *flat);
void R_PatchToMaskedFlat(patch_t *patch, UINT16 *raw, boolean flip);
patch_t *R_FlatToPatch(UINT8 *raw, UINT16 width, UINT16 height, UINT16 leftoffset, UINT16 topoffset, size_t *destsize, boolean transparency);
patch_t *R_MaskedFlatToPatch(UINT16 *raw, UINT16 width, UINT16 height, UINT16 leftoffset, UINT16 topoffset, size_t *destsize);
// SpriteInfo
extern spriteinfo_t spriteinfo[NUMSPRITES];
void R_LoadSpriteInfoLumps(UINT16 wadnum, UINT16 numlumps);
void R_ParseSPRTINFOLump(UINT16 wadNum, UINT16 lumpNum);
// Sprite rotation
#ifdef ROTSPRITE
INT32 R_GetRollAngle(angle_t rollangle);
patch_t *Patch_GetRotatedSprite(
spriteframe_t *sprite,
size_t frame, size_t spriteangle,
boolean flip, boolean adjustfeet,
void *info, INT32 rotationangle);
rotsprite_t *RotatedPatch_Create(INT32 numangles);
void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, boolean flip);
extern fixed_t rollcosang[ROTANGLES];
extern fixed_t rollsinang[ROTANGLES];
#endif
#endif // __R_PATCH__
+1 -1
View File
@@ -1371,7 +1371,7 @@ static void R_ProjectSprite(mobj_t *thing)
rollsum = (thing->rollangle) + (thing->sloperoll);
rollangle = R_GetRollAngle(rollsum);
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, sprinfo, rollangle);
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle);
if (rotsprite != NULL)
{
+6 -7
View File
@@ -3806,8 +3806,7 @@ static long get_entry(const char* name, const char* buf)
}
#endif
// quick fix for compil
UINT32 I_GetFreeMem(UINT32 *total)
size_t I_GetFreeMem(size_t *total)
{
#ifdef FREEBSD
struct vmmeter sum;
@@ -3855,8 +3854,8 @@ UINT32 I_GetFreeMem(UINT32 *total)
info.dwLength = sizeof (MEMORYSTATUS);
GlobalMemoryStatus( &info );
if (total)
*total = (UINT32)info.dwTotalPhys;
return (UINT32)info.dwAvailPhys;
*total = (size_t)info.dwTotalPhys;
return (size_t)info.dwAvailPhys;
#elif defined (__OS2__)
UINT32 pr_arena;
@@ -3871,8 +3870,8 @@ UINT32 I_GetFreeMem(UINT32 *total)
/* Linux */
char buf[1024];
char *memTag;
UINT32 freeKBytes;
UINT32 totalKBytes;
size_t freeKBytes;
size_t totalKBytes;
INT32 n;
INT32 meminfo_fd = -1;
long Cached;
@@ -3903,7 +3902,7 @@ UINT32 I_GetFreeMem(UINT32 *total)
}
memTag += sizeof (MEMTOTAL);
totalKBytes = atoi(memTag);
totalKBytes = (size_t)atoi(memTag);
if ((memTag = strstr(buf, MEMAVAILABLE)) == NULL)
{
+7
View File
@@ -59,6 +59,7 @@
#endif
#include "../doomstat.h"
#include "../p_setup.h"
#include "../i_system.h"
#include "../v_video.h"
#include "../m_argv.h"
@@ -969,6 +970,7 @@ static void Impl_HandleControllerButtonEvent(SDL_ControllerButtonEvent evt, Uint
void I_GetEvent(void)
{
SDL_Event evt;
char* dropped_filedir;
// We only want the first motion event,
// otherwise we'll end up catching the warp back to center.
//int mouseMotionOnce = 0;
@@ -1293,6 +1295,11 @@ void I_GetEvent(void)
if (currentMenu == &OP_JoystickSetDef)
M_SetupJoystickMenu(0);
break;
case SDL_DROPFILE:
dropped_filedir = evt.drop.file;
P_AddWadFile(dropped_filedir);
SDL_free(dropped_filedir); // Free dropped_filedir memory
break;
case SDL_QUIT:
I_Quit();
M_QuitResponse('y');
+6 -5
View File
@@ -140,14 +140,14 @@ static void Command_Memdump_f(void);
void Z_Init(void)
{
UINT32 total, memfree;
size_t total, memfree;
memset(&head, 0x00, sizeof(head));
head.next = head.prev = &head;
memfree = I_GetFreeMem(&total)>>20;
CONS_Printf("System memory: %uMB - Free: %uMB\n", total>>20, memfree);
CONS_Printf("System memory: %sMB - Free: %sMB\n", sizeu1(total>>20), sizeu2(memfree));
// Note: This allocates memory. Watch out.
COM_AddCommand("memfree", Command_Memfree_f);
@@ -616,12 +616,13 @@ size_t Z_TagUsage(INT32 tagnum)
void Command_Memfree_f(void)
{
UINT32 freebytes, totalbytes;
size_t freebytes, totalbytes;
Z_CheckHeap(-1);
CONS_Printf("\x82%s", M_GetText("Memory Info\n"));
CONS_Printf(M_GetText("Total heap used : %7s KB\n"), sizeu1(Z_TagsUsage(0, INT32_MAX)>>10));
CONS_Printf(M_GetText("Static : %7s KB\n"), sizeu1(Z_TagUsage(PU_STATIC)>>10));
CONS_Printf(M_GetText("Lua : %7s KB\n"), sizeu1(Z_TagUsage(PU_LUA)>>10));
CONS_Printf(M_GetText("Static (sound) : %7s KB\n"), sizeu1(Z_TagUsage(PU_SOUND)>>10));
CONS_Printf(M_GetText("Static (music) : %7s KB\n"), sizeu1(Z_TagUsage(PU_MUSIC)>>10));
CONS_Printf(M_GetText("Locked cache : %7s KB\n"), sizeu1(Z_TagUsage(PU_CACHE)>>10));
@@ -643,8 +644,8 @@ void Command_Memfree_f(void)
CONS_Printf("\x82%s", M_GetText("System Memory Info\n"));
freebytes = I_GetFreeMem(&totalbytes);
CONS_Printf(M_GetText(" Total physical memory: %7u KB\n"), totalbytes>>10);
CONS_Printf(M_GetText("Available physical memory: %7u KB\n"), freebytes>>10);
CONS_Printf(M_GetText(" Total physical memory: %s KB\n"), sizeu1(totalbytes>>10));
CONS_Printf(M_GetText("Available physical memory: %s KB\n"), sizeu1(freebytes>>10));
}
#ifdef ZDEBUG