Fix menus not rendering in OpenGL

This commit is contained in:
UnknownShadow200 2020-02-10 20:21:50 +11:00
parent af948f0aed
commit 2a0cc4cf8c
3 changed files with 6 additions and 5 deletions

View File

@ -1072,10 +1072,11 @@ static void* tmpData;
static int tmpSize;
static void* FastAllocTempMem(int size) {
if (size <= tmpSize) return tmpData;
Mem_Free(tmpData);
if (size > tmpSize) {
Mem_Free(tmpData);
tmpData = Mem_Alloc(size, 1, "Gfx_AllocTempMemory");
}
tmpData = Mem_Alloc(size, 1, "Gfx_AllocTempMemory");
tmpSize = size;
return tmpData;
}

View File

@ -20,7 +20,7 @@ static GfxResourceID Particles_TexId, Particles_VB;
static RNGState rnd;
static cc_bool particle_hitTerrain;
void Particle_DoRender(Vec2* size, Vec3* pos, TextureRec* rec, PackedCol col, VertexP3fT2fC4b* v) {
void Particle_DoRender(const Vec2* size, const Vec3* pos, const TextureRec* rec, PackedCol col, VertexP3fT2fC4b* v) {
struct Matrix* view;
float sX, sY;
Vec3 centre;

View File

@ -18,7 +18,7 @@ struct Particle {
};
/* http://www.opengl-tutorial.org/intermediate-tutorials/billboards-particles/billboards/ */
void Particle_DoRender(Vec2* size, Vec3* pos, TextureRec* rec, PackedCol col, VertexP3fT2fC4b* vertices);
void Particle_DoRender(const Vec2* size, const Vec3* pos, const TextureRec* rec, PackedCol col, VertexP3fT2fC4b* vertices);
void Particles_Render(float t);
void Particles_Tick(struct ScheduledTask* task);
void Particles_BreakBlockEffect(IVec3 coords, BlockID oldBlock, BlockID block);