home *** CD-ROM | disk | FTP | other *** search
- on newseg track, pos, len, col, cast, idx
- global maxsegs, objectCount, theObjects
- if objectCount < maxsegs then
- set objectCount to objectCount + 1
- theObjects(mput, objectCount, SEGMENTS(mnew, track, pos, len, col, cast, idx))
- return 1
- else
- alert("No more free casts !")
- return 0
- end if
- end
-
- on displaysegs
- global gTrack, gPos, GLen, gcast, gXp, gYp, vTSprite, stepaction, sel_idx, objectCount, theObjects, minsegs, maxsegs, segsprite, segcurrent, firstsound
- if objectp(theObjects) = 0 then
- exit
- end if
- repeat with i = minsegs + 1 to objectCount
- set ithObject to theObjects(mget, i)
- if objectp(ithObject) then
- ithObject(mrelease)
- ithObject(mdispose)
- end if
- end repeat
- set objectCount to minsegs
- set i to 1
- repeat with i = 1 to 24
- if AR1idx(mget, i) > 0 then
- if i > 12 then
- set track to 2
- set s to "2"
- else
- set track to 1
- set s to "1"
- end if
- set pos to ar1pos(mget, i)
- set len to ar1seg(mget, i)
- getsegment(track, pos, len)
- newseg(gTrack, gPos, GLen, Ar1col(mget, i), gcast, i)
- end if
- end repeat
- timeline(sel_idx)
- end
-
- on getsegment track, pos, len
- global gTrack, gPos, GLen, gcast, gXp, gYp, sl_str, sl_x, sl_y
- if track = 2 then
- set str to "2"
- else
- set str to "1"
- end if
- set str to str & lzero(integer(value(pos)))
- set str to str & lzero(integer(value(len)))
- if not (length(str) >= 5) then
- set str to lzero(integer(value(str)))
- end if
- set chk_sl to getPos(sl_str, str)
- if chk_sl = 0 then
- alertrd("ELEMENT >" & string(tmp) & "< not in list T>" & string(track) & "<P>" & string(pos) & "<L>" & string(len) & "<STR>" & str & "<", "ELEMENT >" & string(tmp) & "< not in list T>" & string(track) & "<P>" & string(pos) & "<L>" & string(len) & "<STR>" & str & "<")
- else
- set gTrack to value(chars(str, 1, 1))
- set gPos to value(chars(str, 2, 3))
- set GLen to value(chars(str, 4, 5))
- set gcast to chars(str, 1, 5)
- set gXp to getAt(sl_x, chk_sl)
- set gYp to getAt(sl_y, chk_sl)
- end if
- end
-
- on sl_create
- global sl_str, sl_x, sl_y
- set sl_str to []
- set sl_x to []
- set sl_y to []
- set lin to 0
- set s to EMPTY
- repeat while 1
- set s to line lin of field "TSEG"
- if s = "END" then
- exit repeat
- end if
- if chars(s, 1, 1) <> "-" then
- append(sl_str, chars(s, 1, 5))
- append(sl_x, value(chars(s, 6, 8)))
- append(sl_y, value(chars(s, 9, 11)))
- end if
- set lin to lin + 1
- end repeat
- end
-
- on sl_search pos
- global ltl_len, ltl_time, ltl_scast
- set ret_time to 0
- repeat with i = pos to 12
- set ret_time to ret_time + getAt(ltl_time, i)
- end repeat
- return ret_time
- end
-