Skip to content

Commit 2fc3059

Browse files
committed
renderer: assert that GLimp_LogComment() calls are always wrapped
1 parent 8d05c89 commit 2fc3059

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/engine/renderer/tr_local.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3389,12 +3389,12 @@ inline bool checkGLErrors()
33893389
#define GLIMP_LOGCOMMENT( ... ) { \
33903390
if ( GLimp_isLogging() ) \
33913391
{ \
3392-
GLimp_LogComment( Str::Format( __VA_ARGS__ ) ); \
3392+
GLimp_LogComment( Str::Format( __VA_ARGS__ ), true ); \
33933393
} \
33943394
}
33953395

33963396
// Never use GLimp_LogComment() directly, use GLIMP_LOGCOMMENT() wrapper instead.
3397-
void GLimp_LogComment( std::string comment );
3397+
void GLimp_LogComment( std::string comment, bool wrapped );
33983398

33993399
/*
34003400
====================================================================

src/engine/sys/sdl_glimp.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3003,8 +3003,15 @@ void GLimp_HandleCvars()
30033003
}
30043004

30053005
// Never use GLimp_LogComment() directly, use the GLIMP_LOGCOMMENT() wrapper instead.
3006-
void GLimp_LogComment( std::string comment )
3006+
void GLimp_LogComment( std::string comment, bool wrapped = false )
30073007
{
3008+
ASSERT( wrapped )
3009+
3010+
if ( !wrapped )
3011+
{
3012+
Log::Warn( "Unwrapped GLimp_LogComment() call: %s", comment );
3013+
}
3014+
30083015
static char buf[ 4096 ];
30093016

30103017
Q_snprintf( buf, sizeof( buf ), "%s\n", comment.c_str() );

0 commit comments

Comments
 (0)