Compare commits

...

3 Commits

Author SHA1 Message Date
9b57d61ed0 [jasper/world] Update coding style
All checks were successful
Build / build (push) Successful in 1m47s
2025-06-19 21:25:05 -05:00
a32a0a067a Merge commit '7688c05bac8c20bc267cae62ec78d55e5d0c493b' 2025-05-31 02:14:15 -05:00
7688c05bac Squashed 'deps/nostalgia/' changes from e1cfcc8b..e78c4050
e78c4050 [nostalgia/gfx] Cleanup
6b7c5d89 [nostalgia] Update release notes
a33a73d7 [nostalgia/gfx/studio/palette] Add preview to color editor

git-subtree-dir: deps/nostalgia
git-subtree-split: e78c4050462c2ae4fa4347af7f1236763d2b8f8f
2025-05-31 02:14:15 -05:00
31 changed files with 133 additions and 118 deletions

View File

@@ -2,6 +2,7 @@
* Add ability to remember recent projects in config
* PaletteEditor: Add RGB key shortcuts for focusing color channels
* PaletteEditor: Add color preview to color editor
# d2025.05.2

View File

@@ -307,6 +307,15 @@ void PaletteEditorImGui::drawColorEditor() noexcept {
colorInput("Red", r, inputFocused, FocusCmd::Red);
colorInput("Green", g, inputFocused, FocusCmd::Green);
colorInput("Blue", b, inputFocused, FocusCmd::Blue);
// color preview
{
ImGui::PushStyleColor(
ImGuiCol_ChildBg,
color32(color16(r, g, b)) | 0xff'00'00'00);
ImGui::BeginChild("ColorPreview", {0, 25});
ImGui::EndChild();
ImGui::PopStyleColor();
}
if (ig::PushButton("Apply to all pages", {-1, ig::BtnSz.y})) {
std::ignore = pushCommand<ApplyColorAllPagesCommand>(
m_pal, m_page, m_selectedColorRow);

View File

@@ -6,7 +6,7 @@
namespace jasper::world {
TileClipboard::TileClipboard(ox::UUID assetId, ox::Size selSz) noexcept:
TileClipboard::TileClipboard(ox::UUID const &assetId, ox::Size selSz) noexcept:
m_assetId(assetId), m_selSz(selSz) {
}
@@ -14,7 +14,7 @@ ox::Size TileClipboard::selectionSize() const noexcept {
return m_selSz;
}
void TileClipboard::addTile(const ModifyTilesCommand::Mod&mod) noexcept {
void TileClipboard::addTile(ModifyTilesCommand::Mod const &mod) noexcept {
m_tileMods.emplace_back(mod);
}

View File

@@ -21,7 +21,7 @@ class TileClipboard : public turbine::ClipboardObject<TileClipboard> {
ox::Vector<ModifyTilesCommand::Mod> m_tileMods;
public:
TileClipboard(ox::UUID assetId, ox::Size selSz) noexcept;
TileClipboard(ox::UUID const &assetId, ox::Size selSz) noexcept;
[[nodiscard]]
ox::Size selectionSize() const noexcept;

View File

@@ -17,7 +17,9 @@
namespace jasper::world {
template<
WorldObjCommand cmd, auto getVar, auto hasMerge = false,
WorldObjCommand cmd,
auto getVar,
auto hasMerge = false,
typename ValType = std::remove_reference_t<decltype(getVar(*new WorldObject))>>
class EditObject: public studio::UndoCommand {
private:

View File

@@ -178,7 +178,10 @@ ox::Error WorldObjectSetEditorImGui::loadObj() noexcept {
}
[[nodiscard]]
static ox::Vec2 clickPos(ImVec2 const&imgSz, ImVec2 const&offset, ox::Vec2 clickPos) noexcept {
static ox::Vec2 clickPos(
ImVec2 const &imgSz,
ImVec2 const &offset,
ox::Vec2 clickPos) noexcept {
clickPos.x -= offset.x;
clickPos.y -= offset.y;
clickPos.x /= imgSz.x;

View File

@@ -11,13 +11,13 @@
namespace jasper::world {
[[nodiscard]]
static bool isUpdatingObj(ObjTileRefSet const&obj) noexcept {
bool isUpdatingObj(ObjTileRefSet const &obj) noexcept {
return obj.frames > 1;
}
World::World(ngfx::Context &nctx, WorldStatic const &worldStatic) noexcept:
m_nctx(nctx),
m_worldStatic(worldStatic) {}
m_nctx{nctx},
m_worldStatic{worldStatic} {}
ox::Error World::setupDisplay() noexcept {
if (m_worldStatic.objTileRefSets.empty()) {