diff --git a/src/gl/renderer/gl_renderer.cpp b/src/gl/renderer/gl_renderer.cpp index 59bae9e0b..1c87a62e8 100644 --- a/src/gl/renderer/gl_renderer.cpp +++ b/src/gl/renderer/gl_renderer.cpp @@ -66,7 +66,6 @@ #include "gl/textures/gl_material.h" #include "gl/textures/gl_samplers.h" #include "gl/utility/gl_clock.h" -#include "gl/utility/gl_templates.h" #include "gl/models/gl_models.h" #include "gl/dynlights/gl_lightbuffer.h" #include "r_videoscale.h" diff --git a/src/gl/scene/gl_drawinfo.cpp b/src/gl/scene/gl_drawinfo.cpp index c2d79b3ca..e546c33d9 100644 --- a/src/gl/scene/gl_drawinfo.cpp +++ b/src/gl/scene/gl_drawinfo.cpp @@ -44,7 +44,6 @@ #include "gl/renderer/gl_renderstate.h" #include "gl/textures/gl_material.h" #include "gl/utility/gl_clock.h" -#include "gl/utility/gl_templates.h" #include "gl/shaders/gl_shader.h" #include "gl/stereo3d/scoped_color_mask.h" #include "gl/renderer/gl_quaddrawer.h" diff --git a/src/gl/scene/gl_flats.cpp b/src/gl/scene/gl_flats.cpp index 98f5afa80..6f7c7a38b 100644 --- a/src/gl/scene/gl_flats.cpp +++ b/src/gl/scene/gl_flats.cpp @@ -54,7 +54,6 @@ #include "gl/textures/gl_material.h" #include "gl/utility/gl_clock.h" #include "gl/utility/gl_convert.h" -#include "gl/utility/gl_templates.h" #include "gl/renderer/gl_quaddrawer.h" #ifdef _DEBUG diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index ed3812766..d2d0a8b6e 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -56,7 +56,6 @@ #include "gl/stereo3d/scoped_color_mask.h" #include "gl/textures/gl_material.h" #include "gl/utility/gl_clock.h" -#include "gl/utility/gl_templates.h" //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- diff --git a/src/gl/scene/gl_portal.h b/src/gl/scene/gl_portal.h index 4eade59d2..6b6f96668 100644 --- a/src/gl/scene/gl_portal.h +++ b/src/gl/scene/gl_portal.h @@ -37,10 +37,8 @@ #define __GL_PORTAL_H #include "tarray.h" -//#include "gl/gl_intern.h" #include "gl/renderer/gl_renderer.h" #include "gl/scene/gl_drawinfo.h" -#include "gl/utility/gl_templates.h" #include "gl/data/gl_data.h" struct GLHorizonInfo diff --git a/src/gl/scene/gl_renderhacks.cpp b/src/gl/scene/gl_renderhacks.cpp index 827842cfd..605d6bfd3 100644 --- a/src/gl/scene/gl_renderhacks.cpp +++ b/src/gl/scene/gl_renderhacks.cpp @@ -39,13 +39,10 @@ #include "gl/scene/gl_portal.h" #include "gl/scene/gl_scenedrawer.h" #include "gl/utility/gl_clock.h" -#include "gl/utility/gl_templates.h" // This is for debugging maps. -FreeList SSR_List; - // profiling data static int totalupper, totallower; static int lowershcount, uppershcount; @@ -62,7 +59,7 @@ void FDrawInfo::ClearBuffers() { gl_subsectorrendernode * n = node; node = node->next; - SSR_List.Release(n); + delete n; } } otherfloorplanes.Clear(); @@ -74,7 +71,7 @@ void FDrawInfo::ClearBuffers() { gl_subsectorrendernode * n = node; node = node->next; - SSR_List.Release(n); + delete n; } } otherceilingplanes.Clear(); @@ -507,7 +504,7 @@ void FDrawInfo::HandleMissingTextures() for (unsigned int j = 0; j < HandledSubsectors.Size(); j++) { - gl_subsectorrendernode * node = SSR_List.GetNew(); + gl_subsectorrendernode * node = new gl_subsectorrendernode; node->sub = HandledSubsectors[j]; AddOtherCeilingPlane(sec->sectornum, node); @@ -551,7 +548,7 @@ void FDrawInfo::HandleMissingTextures() for (unsigned int j = 0; j < HandledSubsectors.Size(); j++) { - gl_subsectorrendernode * node = SSR_List.GetNew(); + gl_subsectorrendernode * node = new gl_subsectorrendernode; node->sub = HandledSubsectors[j]; AddOtherCeilingPlane(fakesector->sectornum, node); } @@ -579,7 +576,7 @@ void FDrawInfo::HandleMissingTextures() for (unsigned int j = 0; j < HandledSubsectors.Size(); j++) { - gl_subsectorrendernode * node = SSR_List.GetNew(); + gl_subsectorrendernode * node = new gl_subsectorrendernode; node->sub = HandledSubsectors[j]; AddOtherFloorPlane(sec->sectornum, node); } @@ -622,7 +619,7 @@ void FDrawInfo::HandleMissingTextures() for (unsigned int j = 0; j < HandledSubsectors.Size(); j++) { - gl_subsectorrendernode * node = SSR_List.GetNew(); + gl_subsectorrendernode * node = new gl_subsectorrendernode; node->sub = HandledSubsectors[j]; AddOtherFloorPlane(fakesector->sectornum, node); } @@ -955,7 +952,7 @@ void FDrawInfo::HandleHackedSubsectors() { for(unsigned int j=0;jsub = HandledSubsectors[j]; AddOtherFloorPlane(sub->render_sector->sectornum, node); @@ -985,7 +982,7 @@ void FDrawInfo::HandleHackedSubsectors() { for(unsigned int j=0;jsub = HandledSubsectors[j]; AddOtherCeilingPlane(sub->render_sector->sectornum, node); @@ -1159,7 +1156,7 @@ void FDrawInfo::ProcessSectorStacks() if (sec->GetAlpha(sector_t::ceiling) != 0 && sec->GetTexture(sector_t::ceiling) != skyflatnum) { - gl_subsectorrendernode * node = SSR_List.GetNew(); + gl_subsectorrendernode * node = new gl_subsectorrendernode; node->sub = sub; AddOtherCeilingPlane(sec->sectornum, node); } @@ -1205,7 +1202,7 @@ void FDrawInfo::ProcessSectorStacks() if (sec->GetAlpha(sector_t::floor) != 0 && sec->GetTexture(sector_t::floor) != skyflatnum) { - gl_subsectorrendernode * node = SSR_List.GetNew(); + gl_subsectorrendernode * node = new gl_subsectorrendernode; node->sub = sub; AddOtherFloorPlane(sec->sectornum, node); } diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index cfc108a81..0c6d5b07e 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -68,7 +68,6 @@ #include "gl/textures/gl_material.h" #include "gl/utility/gl_clock.h" #include "gl/utility/gl_convert.h" -#include "gl/utility/gl_templates.h" //========================================================================== // diff --git a/src/gl/scene/gl_vertex.cpp b/src/gl/scene/gl_vertex.cpp index d693227d5..9d364e886 100644 --- a/src/gl/scene/gl_vertex.cpp +++ b/src/gl/scene/gl_vertex.cpp @@ -34,7 +34,6 @@ #include "gl/scene/gl_portal.h" #include "gl/shaders/gl_shader.h" #include "gl/textures/gl_material.h" -#include "gl/utility/gl_templates.h" EXTERN_CVAR(Bool, gl_seamless) diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index c78c23eff..33ba19db8 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -45,7 +45,6 @@ #include "gl/scene/gl_scenedrawer.h" #include "gl/textures/gl_material.h" #include "gl/utility/gl_clock.h" -#include "gl/utility/gl_templates.h" #include "gl/shaders/gl_shader.h" diff --git a/src/gl/scene/gl_walls_draw.cpp b/src/gl/scene/gl_walls_draw.cpp index beeb103a0..17164bc49 100644 --- a/src/gl/scene/gl_walls_draw.cpp +++ b/src/gl/scene/gl_walls_draw.cpp @@ -45,7 +45,6 @@ #include "gl/shaders/gl_shader.h" #include "gl/textures/gl_material.h" #include "gl/utility/gl_clock.h" -#include "gl/utility/gl_templates.h" #include "gl/renderer/gl_quaddrawer.h" EXTERN_CVAR(Bool, gl_seamless) diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index 772387a2d..be21e49d9 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -45,7 +45,6 @@ #include "gl/data/gl_data.h" #include "gl/textures/gl_hwtexture.h" #include "gl/utility/gl_clock.h" -#include "gl/utility/gl_templates.h" #include "gl/gl_functions.h" #include "gl/data/gl_vertexbuffer.h" #include "gl_debug.h" diff --git a/src/gl/system/gl_wipe.cpp b/src/gl/system/gl_wipe.cpp index 25811cb91..f00dcfeb0 100644 --- a/src/gl/system/gl_wipe.cpp +++ b/src/gl/system/gl_wipe.cpp @@ -41,7 +41,6 @@ #include "gl/shaders/gl_shader.h" #include "gl/textures/gl_material.h" #include "gl/textures/gl_samplers.h" -#include "gl/utility/gl_templates.h" #include "gl/data/gl_vertexbuffer.h" diff --git a/src/gl/textures/gl_texture.h b/src/gl/textures/gl_texture.h deleted file mode 100644 index 22b51610f..000000000 --- a/src/gl/textures/gl_texture.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __GL_TEXTURE_H__ -#define __GL_TEXTURE_H__ - -#include "r_defs.h" -#include "textures/textures.h" - - -#endif // __GL_HQRESIZE_H__ - diff --git a/src/gl/utility/gl_templates.h b/src/gl/utility/gl_templates.h deleted file mode 100644 index 1ebef1f48..000000000 --- a/src/gl/utility/gl_templates.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef __GL_BASIC -#define __GL_BASIC - -#include -#include "stats.h" - - -// Disabled because it doesn't work and only accumulates large portions of blocked heap -// without providing any relevant performance boost. -template struct FreeList -{ - //T * freelist; - - T * GetNew() - { - /* - if (freelist) - { - T * n=freelist; - freelist=*((T**)n); - return new ((void*)n) T; - } - */ - return new T; - } - - void Release(T * node) - { - /* - node->~T(); - *((T**)node) = freelist; - freelist=node; - */ - delete node; - } - - ~FreeList() - { - /* - while (freelist!=NULL) - { - T * n = freelist; - freelist=*((T**)n); - delete n; - } - */ - } -}; - -template class UniqueList -{ - TArray Array; - FreeList TheFreeList; - -public: - - T * Get(T * t) - { - for(unsigned i=0;i class UniqueList +{ + TArray Array; + +public: + + T * Get(T * t) + { + for (unsigned i = 0; i