Skip to content

Commit

Permalink
1.5.82 release
Browse files Browse the repository at this point in the history
* Imagine: Update C++ standard to C++26 and fix build issues
* Imagine: Add visit() member function for variant types using AddVisit CRTP class
* Imagine: Clean up decltype usage in various headers
* Imagine: Remove unused bundled FreeType library
* Imagine: Fix evaluating LD variable in makefiles too early
* NES.emu: Add/Update Lightful and Palightful palettes
* C64.emu, GBA.emu, GBC.emu, MD.emu, PCE.emu, Saturn.emu: Fix C++26 build errors due to deprecated arithmetic conversions on enums
  • Loading branch information
Robert Broglia committed May 1, 2024
1 parent ff8573d commit 540c1e6
Show file tree
Hide file tree
Showing 60 changed files with 254 additions and 670 deletions.
2 changes: 1 addition & 1 deletion C64.emu/src/vice/resid/sid.cc
Expand Up @@ -579,7 +579,7 @@ bool SID::set_sampling_parameters(double clock_freq, sampling_method method,
if (method == SAMPLE_RESAMPLE || method == SAMPLE_RESAMPLE_FASTMEM)
{
// Check whether the sample ring buffer would overfill.
if (FIR_N*clock_freq/sample_freq >= RINGSIZE) {
if (double(FIR_N)*clock_freq/sample_freq >= double(RINGSIZE)) {
return false;
}

Expand Down
2 changes: 0 additions & 2 deletions EmuFramework/include/emuframework/DataPathSelectView.hh
Expand Up @@ -44,8 +44,6 @@ template<DataPathSelectMode mode, ArchivePathSelectMode archiveMode = ArchivePat
class DataPathSelectView : public TableView, public EmuAppHelper
{
public:
using EmuAppHelper::app;

enum class Mode: uint8_t
{
File, Folder
Expand Down
39 changes: 20 additions & 19 deletions EmuFramework/include/emuframework/VController.hh
Expand Up @@ -378,10 +378,11 @@ public:

using VControllerElementVariant = std::variant<VControllerButtonGroup, VControllerUIButtonGroup, VControllerDPad>;

class VControllerElement : public VControllerElementVariant
class VControllerElement : public VControllerElementVariant, public AddVisit
{
public:
using VControllerElementVariant::VControllerElementVariant;
using AddVisit::visit;

std::array<VControllerLayoutPosition, 2> layoutPos;
VControllerState state{VControllerState::SHOWN};
Expand All @@ -394,13 +395,13 @@ public:
{
return (sizeof(VControllerLayoutPosition::pos) + sizeof(_2DOrigin::PackedType)) * 2
+ sizeof(state)
+ visit([](auto &e){ return e.configSize(); }, *this);
+ visit([](auto &e){ return e.configSize(); });
}

WRect bounds() const { return visit([](auto &e){ return e.bounds(); }, *this); }
WRect realBounds() const { return visit([](auto &e){ return e.realBounds(); }, *this); }
void setPos(WPt pos, WRect viewBounds) { visit([&](auto &e){ e.setPos(pos, viewBounds); }, *this); }
void setAlpha(float alpha) { visit([&](auto &e){ e.setAlpha(alpha); }, *this); }
WRect bounds() const { return visit([](auto &e){ return e.bounds(); }); }
WRect realBounds() const { return visit([](auto &e){ return e.realBounds(); }); }
void setPos(WPt pos, WRect viewBounds) { visit([&](auto &e){ e.setPos(pos, viewBounds); }); }
void setAlpha(float alpha) { visit([&](auto &e){ e.setAlpha(alpha); }); }

static bool shouldDraw(VControllerState state, bool showHidden)
{
Expand All @@ -411,7 +412,7 @@ public:
{
if(!shouldDraw(state, showHidden))
return;
visit([&](auto &e){ e.drawButtons(cmds); }, *this);
visit([&](auto &e){ e.drawButtons(cmds); });
}

void drawBounds(Gfx::RendererCommands &__restrict__ cmds, bool showHidden) const
Expand All @@ -424,7 +425,7 @@ public:
{
e.drawBounds(cmds);
}
}, *this);
});
}

void place(WRect viewBounds, WRect windowBounds, int layoutIdx)
Expand All @@ -440,7 +441,7 @@ public:
[&](VControllerDPad &e){ e.setShowBounds(r, on); },
[&](VControllerButtonGroup &e){ e.setShowBounds(on); },
[](auto &e){}
}, *this);
});
}

