Skip to content

Commit 493091d

Browse files
committed
Minor fix-ups
1 parent c2c8487 commit 493091d

File tree

5 files changed

+13
-17
lines changed

5 files changed

+13
-17
lines changed

src/engine/renderer/GeometryCache.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
*/
3434
// GeometryCache.cpp
3535

36+
#include "common/Common.h"
37+
3638
#include "GeometryCache.h"
3739

3840
#include "tr_local.h"
@@ -59,9 +61,6 @@ void GeometryCache::FreeGLBuffers() {
5961
VAO.DelVAO();
6062
}
6163

62-
void GeometryCache::Free() {
63-
}
64-
6564
void GeometryCache::AllocBuffers() {
6665
VBO.BufferData( mapVerticesNumber * 8, nullptr, GL_STATIC_DRAW );
6766

@@ -89,7 +88,7 @@ void GeometryCache::AddMapGeometry( const uint32_t verticesNumber, const uint32_
8988
for ( const vertexAttributeSpec_t* spec = attrBegin; spec < attrEnd; spec++ ) {
9089
vboAttributeLayout_t& attr = VAO.attrs[spec->attrIndex];
9190

92-
CopyVertexAttribute( attr, *spec, mapVerticesNumber, ( byte* ) VBOVerts );
91+
R_CopyVertexAttribute( attr, *spec, mapVerticesNumber, ( byte* ) VBOVerts );
9392
}
9493
VBO.UnmapBuffer();
9594

src/engine/renderer/GeometryCache.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class GeometryCache {
4646
void InitGLBuffers();
4747
void FreeGLBuffers();
4848

49-
void Free();
50-
5149
void AllocBuffers();
5250
void AddMapGeometry( const uint32_t verticesNumber, const uint32_t indicesNumber,
5351
const vertexAttributeSpec_t* attrBegin,

src/engine/renderer/gl_shader.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,6 @@ class GLVAO {
15521552
for ( const vertexAttributeSpec_t* spec = attrBegin; spec < attrEnd; spec++ ) {
15531553
vboAttributeLayout_t& attr = attrs[spec->attrIndex];
15541554
ASSERT_NQ( spec->numComponents, 0U );
1555-
// vbo->attribBits |= 1 << spec->attrIndex;
15561555
attr.componentType = spec->componentStorageType;
15571556
if ( attr.componentType == GL_HALF_FLOAT && !glConfig2.halfFloatVertexAvailable ) {
15581557
attr.componentType = GL_FLOAT;
@@ -1561,7 +1560,7 @@ class GLVAO {
15611560
attr.normalize = spec->attrOptions & ATTR_OPTION_NORMALIZE ? GL_TRUE : GL_FALSE;
15621561

15631562
attr.ofs = ofs;
1564-
ofs += attr.numComponents * ComponentSize( attr.componentType );
1563+
ofs += attr.numComponents * R_ComponentSize( attr.componentType );
15651564
ofs = ( ofs + 3 ) & ~3; // 4 is minimum alignment for any vertex attribute
15661565

15671566
enabledAttrs |= 1 << spec->attrIndex;

src/engine/renderer/tr_local.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3716,8 +3716,8 @@ inline bool checkGLErrors()
37163716
37173717
============================================================
37183718
*/
3719-
uint32_t ComponentSize( GLenum type );
3720-
void CopyVertexAttribute( const vboAttributeLayout_t& attrib, const vertexAttributeSpec_t& spec,
3719+
uint32_t R_ComponentSize( GLenum type );
3720+
void R_CopyVertexAttribute( const vboAttributeLayout_t& attrib, const vertexAttributeSpec_t& spec,
37213721
uint32_t count, byte* interleavedData );
37223722

37233723
VBO_t *R_CreateStaticVBO(

src/engine/renderer/tr_vbo.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void R_SetVBOAttributeLayouts( VBO_t *vbo )
7575
}
7676
}
7777

78-
uint32_t ComponentSize( GLenum type )
78+
uint32_t R_ComponentSize( GLenum type )
7979
{
8080
switch ( type )
8181
{
@@ -91,7 +91,7 @@ uint32_t ComponentSize( GLenum type )
9191
return 4;
9292
}
9393

94-
Sys::Error( "VBO ComponentSize: unknown type %d", type );
94+
Sys::Error( "VBO R_ComponentSize: unknown type %d", type );
9595
}
9696

9797
#if defined( GL_ARB_buffer_storage ) && defined( GL_ARB_sync )
@@ -209,7 +209,7 @@ VBO_t *R_CreateDynamicVBO( const char *name, int numVertexes, uint32_t stateBits
209209
return vbo;
210210
}
211211

212-
void CopyVertexAttribute(
212+
void R_CopyVertexAttribute(
213213
const vboAttributeLayout_t &attrib, const vertexAttributeSpec_t &spec,
214214
uint32_t count, byte *interleavedData )
215215
{
@@ -226,7 +226,7 @@ void CopyVertexAttribute(
226226

227227
if ( attrib.componentType == spec.componentInputType )
228228
{
229-
uint32_t size = attrib.numComponents * ComponentSize( attrib.componentType );
229+
uint32_t size = attrib.numComponents * R_ComponentSize( attrib.componentType );
230230

231231
for ( uint32_t v = count; ; )
232232
{
@@ -333,7 +333,7 @@ VBO_t *R_CreateStaticVBO(
333333

334334
uint32_t &ofs = spec->attrOptions & ATTR_OPTION_HAS_FRAMES ? ofsFrameful : ofsFrameless;
335335
attrib.ofs = ofs;
336-
ofs += attrib.numComponents * ComponentSize( attrib.componentType );
336+
ofs += attrib.numComponents * R_ComponentSize( attrib.componentType );
337337
ofs = ( ofs + 3 ) & ~3; // 4 is minimum alignment for any vertex attribute
338338
}
339339

@@ -353,12 +353,12 @@ VBO_t *R_CreateStaticVBO(
353353
attrib.stride = ofsFrameful;
354354
attrib.frameOffset = numVerts * ofsFrameful;
355355
attrib.ofs += framelessSize;
356-
CopyVertexAttribute( attrib, *spec, numVerts * numFrames, interleavedData );
356+
R_CopyVertexAttribute( attrib, *spec, numVerts * numFrames, interleavedData );
357357
}
358358
else
359359
{
360360
attrib.stride = ofsFrameless;
361-
CopyVertexAttribute( attrib, *spec, numVerts, interleavedData );
361+
R_CopyVertexAttribute( attrib, *spec, numVerts, interleavedData );
362362
}
363363
}
364364

0 commit comments

Comments
 (0)