Skip to content
Open
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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ add_subdirectory(Externals/corrosion)

if(SLIPPI_PLAYBACK)
# Slippi Playback build option
# message("Enabling Playback build")
# add_definitions(-DIS_PLAYBACK=1)
message("Enabling Playback build")
add_definitions(-DIS_PLAYBACK=1)
endif()

########################################
Expand Down
22 changes: 21 additions & 1 deletion CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,28 @@
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ]
},
{
"name": "ReleasePlayback",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${workspaceRoot}\\Build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
"variables": [
{
"name": "Qt5_DIR",
"value": "${workspaceRoot}\\Externals\\Qt\\Qt5.15.0\\msvc2019_64\\lib\\cmake\\Qt5",
"type": "STRING"
},
{
"name": "SLIPPI_PLAYBACK",
"value": "ON",
"type": "BOOL"
}
]
}
]
}
5 changes: 5 additions & 0 deletions Externals/imgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ set(SRCS
add_library(imgui STATIC ${SRCS})
dolphin_disable_warnings(imgui)
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
# Tell ImGui to both declare and emit the math operators in THIS target:
target_compile_definitions(imgui
PUBLIC
IMGUI_DEFINE_MATH_OPERATORS
)

target_link_libraries(imgui
PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Common/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Common
#ifndef IS_PLAYBACK
#define SLIPPI_REV_STR "4.0.0-mainline-beta.11" // netplay version
#else
#define SLIPPI_REV_STR "3.2.0" // playback version
#define SLIPPI_REV_STR "4.0.0-mainline-beta.1" // playback version
#endif

const std::string& GetScmRevStr()
Expand Down
21 changes: 10 additions & 11 deletions Source/Core/Core/HW/EXI/EXI_DeviceSlippi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,24 +941,23 @@ void CEXISlippi::prepareCharacterFrameData(Slippi::FrameData* frame, u8 port, u8
// << data.animation
// << "\n";

// WARN_LOG_FMT(EXPANSIONINTERFACE, "[Frame {}] [Player {}] Positions: %f | %f", frame_idx, port,
// data.locationX, data.locationY);
// WARN_LOG_FMT(EXPANSIONINTERFACE, "[Frame {}] [Player {}] Positions: {:.4} | {:.4}", frame->frame, port, data.locationX, data.locationY);

// Add all of the inputs in order
appendWordToBuffer(&m_read_queue, data.randomSeed);
appendWordToBuffer(&m_read_queue, static_cast<u32>(data.joystickX));
appendWordToBuffer(&m_read_queue, static_cast<u32>(data.joystickY));
appendWordToBuffer(&m_read_queue, static_cast<u32>(data.cstickX));
appendWordToBuffer(&m_read_queue, static_cast<u32>(data.cstickY));
appendWordToBuffer(&m_read_queue, static_cast<u32>(data.trigger));
appendWordToBuffer(&m_read_queue, std::bit_cast<u32>(data.joystickX));
appendWordToBuffer(&m_read_queue, std::bit_cast<u32>(data.joystickY));
appendWordToBuffer(&m_read_queue, std::bit_cast<u32>(data.cstickX));
appendWordToBuffer(&m_read_queue, std::bit_cast<u32>(data.cstickY));
appendWordToBuffer(&m_read_queue, std::bit_cast<u32>(data.trigger));
appendWordToBuffer(&m_read_queue, data.buttons);
appendWordToBuffer(&m_read_queue, static_cast<u32>(data.locationX));
appendWordToBuffer(&m_read_queue, static_cast<u32>(data.locationY));
appendWordToBuffer(&m_read_queue, static_cast<u32>(data.facingDirection));
appendWordToBuffer(&m_read_queue, std::bit_cast<u32>(data.locationX));
appendWordToBuffer(&m_read_queue, std::bit_cast<u32>(data.locationY));
appendWordToBuffer(&m_read_queue, std::bit_cast<u32>(data.facingDirection));
appendWordToBuffer(&m_read_queue, static_cast<u32>(data.animation));
m_read_queue.push_back(data.joystickXRaw);
m_read_queue.push_back(data.joystickYRaw);
appendWordToBuffer(&m_read_queue, static_cast<u32>(data.percent));
appendWordToBuffer(&m_read_queue, std::bit_cast<u32>(data.percent));
m_read_queue.push_back(data.cstickXRaw);
m_read_queue.push_back(data.cstickYRaw);
// NOTE TO DEV: If you add data here, make sure to increase the size above
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Slippi/SlippiConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ struct Config
Melee::Version melee_version;
bool oc_enable = true;
float oc_factor = 1.0f;
std::string slippi_input = "";
std::string slippi_input = ""; // Putting the default value here doesn't work for some reason
};
} // namespace Slippi
4 changes: 4 additions & 0 deletions Source/Core/DolphinNoGUI/MainNoGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ int main(int argc, char* argv[])
slippi_input_path = static_cast<const char*>(options.get("slippi_input"));
SConfig::GetSlippiConfig().slippi_input = slippi_input_path.value();
}
else
{
SConfig::GetSlippiConfig().slippi_input = "Slippi/playback.txt";
}
#endif

