Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,78 @@ FetchContent_Declare(
EXCLUDE_FROM_ALL
)

FetchContent_Declare(
boost_core
GIT_TAG "boost-1.91.0"
GIT_REPOSITORY "https://github.com/boostorg/core.git"
SYSTEM
EXCLUDE_FROM_ALL
)

FetchContent_Declare(
boost_config
GIT_TAG "boost-1.91.0"
GIT_REPOSITORY "https://github.com/boostorg/config.git"
SYSTEM
EXCLUDE_FROM_ALL
)

FetchContent_Declare(
boost_throwexception
GIT_TAG "boost-1.91.0"
GIT_REPOSITORY "https://github.com/boostorg/throw_exception.git"
SYSTEM
EXCLUDE_FROM_ALL
)

FetchContent_Declare(
boost_assert
GIT_TAG "boost-1.91.0"
GIT_REPOSITORY "https://github.com/boostorg/assert.git"
SYSTEM
EXCLUDE_FROM_ALL
)

FetchContent_Declare(
boost_preprocessor
GIT_TAG "boost-1.91.0"
GIT_REPOSITORY "https://github.com/boostorg/preprocessor.git"
SYSTEM
EXCLUDE_FROM_ALL
)

FetchContent_Declare(
boost_move
GIT_TAG "boost-1.91.0"
GIT_REPOSITORY "https://github.com/boostorg/move.git"
SYSTEM
EXCLUDE_FROM_ALL
)

FetchContent_Declare(
boost_typetraits
GIT_TAG "boost-1.91.0"
GIT_REPOSITORY "https://github.com/boostorg/type_traits.git"
SYSTEM
EXCLUDE_FROM_ALL
)

FetchContent_Declare(
boost_conceptcheck
GIT_TAG "boost-1.91.0"
GIT_REPOSITORY "https://github.com/boostorg/concept_check.git"
SYSTEM
EXCLUDE_FROM_ALL
)

FetchContent_Declare(
boost_circularbuffer
GIT_TAG "boost-1.91.0"
GIT_REPOSITORY "https://github.com/boostorg/circular_buffer.git"
SYSTEM
EXCLUDE_FROM_ALL
)

if (NOT VCPKG_TOOLCHAIN)
FetchContent_MakeAvailable(fmt)
endif ()
Expand All @@ -904,6 +976,16 @@ FetchContent_MakeAvailable(readerwriterqueue)
FetchContent_MakeAvailable(unordered_dense)
FetchContent_MakeAvailable(magic_enum)

FetchContent_MakeAvailable(boost_core)
FetchContent_MakeAvailable(boost_config)
FetchContent_MakeAvailable(boost_throwexception)
FetchContent_MakeAvailable(boost_assert)
FetchContent_MakeAvailable(boost_preprocessor)
FetchContent_MakeAvailable(boost_move)
FetchContent_MakeAvailable(boost_typetraits)
FetchContent_MakeAvailable(boost_conceptcheck)
FetchContent_MakeAvailable(boost_circularbuffer)

