Dungeon object updates

This commit is contained in:
scawful
2023-11-22 12:23:02 -05:00
parent e93ff212af
commit 041e365416
25 changed files with 311 additions and 150 deletions

View File

@@ -19,7 +19,7 @@ class ExperimentFlags {
bool kUseBitmapManager = true;
// Log instructions to the GUI debugger.
bool kLogInstructions = true;
bool kLogInstructions = false;
// Flag to enable ImGui input config flags. Currently is
// handled manually by controller class but should be
@@ -35,7 +35,7 @@ class ExperimentFlags {
bool kSaveWithChangeQueue = false;
// Attempt to run the dungeon room draw routine when opening a room.
bool kDrawDungeonRoomGraphics = false;
bool kDrawDungeonRoomGraphics = true;
};
ExperimentFlags() = default;
@@ -58,11 +58,43 @@ class ExperimentFlags {
static std::shared_ptr<Flags> flags_;
};
// NotifyFlag is a special type class which stores two copies of a type
// and uses that to check if the value was updated last or not
// It should have an accessor which says if it was modified or not
// and when that is read it should reset the value and state
template <typename T>
class NotifyFlag {
public:
NotifyFlag() : value_(), modified_(false) {}
void set(const T &value) {
value_ = value;
modified_ = true;
}
const T &get() {
modified_ = false;
return value_;
}
void operator=(const T &value) { set(value); }
operator T() const { return get(); }
bool isModified() const { return modified_; }
private:
T value_;
bool modified_;
};
uint32_t SnesToPc(uint32_t addr);
uint32_t PcToSnes(uint32_t addr);
uint32_t MapBankToWordAddress(uint8_t bank, uint16_t addr);
int AddressFromBytes(uint8_t addr1, uint8_t addr2, uint8_t addr3);
int HexToDec(char *input, int length);
bool StringReplace(std::string &str, const std::string &from,
const std::string &to);