Initial commit, reusable code for my nvgt based games.

This commit is contained in:
Storm Dragon
2026-02-16 19:49:29 -05:00
commit 65370b4679
16 changed files with 1735 additions and 0 deletions

25
audio_paths.nvgt Normal file
View File

@@ -0,0 +1,25 @@
// Audio path helpers for reusable modules.
// Resolves an audio path with optional extension fallback.
// Checks exact path first, then ".ogg", then ".wav".
string resolve_audio_path(const string audioPath) {
if (audioPath == "") {
return "";
}
if (file_exists(audioPath)) {
return audioPath;
}
string oggPath = audioPath + ".ogg";
if (file_exists(oggPath)) {
return oggPath;
}
string wavPath = audioPath + ".wav";
if (file_exists(wavPath)) {
return wavPath;
}
return "";
}