Changes to fix compilation on linux

This commit is contained in:
Mr-Wiseguy
2024-04-21 14:18:33 -04:00
parent 68ee43f5ac
commit a6e34bb49b
8 changed files with 39 additions and 18 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ std::filesystem::path recomp::get_app_folder_path() {
}
if (homedir != nullptr) {
recomp_dir = std::filesystem::path{homedir} / (std::string{"."} + recomp::program_id);
recomp_dir = std::filesystem::path{homedir} / (std::u8string{u8"."} + std::u8string{recomp::program_id});
}
#endif
+1 -4
View File
@@ -380,12 +380,9 @@ void recomp::set_rumble(bool on) {
InputState.rumble_active = on;
}
static float lerp(float from, float to, float amount) {
return (from + (to - from) * amount);
}
static float smoothstep(float from, float to, float amount) {
amount = (amount * amount) * (3.0f - 2.0f * amount);
return lerp(from, to, amount);
return std::lerp(from, to, amount);
}
// Update rumble to attempt to mimic the way n64 rumble ramps up and falls off
+1 -1
View File
@@ -39,7 +39,7 @@ extern "C" void recomp_powf(uint8_t* rdram, recomp_context* ctx) {
float a = _arg<0, float>(rdram, ctx);
float b = ctx->f14.fl; //_arg<1, float>(rdram, ctx);
_return(ctx, std::powf(a, b));
_return(ctx, std::pow(a, b));
}
extern "C" void recomp_get_target_framerate(uint8_t* rdram, recomp_context* ctx) {
+1 -7
View File
@@ -17,12 +17,6 @@
#include "../ultramodern/ultramodern.hpp"
#include "../../RecompiledPatches/patches_bin.h"
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#else
#define EXPORT __attribute__((visibility("default")))
#endif
#ifdef _MSC_VER
inline uint32_t byteswap(uint32_t val) {
return _byteswap_ulong(val);
@@ -49,7 +43,7 @@ bool check_hash(const std::vector<uint8_t>& rom_data, uint64_t expected_hash) {
return calculated_hash == expected_hash;
}
std::vector<uint8_t> read_file(const std::filesystem::path& path) {
static std::vector<uint8_t> read_file(const std::filesystem::path& path) {
std::vector<uint8_t> ret;
std::ifstream file{ path, std::ios::binary};
+1 -1
View File
@@ -68,7 +68,7 @@ struct TextureHandle {
std::unique_ptr<RT64::RenderDescriptorSet> set;
};
std::vector<char> read_file(const std::filesystem::path& filepath) {
static std::vector<char> read_file(const std::filesystem::path& filepath) {
std::vector<char> ret{};
std::ifstream input_file{ filepath, std::ios::binary };