_2DOrigin layoutOrigin() const
Expand All @@ -449,12 +450,12 @@ public:
{
[&](const VControllerDPad &e){ return LB2DO; },
[](auto &e){ return e.layout.origin; }
}, *this);
});
}

std::string name(const InputManager &mgr) const
{
return visit([&](auto &e){ return e.name(mgr); }, *this);
return visit([&](auto &e){ return e.name(mgr); });
}

void updateMeasurements(const Window &win)
Expand All @@ -465,7 +466,7 @@ public:
{
e.updateMeasurements(win);
}
}, *this);
});
}

void transposeKeysForPlayer(const InputManager &mgr, int player)
Expand All @@ -476,7 +477,7 @@ public:
{
e.transposeKeysForPlayer(mgr, player);
}
}, *this);
});
}

std::span<VControllerButton> buttons()
Expand All @@ -487,7 +488,7 @@ public:
return e.buttons;
else
return {};
}, *this);
});
}

void add(KeyInfo keyCode)
Expand All @@ -498,7 +499,7 @@ public:
{
e.buttons.emplace_back(keyCode);
}
}, *this);
});
}

void remove(VControllerButton &btnToErase)
Expand All @@ -509,7 +510,7 @@ public:
{
std::erase_if(e.buttons, [&](auto &b) { return &b == &btnToErase; });
}
}, *this);
});
}

void setRowSize(int8_t size)
Expand All @@ -518,7 +519,7 @@ public:
{
if constexpr(requires {e.layout.rowItems;})
e.layout.rowItems = size;
}, *this);
});
}

auto rowSize() const
Expand All @@ -529,7 +530,7 @@ public:
return e.layout.rowItems;
else
return 1;
}, *this);
});
}

void updateSprite(VControllerButton &b)
Expand All @@ -538,7 +539,7 @@ public:
{
if constexpr(requires {e.updateSprite(b);})
e.updateSprite(b);
}, *this);
});
}
};

Expand Down
3 changes: 2 additions & 1 deletion EmuFramework/include/emuframework/inputDefs.hh
Expand Up @@ -17,6 +17,7 @@

#include <imagine/input/inputDefs.hh>
#include <imagine/util/container/array.hh>
#include <imagine/util/concepts.hh>
#include <array>
#include <cstdint>

Expand Down Expand Up @@ -49,7 +50,7 @@ struct KeyInfo

constexpr KeyInfo() = default;

constexpr KeyInfo(auto code, KeyFlags flags = {}):
constexpr KeyInfo(NotPointer auto code, KeyFlags flags = {}):
codes{KeyCode(code)}, flags{flags} {}

template <class T>
Expand Down
2 changes: 1 addition & 1 deletion EmuFramework/metadata/conf.mk
@@ -1,4 +1,4 @@
metadata_version = 1.5.81
metadata_version = 1.5.82
metadata_supportedMIMETypes = application/zip
metadata_supportedFileExtensions = rar 7z
android_metadata_versionCodeExtra = 16
Expand Down
4 changes: 2 additions & 2 deletions EmuFramework/src/gui/ButtonConfigView.cc
Expand Up @@ -226,7 +226,7 @@ void ButtonConfigSetView::place()

bool ButtonConfigSetView::inputEvent(const Input::Event &e)
{
return visit(overloaded
return e.visit(overloaded
{
[&](const Input::MotionEvent &motionEv)
{
Expand Down Expand Up @@ -300,7 +300,7 @@ bool ButtonConfigSetView::inputEvent(const Input::Event &e)
}
return true;
}
}, e);
});
}

void ButtonConfigSetView::finalize()
Expand Down
4 changes: 2 additions & 2 deletions EmuFramework/src/gui/CreditsView.cc
Expand Up @@ -59,11 +59,11 @@ void CreditsView::place()