s_platform = GetPlatform(options);
Expand Down
12 changes: 12 additions & 0 deletions Source/Core/DolphinQt/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "Common/ScopeGuard.h"

#include "Core/Boot/Boot.h"
#include "Core/ConfigManager.h"
#include "Core/Config/MainSettings.h"
#include "Core/Core.h"
#include "Core/DolphinAnalytics.h"
Expand Down Expand Up @@ -176,6 +177,17 @@ int main(int argc, char* argv[])
#ifdef IS_PLAYBACK
if (options.is_set("hide-seekbar"))
Settings::Instance().SetSlippiSeekbarEnabled(false);

std::optional<std::string> slippi_input_path;
if (options.is_set("slippi_input"))
{
slippi_input_path = static_cast<const char*>(options.get("slippi_input"));
SConfig::GetSlippiConfig().slippi_input = slippi_input_path.value();
}
else
{
SConfig::GetSlippiConfig().slippi_input = "Slippi/playback.txt";
}
#endif

// Hook up alerts from core
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/DolphinQt/Settings/SlippiPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,15 @@ void SlippiPane::ToggleJukebox(bool checked)

if (Core::GetState(Core::System::GetInstance()) == Core::State::Running)
{
#ifndef IS_PLAYBACK
auto& system = Core::System::GetInstance();
auto& exi_manager = system.GetExpansionInterface();
ExpansionInterface::CEXISlippi* slippi_exi = static_cast<ExpansionInterface::CEXISlippi*>(
exi_manager.GetDevice(ExpansionInterface::Slot::B));

if (slippi_exi != nullptr)
slippi_exi->ConfigureJukebox();
#endif // IS_PLAYBACK
}
}

Expand All @@ -303,13 +305,15 @@ void SlippiPane::OnMusicVolumeUpdate(int volume)
m_music_volume_percent->setText(tr(" %1%").arg(volume));
if (Core::GetState(Core::System::GetInstance()) == Core::State::Running)
{
#ifndef IS_PLAYBACK
auto& system = Core::System::GetInstance();
auto& exi_manager = system.GetExpansionInterface();
ExpansionInterface::CEXISlippi* slippi_exi = static_cast<ExpansionInterface::CEXISlippi*>(
exi_manager.GetDevice(ExpansionInterface::Slot::B));

if (slippi_exi != nullptr)
slippi_exi->UpdateJukeboxDolphinMusicVolume(volume);
#endif // IS_PLAYBACK
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/VideoCommon/OnScreenDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ bool SeekBarBehavior(const ImRect& bb, ImGuiID id, int* v, int v_min, int v_max,
auto hover_bb = ImRect(ImVec2(width * 0.0025f, height - scaled_height * 0.0475f),
ImVec2(width * 0.9975f, bb.Min.y));

const bool hovered = ImGui::ItemHoverable(hover_bb, id);
const bool hovered = ImGui::ItemHoverable(hover_bb, id, ImGuiItemFlags_None);

if (!isHeld && isActive)
{
Expand Down Expand Up @@ -510,7 +510,7 @@ bool VolumeBarBehavior(const ImRect& bb, ImGuiID id, int* v, int v_min, int v_ma
}

const bool isDown = g.IO.MouseDown[0];
const bool hovered = ImGui::ItemHoverable(bb, id);
const bool hovered = ImGui::ItemHoverable(bb, id, ImGuiItemFlags_None);
static bool isHeld = false;
bool value_changed = false;
bool isActive = g.ActiveId == id;
Expand Down
1 change: 1 addition & 0 deletions build-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib:/usr/lib/
if [ "$1" == "playback" ]
then
echo "Using Playback build config"
CMAKE_FLAGS+=" -DSLIPPI_PLAYBACK=true"
else
echo "Using Netplay build config"
CMAKE_FLAGS+=" -DSLIPPI_PLAYBACK=false"
Expand Down
Loading