From d5f78a4c2e7b626a492643efd62ddeb394276722 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 9 Feb 2026 17:35:32 +0100 Subject: feat: Add debug-only file change detection for rapid iteration Enables --hot-reload flag to watch config files and notify on changes. Detects modifications to assets/sequences/music for rebuild workflow. Completely stripped from release builds (0 bytes overhead). Co-Authored-By: Claude Sonnet 4.5 --- src/util/file_watcher.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/util/file_watcher.h (limited to 'src/util/file_watcher.h') diff --git a/src/util/file_watcher.h b/src/util/file_watcher.h new file mode 100644 index 0000000..2766a43 --- /dev/null +++ b/src/util/file_watcher.h @@ -0,0 +1,33 @@ +// file_watcher.h - Hot-reload file change detection (debug only) + +#ifndef FILE_WATCHER_H_ +#define FILE_WATCHER_H_ + +#if !defined(STRIP_ALL) + +#include +#include +#include + +class FileWatcher { + public: + FileWatcher() = default; + + void add_file(const char* path); + bool check_changes(); + void reset(); + + private: + struct WatchEntry { + std::string path; + time_t last_mtime; + bool changed; + }; + + std::vector files_; + time_t get_mtime(const char* path); +}; + +#endif // !defined(STRIP_ALL) + +#endif // FILE_WATCHER_H_ -- cgit v1.2.3