bool CreditsView::inputEvent(const Input::Event &e)
{
if(visit(overloaded
if(e.visit(overloaded
{
[&](const Input::MotionEvent &e) { return viewRect().overlaps(e.pos()) && e.released(); },
[&](const Input::KeyEvent &e) { return e.pushed(Input::DefaultKey::CANCEL); }
}, e))
}))
{
dismiss();
return true;
Expand Down
4 changes: 2 additions & 2 deletions EmuFramework/src/gui/EmuInputView.cc
Expand Up @@ -75,7 +75,7 @@ void EmuInputView::updateRunSpeed(AltSpeedMode mode)

bool EmuInputView::inputEvent(const Input::Event &e)
{
return visit(overloaded
return e.visit(overloaded
{
[&](const Input::MotionEvent &motionEv)
{
Expand Down Expand Up @@ -139,7 +139,7 @@ bool EmuInputView::inputEvent(const Input::Event &e)
|| keyEv.isGamepad() // consume all gamepad events
|| devData.devConf.shouldHandleUnboundKeys;
}
}, e);
});
}

void EmuInputView::setSystemGestureExclusion(bool on)
Expand Down
4 changes: 2 additions & 2 deletions EmuFramework/src/gui/InputManagerView.cc
Expand Up @@ -53,7 +53,7 @@ void IdentInputDeviceView::place()

bool IdentInputDeviceView::inputEvent(const Input::Event &e)
{
return visit(overloaded
return e.visit(overloaded
{
[&](const Input::MotionEvent &e)
{
Expand All @@ -75,7 +75,7 @@ bool IdentInputDeviceView::inputEvent(const Input::Event &e)
}
return false;
}
}, e);
});
}

void IdentInputDeviceView::draw(Gfx::RendererCommands &__restrict__ cmds)
Expand Down
4 changes: 2 additions & 2 deletions EmuFramework/src/gui/PlaceVControlsView.cc
Expand Up @@ -84,7 +84,7 @@ void PlaceVControlsView::place()

bool PlaceVControlsView::inputEvent(const Input::Event &e)
{
return visit(overloaded
return e.visit(overloaded
{
[&](const Input::KeyEvent &e)
{
Expand Down Expand Up @@ -170,7 +170,7 @@ bool PlaceVControlsView::inputEvent(const Input::Event &e)
});
return true;
}
}, e);
});
}

void PlaceVControlsView::draw(Gfx::RendererCommands &__restrict__ cmds)
Expand Down
4 changes: 2 additions & 2 deletions EmuFramework/src/gui/PlaceVideoView.cc
Expand Up @@ -65,7 +65,7 @@ void PlaceVideoView::place()

bool PlaceVideoView::inputEvent(const Input::Event &e)
{
return visit(overloaded
return e.visit(overloaded
{
[&](const Input::KeyEvent &e)
{
Expand Down Expand Up @@ -150,7 +150,7 @@ bool PlaceVideoView::inputEvent(const Input::Event &e)
}
return true;
}
}, e);
});
}

void PlaceVideoView::draw(Gfx::RendererCommands &__restrict__ cmds)
Expand Down
8 changes: 4 additions & 4 deletions EmuFramework/src/gui/TouchConfigView.cc
Expand Up @@ -1029,12 +1029,12 @@ void TouchConfigView::reloadItems()
elem.name(app().inputManager), attachParams(),
[this, &elem](const Input::Event &e)
{
visit(overloaded
elem.visit(overloaded
{
[&](VControllerDPad &){ pushAndShow(makeView<DPadElementConfigView>(*this, vController, elem), e); },
[&](VControllerButtonGroup &){ pushAndShow(makeView<ButtonGroupElementConfigView>(*this, vController, elem), e); },
[](auto &){}
}, elem);
});
});
item.emplace_back(&i);
}
Expand All @@ -1045,11 +1045,11 @@ void TouchConfigView::reloadItems()
elem.name(app().inputManager), attachParams(),
[this, &elem](const Input::Event &e)
{
visit(overloaded
elem.visit(overloaded
{
[&](VControllerUIButtonGroup &){ pushAndShow(makeView<ButtonGroupElementConfigView>(*this, vController, elem), e); },
[](auto &){}
}, elem);
});
});
item.emplace_back(&i);
}
Expand Down

0 comments on commit 540c1e6

Please sign in to comment.