diff options
author | Andrey Nazarov <skuller@skuller.net> | 2007-12-02 18:33:17 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2007-12-02 18:33:17 +0000 |
commit | 54124502cfb00c497ed24cbc8a9afefff1ba1b3a (patch) | |
tree | 981e7fcfbea28b5e1f9d913e56752bbf5750b89c /source/ui_loading.c | |
parent | 93bdbd9e43c4616d2fa647374bc7d43fa5cc0220 (diff) |
Implemented UI scaling, added ui_scale variable.
Draw_ClipRect now operates correctly on scaled coordinates.
Diffstat (limited to 'source/ui_loading.c')
-rw-r--r-- | source/ui_loading.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/source/ui_loading.c b/source/ui_loading.c index 5f7e61d..1429c69 100644 --- a/source/ui_loading.c +++ b/source/ui_loading.c @@ -42,26 +42,31 @@ void UI_DrawLoading( int realtime ) { client.GetClientStatus( &loadingStatus ); + if( uis.glconfig.renderer == GL_RENDERER_SOFTWARE ) { + ref.SetClipRect( DRAW_CLIP_MASK, &uis.clipRect ); + } else { + ref.SetScale( &uis.scale ); + } + #if 0 if( loadingStatus.mapname[0] ) { qhandle_t hPic; Com_sprintf( buffer, sizeof( buffer ), "/levelshots/%s.jpg", loadingStatus.mapname ); if( ( hPic = ref.RegisterPic( buffer ) ) != 0 ) { - ref.DrawStretchPic( 0, 0, uis.glconfig.vidWidth, uis.glconfig.vidHeight, hPic ); + ref.DrawStretchPic( 0, 0, uis.width, uis.height, hPic ); } else { - ref.DrawFill( 0, 0, uis.glconfig.vidWidth, uis.glconfig.vidHeight, 0x00 ); + ref.DrawFill( 0, 0, uis.width, uis.height, 0x00 ); } } else #endif - { - ref.DrawFill( 0, 0, uis.glconfig.vidWidth, uis.glconfig.vidHeight, 0x00 ); - } + ref.DrawFill( 0, 0, uis.width, uis.height, 0x00 ); - x = uis.glconfig.vidWidth / 2; + x = uis.width / 2; y = 8; - - Q_concat( buffer, sizeof( buffer ), loadingStatus.demoplayback ? "Playing back " : "Connecting to ", loadingStatus.servername, NULL ); + + s = loadingStatus.demoplayback ? "Playing back " : "Connecting to "; + Q_concat( buffer, sizeof( buffer ), s, loadingStatus.servername, NULL ); UI_DrawString( x, y, NULL, UI_CENTER|UI_DROPSHADOW, buffer ); y += 40; @@ -91,7 +96,7 @@ void UI_DrawLoading( int realtime ) { s = "Awaiting server frame..."; break; default: - Com_Error( ERR_DROP, "SCR_DrawLoading: bad cls.state %i", loadingStatus.connState ); + Com_Error( ERR_DROP, "%s: bad cls.state %i", __func__, loadingStatus.connState ); break; } UI_DrawString( x, y, NULL, UI_CENTER|UI_DROPSHADOW, s ); @@ -105,5 +110,11 @@ void UI_DrawLoading( int realtime ) { if( loadingStatus.loadingString[0] ) { UI_DrawString( x, y, colorRed, UI_CENTER|UI_DROPSHADOW|UI_MULTILINE, loadingStatus.loadingString ); } + + if( uis.glconfig.renderer == GL_RENDERER_SOFTWARE ) { + ref.SetClipRect( DRAW_CLIP_DISABLED, NULL ); + } else { + ref.SetScale( NULL ); + } } |