aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-11 17:03:18 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-11 17:03:18 +0000
commit059a6898f9ab5069bd0bf5424b0590d1900325b3 (patch)
tree1f6ff980c29600cd0991307dd83f844d1768a562
parentac102e54fc6f7232c9cace99bffeb2d79f7de86b (diff)
downloadusdx-059a6898f9ab5069bd0bf5424b0590d1900325b3.tar.gz
usdx-059a6898f9ab5069bd0bf5424b0590d1900325b3.tar.xz
usdx-059a6898f9ab5069bd0bf5424b0590d1900325b3.zip
fix display of "InfoBar" for songs whose first note doesn't start at beat zero
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2490 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--src/screens/UScreenEditSub.pas13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/screens/UScreenEditSub.pas b/src/screens/UScreenEditSub.pas
index 7f664fc6..b3300a77 100644
--- a/src/screens/UScreenEditSub.pas
+++ b/src/screens/UScreenEditSub.pas
@@ -1413,6 +1413,7 @@ end;
procedure TScreenEditSub.DrawInfoBar(x, y, w, h: integer);
var
start, end_: integer;
+ SongStart, SongEnd: integer;
ww: integer;
pos: real;
@@ -1427,9 +1428,9 @@ begin
if(numLines=0) then
Exit;
- start := Lines[0].Line[0].Start;
- end_ := Lines[0].Line[numLines-1].End_;
- ww := end_ - start;
+ SongStart := Lines[0].Line[0].Note[0].Start;
+ SongEnd := Lines[0].Line[numLines-1].End_;
+ ww := SongEnd - SongStart;
glColor4f(0, 0, 0, 1);
glDisable(GL_BLEND);
@@ -1462,7 +1463,7 @@ begin
end_ := Lines[0].Line[line].Note[Lines[0].Line[line].HighNote].Start+
Lines[0].Line[line].Note[Lines[0].Line[line].HighNote].Length;
- pos := start/ww*w;
+ pos := (start - SongStart)/ww*w;
br := (end_-start)/ww*w;
glbegin(gl_quads);
@@ -1484,13 +1485,13 @@ begin
begin
glColor4f(0, 0, 0, 0.5);
pos := 0;
- br := AktBeat/ww*w;
+ br := (AktBeat - SongStart)/ww*w;
if (br>w) then
br := w;
end else
begin
glColor4f(1, 0, 0, 1);
- pos := Lines[0].Line[Lines[0].Current].Note[CurrentNote].Start/ww*w;
+ pos := (Lines[0].Line[Lines[0].Current].Note[CurrentNote].Start - SongStart)/ww*w;
br := Lines[0].Line[Lines[0].Current].Note[CurrentNote].Length/ww*w;
if (br<1) then
br := 1;