mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
Warn when a 3D shockwave model has no glow map (#7795)
Check each 3D shockwave model when it is loaded and warn if none of its textures has a glow map. The check is skipped when glow maps are disabled, since they are not loaded then. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
1 parent
5d89c6cce7
commit
c342b6df61
1 file changed
+12
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "weapon/shockwave.h"
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "io/timer.h"
|
||||
@@ -577,6 +578,17 @@ int shockwave_load(const char *s_name, bool shock_3D)
|
||||
Shockwave_info.pop_back();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// glow maps are only loaded when enabled, so only check then
|
||||
if (Cmdline_glow || Fred_running) {
|
||||
auto pm = model_get(si->model_id);
|
||||
bool has_glow = std::any_of(pm->maps, pm->maps + pm->n_textures, [](const texture_map &tmap) {
|
||||
return tmap.textures[TM_GLOW_TYPE].GetTexture() >= 0;
|
||||
});
|
||||
|
||||
if (!has_glow)
|
||||
Warning(LOCATION, "3D shockwave model '%s' has no glow map. For a 3D shockwave, the glow texture typically carries the animation.", si->filename);
|
||||
}
|
||||
} else {
|
||||
si->bitmap_id = bm_load_animation( si->filename, &si->num_frames, &si->fps, nullptr, nullptr, true );
|
||||
|
||||
|
||||
Reference in new issue
Block a user