Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into android
Browse files Browse the repository at this point in the history
  • Loading branch information
Velaron committed Feb 16, 2024
2 parents 34f2f8a + 2c0d6e0 commit fae013d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
5 changes: 3 additions & 2 deletions engine/client/cl_font.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ qboolean Con_LoadVariableWidthFont( const char *fontname, cl_font_t *font, float

font->type = FONT_VARIABLE;
font->valid = true;
font->scale = scale;
font->scale = scale ? scale : 1.0f;
font->rendermode = rendermode;
font->charHeight = Q_rint( src.rowheight * scale );

Expand Down Expand Up @@ -205,7 +205,8 @@ int CL_DrawCharacter( float x, float y, int number, rgba_t color, cl_font_t *fon
return font->charWidths[number];

rc = &font->fontRc[number];
if( font->scale <= 1.0f || REF_GET_PARM( PARM_TEX_FILTERING, font->hFontTexture ))

if( font->scale <= 1.f || !REF_GET_PARM( PARM_TEX_FILTERING, font->hFontTexture ))
half = 0;

s1 = ((float)rc->left + half ) / texw;
Expand Down
14 changes: 8 additions & 6 deletions engine/client/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -2191,6 +2191,8 @@ INTERNAL RESOURCE
*/
void Con_VidInit( void )
{
const uint flags = TF_IMAGE|TF_ALLOW_NEAREST;

if( !con.historyLoaded )
{
Con_LoadHistory( &con.history );
Expand All @@ -2210,28 +2212,28 @@ void Con_VidInit( void )
{
// trying to load truecolor image first
if( FS_FileExists( "gfx/shell/conback.bmp", false ) || FS_FileExists( "gfx/shell/conback.tga", false ))
con.background = ref.dllFuncs.GL_LoadTexture( "gfx/shell/conback", NULL, 0, TF_IMAGE );
con.background = ref.dllFuncs.GL_LoadTexture( "gfx/shell/conback", NULL, 0, flags );

if( !con.background )
{
if( FS_FileExists( "cached/conback640", false ))
con.background = ref.dllFuncs.GL_LoadTexture( "cached/conback640", NULL, 0, TF_IMAGE );
con.background = ref.dllFuncs.GL_LoadTexture( "cached/conback640", NULL, 0, flags );
else if( FS_FileExists( "cached/conback", false ))
con.background = ref.dllFuncs.GL_LoadTexture( "cached/conback", NULL, 0, TF_IMAGE );
con.background = ref.dllFuncs.GL_LoadTexture( "cached/conback", NULL, 0, flags );
}
}
else
{
// trying to load truecolor image first
if( FS_FileExists( "gfx/shell/loading.bmp", false ) || FS_FileExists( "gfx/shell/loading.tga", false ))
con.background = ref.dllFuncs.GL_LoadTexture( "gfx/shell/loading", NULL, 0, TF_IMAGE );
con.background = ref.dllFuncs.GL_LoadTexture( "gfx/shell/loading", NULL, 0, flags );

if( !con.background )
{
if( FS_FileExists( "cached/loading640", false ))
con.background = ref.dllFuncs.GL_LoadTexture( "cached/loading640", NULL, 0, TF_IMAGE );
con.background = ref.dllFuncs.GL_LoadTexture( "cached/loading640", NULL, 0, flags );
else if( FS_FileExists( "cached/loading", false ))
con.background = ref.dllFuncs.GL_LoadTexture( "cached/loading", NULL, 0, TF_IMAGE );
con.background = ref.dllFuncs.GL_LoadTexture( "cached/loading", NULL, 0, flags );
}
}

Expand Down
6 changes: 3 additions & 3 deletions engine/server/sv_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ sv_client_t *SV_ClientById( int id )

ASSERT( id >= 0 );

for( i = 0, cl = svs.clients; i < svgame.globals->maxClients; i++, cl++ )
for( i = 0, cl = svs.clients; cl && i < svgame.globals->maxClients; i++, cl++ )
{
if( !cl->state )
continue;
Expand All @@ -819,7 +819,7 @@ sv_client_t *SV_ClientByName( const char *name )
if( !COM_CheckString( name ))
return NULL;

for( i = 0, cl = svs.clients; i < svgame.globals->maxClients; i++, cl++ )
for( i = 0, cl = svs.clients; cl && i < svgame.globals->maxClients; i++, cl++ )
{
if( !cl->state )
continue;
Expand Down Expand Up @@ -3458,7 +3458,7 @@ static void SV_ParseVoiceData( sv_client_t *cl, sizebuf_t *msg )

MSG_ReadBytes( msg, received, size );

if( !sv_voiceenable.value )
if( !sv_voiceenable.value || svs.maxclients <= 1 )
return;

for( i = 0, cur = svs.clients; i < svs.maxclients; i++, cur++ )
Expand Down
3 changes: 2 additions & 1 deletion engine/server/sv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ static void SV_CreateBaseline( void )
int delta_type;
int entnum;

SV_WriteVoiceCodec( &sv.signon );
if( svs.maxclients > 1 )
SV_WriteVoiceCodec( &sv.signon );

if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE ))
playermodel = SV_ModelIndex( DEFAULT_PLAYER_PATH_QUAKE );
Expand Down

0 comments on commit fae013d

Please sign in to comment.