Skip to content

Commit 81cfb32

Browse files
authored
Catch sound errors for customs, update to 2.7.2 (#1322)
Catch errors for sounds on customs - some are NGLE which just won't work yet. Closes #1321 Closes #1320
1 parent 1172e65 commit 81cfb32

2 files changed

Lines changed: 30 additions & 7 deletions

File tree

trlevel/Level.cpp

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,18 @@ namespace trlevel
20672067
_sample_indices = read_sample_indices(activity, data_stream, callbacks);
20682068
}
20692069

2070-
read_sound_samples_tr4_5(activity, file, callbacks);
2070+
const auto sound_start = file.tellg();
2071+
try
2072+
{
2073+
read_sound_samples_tr4_5(activity, file, callbacks);
2074+
}
2075+
catch (const std::exception& e)
2076+
{
2077+
callbacks.on_progress("Failed to load sound samples");
2078+
file.clear();
2079+
file.seekg(sound_start, std::ios::beg);
2080+
log_file(activity, file, std::format("Failed to load sound samples {}", e.what()));
2081+
}
20712082
callbacks.on_progress("Generating meshes");
20722083
log_file(activity, file, "Generating meshes");
20732084
generate_meshes(_mesh_data);
@@ -2144,7 +2155,19 @@ namespace trlevel
21442155

21452156
file.seekg(at + static_cast<std::fpos_t>(uncompressed_size), std::ios::beg);
21462157

2147-
read_sound_samples_tr4_5(activity, file, callbacks);
2158+
const auto sound_start = file.tellg();
2159+
try
2160+
{
2161+
read_sound_samples_tr4_5(activity, file, callbacks);
2162+
}
2163+
catch (const std::exception& e)
2164+
{
2165+
callbacks.on_progress("Failed to load sound samples");
2166+
file.clear();
2167+
file.seekg(sound_start, std::ios::beg);
2168+
log_file(activity, file, std::format("Failed to load sound samples {}", e.what()));
2169+
}
2170+
21482171
callbacks.on_progress("Generating meshes");
21492172
log_file(activity, file, "Generating meshes");
21502173
generate_meshes(_mesh_data);

trview.app/Resources/trview.app.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ CAPTION "About trview"
115115
FONT 8, "MS Shell Dlg", 0, 0, 0x1
116116
BEGIN
117117
ICON IDI_TRVIEW,IDC_STATIC,14,14,21,20
118-
LTEXT "trview, Version 2.7.1",IDC_STATIC,42,14,114,8,SS_NOPREFIX
118+
LTEXT "trview, Version 2.7.2",IDC_STATIC,42,14,114,8,SS_NOPREFIX
119119
LTEXT "Copyright (C) 2024 trview team",IDC_STATIC,42,26,127,17
120120
LTEXT "Licensed under the MIT license\r\n\
121121
Uses DirectXTK (MIT)\r\n\
@@ -209,8 +209,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
209209
//
210210

211211
VS_VERSION_INFO VERSIONINFO
212-
FILEVERSION 2,7,1,0
213-
PRODUCTVERSION 2,7,1,0
212+
FILEVERSION 2,7,2,0
213+
PRODUCTVERSION 2,7,2,0
214214
FILEFLAGSMASK 0x3fL
215215
#ifdef _DEBUG
216216
FILEFLAGS 0x1L
@@ -226,12 +226,12 @@ BEGIN
226226
BLOCK "080904b0"
227227
BEGIN
228228
VALUE "FileDescription", "TRView"
229-
VALUE "FileVersion", "2.7.1.0"
229+
VALUE "FileVersion", "2.7.2.0"
230230
VALUE "InternalName", "trview.exe"
231231
VALUE "LegalCopyright", "Copyright (C) chreden 2024"
232232
VALUE "OriginalFilename", "trview.exe"
233233
VALUE "ProductName", "TRView"
234-
VALUE "ProductVersion", "2.7.1.0"
234+
VALUE "ProductVersion", "2.7.2.0"
235235
END
236236
END
237237
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)