aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UDraw.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-29 03:24:33 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-29 03:24:33 +0000
commit76616a7974a926ddee09ab605f89acc78321e728 (patch)
tree4f7b9af0a804fff99b10af22fc257d46d1dd4c1d /Game/Code/Classes/UDraw.pas
parent95662b4cb8252ae665de8222762f9fc320f11ea0 (diff)
downloadusdx-76616a7974a926ddee09ab605f89acc78321e728.tar.gz
usdx-76616a7974a926ddee09ab605f89acc78321e728.tar.xz
usdx-76616a7974a926ddee09ab605f89acc78321e728.zip
fixed runtime sing errors, when compiled in lazarus.
mainly divide by 0 errors. need to be more careful with these, as they can be a pain to track down git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@446 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/UDraw.pas')
-rw-r--r--Game/Code/Classes/UDraw.pas48
1 files changed, 46 insertions, 2 deletions
diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas
index 1e631648..22b1263d 100644
--- a/Game/Code/Classes/UDraw.pas
+++ b/Game/Code/Classes/UDraw.pas
@@ -221,6 +221,9 @@ var
PlayerNumber: Integer;
GoldenStarPos : real;
+
+ lTmpA ,
+ lTmpB : real;
begin
// We actually don't have a playernumber in this procedure, it should reside in NrCzesci - but it's always set to zero
// So we exploit this behavior a bit - we give NrCzesci the playernumber, keep it in playernumber - and then we set NrCzesci to zero
@@ -236,7 +239,26 @@ begin
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- TempR := (Right-Left) / (Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt].Koniec - Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt].StartNote);
+
+ lTmpA := (Right-Left);
+ lTmpB := (Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt].Koniec - Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt].StartNote);
+
+ writeln( 'UDRAW (Right-Left) : ' + floattostr( lTmpA ) );
+ writeln( 'UDRAW : ' + floattostr( lTmpB ) );
+ writeln( '' );
+
+
+ if ( lTmpA > 0 ) AND
+ ( lTmpB > 0 ) THEN
+ begin
+ TempR := lTmpA / lTmpB;
+ end
+ else
+ begin
+ TempR := 0;
+ end;
+
+
with Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt] do begin
for Pet := 0 to HighNut do begin
with Nuta[Pet] do begin
@@ -440,13 +462,35 @@ var
R,G,B: real;
X1, X2, X3, X4: real;
W, H: real;
+
+ lTmpA ,
+ lTmpB : real;
begin
if (Player[NrGracza].ScoreTotalI >= 0) then begin
glColor4f(1, 1, 1, sqrt((1+sin(Music.Position * 3))/4)/ 2 + 0.5 );
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- TempR := (Right-Left) / (Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt].Koniec - Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt].StartNote);
+
+
+ lTmpA := (Right-Left);
+ lTmpB := (Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt].Koniec - Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt].StartNote);
+
+ writeln( 'UDRAW (Right-Left) : ' + floattostr( lTmpA ) );
+ writeln( 'UDRAW : ' + floattostr( lTmpB ) );
+ writeln( '' );
+
+
+ if ( lTmpA > 0 ) AND
+ ( lTmpB > 0 ) THEN
+ begin
+ TempR := lTmpA / lTmpB;
+ end
+ else
+ begin
+ TempR := 0;
+ end;
+
with Czesci[NrCzesci].Czesc[Czesci[NrCzesci].Akt] do begin
for Pet := 0 to HighNut do begin
with Nuta[Pet] do begin