aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-03-28 00:31:17 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-03-28 00:31:17 +0000
commit2bb04d205b5b0302907d3f14c25ccf440fa97dc4 (patch)
tree7f9c6c1fba8fef318be47fe4c6dcfe1b1085c0d8 /Game
parent10e6d7591c71597228046d0191b2a8bc9662e858 (diff)
downloadusdx-2bb04d205b5b0302907d3f14c25ccf440fa97dc4.tar.gz
usdx-2bb04d205b5b0302907d3f14c25ccf440fa97dc4.tar.xz
usdx-2bb04d205b5b0302907d3f14c25ccf440fa97dc4.zip
fixed EIntOverflow in function TMenu.WideCharUpperCase when used on Linux ( or other Unix Systems )
this fix should make Eddies fix for same or similar problem Correct, because the previous fix simply did an UpperCase which is not WideString Compatible. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@977 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Menu/UMenu.pas23
-rw-r--r--Game/Code/UltraStar.lpr1
2 files changed, 23 insertions, 1 deletions
diff --git a/Game/Code/Menu/UMenu.pas b/Game/Code/Menu/UMenu.pas
index 4fd9262a..fa09145d 100644
--- a/Game/Code/Menu/UMenu.pas
+++ b/Game/Code/Menu/UMenu.pas
@@ -163,6 +163,7 @@ const
implementation
uses UCommon,
+ ULog,
UMain,
UDrawTexture,
UGraphic,
@@ -1546,12 +1547,32 @@ end;
function TMenu.WideCharUpperCase(const wchar : WideChar) : WideString;
begin
+ // JB - I got EIntOverflow in this function ( on Linux ), the same as eddie may have...
+ // after a little investigation I found this info : http://www.hu.freepascal.org/lists/fpc-pascal/2007-October/015233.html
+ // seems we need "cwstring", which I added to UltraStar.lpr and all seems to work now..
+ // I assume it will work correcty on Darwin also. Im not sure if Eddie uses the Ultrastar.lpr file.. if not then maybe we need
+ // to move some of that stuff to the dpr file with appropriate IFDEF's to make it easier to maintain.
+
+ {$IFDEF Win32}
+ Result := WideUpperCase(wchar);
+ {$ELSE}
+ debugwriteln( 'WideCharUpperCase('+wchar+'):'+inttostr(length(wchar)) );
+
+ // fpc implementation dosnt seem to like non wide strings... or Empty strings
+ if ( wchar <> emptyWideStr ) then
+ Result := WideUpperCase(wchar)
+ else
+ Result := UpperCase(wchar);
+ {$ENDIF}
+
+(*
{$IFDEF DARWIN}
// eddie: WideUpperCase crashes on the mac with WideChars.
Result := UpperCase(wchar);
{$ELSE}
Result := WideUpperCase(wchar);
- {$ENDIF}
+ {$ENDIF}
+*)
end;
procedure TMenu.onHide;
diff --git a/Game/Code/UltraStar.lpr b/Game/Code/UltraStar.lpr
index ab4a6534..06a6f86e 100644
--- a/Game/Code/UltraStar.lpr
+++ b/Game/Code/UltraStar.lpr
@@ -7,6 +7,7 @@ program UltraStar;
uses
{$ifdef unix} // http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial
cthreads, // THIS MUST be the first used unit !!
+ cwstring,
{$endif}
{$ifdef MSWINDOWS} // do not initialize the widgets in linux -> see below
{$ifdef LCL}