squashed stuff

faster palette stuff for ogl. no number for samplerate. smaller possible sdl mixer buffer size. some inline warning fixes. also some camera interp fix on level load. bigger console buffer for very high resolutons etc.
This commit is contained in:
Alug committed 2024-03-19 22:32:20 +01:00
1 parent 855ba36921
commit 62b058c9fb
9 files changed
+32 -34

No files matched your search

+1 -1
View File
@@ -112,7 +112,7 @@ static void CONS_backcolor_Change(void);
#ifdef macintosh
#define CON_BUFFERSIZE 4096 // my compiler can't handle local vars >32k
#else
#define CON_BUFFERSIZE 16384
#define CON_BUFFERSIZE 32768
#endif
static char con_buffer[CON_BUFFERSIZE];
+1 -1
View File
@@ -8628,7 +8628,7 @@ static int lib_dummysuper(lua_State *L)
return luaL_error(L, "Can't call super() outside of hardcode-replacing A_Action functions being called by state changes!"); // convoluted, I know. @_@;;
}
static inline int lib_getenum(lua_State *L)
FUNCINLINE static ATTRINLINE int lib_getenum(lua_State *L)
{
const int UV_MATHLIB = lua_upvalueindex(1);
const int GLIB_PROXY = lua_upvalueindex(2);
+6 -12
View File
@@ -556,18 +556,12 @@ EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl)
// -----------------+
EXPORT void HWRAPI(SetPalette) (RGBA_t *pal)
{
INT32 i;
for (i = 0; i < 256; i++)
{
myPaletteData[i].s.red = pal[i].s.red;
myPaletteData[i].s.green = pal[i].s.green;
myPaletteData[i].s.blue = pal[i].s.blue;
myPaletteData[i].s.alpha = pal[i].s.alpha;
}
size_t palsize = (sizeof(RGBA_t) * 256);
// on a palette change, you have to reload all of the textures
Flush();
if (memcmp(&myPaletteData, pal, palsize))
{
memcpy(&myPaletteData, pal, palsize);
Flush();
}
}
#endif
+2 -2
View File
@@ -44,11 +44,11 @@ boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2,
#define P_AproxDistance(dx, dy) FixedHypot(dx, dy)
void P_ClosestPointOnLine(fixed_t x, fixed_t y, line_t *line, vertex_t *result);
void P_ClosestPointOnLine3D(fixed_t x, fixed_t y, fixed_t z, line_t *line, vertex_t *result);
INT32 P_PointOnLineSide(fixed_t x, fixed_t y, line_t *line);
INT32 P_PointOnLineSide(fixed_t x, fixed_t y, const line_t *line);
void P_MakeDivline(line_t *li, divline_t *dl);
void P_CameraLineOpening(line_t *plinedef);
fixed_t P_InterceptVector(divline_t *v2, divline_t *v1);
INT32 P_BoxOnLineSide(fixed_t *tmbox, line_t *ld);
INT32 P_BoxOnLineSide(fixed_t *tmbox, const line_t *ld);
void P_UnsetPrecipThingPosition(precipmobj_t *thing);
void P_SetPrecipitationThingPosition(precipmobj_t *thing);
void P_CreatePrecipSecNodeList(precipmobj_t *thing, fixed_t x,fixed_t y);
+9 -2
View File
@@ -382,7 +382,7 @@ UINT32 P_GetScoreForGrade(INT16 map, UINT8 mare, UINT8 grade)
* \sa ML_VERTEXES
*/
static inline void P_LoadRawVertexes(UINT8 *data, size_t i)
FUNCINLINE static ATTRINLINE void P_LoadRawVertexes(UINT8 *data, size_t i)
{
mapvertex_t *ml;
vertex_t *li;
@@ -506,7 +506,7 @@ static void P_LoadSegs(lumpnum_t lumpnum)
* \param lump Lump number of the SSECTORS resource.
* \sa ::ML_SSECTORS
*/
static inline void P_LoadRawSubsectors(void *data, size_t i)
FUNCINLINE static ATTRINLINE void P_LoadRawSubsectors(void *data, size_t i)
{
mapsubsector_t *ms;
subsector_t *ss;
@@ -3308,6 +3308,13 @@ boolean P_SetupLevel(boolean skipprecip)
LUAh_MapLoad();
}
if (rendermode != render_none)
{
R_ResetViewInterpolation(0);
R_ResetViewInterpolation(0);
R_UpdateMobjInterpolators();
}
G_AddMapToBuffer(gamemap-1);
return true;
+1 -2
View File
@@ -82,7 +82,6 @@ subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y);
boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixed_t bottomh, fixed_t toph);
// Performance stats
extern precise_t ps_prevframetime;// time when previous frame was rendered
extern ps_metric_t ps_rendercalltime;
extern ps_metric_t ps_otherrendertime;
@@ -113,7 +112,7 @@ extern consvar_t cv_flipcam, cv_flipcam2, cv_flipcam3, cv_flipcam4;
extern consvar_t cv_shadow, cv_shadowoffs;
extern consvar_t cv_ffloorclip, cv_spriteclip;
extern consvar_t cv_translucency;
extern consvar_t /*cv_precipdensity,*/ cv_drawdist, /*cv_drawdist_nights,*/ cv_drawdist_precip, cv_lessprecip;
extern consvar_t cv_drawdist, cv_drawdist_precip, cv_lessprecip;
extern consvar_t cv_fov;
extern consvar_t cv_skybox;
extern consvar_t cv_tailspickup;
+1 -1
View File
@@ -65,7 +65,7 @@ static void AmigaType_OnChange(void);
consvar_t cv_samplerate = {"samplerate", "44100", 0, CV_Unsigned, NULL, 22050, NULL, NULL, 0, 0, NULL}; //Alam: For easy hacking?
static CV_PossibleValue_t audbuffersize_cons_t[] = {{1024, "1024"}, {2048, "2048"}, {4096, "4096"}, {0, NULL}};
static CV_PossibleValue_t audbuffersize_cons_t[] = {{512, "512"}, {1024, "1024"}, {2048, "2048"}, {4096, "4096"}, {0, NULL}};
consvar_t cv_audbuffersize = {"buffersize", "2048", CV_SAVE, audbuffersize_cons_t, BufferSize_OnChange, 0, NULL, NULL, 0, 0, NULL};
// stereo reverse
+6 -5
View File
@@ -422,7 +422,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
zErr = inflate(&stream, Z_FINISH);
if (zErr == Z_STREAM_END) {
// Run GME on new data
if (!gme_open_data(inflatedData, inflatedLen, &emu, 44100))
if (!gme_open_data(inflatedData, inflatedLen, &emu, SAMPLERATE))
{
short *mem;
UINT32 len;
@@ -456,7 +456,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
#endif
}
// Try to read it as a GME sound
else if (!gme_open_data(lump, sfx->length, &emu, 44100))
else if (!gme_open_data(lump, sfx->length, &emu, SAMPLERATE))
{
short *mem;
UINT32 len;
@@ -1109,9 +1109,10 @@ boolean I_LoadSong(char *data, size_t len)
if (zErr == Z_OK) // We're good to go
{
zErr = inflate(&stream, Z_FINISH);
if (zErr == Z_STREAM_END) {
if (zErr == Z_STREAM_END)
{
// Run GME on new data
if (!gme_open_data(inflatedData, inflatedLen, &gme, 44100))
if (!gme_open_data(inflatedData, inflatedLen, &gme, SAMPLERATE))
{
Z_Free(inflatedData); // GME supposedly makes a copy for itself, so we don't need this lying around
return true;
@@ -1130,7 +1131,7 @@ boolean I_LoadSong(char *data, size_t len)
return false;
#endif
}
else if (!gme_open_data(data, len, &gme, 44100))
else if (!gme_open_data(data, len, &gme, SAMPLERATE))
return true;
#endif
+5 -8
View File
@@ -207,16 +207,13 @@ void OglSdlFinishUpdate(boolean waitvbl)
EXPORT void HWRAPI(OglSdlSetPalette) (RGBA_t *palette)
{
INT32 i;
for (i = 0; i < 256; i++)
size_t palsize = (sizeof(RGBA_t) * 256);
// on a palette change, you have to reload all of the textures
if (memcmp(&myPaletteData, palette, palsize))
{
myPaletteData[i].s.red = palette[i].s.red;
myPaletteData[i].s.green = palette[i].s.green;
myPaletteData[i].s.blue = palette[i].s.blue;
myPaletteData[i].s.alpha = palette[i].s.alpha;
memcpy(&myPaletteData, palette, palsize);
Flush();
}
Flush();
}
#endif //HWRENDER