aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
authormogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-07-12 03:23:24 +0000
committermogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-07-12 03:23:24 +0000
commit8121a296beadb6117aa51353c642aab92cf19151 (patch)
treef03f4da54eae3e5f895a932e6ca3de53d7e82058 /Game/Code/Classes
parentde20f99f49e0091e72b2662d41679c0ed784bf10 (diff)
downloadusdx-8121a296beadb6117aa51353c642aab92cf19151.tar.gz
usdx-8121a296beadb6117aa51353c642aab92cf19151.tar.xz
usdx-8121a296beadb6117aa51353c642aab92cf19151.zip
Text has a new property -> Z (default is 0)
Selects on the options have been exchanged for SelectSlides (OptionsScreens are looking less broken (more to come)) Solmization has been banned from the options (it's still available via config.ini and is working) Uncommented poc ttf code [Back] button in OptionsRecord is skineable again git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1183 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/TextGL.pas70
-rw-r--r--Game/Code/Classes/UThemes.pas106
2 files changed, 95 insertions, 81 deletions
diff --git a/Game/Code/Classes/TextGL.pas b/Game/Code/Classes/TextGL.pas
index 2c29af59..2e186793 100644
--- a/Game/Code/Classes/TextGL.pas
+++ b/Game/Code/Classes/TextGL.pas
@@ -29,6 +29,7 @@ procedure glPrintLetterCut(letter: char; Start, Finish: real);
procedure glPrint(text: pchar); // custom GL "Print" routine
procedure glPrintCut(text: pchar);
procedure SetFontPos(X, Y: real); // sets X and Y
+procedure SetFontZ(Z: real); // sets Z
procedure SetFontSize(Size: real);
procedure SetFontStyle(Style: integer); // sets active font style (normal, bold, etc)
procedure SetFontItalic(Enable: boolean); // sets italic type letter (works for all fonts)
@@ -36,19 +37,20 @@ procedure SetFontAspectW(Aspect: real);
procedure SetFontReflection(Enable:boolean;Spacing: real); // Enables/Disables text reflection
// Start of SDL_ttf
-function NextPowerOfTwo(Value: integer): integer;
+//function NextPowerOfTwo(Value: integer): integer;
// Checks if the ttf exists, if yes then a SDL_ttf is returned
-function LoadFont(FileName: PAnsiChar; PointSize: integer):PTTF_Font;
+//function LoadFont(FileName: PAnsiChar; PointSize: integer):PTTF_Font;
// Does the renderstuff, color is in $ffeecc style
-function RenderText(font: PTTF_Font; Text:PAnsiChar; Color: Cardinal):PSDL_Surface;
-procedure printrandomtext();
+//function RenderText(font: PTTF_Font; Text:PAnsiChar; Color: Cardinal):PSDL_Surface;
+//procedure printrandomtext();
// End of SDL_ttf
type
TTextGL = record
X: real;
Y: real;
+ Z: real;
Text: string;
Size: real;
ColR: real;
@@ -307,7 +309,7 @@ var
OutTemp: real;
XItal: real;
begin
- with Fonts[ActFont].Tex do
+ with Fonts[ActFont].Tex do
begin
FWidth := Fonts[ActFont].Width[Ord(Letter)];
@@ -389,31 +391,36 @@ begin
end;
+{*
+<mog> I uncommented this, because it was some kind of after hour hack together with blindy
+it's actually just a prove of concept, as it's having some flaws
+- instead nice and clean ttf code should be placed here :)
+*}
// tyty to Asphyre
// FIXME: check if the non-asm version is fast enough and use it by default if so
-function NextPowerOfTwo(Value: integer): integer;
-begin
- Result:= 1;
-{$IF Defined(CPUX86_64)}
- asm
- mov rcx, -1
- bsr rcx, Value
- inc rcx
- shl Result, cl
- end;
-{$ELSEIF Defined(CPU386) or Defined(CPUI386)}
- asm
- mov ecx, -1
- bsr ecx, Value
- inc ecx
- shl Result, cl
- end;
-{$ELSE}
- while (Result <= Value) do
- Result := 2 * Result;
-{$IFEND}
-end;
-
+//function NextPowerOfTwo(Value: integer): integer;
+//begin
+// Result:= 1;
+//{$IF Defined(CPUX86_64)}
+// asm
+// mov rcx, -1
+// bsr rcx, Value
+// inc rcx
+// shl Result, cl
+// end;
+//{$ELSEIF Defined(CPU386) or Defined(CPUI386)}
+// asm
+// mov ecx, -1
+// bsr ecx, Value
+// inc ecx
+// shl Result, cl
+// end;
+//{$ELSE}
+// while (Result <= Value) do
+// Result := 2 * Result;
+//{$IFEND}
+//end;
+{*
function LoadFont(FileName: PAnsiChar; PointSize: integer):PTTF_Font;
begin
if (FileExists(FileName)) then
@@ -505,7 +512,7 @@ begin
TTF_CloseFont(font);
end;
-
+*}
procedure glPrintCut(text: pchar);
var
Letter: char;
@@ -556,6 +563,11 @@ begin
Fonts[ActFont].Tex.Y := Y;
end;
+procedure SetFontZ(Z: real);
+begin
+ Fonts[ActFont].Tex.Z := Z;
+end;
+
procedure SetFontSize(Size: real);
begin
Fonts[ActFont].Tex.H := 30 * (Size/10);
diff --git a/Game/Code/Classes/UThemes.pas b/Game/Code/Classes/UThemes.pas
index e38e08c2..31e91724 100644
--- a/Game/Code/Classes/UThemes.pas
+++ b/Game/Code/Classes/UThemes.pas
@@ -56,6 +56,7 @@ type
X: integer;
Y: integer;
W: integer;
+ Z: real;
Color: string;
ColR: real;
ColG: real;
@@ -385,41 +386,40 @@ type
end;
TThemeOptionsGame = class(TThemeBasic)
- SelectPlayers: TThemeSelect;
- SelectDifficulty: TThemeSelect;
+ SelectPlayers: TThemeSelectSlide;
+ SelectDifficulty: TThemeSelectSlide;
SelectLanguage: TThemeSelectSlide;
- SelectTabs: TThemeSelect;
+ SelectTabs: TThemeSelectSlide;
SelectSorting: TThemeSelectSlide;
- SelectDebug: TThemeSelect;
+ SelectDebug: TThemeSelectSlide;
ButtonExit: TThemeButton;
end;
TThemeOptionsGraphics = class(TThemeBasic)
- SelectFullscreen: TThemeSelect;
- SelectSlideResolution: TThemeSelectSlide;
- SelectDepth: TThemeSelect;
- SelectOscilloscope: TThemeSelect;
- SelectLineBonus: TThemeSelect;
- SelectMovieSize: TThemeSelect;
+ SelectFullscreen: TThemeSelectSlide;
+ SelectResolution: TThemeSelectSlide;
+ SelectDepth: TThemeSelectSlide;
+ SelectOscilloscope: TThemeSelectSlide;
+ SelectLineBonus: TThemeSelectSlide;
+ SelectMovieSize: TThemeSelectSlide;
ButtonExit: TThemeButton;
end;
TThemeOptionsSound = class(TThemeBasic)
- SelectMicBoost: TThemeSelect;
- SelectClickAssist: TThemeSelect;
- SelectBeatClick: TThemeSelect;
- SelectThreshold: TThemeSelect;
- //Song Preview
+ SelectMicBoost: TThemeSelectSlide;
+ SelectClickAssist: TThemeSelectSlide;
+ SelectBeatClick: TThemeSelectSlide;
+ SelectThreshold: TThemeSelectSlide;
SelectSlidePreviewVolume: TThemeSelectSlide;
SelectSlidePreviewFading: TThemeSelectSlide;
- ButtonExit: TThemeButton;
+ ButtonExit: TThemeButton;
end;
TThemeOptionsLyrics = class(TThemeBasic)
- SelectLyricsFont: TThemeSelect;
+ SelectLyricsFont: TThemeSelectSlide;
SelectLyricsEffect: TThemeSelectSlide;
- SelectSolmization: TThemeSelect;
- SelectNoteLines: TThemeSelect;
+// SelectSolmization: TThemeSelectSlide;
+ SelectNoteLines: TThemeSelectSlide;
ButtonExit: TThemeButton;
end;
@@ -438,13 +438,13 @@ type
end;
TThemeOptionsAdvanced = class(TThemeBasic)
- SelectLoadAnimation: TThemeSelect;
- SelectEffectSing: TThemeSelect;
- SelectScreenFade: TThemeSelect;
- SelectLineBonus: TThemeSelect;
- SelectAskbeforeDel: TThemeSelect;
+ SelectLoadAnimation: TThemeSelectSlide;
+ SelectEffectSing: TThemeSelectSlide;
+ SelectScreenFade: TThemeSelectSlide;
+ SelectLineBonus: TThemeSelectSlide;
+ SelectAskbeforeDel: TThemeSelectSlide;
SelectOnSongClick: TThemeSelectSlide;
- SelectPartyPopup: TThemeSelect;
+ SelectPartyPopup: TThemeSelectSlide;
ButtonExit: TThemeButton;
end;
@@ -1134,32 +1134,32 @@ begin
// Options Game
ThemeLoadBasic(OptionsGame, 'OptionsGame');
- ThemeLoadSelect(OptionsGame.SelectPlayers, 'OptionsGameSelectPlayers');
- ThemeLoadSelect(OptionsGame.SelectDifficulty, 'OptionsGameSelectDifficulty');
+ ThemeLoadSelectSlide(OptionsGame.SelectPlayers, 'OptionsGameSelectPlayers');
+ ThemeLoadSelectSlide(OptionsGame.SelectDifficulty, 'OptionsGameSelectDifficulty');
ThemeLoadSelectSlide(OptionsGame.SelectLanguage, 'OptionsGameSelectSlideLanguage');
- ThemeLoadSelect(OptionsGame.SelectTabs, 'OptionsGameSelectTabs');
+ ThemeLoadSelectSlide(OptionsGame.SelectTabs, 'OptionsGameSelectTabs');
ThemeLoadSelectSlide(OptionsGame.SelectSorting, 'OptionsGameSelectSlideSorting');
- ThemeLoadSelect(OptionsGame.SelectDebug, 'OptionsGameSelectDebug');
+ ThemeLoadSelectSlide(OptionsGame.SelectDebug, 'OptionsGameSelectDebug');
ThemeLoadButton(OptionsGame.ButtonExit, 'OptionsGameButtonExit');
// Options Graphics
ThemeLoadBasic(OptionsGraphics, 'OptionsGraphics');
- ThemeLoadSelect(OptionsGraphics.SelectFullscreen, 'OptionsGraphicsSelectFullscreen');
- ThemeLoadSelectSlide(OptionsGraphics.SelectSlideResolution, 'OptionsGraphicsSelectSlideResolution');
- ThemeLoadSelect(OptionsGraphics.SelectDepth, 'OptionsGraphicsSelectDepth');
- ThemeLoadSelect(OptionsGraphics.SelectOscilloscope, 'OptionsGraphicsSelectOscilloscope');
- ThemeLoadSelect(OptionsGraphics.SelectLineBonus, 'OptionsGraphicsSelectLineBonus');
- ThemeLoadSelect(OptionsGraphics.SelectMovieSize, 'OptionsGraphicsSelectMovieSize');
- ThemeLoadButton(OptionsGraphics.ButtonExit, 'OptionsGraphicsButtonExit');
+ ThemeLoadSelectSlide(OptionsGraphics.SelectFullscreen, 'OptionsGraphicsSelectFullscreen');
+ ThemeLoadSelectSlide(OptionsGraphics.SelectResolution, 'OptionsGraphicsSelectSlideResolution');
+ ThemeLoadSelectSlide(OptionsGraphics.SelectDepth, 'OptionsGraphicsSelectDepth');
+ ThemeLoadSelectSlide(OptionsGraphics.SelectOscilloscope, 'OptionsGraphicsSelectOscilloscope');
+ ThemeLoadSelectSlide(OptionsGraphics.SelectLineBonus, 'OptionsGraphicsSelectLineBonus');
+ ThemeLoadSelectSlide(OptionsGraphics.SelectMovieSize, 'OptionsGraphicsSelectMovieSize');
+ ThemeLoadButton(OptionsGraphics.ButtonExit, 'OptionsGraphicsButtonExit');
// Options Sound
ThemeLoadBasic(OptionsSound, 'OptionsSound');
- ThemeLoadSelect(OptionsSound.SelectMicBoost, 'OptionsSoundSelectMicBoost');
- ThemeLoadSelect(OptionsSound.SelectClickAssist, 'OptionsSoundSelectClickAssist');
- ThemeLoadSelect(OptionsSound.SelectBeatClick, 'OptionsSoundSelectBeatClick');
- ThemeLoadSelect(OptionsSound.SelectThreshold, 'OptionsSoundSelectThreshold');
+ ThemeLoadSelectSlide(OptionsSound.SelectMicBoost, 'OptionsSoundSelectMicBoost');
+ ThemeLoadSelectSlide(OptionsSound.SelectClickAssist, 'OptionsSoundSelectClickAssist');
+ ThemeLoadSelectSlide(OptionsSound.SelectBeatClick, 'OptionsSoundSelectBeatClick');
+ ThemeLoadSelectSlide(OptionsSound.SelectThreshold, 'OptionsSoundSelectThreshold');
//Song Preview
ThemeLoadSelectSlide(OptionsSound.SelectSlidePreviewVolume, 'OptionsSoundSelectSlidePreviewVolume');
ThemeLoadSelectSlide(OptionsSound.SelectSlidePreviewFading, 'OptionsSoundSelectSlidePreviewFading');
@@ -1169,11 +1169,11 @@ begin
// Options Lyrics
ThemeLoadBasic(OptionsLyrics, 'OptionsLyrics');
- ThemeLoadSelect(OptionsLyrics.SelectLyricsFont, 'OptionsLyricsSelectLyricsFont');
+ ThemeLoadSelectSlide(OptionsLyrics.SelectLyricsFont, 'OptionsLyricsSelectLyricsFont');
ThemeLoadSelectSlide(OptionsLyrics.SelectLyricsEffect, 'OptionsLyricsSelectLyricsEffect');
- ThemeLoadSelect(OptionsLyrics.SelectSolmization, 'OptionsLyricsSelectSolmization');
- ThemeLoadSelect(OptionsLyrics.SelectNoteLines, 'OptionsLyricsSelectNoteLines');
- ThemeLoadButton(OptionsLyrics.ButtonExit, 'OptionsLyricsButtonExit');
+ //ThemeLoadSelectSlide(OptionsLyrics.SelectSolmization, 'OptionsLyricsSelectSolmization');
+ ThemeLoadSelectSlide(OptionsLyrics.SelectNoteLines, 'OptionsLyricsSelectNoteLines');
+ ThemeLoadButton(OptionsLyrics.ButtonExit, 'OptionsLyricsButtonExit');
// Options Themes
ThemeLoadBasic(OptionsThemes, 'OptionsThemes');
@@ -1194,14 +1194,14 @@ begin
//Options Advanced
ThemeLoadBasic(OptionsAdvanced, 'OptionsAdvanced');
- ThemeLoadSelect (OptionsAdvanced.SelectLoadAnimation, 'OptionsAdvancedSelectLoadAnimation');
- ThemeLoadSelect (OptionsAdvanced.SelectScreenFade, 'OptionsAdvancedSelectScreenFade');
- ThemeLoadSelect (OptionsAdvanced.SelectEffectSing, 'OptionsAdvancedSelectEffectSing');
- ThemeLoadSelect (OptionsAdvanced.SelectLineBonus, 'OptionsAdvancedSelectLineBonus');
- ThemeLoadSelectSlide (OptionsAdvanced.SelectOnSongClick, 'OptionsAdvancedSelectSlideOnSongClick');
- ThemeLoadSelect (OptionsAdvanced.SelectAskbeforeDel, 'OptionsAdvancedSelectAskbeforeDel');
- ThemeLoadSelect (OptionsAdvanced.SelectPartyPopup, 'OptionsAdvancedSelectPartyPopup');
- ThemeLoadButton (OptionsAdvanced.ButtonExit, 'OptionsAdvancedButtonExit');
+ ThemeLoadSelectSlide(OptionsAdvanced.SelectLoadAnimation, 'OptionsAdvancedSelectLoadAnimation');
+ ThemeLoadSelectSlide(OptionsAdvanced.SelectScreenFade, 'OptionsAdvancedSelectScreenFade');
+ ThemeLoadSelectSlide(OptionsAdvanced.SelectEffectSing, 'OptionsAdvancedSelectEffectSing');
+ ThemeLoadSelectSlide(OptionsAdvanced.SelectLineBonus, 'OptionsAdvancedSelectLineBonus');
+ ThemeLoadSelectSlide(OptionsAdvanced.SelectOnSongClick, 'OptionsAdvancedSelectSlideOnSongClick');
+ ThemeLoadSelectSlide(OptionsAdvanced.SelectAskbeforeDel, 'OptionsAdvancedSelectAskbeforeDel');
+ ThemeLoadSelectSlide(OptionsAdvanced.SelectPartyPopup, 'OptionsAdvancedSelectPartyPopup');
+ ThemeLoadButton (OptionsAdvanced.ButtonExit, 'OptionsAdvancedButtonExit');
//error and check popup
ThemeLoadBasic (ErrorPopup, 'ErrorPopup');
@@ -1457,6 +1457,8 @@ begin
ThemeText.Y := ThemeIni.ReadInteger(Name, 'Y', 0);
ThemeText.W := ThemeIni.ReadInteger(Name, 'W', 0);
+ ThemeText.Z := ThemeIni.ReadFloat(Name, 'Z', 0);
+
ThemeText.ColR := ThemeIni.ReadFloat(Name, 'ColR', 0);
ThemeText.ColG := ThemeIni.ReadFloat(Name, 'ColG', 0);
ThemeText.ColB := ThemeIni.ReadFloat(Name, 'ColB', 0);