mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
- moved contents of gl_templates.h to files outside of gl/
This commit is contained in:
parent
e49cd2cb83
commit
1461059dae
16 changed files with 48 additions and 118 deletions
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<gl_subsectorrendernode> 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;j<HandledSubsectors.Size();j++)
|
||||
{
|
||||
gl_subsectorrendernode * node = SSR_List.GetNew();
|
||||
gl_subsectorrendernode * node = new gl_subsectorrendernode;
|
||||
|
||||
node->sub = HandledSubsectors[j];
|
||||
AddOtherFloorPlane(sub->render_sector->sectornum, node);
|
||||
|
@ -985,7 +982,7 @@ void FDrawInfo::HandleHackedSubsectors()
|
|||
{
|
||||
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(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);
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef __GL_TEXTURE_H__
|
||||
#define __GL_TEXTURE_H__
|
||||
|
||||
#include "r_defs.h"
|
||||
#include "textures/textures.h"
|
||||
|
||||
|
||||
#endif // __GL_HQRESIZE_H__
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
#ifndef __GL_BASIC
|
||||
#define __GL_BASIC
|
||||
|
||||
#include <new>
|
||||
#include "stats.h"
|
||||
|
||||
|
||||
// Disabled because it doesn't work and only accumulates large portions of blocked heap
|
||||
// without providing any relevant performance boost.
|
||||
template <class T> 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 T> class UniqueList
|
||||
{
|
||||
TArray<T*> Array;
|
||||
FreeList<T> TheFreeList;
|
||||
|
||||
public:
|
||||
|
||||
T * Get(T * t)
|
||||
{
|
||||
for(unsigned i=0;i<Array.Size();i++)
|
||||
{
|
||||
if (!memcmp(t, Array[i], sizeof(T))) return Array[i];
|
||||
}
|
||||
T * newo=TheFreeList.GetNew();
|
||||
|
||||
*newo=*t;
|
||||
Array.Push(newo);
|
||||
return newo;
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
for(unsigned i=0;i<Array.Size();i++) TheFreeList.Release(Array[i]);
|
||||
Array.Clear();
|
||||
}
|
||||
|
||||
~UniqueList()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
|
@ -50,12 +50,10 @@
|
|||
#include "gl/system/gl_system.h"
|
||||
#include "r_defs.h"
|
||||
#include "gl/gl_functions.h"
|
||||
//#include "gl/gl_intern.h"
|
||||
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl/system/gl_framebuffer.h"
|
||||
#include "gl/shaders/gl_shader.h"
|
||||
#include "gl/utility/gl_templates.h"
|
||||
#include "gl/textures/gl_material.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
|
||||
|
|
38
src/tarray.h
38
src/tarray.h
|
@ -1221,3 +1221,41 @@ protected:
|
|||
hash_t Position;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// an array to hold a small number of unique entries
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
template<class T> class UniqueList
|
||||
{
|
||||
TArray<T*> Array;
|
||||
|
||||
public:
|
||||
|
||||
T * Get(T * t)
|
||||
{
|
||||
for (unsigned i = 0; i<Array.Size(); i++)
|
||||
{
|
||||
if (!memcmp(t, Array[i], sizeof(T))) return Array[i];
|
||||
}
|
||||
T * newo = new T;
|
||||
|
||||
*newo = *t;
|
||||
Array.Push(newo);
|
||||
return newo;
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
for (unsigned i = 0; i<Array.Size(); i++) delete Array[i];
|
||||
Array.Clear();
|
||||
}
|
||||
|
||||
~UniqueList()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue