mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-11 11:33:52 +00:00
feat(pipeline): add WOL preset variants for cave/dungeon/night
Three new single-keyframe WOL presets complement the
existing 4-keyframe day/night cycle from --gen-light:
• --gen-light-cave — dim cool ambient (0.05, 0.05, 0.07)
+ heavy short-range fog (15..80)
for cave / mine interiors
• --gen-light-dungeon — warm torchlit ambient (0.18, 0.14,
0.10) + medium fog (25..200) for
dungeon / crypt interiors
• --gen-light-night — cold blue ambient (0.06, 0.07, 0.12)
+ moonlit directional + far fog
(80..500) for always-night zones
Each preset emits a single-keyframe WOL since enclosed /
fixed-time scenes don't vary with time-of-day. All three
share an emitLightPreset helper so adding more presets
(e.g. --gen-light-tundra, --gen-light-volcanic) is one
line of registration + a maker function.
All four WOL outputs validate clean under --validate-wol
(1 or 4 keyframe(s) valid).
This commit is contained in:
parent
2b96863db9
commit
8f16a27253
5 changed files with 113 additions and 11 deletions
|
|
@ -525,12 +525,12 @@ int handleInfoWolAt(int& i, int argc, char** argv) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int handleGenLight(int& i, int argc, char** argv) {
|
||||
// Emit a starter .wol file with the default 4-keyframe day/
|
||||
// night cycle (midnight, dawn, noon, dusk). User can edit
|
||||
// the keyframes by re-saving via a future authoring tool;
|
||||
// for now this is the canonical "make me a usable atmosphere
|
||||
// file in one command" entrypoint.
|
||||
// Emit a .wol from a named preset. Used by all four
|
||||
// --gen-light* convenience commands.
|
||||
int emitLightPreset(const std::string& cmdName,
|
||||
int& i, int argc, char** argv,
|
||||
wowee::pipeline::WoweeLight (*maker)(const std::string&),
|
||||
const char* presetDescription) {
|
||||
std::string base = argv[++i];
|
||||
std::string zoneName = "Default";
|
||||
if (i + 1 < argc && argv[i + 1][0] != '-') {
|
||||
|
|
@ -539,19 +539,48 @@ int handleGenLight(int& i, int argc, char** argv) {
|
|||
if (base.size() >= 4 && base.substr(base.size() - 4) == ".wol") {
|
||||
base = base.substr(0, base.size() - 4);
|
||||
}
|
||||
auto wol = wowee::pipeline::WoweeLightLoader::makeDefaultDayNight(zoneName);
|
||||
auto wol = maker(zoneName);
|
||||
if (!wowee::pipeline::WoweeLightLoader::save(wol, base)) {
|
||||
std::fprintf(stderr, "gen-light: failed to save %s.wol\n",
|
||||
base.c_str());
|
||||
std::fprintf(stderr, "%s: failed to save %s.wol\n",
|
||||
cmdName.c_str(), base.c_str());
|
||||
return 1;
|
||||
}
|
||||
std::printf("Wrote %s.wol\n", base.c_str());
|
||||
std::printf(" zone : %s\n", zoneName.c_str());
|
||||
std::printf(" keyframes : %zu (midnight + dawn + noon + dusk)\n",
|
||||
wol.keyframes.size());
|
||||
std::printf(" preset : %s (%zu keyframe%s)\n",
|
||||
presetDescription, wol.keyframes.size(),
|
||||
wol.keyframes.size() == 1 ? "" : "s");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int handleGenLight(int& i, int argc, char** argv) {
|
||||
return emitLightPreset(
|
||||
"gen-light", i, argc, argv,
|
||||
wowee::pipeline::WoweeLightLoader::makeDefaultDayNight,
|
||||
"midnight + dawn + noon + dusk");
|
||||
}
|
||||
|
||||
int handleGenLightCave(int& i, int argc, char** argv) {
|
||||
return emitLightPreset(
|
||||
"gen-light-cave", i, argc, argv,
|
||||
wowee::pipeline::WoweeLightLoader::makeCave,
|
||||
"dim cool ambient + heavy short-range fog");
|
||||
}
|
||||
|
||||
int handleGenLightDungeon(int& i, int argc, char** argv) {
|
||||
return emitLightPreset(
|
||||
"gen-light-dungeon", i, argc, argv,
|
||||
wowee::pipeline::WoweeLightLoader::makeDungeon,
|
||||
"warm torchlit ambient + medium fog");
|
||||
}
|
||||
|
||||
int handleGenLightNight(int& i, int argc, char** argv) {
|
||||
return emitLightPreset(
|
||||
"gen-light-night", i, argc, argv,
|
||||
wowee::pipeline::WoweeLightLoader::makeNight,
|
||||
"moonlit directional + far fog");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool handleWorldInfo(int& i, int argc, char** argv, int& outRc) {
|
||||
|
|
@ -579,6 +608,15 @@ bool handleWorldInfo(int& i, int argc, char** argv, int& outRc) {
|
|||
if (std::strcmp(argv[i], "--gen-light") == 0 && i + 1 < argc) {
|
||||
outRc = handleGenLight(i, argc, argv); return true;
|
||||
}
|
||||
if (std::strcmp(argv[i], "--gen-light-cave") == 0 && i + 1 < argc) {
|
||||
outRc = handleGenLightCave(i, argc, argv); return true;
|
||||
}
|
||||
if (std::strcmp(argv[i], "--gen-light-dungeon") == 0 && i + 1 < argc) {
|
||||
outRc = handleGenLightDungeon(i, argc, argv); return true;
|
||||
}
|
||||
if (std::strcmp(argv[i], "--gen-light-night") == 0 && i + 1 < argc) {
|
||||
outRc = handleGenLightNight(i, argc, argv); return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue