hedgewars/uStore.pas
changeset 3895 e7c202c08ac1
parent 3881 e570268a9d52
child 3897 27e115fa1143
--- a/hedgewars/uStore.pas	Wed Sep 22 02:22:15 2010 +0200
+++ b/hedgewars/uStore.pas	Wed Sep 22 23:46:38 2010 +0200
@@ -732,8 +732,13 @@
 end;
 
 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
+var scale: GLfloat;
 begin
-DrawTexture(X - Source^.w shr 1, Top, Source)
+    if (Source^.w + 20) > cScreenWidth then
+        scale:= cScreenWidth / (Source^.w + 20)
+    else
+        scale:= 1.0;
+    DrawTexture(X - round((Source^.w * scale) div 2, Top, Source, scale)
 end;
 
 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);