aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-09 01:28:01 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-09 01:28:01 +0000
commitc9a85e82f599515461536902f84a5b9222ef27a7 (patch)
tree963516709042f5533e56ae7f0ba0566a551e2b6a
parent43e235bb4c46af4aac73e980bc20607cf52323db (diff)
downloadusdx-c9a85e82f599515461536902f84a5b9222ef27a7.tar.gz
usdx-c9a85e82f599515461536902f84a5b9222ef27a7.tar.xz
usdx-c9a85e82f599515461536902f84a5b9222ef27a7.zip
backported the fix that allows USDX 1.0 tree to run in wine.
jira#USDX-124 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.01@479 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--Game/Code/Classes/UIni.pas12
1 files changed, 10 insertions, 2 deletions
diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas
index 846c0deb..82bae011 100644
--- a/Game/Code/Classes/UIni.pas
+++ b/Game/Code/Classes/UIni.pas
@@ -252,12 +252,20 @@ begin
SetLength(IResolution, 0);
Modes := SDL_ListModes(nil, SDL_OPENGL or SDL_FULLSCREEN); // Check if there are any modes available
repeat
-// Log.LogError(Format( ' %d x %d', [ modes^.w, modes^.h ] ) );
SetLength(IResolution, Length(IResolution) + 1);
IResolution[High(IResolution)] := IntToStr(Modes^.w) + 'x' + IntToStr(Modes^.h);
Inc(Modes);
until Modes^ = nil;
+ // if no modes were set, then failback to 800x600
+ // as per http://sourceforge.net/forum/message.php?msg_id=4544965
+ // THANKS : linnex at users.sourceforge.net
+ if Length(IResolution) < 1 then
+ begin
+ SetLength(IResolution, Length(IResolution) + 1);
+ IResolution[High(IResolution)] := IntToStr(800) + 'x' + IntToStr(600);
+ end;
+
// reverse order
for I := 0 to (Length(IResolution) div 2) - 1 do begin
S := IResolution[I];
@@ -761,4 +769,4 @@ begin
end;
end;
-end. \ No newline at end of file
+end.