aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UIni.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-02-26 07:00:58 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-02-26 07:00:58 +0000
commita265788184832a725213c0fc87372c7df42146d1 (patch)
tree6ef43b4cc71b0c6f247732f3d1d0e87a9e558118 /Game/Code/Classes/UIni.pas
parent318eae8dadf86fe5b64697775ebea6ad7f748c96 (diff)
downloadusdx-a265788184832a725213c0fc87372c7df42146d1.tar.gz
usdx-a265788184832a725213c0fc87372c7df42146d1.tar.xz
usdx-a265788184832a725213c0fc87372c7df42146d1.zip
added patch to toggle full screen with F11
( and tried Alt Enter. but not working yet ) also did some investigation into SDL Video modes on linux note this bug : https://bugs.launchpad.net/ubuntu/+source/libsdl1.2/+bug/14044 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@888 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UIni.pas48
1 files changed, 36 insertions, 12 deletions
diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas
index 4ac67cda..4de18ba3 100644
--- a/Game/Code/Classes/UIni.pas
+++ b/Game/Code/Classes/UIni.pas
@@ -190,7 +190,8 @@ var
I, I2, I3: integer;
S: string;
Modes: PPSDL_Rect;
- SR: TSearchRec; //Skin List Patch
+ SR: TSearchRec; //Skin List Patch
+ lFileName : String;
function GetFileName (S: String):String;
begin
@@ -201,14 +202,19 @@ var
begin
GamePath := Platform.GetGameUserPath;
+ Log.LogStatus( 'GamePath : ' +GamePath , '' );
+
if (Params.ConfigFile <> '') then
try
- IniFile := TMemIniFile.Create(Params.ConfigFile);
+ lFileName := Params.ConfigFile;
except
- IniFile := TMemIniFile.Create(GamePath + 'config.ini');
+ lFileName := GamePath + 'config.ini';
end
else
- IniFile := TMemIniFile.Create(GamePath + 'config.ini');
+ lFileName := GamePath + 'config.ini';
+
+ Log.LogStatus( 'Using config : ' +lFileName , '');
+ IniFile := TMemIniFile.Create( lFileName );
// Name
@@ -273,19 +279,37 @@ begin
// Resolution
SetLength(IResolution, 0);
- Modes := SDL_ListModes(nil, SDL_OPENGL or SDL_FULLSCREEN); // Check if there are any modes available
- while assigned( Modes^ ) do //this should solve the biggest wine problem | THANKS Linnex (11.11.07)
- begin
- SetLength(IResolution, Length(IResolution) + 1);
- IResolution[High(IResolution)] := IntToStr(Modes^.w) + 'x' + IntToStr(Modes^.h);
- Inc(Modes);
- end;
+ Modes := SDL_ListModes(nil, SDL_OPENGL or SDL_RESIZABLE ) ; // Check if there are any modes available
+// Modes := SDL_ListModes(nil, SDL_OPENGL or SDL_FULLSCREEN or SDL_RESIZABLE); // Check if there are any modes available
+ if integer( Modes ) = 0 then
+ begin
+ Log.LogStatus( 'No resolutions Found' , 'Video');
+ end
+ else
+ if integer( Modes ) = -1 then
+ begin
+ Log.LogStatus( 'ANY resolutions can be used' , 'Video');
+ // Interesting bug here on linux ...
+ // https://bugs.launchpad.net/ubuntu/+source/libsdl1.2/+bug/14044
+ end
+ else
+ begin
+ while assigned( Modes^ ) do //this should solve the biggest wine problem | THANKS Linnex (11.11.07)
+ begin
+ Log.LogStatus( 'Found Video Mode : ' + IntToStr(Modes^.w) + 'x' + IntToStr(Modes^.h) , 'Video');
+ SetLength(IResolution, Length(IResolution) + 1);
+ IResolution[High(IResolution)] := IntToStr(Modes^.w) + 'x' + IntToStr(Modes^.h);
+ Inc(Modes);
+ end;
+ end;
+
// 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
+ begin
+ Log.LogStatus( 'Found Video Mode : NONE !!! ( Defaulted to 800 x 600 )', 'Video');
SetLength(IResolution, Length(IResolution) + 1);
IResolution[High(IResolution)] := IntToStr(800) + 'x' + IntToStr(600);
Log.LogStatus('SDL_ListModes Defaulted Res To : ' + IResolution[High(IResolution)] , 'Graphics - Resolutions');