bsnes/hiro/core/application.cpp
Tim Allen ec960c5172 Update to v106r44 release.
byuu says:

Changelog:

  - hiro/Windows: use `WS_CLIPSIBLINGS` on Label to prevent resize
    drawing issues
  - bsnes: correct viewport resizing
  - bsnes: speed up window resizing a little bit
  - bsnes: fix the cheat editor list enable checkbox
  - bsnes: fix the state manager filename display in game ROM mode
  - bsnes: fix the state manager save/rename/remove functionality in
    game ROM mode
  - bsnes: correct path searching for IPS and BPS patches in game ROM
    mode
  - bsnes: patch BS-X town cartridge to disable play limits
  - bsnes: do not load (program,data,expansion).(rom,flash) from disk in
    game pak mode
      - this is required to support soft-patching and ROM hacks
  - bsnes: added speed mode selection (50%, 75%, 100%, 150%, 200%);
    maintains proper pitch
  - bsnes: added icons to the menubar
      - this is particularly useful to tell game ROMs from game paks in
        the load recent game menu
  - bsnes: added emblem at bottom left of status bar to indicate if a
    game is verified or not
      - verified means it is in the icarus verified game dump database
      - the verified diamond is orange; the unverified diamond is blue
  - bsnes: added an option (which defaults to off) to warn when loading
    unverified games
      - working around a bug in GTK, I have to use the uglier
        MessageWindow instead of MessageDialog
  - bsnes: added (non-functional) link to <https://doc.byuu.org/bsnes/>
    to the help menu
  - bsnes: added GUI setting to toggle memory auto-save feature
  - bsnes: added GUI setting to toggle capturing a backup save state
    when closing the emulator
  - bsnes: made auto-saving states on exit an option
  - bsnes: added an option to auto-load the auto-saved state on load
      - basically, the two combined implements auto-resume
  - bsnes: when firmware is missing, offer to take the user to the
    online help documentation
  - bsnes: added fast PPU option to disable the sprite limit
      - increase from 32 items/line + 34 tiles/line to 128 items/line +
        128 tiles/line
      - technically, 1024 tiles/line are possible with 128 sprites at
        64-width
      - but this is just a waste of cache locality and worst-case
        performance; it'll never happen

Errata:

  - hiro/Windows: fallthrough on Canvas `WM_ERASEBKGND` to prevent
    startup flicker
2018-06-28 16:28:27 +10:00

132 lines
2.9 KiB
C++

#if defined(Hiro_Application)
Application::State Application::state;
auto Application::doMain() -> void {
if(state.onMain) return state.onMain();
}
auto Application::font() -> Font {
return state.font;
}
auto Application::modal() -> bool {
return state.modal > 0;
}
auto Application::name() -> string {
return state.name;
}
auto Application::onMain(const function<void ()>& callback) -> void {
state.onMain = callback;
}
auto Application::run() -> void {
return pApplication::run();
}
auto Application::pendingEvents() -> bool {
return pApplication::pendingEvents();
}
auto Application::processEvents() -> void {
return pApplication::processEvents();
}
auto Application::quit() -> void {
state.quit = true;
return pApplication::quit();
}
auto Application::scale() -> float {
return state.scale;
}
auto Application::scale(float value) -> float {
return value * state.scale;
}
auto Application::setFont(const Font& font) -> void {
state.font = font;
}
auto Application::setName(const string& name) -> void {
state.name = name;
}
auto Application::setScale(float scale) -> void {
state.scale = scale;
}
auto Application::unscale(float value) -> float {
return value * (1.0 / state.scale);
}
//Windows
//=======
auto Application::Windows::doModalChange(bool modal) -> void {
if(state.windows.onModalChange) return state.windows.onModalChange(modal);
}
auto Application::Windows::doScreenSaver() -> bool {
if(state.windows.onScreenSaver) return state.windows.onScreenSaver();
return true; //true = allow screen saver (default); false = suppress screen saver
}
auto Application::Windows::onModalChange(const function<void (bool)>& callback) -> void {
state.windows.onModalChange = callback;
}
auto Application::Windows::onScreenSaver(const function<bool ()>& callback) -> void {
state.windows.onScreenSaver = callback;
}
//Cocoa
//=====
auto Application::Cocoa::doAbout() -> void {
if(state.cocoa.onAbout) return state.cocoa.onAbout();
}
auto Application::Cocoa::doActivate() -> void {
if(state.cocoa.onActivate) return state.cocoa.onActivate();
}
auto Application::Cocoa::doPreferences() -> void {
if(state.cocoa.onPreferences) return state.cocoa.onPreferences();
}
auto Application::Cocoa::doQuit() -> void {
if(state.cocoa.onQuit) return state.cocoa.onQuit();
}
auto Application::Cocoa::onAbout(const function<void ()>& callback) -> void {
state.cocoa.onAbout = callback;
}
auto Application::Cocoa::onActivate(const function<void ()>& callback) -> void {
state.cocoa.onActivate = callback;
}
auto Application::Cocoa::onPreferences(const function<void ()>& callback) -> void {
state.cocoa.onPreferences = callback;
}
auto Application::Cocoa::onQuit(const function<void ()>& callback) -> void {
state.cocoa.onQuit = callback;
}
//Internal
//========
auto Application::initialize() -> void {
static bool initialized = false;
if(initialized == false) {
initialized = true;
return pApplication::initialize();
}
}
#endif