aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens/UScreenSingModi.pas
diff options
context:
space:
mode:
authors_alexander <s_alexander@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-11-09 00:27:55 +0000
committers_alexander <s_alexander@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-11-09 00:27:55 +0000
commit917901e8e33438c425aef50a0a7417f32d77b760 (patch)
tree95f081dd0d9a206bba3bd9c0a70e7a9a4cddafc8 /src/screens/UScreenSingModi.pas
parent474452a88427e6ea83d6435b117e5deb1d4cd0c6 (diff)
downloadusdx-917901e8e33438c425aef50a0a7417f32d77b760.tar.gz
usdx-917901e8e33438c425aef50a0a7417f32d77b760.tar.xz
usdx-917901e8e33438c425aef50a0a7417f32d77b760.zip
merged unicode branch (r1931) into trunk
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1939 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--src/screens/UScreenSingModi.pas32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/screens/UScreenSingModi.pas b/src/screens/UScreenSingModi.pas
index eeb06004..48d1e9a1 100644
--- a/src/screens/UScreenSingModi.pas
+++ b/src/screens/UScreenSingModi.pas
@@ -47,7 +47,7 @@ uses
ULyrics,
TextGL,
gl,
-
+ UPath,
UThemes,
UScreenSing,
ModiSDK;
@@ -62,16 +62,16 @@ type
TeamInfo: TTeamInfo;
constructor Create; override;
- procedure onShow; override;
+ procedure OnShow; override;
//procedure onShowFinish; override;
- function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override;
+ function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override;
function Draw: boolean; override;
procedure Finish; override;
end;
type
TCustomSoundEntry = record
- Filename : string;
+ Filename : IPath;
Stream : TAudioPlaybackStream;
end;
@@ -108,13 +108,13 @@ uses
UGraphicClasses,
ULanguage,
UNote,
- UPath,
+ UPathUtils,
URecord,
USkins;
// Method for input parsing. If false is returned, GetNextWindow
// should be checked to know the next window to load;
-function TScreenSingModi.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean;
+function TScreenSingModi.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean;
begin
Result := true;
if (PressedDown) then
@@ -176,7 +176,7 @@ begin
end;
end;
-procedure TScreenSingModi.onShow;
+procedure TScreenSingModi.OnShow;
var
I: integer;
begin
@@ -503,19 +503,20 @@ end;
function LoadTex(const Name: PChar; Typ: TTextureType): TsmallTexture;
var
- Texname, EXT: string;
+ TexName: IPath;
+ Ext: UTF8String;
Tex: TTexture;
begin
//Get texture Name
TexName := Skin.GetTextureFileName(string(Name));
//Get File Typ
- Ext := ExtractFileExt(TexName);
- if (uppercase(Ext) = '.JPG') then
+ Ext := TexName.GetExtension().ToUTF8;
+ if (UpperCase(Ext) = '.JPG') then
Ext := 'JPG'
else
Ext := 'BMP';
- Tex := Texture.LoadTexture(false, PChar(TexName), UTEXTURE.TTextureType(Typ), 0);
+ Tex := Texture.LoadTexture(false, TexName, UTexture.TTextureType(Typ), 0);
Result.TexNum := Tex.TexNum;
Result.W := Tex.W;
@@ -544,20 +545,21 @@ function LoadSound(const Name: PChar): cardinal;
var
Stream: TAudioPlaybackStream;
i: integer;
- Filename: string;
+ Filename: IPath;
+ SoundFile: IPath;
begin
//Search for Sound in already loaded Sounds
- Filename := UpperCase(SoundPath + Name);
+ SoundFile := SoundPath.Append(Name);
for i := 0 to High(CustomSounds) do
begin
- if (UpperCase(CustomSounds[i].Filename) = Filename) then
+ if (SoundFile.Equals(CustomSounds[i].Filename, true)) then
begin
Result := i;
Exit;
end;
end;
- Stream := AudioPlayback.OpenSound(SoundPath + string(Name));
+ Stream := AudioPlayback.OpenSound(SoundFile);
if (Stream = nil) then
begin
Result := 0;