aboutsummaryrefslogtreecommitdiff
path: root/project/src/lib-std.c
diff options
context:
space:
mode:
authorWiimm <wiimm@wiimm.de>2023-10-24 19:17:33 +0200
committerWiimm <wiimm@wiimm.de>2023-10-24 19:17:33 +0200
commit6acd361e1439ace91468735bd286d69d23fd86af (patch)
tree03604f4aca7a8f4ef939d4d548b1f32e132b1342 /project/src/lib-std.c
parent336da838ce43edae40dd708dd465f1f43a2c312d (diff)
SZS v2.39a
Diffstat (limited to 'project/src/lib-std.c')
-rw-r--r--project/src/lib-std.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/project/src/lib-std.c b/project/src/lib-std.c
index 5855450..03d9061 100644
--- a/project/src/lib-std.c
+++ b/project/src/lib-std.c
@@ -5514,6 +5514,56 @@ uint GetMkwMusicSlot ( uint tid )
}
}
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+int FindTrackSlot ( ccp name, bool allow_arenas )
+{
+ int idx = ScanTrack(name);
+ if ( idx >= 0 )
+ return idx;
+
+ if (allow_arenas)
+ {
+ idx = ScanArena(name);
+ if ( idx >= 0 )
+ return idx + MKW_ARENA_BEG;
+ }
+
+ return -1;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+int FindArenaSlot ( ccp name, bool allow_tracks )
+{
+ int idx = ScanArena(name);
+ if ( idx >= 0 )
+ return idx + MKW_ARENA_BEG;
+
+ if (allow_tracks)
+ {
+ idx = ScanTrack(name);
+ if ( idx >= 0 )
+ return idx;
+ }
+
+ return -1;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+const TrackInfo_t * FindTrackInfo ( ccp name, bool allow_arenas )
+{
+ return GetTrackInfo(FindTrackSlot(name,allow_arenas));
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+const TrackInfo_t * FindArenaInfo ( ccp name, bool allow_tracks )
+{
+ return GetTrackInfo(FindArenaSlot(name,allow_tracks));
+}
//
///////////////////////////////////////////////////////////////////////////////
/////////////// apple only ///////////////