if (NOT DEFINED IMPACTO_DISABLE_MMAP)
list(APPEND Impacto_Src
src/io/memorymappedfilestream.cpp
Expand Down Expand Up @@ -1080,6 +1162,7 @@ list(APPEND Impacto_Libs
utf8cpp
concurrentqueue
readerwriterqueue
Boost::circular_buffer
)

if (NOT DEFINED IMPACTO_DISABLE_LIBASS)
Expand Down
9 changes: 8 additions & 1 deletion THIRDPARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ All third-party code mentioned above is mandatory, included in the build process
* [pugixml](https://github.com/zeux/pugixml)
* [UTF8-CPP](https://github.com/nemtrif/utfcpp)
* [magic_enum](https://github.com/Neargye/magic_enum)
* [boost](https://boost.org)

**Sourcing and linkage:**

Expand Down Expand Up @@ -764,7 +765,7 @@ Copyright 2014 Melissa O'Neill <oneill@pcg-random.org>

Licensed under the Apache License, Version 2.0. See below for license text.

# Ryujinx
## Ryujinx

https://github.com/Ryujinx/Ryujinx/tree/eee639d6ba544fa5dd9352426d55e91bc54e157d/Ryujinx.Graphics/Graphics3d/Texture

Expand Down Expand Up @@ -1000,6 +1001,12 @@ https://github.com/libass/libass

See below for license text (ISC)

## boost

https://boost.org

See below for license text (Boost Software License, Version 1.0)

# Generic license texts

## 2-clause BSD license
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.9.
0.9.10.
39 changes: 22 additions & 17 deletions src/games/cc/backlogmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using namespace Impacto::UI::Widgets::CC;
using namespace Impacto::Profile::ScriptVars;

void BacklogMenu::MenuButtonOnClick(Widgets::BacklogEntry* target) {
UI::BacklogMenu::MenuButtonOnClick(target);
UI::BacklogMenu<BacklogEntry>::MenuButtonOnClick(target);

if (!target->AudioId.has_value())
Audio::PlayInGroup(Audio::ACG_SE, "sysse", 4, false, 0.0f);
Expand All @@ -31,12 +31,12 @@ void BacklogMenu::Show() {
CommonMenu::OnShow(FadeInDuration, FadeOutDuration, FadeAnimation);
}

UI::BacklogMenu::Show();
UI::BacklogMenu<BacklogEntry>::Show();
}

void BacklogMenu::Hide() {
Audio::Channels[Audio::AC_REV]->Stop(0.0f);
UI::BacklogMenu::Hide();
UI::BacklogMenu<BacklogEntry>::Hide();
}

void BacklogMenu::UpdateVisibility() {
Expand All @@ -56,16 +56,18 @@ void BacklogMenu::UpdateVisibility() {
IsFocused = false;
if (UI::FocusedMenu) UI::FocusedMenu->IsFocused = true;

MainItems->Hide();
for (auto& entry : Entries) {
entry.Hide();
}
}
}

void BacklogMenu::Update(float dt) {
float prevScrollPos = *MainScrollbar->Value;
UI::BacklogMenu::Update(dt);
if (IsFocused && prevScrollPos != *MainScrollbar->Value) {
float prevScrollPos = *MainScrollbar.Value;
UI::BacklogMenu<BacklogEntry>::Update(dt);
if (IsFocused && prevScrollPos != *MainScrollbar.Value) {
if (auto* menu = dynamic_cast<UI::CCLCC::SystemMenu*>(UI::SystemMenuPtr)) {
menu->BGPosition.y += (prevScrollPos - *MainScrollbar->Value) * 0.5f;
menu->BGPosition.y += (prevScrollPos - *MainScrollbar.Value) * 0.5f;
}
}
}
Expand All @@ -76,24 +78,27 @@ void BacklogMenu::Render() {
const float opacity = glm::smoothstep(0.0f, 1.0f, FadeAnimation.Progress);
const glm::vec4 transition(1.0f, 1.0f, 1.0f, opacity);

MainItems->Tint = transition;
MainScrollbar->Tint = transition;

const float backgroundY =
static_cast<float>(fmod(PageY - EntryYPadding - RenderingBounds.Y,
BacklogBackground.Bounds.Height));
static_cast<float>(fmod(PageY, BacklogBackground.Bounds.Height));

if (OpenedAsDirect) CommonMenu::DrawBgSprite<false>(State, FadeAnimation);

for (float yPos = backgroundY; yPos <= Profile::DesignHeight;
yPos += BacklogBackground.Bounds.Height) {
for (float yPos = backgroundY - Profile::DesignHeight;
yPos <= Profile::DesignHeight; yPos += BacklogBackground.Bounds.Height) {
Renderer->DrawSprite(BacklogBackground, {0.0f, yPos}, transition);
}

RenderHighlight();
Renderer->DrawSprite(BacklogHeaderSprite, BacklogHeaderPosition, transition);
MainItems->Render();
MainScrollbar->Render();

for (auto& entry : Entries) {
if (!entry.Bounds.Intersects(RenderingBounds)) continue;
entry.Tint = transition;
entry.Render();
}

MainScrollbar.Tint = transition;
MainScrollbar.Render();

if (ScrWork[SW_SYSSUBMENUNO] == 1) {
CommonMenu::DrawOverlay();
Expand Down
10 changes: 2 additions & 8 deletions src/games/cc/backlogmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@ namespace Impacto {
namespace UI {
namespace CC {

class BacklogMenu : public UI::BacklogMenu, public CCLCC::CommonMenu {
class BacklogMenu : public UI::BacklogMenu<Widgets::CC::BacklogEntry>,
public CCLCC::CommonMenu {
public:
void Show() override;
void Hide() override;
void Render() override;
void Update(float dt) override;

Widgets::BacklogEntry* CreateBacklogEntry(
int id, Vm::BufferOffsetContext scrCtx, std::optional<int> audioId,
int characterId, glm::vec2 pos, const RectF& hoverBounds) const override {
return new Widgets::CC::BacklogEntry(id, scrCtx, audioId, characterId, pos,
hoverBounds);
}

void MenuButtonOnClick(Widgets::BacklogEntry* target) override;

private:
Expand Down
34 changes: 21 additions & 13 deletions src/games/chlcc/backlogmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void BacklogMenu::Show() {
FromSystemMenuTransition->StartIn();
}
IsFocused = true;
UI::BacklogMenu::Show();
UI::BacklogMenu<BacklogEntry>::Show();
}
}

Expand Down Expand Up @@ -70,15 +70,21 @@ void BacklogMenu::Render() {
Renderer->DisableScissor();
RenderHighlight({0.0f, yOffset});
}
MainItems->RenderingBounds.Y += yOffset;
MainItems->Move({0.0f, yOffset});
MainItems->Render();
MainItems->Move({0.0f, -yOffset});
MainItems->RenderingBounds.Y -= yOffset;

MainScrollbar->Move({0.0f, yOffset});
MainScrollbar->Render();
MainScrollbar->Move({0.0f, -yOffset});

Renderer->EnableScissor();
Renderer->SetScissorRect(RectF(RenderingBounds).Translate({0.0f, yOffset}));
for (auto& entry : Entries) {
if (!entry.Bounds.Intersects(RenderingBounds)) continue;

entry.Move({0.0f, yOffset});
entry.Render();
entry.Move({0.0f, -yOffset});
}
Renderer->DisableScissor();

MainScrollbar.Move({0.0f, yOffset});
MainScrollbar.Render();
MainScrollbar.Move({0.0f, -yOffset});
}

void BacklogMenu::Update(float dt) {
Expand All @@ -97,16 +103,18 @@ void BacklogMenu::Update(float dt) {
systemMenuCHG == 0 && (sysMenuCt == 0 || GetFlag(SF_SYSTEMMENU)) &&
State == Hiding) {
State = Hidden;
MainItems->Hide();

for (auto& entry : Entries) {
entry.Hide();
}
} else if (MenuTransition.IsIn() && sysMenuCt == 10000 &&
(systemMenuCHG == 0 || systemMenuCHG == 64) &&
GetFlag(SF_BACKLOGMENU) && State == Showing) {
State = Shown;
MainItems->HasFocus = true;
}

if (State != Hidden) {
UI::BacklogMenu::Update(dt);
UI::BacklogMenu<BacklogEntry>::Update(dt);
MenuTransition.Update(dt);
FromSystemMenuTransition->Update(dt);
if (MenuTransition.Direction == AnimationDirection::Out &&
Expand Down
10 changes: 2 additions & 8 deletions src/games/chlcc/backlogmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,15 @@ namespace Impacto {
namespace UI {
namespace CHLCC {

class BacklogMenu : public UI::BacklogMenu, public CommonMenu {
class BacklogMenu : public UI::BacklogMenu<Widgets::CHLCC::BacklogEntry>,
public CommonMenu {
public:
BacklogMenu();

void Show() override;
void Hide() override;
void Update(float dt) override;
void Render() override;

Widgets::BacklogEntry* CreateBacklogEntry(
int id, Vm::BufferOffsetContext scrCtx, std::optional<int> audioId,
int characterId, glm::vec2 pos, const RectF& hoverBounds) const override {
return new Widgets::CHLCC::BacklogEntry(id, scrCtx, audioId, characterId,
pos, hoverBounds);
}
};

} // namespace CHLCC
Expand Down
25 changes: 18 additions & 7 deletions src/games/mo6tw/backlogmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,24 @@ using namespace Impacto::Profile::MO6TW::BacklogMenu;
void BacklogMenu::Render() {
if (State == Hidden) return;

float opacity = glm::smoothstep(0.0f, 1.0f, FadeAnimation.Progress);
glm::vec4 col(1.0f, 1.0f, 1.0f, opacity);
MainItems->Tint = col;
MainScrollbar->Tint = col;
const float opacity = glm::smoothstep(0.0f, 1.0f, FadeAnimation.Progress);
const glm::vec4 col(1.0f, 1.0f, 1.0f, opacity);

Renderer->DrawSprite(BacklogBackground, glm::vec2(0.0f), col);
RenderHighlight();
MainItems->Render();
MainScrollbar->Render();

Renderer->EnableScissor();
Renderer->SetScissorRect(RenderingBounds);
for (auto& entry : Entries) {
if (!entry.Bounds.Intersects(RenderingBounds)) continue;

entry.Tint = col;
entry.Render();
}
Renderer->DisableScissor();

MainScrollbar.Tint = col;
MainScrollbar.Render();
}

void BacklogMenu::UpdateVisibility() {
Expand All @@ -35,7 +44,9 @@ void BacklogMenu::UpdateVisibility() {
IsFocused = false;
if (UI::FocusedMenu) UI::FocusedMenu->IsFocused = true;

MainItems->Hide();
for (auto& entry : Entries) {
entry.Hide();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/games/mo6tw/backlogmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Impacto {
namespace UI {
namespace MO6TW {

class BacklogMenu : public UI::BacklogMenu {
class BacklogMenu : public UI::BacklogMenu<Widgets::BacklogEntry> {
public:
void Render() override;

Expand Down
3 changes: 2 additions & 1 deletion src/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
#include <ankerl/unordered_dense.h>
#include <span>
#include <glm/glm.hpp>
#include <magic_enum/magic_enum.hpp>
#include <magic_enum/magic_enum.hpp>
#include <boost/circular_buffer.hpp>
Loading
Loading