diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-05-31 14:10:42 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-05-31 14:10:42 +0000 |
commit | 257854c587f0876a912cfbeb4fe0a30970d25a9b (patch) | |
tree | 43a87074b46eb6211e8c103510f9b2261fe2d08b /src/base/UGraphic.pas | |
parent | 1d3a28457fb5ff32d55435e31a5697fd383366d4 (diff) | |
download | usdx-257854c587f0876a912cfbeb4fe0a30970d25a9b.tar.gz usdx-257854c587f0876a912cfbeb4fe0a30970d25a9b.tar.xz usdx-257854c587f0876a912cfbeb4fe0a30970d25a9b.zip |
merged (experimental) mouse support patch by d0ccrazy
some changes to patch
- implemented software cursor (texturable)
- option to turn of mouse support or switch between hardware and software cursor
- hide software cursor if there is no mouse activity for 5 seconds
- soft fade in and out for software cursor
- some test cursor-textures for deluxe theme (mog pls change these horible looking images)
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1789 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base/UGraphic.pas')
-rw-r--r-- | src/base/UGraphic.pas | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/base/UGraphic.pas b/src/base/UGraphic.pas index 82cb3c50..818e49aa 100644 --- a/src/base/UGraphic.pas +++ b/src/base/UGraphic.pas @@ -199,10 +199,13 @@ var Tex_Score_Ratings : array [0..7] of TTexture; - //Arrows for SelectSlide + // arrows for SelectSlide Tex_SelectS_ArrowL: TTexture; Tex_SelectS_ArrowR: TTexture; - + + // textures for software mouse cursor + Tex_Cursor_Unpressed: TTexture; + Tex_Cursor_Pressed: TTexture; const Skin_BGColorR = 1; Skin_BGColorG = 1; @@ -335,6 +338,13 @@ begin Tex_SelectS_ArrowL := Texture.LoadTexture(Skin.GetTextureFileName('Select_ArrowLeft'), TEXTURE_TYPE_TRANSPARENT, 0); Tex_SelectS_ArrowR := Texture.LoadTexture(Skin.GetTextureFileName('Select_ArrowRight'), TEXTURE_TYPE_TRANSPARENT, 0); + Tex_Cursor_Unpressed := Texture.LoadTexture(Skin.GetTextureFileName('Cursor'), TEXTURE_TYPE_TRANSPARENT, 0); + + if (Skin.GetTextureFileName('Cursor_Pressed') <> '') then + Tex_Cursor_Pressed := Texture.LoadTexture(Skin.GetTextureFileName('Cursor_Pressed'), TEXTURE_TYPE_TRANSPARENT, 0) + else + Tex_Cursor_Pressed.TexNum := 0; + //TimeBar mod Tex_TimeProgress := Texture.LoadTexture(Skin.GetTextureFileName('TimeBar')); //eoa TimeBar mod @@ -492,6 +502,7 @@ begin Log.LogStatus('TDisplay.Create', 'UGraphic.Initialize3D'); Display := TDisplay.Create; + //Display.SetCursor; //Log.BenchmarkEnd(2); Log.LogBenchmark('====> Creating Display', 2); @@ -624,15 +635,15 @@ begin begin Log.LogStatus('SDL_SetVideoMode', 'Set Video Mode... Full Screen'); screen := SDL_SetVideoMode(W, H, (Depth+1) * 16, SDL_OPENGL or SDL_FULLSCREEN ); - SDL_ShowCursor(0); end else begin Log.LogStatus('SDL_SetVideoMode', 'Set Video Mode... Windowed'); screen := SDL_SetVideoMode(W, H, 0, SDL_OPENGL or SDL_RESIZABLE); - SDL_ShowCursor(1); end; + SDL_ShowCursor(0); + if (screen = nil) then begin Log.LogCritical('SDL_SetVideoMode Failed', 'Initialize3D'); |