Skip to content

Commit 4030cdf

Browse files
committed
renderer: assert that GLimp_LogComment() calls are always wrapped
1 parent d6c6078 commit 4030cdf

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/engine/renderer/tr_local.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,12 +3387,12 @@ inline bool GLimp_isLogging() {
33873387
}
33883388

33893389
// Never use GLimp_LogComment() directly, use the GLIMP_LOGCOMMENT() wrapper instead.
3390-
void GLimp_LogComment( std::string comment );
3390+
void GLimp_LogComment( std::string comment, bool wrapped = false );
33913391

33923392
#define GLIMP_LOGCOMMENT( ... ) { \
33933393
if ( GLimp_isLogging() ) \
33943394
{ \
3395-
GLimp_LogComment( Str::Format( __VA_ARGS__ ) ); \
3395+
GLimp_LogComment( Str::Format( __VA_ARGS__ ), true ); \
33963396
} \
33973397
}
33983398

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 )
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)