more stuff i forgor
This commit is contained in:
1 parent
ce4a89ed96
commit
61bd811dfd
4 files changed
+38
-56
No files matched your search
+1
-14
@@ -6327,8 +6327,6 @@ boolean TryRunTics(tic_t realtics)
|
||||
|
||||
if (ticking)
|
||||
{
|
||||
boolean tickInterp = true;
|
||||
|
||||
// run the count * tics
|
||||
while (neededtic > gametic)
|
||||
{
|
||||
@@ -6339,18 +6337,7 @@ boolean TryRunTics(tic_t realtics)
|
||||
if (update_stats)
|
||||
PS_START_TIMING(ps_tictime);
|
||||
|
||||
boolean run = (gametic % NEWTICRATERATIO) == 0;
|
||||
|
||||
if (run && tickInterp)
|
||||
{
|
||||
// Update old view state BEFORE ticking so resetting
|
||||
// the old interpolation state from game logic works.
|
||||
R_UpdateViewInterpolation();
|
||||
tickInterp = false; // do not update again in sped-up tics
|
||||
}
|
||||
|
||||
G_Ticker(run);
|
||||
|
||||
G_Ticker((gametic % NEWTICRATERATIO) == 0);
|
||||
ExtraDataTicker();
|
||||
gametic++;
|
||||
consistancy[gametic%TICQUEUE] = Consistancy();
|
||||
|
||||
@@ -795,7 +795,7 @@ EXPORT boolean HWRAPI(InitShaders) (void)
|
||||
{
|
||||
if (!pglUseProgram)
|
||||
return false;
|
||||
|
||||
|
||||
gl_fallback_shader.vertex_shader = Z_StrDup(GLSL_FALLBACK_VERTEX_SHADER);
|
||||
gl_fallback_shader.fragment_shader = Z_StrDup(GLSL_FALLBACK_FRAGMENT_SHADER);
|
||||
|
||||
@@ -1016,6 +1016,39 @@ void SetStates(void)
|
||||
pglScalef(1.0f, 1.0f, -1.0f);
|
||||
pglGetFloatv(GL_MODELVIEW_MATRIX, modelMatrix); // added for new coronas' code (without depth buffer)
|
||||
}
|
||||
// -----------------+
|
||||
// DeleteTexture : Deletes a texture from the GPU and frees its data
|
||||
// -----------------+
|
||||
EXPORT void HWRAPI(DeleteTexture) (GLMipmap_t *pTexInfo)
|
||||
{
|
||||
FTextureInfo *head = TexCacheHead;
|
||||
|
||||
if (!pTexInfo)
|
||||
return;
|
||||
else if (pTexInfo->downloaded)
|
||||
pglDeleteTextures(1, (GLuint *)&pTexInfo->downloaded);
|
||||
|
||||
while (head)
|
||||
{
|
||||
if (head->downloaded == pTexInfo->downloaded)
|
||||
{
|
||||
if (head->next)
|
||||
head->next->prev = head->prev;
|
||||
else // no next -> tail is being deleted -> update TexCacheTail
|
||||
TexCacheTail = head->prev;
|
||||
if (head->prev)
|
||||
head->prev->next = head->next;
|
||||
else // no prev -> head is being deleted -> update TexCacheHead
|
||||
TexCacheHead = head->next;
|
||||
free(head);
|
||||
break;
|
||||
}
|
||||
|
||||
head = head->next;
|
||||
}
|
||||
|
||||
pTexInfo->downloaded = 0;
|
||||
}
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
static void GLFramebuffer_GenerateAttachments(void)
|
||||
@@ -1139,40 +1172,6 @@ void GLFramebuffer_Disable(void)
|
||||
GLFramebuffer_Delete();
|
||||
}
|
||||
#endif
|
||||
// -----------------+
|
||||
// DeleteTexture : Deletes a texture from the GPU and frees its data
|
||||
// -----------------+
|
||||
EXPORT void HWRAPI(DeleteTexture) (GLMipmap_t *pTexInfo)
|
||||
{
|
||||
FTextureInfo *head = TexCacheHead;
|
||||
|
||||
if (!pTexInfo)
|
||||
return;
|
||||
else if (pTexInfo->downloaded)
|
||||
pglDeleteTextures(1, (GLuint *)&pTexInfo->downloaded);
|
||||
|
||||
while (head)
|
||||
{
|
||||
if (head->downloaded == pTexInfo->downloaded)
|
||||
{
|
||||
if (head->next)
|
||||
head->next->prev = head->prev;
|
||||
else // no next -> tail is being deleted -> update TexCacheTail
|
||||
TexCacheTail = head->prev;
|
||||
if (head->prev)
|
||||
head->prev->next = head->next;
|
||||
else // no prev -> head is being deleted -> update TexCacheHead
|
||||
TexCacheHead = head->next;
|
||||
free(head);
|
||||
break;
|
||||
}
|
||||
|
||||
head = head->next;
|
||||
}
|
||||
|
||||
pTexInfo->downloaded = 0;
|
||||
}
|
||||
|
||||
|
||||
// -----------------+
|
||||
// Flush : flush OpenGL textures
|
||||
|
||||
+2
-6
@@ -63,10 +63,9 @@ void I_UpdateTime(fixed_t timescale)
|
||||
enterprecise = I_GetPreciseTime();
|
||||
elapsedseconds = (double)(enterprecise - oldenterprecise) / I_GetPrecisePrecision();
|
||||
tictimer += elapsedseconds;
|
||||
|
||||
while (tictimer >= (1.0 / ticratescaled))
|
||||
while (tictimer > 1.0/ticratescaled)
|
||||
{
|
||||
entertic ++;
|
||||
entertic += 1;
|
||||
tictimer -= 1.0/ticratescaled;
|
||||
}
|
||||
realtics = entertic - oldentertics;
|
||||
@@ -81,6 +80,3 @@ void I_UpdateTime(fixed_t timescale)
|
||||
g_time.timefrac = FLOAT_TO_FIXED(fractional);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -256,4 +256,4 @@ int LUA_BlockmapLib(lua_State *L)
|
||||
{
|
||||
lua_register(L, "searchBlockmap", lib_searchBlockmap);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user