diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-07-08 12:00:15 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-07-08 12:00:15 +0000 |
commit | dd3cc6f8e84f03f626a88741474412d36e4d18ac (patch) | |
tree | b4c398b4f01aac329108b77008b62bdad9209820 /Game/Code/Classes/UGraphic.pas | |
parent | dce08a8771098ac1a56dd4548202454ab268e951 (diff) | |
download | usdx-dd3cc6f8e84f03f626a88741474412d36e4d18ac.tar.gz usdx-dd3cc6f8e84f03f626a88741474412d36e4d18ac.tar.xz usdx-dd3cc6f8e84f03f626a88741474412d36e4d18ac.zip |
Improved Error Logging and Benchmark:
Write US Version, date and time to files.
Added better Commandline Parameter Interpreter:
More than one parameter can be used at the same time
Many new, useful farameters: e.g. No error logging, Resolution change, FullScreen, DualScreen Mode, other Config File, other Score File and SongPath
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@274 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Classes/UGraphic.pas | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/Game/Code/Classes/UGraphic.pas b/Game/Code/Classes/UGraphic.pas index 205fa9fd..cf1a0c5a 100644 --- a/Game/Code/Classes/UGraphic.pas +++ b/Game/Code/Classes/UGraphic.pas @@ -178,7 +178,7 @@ procedure LoadScreens; implementation
-uses UMain, UIni, UDisplay, Graphics, Classes, Windows;
+uses UMain, UIni, UDisplay, UCommandLine, Graphics, Classes, Windows;
procedure LoadTextures;
var
@@ -332,8 +332,12 @@ var S: string;
I: integer;
W, H: integer;
+ Depth: Integer;
begin
- Screens := Ini.Screens + 1;
+ if (Params.Screens <> -1) then
+ Screens := Params.Screens + 1
+ else
+ Screens := Ini.Screens + 1;
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
@@ -341,28 +345,39 @@ begin SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
- S := IResolution[Ini.Resolution];
+ // If there is a resolution in Parameters, use it, else use the Ini value
+ I := Params.Resolution;
+ if (I <> -1) then
+ S := IResolution[I]
+ else
+ S := IResolution[Ini.Resolution];
+
I := Pos('x', S);
W := StrToInt(Copy(S, 1, I-1)) * Screens;
H := StrToInt(Copy(S, I+1, 1000));
- if ParamStr(1) = '-fsblack' then begin
+ {if ParamStr(1) = '-fsblack' then begin
W := 800;
H := 600;
end;
if ParamStr(1) = '-320x240' then begin
W := 320;
H := 240;
- end;
+ end; }
+
+ If (Params.Depth <> -1) then
+ Depth := Params.Depth
+ else
+ Depth := Ini.Depth;
Log.LogStatus('SDL_SetVideoMode', 'Initialize3D');
// SDL_SetRefreshrate(85);
// SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
- if (Ini.FullScreen = 0) and (ParamStr(1) <> '-fsblack') then
- screen := SDL_SetVideoMode(W, H, (Ini.Depth+1) * 16, SDL_OPENGL)
+ if (Ini.FullScreen = 0) and (Not Params.FullScreen) then
+ screen := SDL_SetVideoMode(W, H, (Depth+1) * 16, SDL_OPENGL)
else begin
- screen := SDL_SetVideoMode(W, H, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_FULLSCREEN);
+ screen := SDL_SetVideoMode(W, H, (Depth+1) * 16, SDL_OPENGL or SDL_FULLSCREEN);
SDL_ShowCursor(0);
end;
if (screen = nil) then begin
|