You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
// Don't try to append numbers if there's only one frame
134
149
if (frameCount == 1) {
150
+
// Check for 000 in the file name in case it is part of an animation but the FrameCount was set to 1. Do not warn about this because it's normal operation, but warn about incorrect extension.
// Check for 000 in the file name in case it is part of an animation but the FrameCount was set to 1. Do not warn about this because it's normal operation.
160
-
if (std::filesystem::exists(m_DataPathWithoutExtension + "000" + m_DataPathExtension)) {
RTEAssert(returnBitmap, "Failed to load image file with following path and name:\n\n" + m_DataPathAndReaderPosition + "\nThe file may be corrupt, incorrectly converted or saved with unsupported parameters.");
Copy file name to clipboardExpand all lines: System/ContentFile.h
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -119,8 +119,9 @@ namespace RTE {
119
119
/// Gets the data represented by this ContentFile object as an Allegro BITMAP, loading it into the static maps if it's not already loaded. Note that ownership of the BITMAP is NOT transferred!
120
120
/// </summary>
121
121
/// <param name="conversionMode">The Allegro color conversion mode to use when loading this bitmap.</param>
122
+
/// <param name="dataPathToSpecificFrame">Path to a specific frame when loading an animation to avoid overwriting the original preset DataPath when loading each frame.</param>
122
123
/// <returns>Pointer to the BITMAP loaded from disk.</returns>
/// Gets the data represented by this ContentFile object as an array of Allegro BITMAPs, each representing a frame in the animation.
@@ -136,8 +137,9 @@ namespace RTE {
136
137
/// Note that this is relatively slow since it reads the data from disk each time.
137
138
/// </summary>
138
139
/// <param name="conversionMode">The Allegro color conversion mode to use when loading this bitmap. Only applies the first time a bitmap is loaded from the disk.</param>
140
+
/// <param name="dataPathToSpecificFrame">Path to a specific frame when loading an animation to avoid overwriting the original preset DataPath when loading each frame.</param>
139
141
/// <returns>Pointer to the BITMAP loaded from disk.</returns>
/// Gets the data represented by this ContentFile object as an FMOD FSOUND_SAMPLE, loading it into the static maps if it's not already loaded. Ownership of the FSOUND_SAMPLE is NOT transferred!
static std::unordered_map<size_t, std::string> s_PathHashes; //!< Static map containing the hash values of paths of all loaded data files.
177
-
static std::unordered_map<std::string, BITMAP *> s_LoadedBitmaps[BitDepthCount]; //!< Static map containing all the already loaded BITMAPs and their paths for each bit depth.
179
+
static std::array<std::unordered_map<std::string, BITMAP *>, BitDepthCount> s_LoadedBitmaps; //!< Static map containing all the already loaded BITMAPs and their paths for each bit depth.
178
180
static std::unordered_map<std::string, FMOD::Sound *> s_LoadedSamples; //!< Static map containing all the already loaded FSOUND_SAMPLEs and their paths.
179
181
180
182
std::string m_DataPath; //!< The path to this ContentFile's data file. In the case of an animation, this filename/name will be appended with 000, 001, 002 etc.
0 commit comments