//================================================================ void bring_track_front(int scene, int trackid) { if(!is_track(scene,trackid)) return; if( trackscenevec[scene]->zorder.size() <= 0 ) { trackscenevec[scene]->zorder.push_back(trackid); return; } // find the track in the zorder, and bring it to the front int i; int z = -1; for( i = trackscenevec[scene]->zorder.size() - 1; i >= 0; --i) { if( trackscenevec[scene]->zorder[i] == trackid) { z = i; i = -1; } } // never found!!! if( z < 0 ) { trackscenevec[scene]->zorder.push_back(trackid); return; } for( i = z; i > 0; --i) trackscenevec[scene]->zorder[i] = trackscenevec[scene]->zorder[i - 1]; trackscenevec[scene]->zorder[0] = trackid; }
//================================================================ float get_scene_track_nextpos (int trackid) { if(!is_track(BoundScene,trackid)) return 0.0f; return trackscenevec[BoundScene]->trackvec[trackid]->nextPos; }
//================================================================ void free_track(int scene, int trackid) { if(!is_track(scene,trackid)) return; free_track(trackscenevec[scene]->trackvec[trackid]); trackscenevec[scene]->trackvec[trackid] = NULL; }
stack_t * get_tracks(char * page) { stack_t * result = NULL; while (page[0] != '\0') { if (is_track(page)) { int length = get_line_length(page); s_push(&result, extract_next_substring(page, length)); page += length; } else { page++; } } return result; }
//================================================================ TrackSceneNode* get_scene_track(int trackid) { if(!is_scene_bound()) return NULL; if(!is_track(BoundScene,trackid)) return NULL; return trackscenevec[BoundScene]->trackvec[trackid]; }
//================================================================ void highlight_track(int trackid, bool h) { if(!is_track(BoundScene,trackid)) return; trackscenevec[BoundScene]->trackvec[trackid]->highlight = h; }
//================================================================ bool is_track(int trackid) { return is_track(BoundScene,trackid); }
//================================================================ TrackSceneNode* get_scene_track(int scene, int trackid) { if(!is_track(scene,trackid)) return NULL; return trackscenevec[scene]->trackvec[trackid]; }
//================================================================ void free_track_section_model(int scene, int trackid, int sectionid) { if(!is_track(scene,trackid)) return; free_model(trackscenevec[scene]->trackvec[trackid], sectionid); }