Fix for gcc/clang build

This commit is contained in:
DH 2015-10-07 19:02:10 +03:00
parent cc0c3fc98d
commit 6cb036d35f
9 changed files with 108 additions and 86 deletions

View file

@ -56,45 +56,47 @@ struct size2_base
{ {
T width, height; T width, height;
/* constexpr size2_base() : width{}, height{}
size2_base() : width{}, height{}
{ {
} }
size2_base(T width, T height) : width{ width }, height{ height } constexpr size2_base(T width, T height) : width{ width }, height{ height }
{ {
} }
*/
size2_base operator -(const size2_base& rhs) const constexpr size2_base(const size2_base& rhs) : width{ rhs.width }, height{ rhs.height }
{
}
constexpr size2_base operator -(const size2_base& rhs) const
{ {
return{ width - rhs.width, height - rhs.height }; return{ width - rhs.width, height - rhs.height };
} }
size2_base operator -(T rhs) const constexpr size2_base operator -(T rhs) const
{ {
return{ width - rhs, height - rhs }; return{ width - rhs, height - rhs };
} }
size2_base operator +(const size2_base& rhs) const constexpr size2_base operator +(const size2_base& rhs) const
{ {
return{ width + rhs.width, height + rhs.height }; return{ width + rhs.width, height + rhs.height };
} }
size2_base operator +(T rhs) const constexpr size2_base operator +(T rhs) const
{ {
return{ width + rhs, height + rhs }; return{ width + rhs, height + rhs };
} }
size2_base operator /(const size2_base& rhs) const constexpr size2_base operator /(const size2_base& rhs) const
{ {
return{ width / rhs.width, height / rhs.height }; return{ width / rhs.width, height / rhs.height };
} }
size2_base operator /(T rhs) const constexpr size2_base operator /(T rhs) const
{ {
return{ width / rhs, height / rhs }; return{ width / rhs, height / rhs };
} }
size2_base operator *(const size2_base& rhs) const constexpr size2_base operator *(const size2_base& rhs) const
{ {
return{ width * rhs.width, height * rhs.height }; return{ width * rhs.width, height * rhs.height };
} }
size2_base operator *(T rhs) const constexpr size2_base operator *(T rhs) const
{ {
return{ width * rhs, height * rhs }; return{ width * rhs, height * rhs };
} }
@ -148,18 +150,18 @@ struct size2_base
return *this; return *this;
} }
bool operator == (const size2_base& rhs) const constexpr bool operator == (const size2_base& rhs) const
{ {
return width == rhs.width && height == rhs.height; return width == rhs.width && height == rhs.height;
} }
bool operator != (const size2_base& rhs) const constexpr bool operator != (const size2_base& rhs) const
{ {
return width != rhs.width || height != rhs.height; return width != rhs.width || height != rhs.height;
} }
template<typename NT> template<typename NT>
operator size2_base<NT>() const constexpr operator size2_base<NT>() const
{ {
return{ (NT)width, (NT)height }; return{ (NT)width, (NT)height };
} }
@ -285,84 +287,87 @@ template<typename T>
struct position2_base struct position2_base
{ {
T x, y; T x, y;
/*
position2_base() : x{}, y{} constexpr position2_base() : x{}, y{}
{ {
} }
position2_base(T x, T y) : x{ x }, y{ y } constexpr position2_base(T x, T y) : x{ x }, y{ y }
{ {
} }
*/
bool operator >(const position2_base& rhs) const constexpr position2_base(const position2_base& rhs) : x{ rhs.x }, y{ rhs.y }
{
}
constexpr bool operator >(const position2_base& rhs) const
{ {
return x > rhs.x && y > rhs.y; return x > rhs.x && y > rhs.y;
} }
bool operator >(T rhs) const constexpr bool operator >(T rhs) const
{ {
return x > rhs && y > rhs; return x > rhs && y > rhs;
} }
bool operator <(const position2_base& rhs) const constexpr bool operator <(const position2_base& rhs) const
{ {
return x < rhs.x && y < rhs.y; return x < rhs.x && y < rhs.y;
} }
bool operator <(T rhs) const constexpr bool operator <(T rhs) const
{ {
return x < rhs && y < rhs; return x < rhs && y < rhs;
} }
bool operator >=(const position2_base& rhs) const constexpr bool operator >=(const position2_base& rhs) const
{ {
return x >= rhs.x && y >= rhs.y; return x >= rhs.x && y >= rhs.y;
} }
bool operator >=(T rhs) const constexpr bool operator >=(T rhs) const
{ {
return x >= rhs && y >= rhs; return x >= rhs && y >= rhs;
} }
bool operator <=(const position2_base& rhs) const constexpr bool operator <=(const position2_base& rhs) const
{ {
return x <= rhs.x && y <= rhs.y; return x <= rhs.x && y <= rhs.y;
} }
bool operator <=(T rhs) const constexpr bool operator <=(T rhs) const
{ {
return x <= rhs && y <= rhs; return x <= rhs && y <= rhs;
} }
position2_base operator -(const position2_base& rhs) const constexpr position2_base operator -(const position2_base& rhs) const
{ {
return{ x - rhs.x, y - rhs.y }; return{ x - rhs.x, y - rhs.y };
} }
position2_base operator -(T rhs) const constexpr position2_base operator -(T rhs) const
{ {
return{ x - rhs, y - rhs }; return{ x - rhs, y - rhs };
} }
position2_base operator +(const position2_base& rhs) const constexpr position2_base operator +(const position2_base& rhs) const
{ {
return{ x + rhs.x, y + rhs.y }; return{ x + rhs.x, y + rhs.y };
} }
position2_base operator +(T rhs) const constexpr position2_base operator +(T rhs) const
{ {
return{ x + rhs, y + rhs }; return{ x + rhs, y + rhs };
} }
template<typename RhsT> template<typename RhsT>
position2_base operator *(RhsT rhs) const constexpr position2_base operator *(RhsT rhs) const
{ {
return{ T(x * rhs), T(y * rhs) }; return{ T(x * rhs), T(y * rhs) };
} }
position2_base operator *(const position2_base& rhs) const constexpr position2_base operator *(const position2_base& rhs) const
{ {
return{ T(x * rhs.x), T(y * rhs.y) }; return{ T(x * rhs.x), T(y * rhs.y) };
} }
template<typename RhsT> template<typename RhsT>
position2_base operator /(RhsT rhs) const constexpr position2_base operator /(RhsT rhs) const
{ {
return{ x / rhs, y / rhs }; return{ x / rhs, y / rhs };
} }
position2_base operator /(const position2_base& rhs) const constexpr position2_base operator /(const position2_base& rhs) const
{ {
return{ x / rhs.x, y / rhs.y }; return{ x / rhs.x, y / rhs.y };
} }
position2_base operator /(const size2_base<T>& rhs) const constexpr position2_base operator /(const size2_base<T>& rhs) const
{ {
return{ x / rhs.width, y / rhs.height }; return{ x / rhs.width, y / rhs.height };
} }
@ -393,59 +398,59 @@ struct position2_base
} }
template<typename RhsT> template<typename RhsT>
position2_base& operator *=(RhsT rhs) const position2_base& operator *=(RhsT rhs)
{ {
x *= rhs; x *= rhs;
y *= rhs; y *= rhs;
return *this; return *this;
} }
position2_base& operator *=(const position2_base& rhs) const position2_base& operator *=(const position2_base& rhs)
{ {
x *= rhs.x; x *= rhs.x;
y *= rhs.y; y *= rhs.y;
return *this; return *this;
} }
template<typename RhsT> template<typename RhsT>
position2_base& operator /=(RhsT rhs) const position2_base& operator /=(RhsT rhs)
{ {
x /= rhs; x /= rhs;
y /= rhs; y /= rhs;
return *this; return *this;
} }
position2_base& operator /=(const position2_base& rhs) const position2_base& operator /=(const position2_base& rhs)
{ {
x /= rhs.x; x /= rhs.x;
y /= rhs.y; y /= rhs.y;
return *this; return *this;
} }
bool operator ==(const position2_base& rhs) const constexpr bool operator ==(const position2_base& rhs) const
{ {
return x == rhs.x && y == rhs.y; return x == rhs.x && y == rhs.y;
} }
bool operator ==(T rhs) const constexpr bool operator ==(T rhs) const
{ {
return x == rhs && y == rhs; return x == rhs && y == rhs;
} }
bool operator !=(const position2_base& rhs) const constexpr bool operator !=(const position2_base& rhs) const
{ {
return !(*this == rhs); return !(*this == rhs);
} }
bool operator !=(T rhs) const constexpr bool operator !=(T rhs) const
{ {
return !(*this == rhs); return !(*this == rhs);
} }
template<typename NT> template<typename NT>
operator position2_base<NT>() const constexpr operator position2_base<NT>() const
{ {
return{ (NT)x, (NT)y }; return{ (NT)x, (NT)y };
} }
double distance(const position2_base& to) double distance(const position2_base& to) const
{ {
return std::sqrt(double((x - to.x) * (x - to.x) + (y - to.y) * (y - to.y))); return std::sqrt(double((x - to.x) * (x - to.x) + (y - to.y) * (y - to.y)));
} }
@ -646,12 +651,19 @@ struct coord_base
struct { T width, height; }; struct { T width, height; };
}; };
constexpr coord_base() : x{}, y{}, position{}, width{}, height{}, size{} constexpr coord_base() : position{}, size{}
#ifdef _MSC_VER
//compiler error
, x{}, y{}, width{}, height{}
#endif
{ {
} }
constexpr coord_base(const position_base<T>& position, const size2_base<T>& size) constexpr coord_base(const position_base<T>& position, const size2_base<T>& size)
: x{ position.x }, y{ position.y }, position{ position }, width{ size.width }, height{ size.height }, size{ size } : position{ position }, size{ size }
#ifdef _MSC_VER
, x{ position.x }, y{ position.y }, width{ size.width }, height{ size.height }
#endif
{ {
} }

View file

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#ifdef DX12_SUPPORT
#include "BufferUtils.h" #include "BufferUtils.h"
@ -244,3 +245,4 @@ void uploadIndexData(unsigned m_draw_mode, unsigned index_type, void* indexBuffe
} }
} }
} }
#endif

View file

@ -1,3 +1,4 @@
#ifdef DX12_SUPPORT
#pragma once #pragma once
#include <vector> #include <vector>
#include "Emu/Memory/vm.h" #include "Emu/Memory/vm.h"
@ -38,3 +39,4 @@ size_t getIndexCount(unsigned m_draw_mode, unsigned initial_index_count);
* Write index information to bufferMap * Write index information to bufferMap
*/ */
void uploadIndexData(unsigned m_draw_mode, unsigned index_type, void* indexBuffer, void* bufferMap, unsigned element_count); void uploadIndexData(unsigned m_draw_mode, unsigned index_type, void* indexBuffer, void* bufferMap, unsigned element_count);
#endif

View file

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#ifdef DX12_SUPPORT
#include "Emu/Memory/vm.h" #include "Emu/Memory/vm.h"
#include "TextureUtils.h" #include "TextureUtils.h"
#include "../RSXThread.h" #include "../RSXThread.h"
@ -542,3 +543,4 @@ std::vector<MipmapLevelInfo> uploadPlacedTexture(const RSXTexture &texture, size
} }
} }
#endif

View file

@ -1,4 +1,5 @@
#pragma once #pragma once
#ifdef DX12_SUPPORT
#include "../RSXTexture.h" #include "../RSXTexture.h"
#include <vector> #include <vector>
@ -22,3 +23,4 @@ size_t getPlacedTextureStorageSpace(const rsx::texture &texture, size_t rowPitch
* Similarly, offset for every mipmaplevel is aligned to rowPitchAlignement boundary. * Similarly, offset for every mipmaplevel is aligned to rowPitchAlignement boundary.
*/ */
std::vector<MipmapLevelInfo> uploadPlacedTexture(const rsx::texture &texture, size_t rowPitchAlignement, void* textureData); std::vector<MipmapLevelInfo> uploadPlacedTexture(const rsx::texture &texture, size_t rowPitchAlignement, void* textureData);
#endif

View file

@ -903,9 +903,9 @@ enum Method
namespace rsx namespace rsx
{ {
template<typename ...T> template<typename ...T>
static std::array<u32, sizeof...(T) + 1> make_command(u32 start_register, T... values) static auto make_command(u32 start_register, T... values) -> std::array<u32, sizeof...(values) + 1>
{ {
return{ (start_register << 2) | (sizeof...(values) << 18), values... }; return{ (start_register << 2) | u32(sizeof...(values) << 18), u32(values)... };
} }
static u32 make_jump(u32 offset) static u32 make_jump(u32 offset)
@ -916,14 +916,12 @@ namespace rsx
template<typename AT, typename ...T> template<typename AT, typename ...T>
static size_t make_command(vm::ps3::ptr<u32, AT> &dst, u32 start_register, T... values) static size_t make_command(vm::ps3::ptr<u32, AT> &dst, u32 start_register, T... values)
{ {
auto commands = make_command(start_register, values...); for (u32 command : { (start_register << 2) | u32(sizeof...(values) << 18), u32(values)... })
for (u32 command : commands)
{ {
*dst++ = command; *dst++ = command;
} }
return commands.size(); return sizeof...(values) + 1;
} }
template<typename AT> template<typename AT>

View file

@ -796,7 +796,7 @@ namespace gl
clamp_to_edge = GL_CLAMP_TO_EDGE, clamp_to_edge = GL_CLAMP_TO_EDGE,
clamp_to_border = GL_CLAMP_TO_BORDER, clamp_to_border = GL_CLAMP_TO_BORDER,
mirror_clamp = GL_MIRROR_CLAMP_EXT, mirror_clamp = GL_MIRROR_CLAMP_EXT,
mirror_clamp_to_edge = GL_MIRROR_CLAMP_TO_EDGE, //mirror_clamp_to_edge = GL_MIRROR_CLAMP_TO_EDGE,
mirror_clamp_to_border = GL_MIRROR_CLAMP_TO_BORDER_EXT mirror_clamp_to_border = GL_MIRROR_CLAMP_TO_BORDER_EXT
}; };

View file

@ -39,12 +39,12 @@ namespace rsx
namespace nv406e namespace nv406e
{ {
__forceinline void set_reference(thread* rsx, u32 arg) force_inline void set_reference(thread* rsx, u32 arg)
{ {
rsx->ctrl->ref.exchange(arg); rsx->ctrl->ref.exchange(arg);
} }
__forceinline void semaphore_acquire(thread* rsx, u32 arg) force_inline void semaphore_acquire(thread* rsx, u32 arg)
{ {
//TODO: dma //TODO: dma
while (vm::read32(rsx->label_addr + method_registers[NV406E_SEMAPHORE_OFFSET]) != arg) while (vm::read32(rsx->label_addr + method_registers[NV406E_SEMAPHORE_OFFSET]) != arg)
@ -56,7 +56,7 @@ namespace rsx
} }
} }
__forceinline void semaphore_release(thread* rsx, u32 arg) force_inline void semaphore_release(thread* rsx, u32 arg)
{ {
//TODO: dma //TODO: dma
vm::write32(rsx->label_addr + method_registers[NV406E_SEMAPHORE_OFFSET], arg); vm::write32(rsx->label_addr + method_registers[NV406E_SEMAPHORE_OFFSET], arg);
@ -65,13 +65,13 @@ namespace rsx
namespace nv4097 namespace nv4097
{ {
__forceinline void texture_read_semaphore_release(thread* rsx, u32 arg) force_inline void texture_read_semaphore_release(thread* rsx, u32 arg)
{ {
//TODO: dma //TODO: dma
vm::write32(rsx->label_addr + method_registers[NV4097_SET_SEMAPHORE_OFFSET], arg); vm::write32(rsx->label_addr + method_registers[NV4097_SET_SEMAPHORE_OFFSET], arg);
} }
__forceinline void back_end_write_semaphore_release(thread* rsx, u32 arg) force_inline void back_end_write_semaphore_release(thread* rsx, u32 arg)
{ {
//TODO: dma //TODO: dma
vm::write32(rsx->label_addr + method_registers[NV4097_SET_SEMAPHORE_OFFSET], vm::write32(rsx->label_addr + method_registers[NV4097_SET_SEMAPHORE_OFFSET],
@ -80,7 +80,7 @@ namespace rsx
//fire only when all data passed to rsx cmd buffer //fire only when all data passed to rsx cmd buffer
template<u32 id, u32 index, int count, typename type> template<u32 id, u32 index, int count, typename type>
__forceinline void set_vertex_data_impl(thread* rsx, u32 arg) force_inline void set_vertex_data_impl(thread* rsx, u32 arg)
{ {
static const size_t element_size = (count * sizeof(type)); static const size_t element_size = (count * sizeof(type));
static const size_t element_size_in_words = element_size / sizeof(u32); static const size_t element_size_in_words = element_size / sizeof(u32);
@ -105,56 +105,56 @@ namespace rsx
} }
template<u32 index> template<u32 index>
__forceinline void set_vertex_data4ub_m(thread* rsx, u32 arg) force_inline void set_vertex_data4ub_m(thread* rsx, u32 arg)
{ {
set_vertex_data_impl<NV4097_SET_VERTEX_DATA4UB_M, index, 4, u8>(rsx, arg); set_vertex_data_impl<NV4097_SET_VERTEX_DATA4UB_M, index, 4, u8>(rsx, arg);
} }
template<u32 index> template<u32 index>
__forceinline void set_vertex_data1f_m(thread* rsx, u32 arg) force_inline void set_vertex_data1f_m(thread* rsx, u32 arg)
{ {
set_vertex_data_impl<NV4097_SET_VERTEX_DATA1F_M, index, 1, f32>(rsx, arg); set_vertex_data_impl<NV4097_SET_VERTEX_DATA1F_M, index, 1, f32>(rsx, arg);
} }
template<u32 index> template<u32 index>
__forceinline void set_vertex_data2f_m(thread* rsx, u32 arg) force_inline void set_vertex_data2f_m(thread* rsx, u32 arg)
{ {
set_vertex_data_impl<NV4097_SET_VERTEX_DATA1F_M, index, 2, f32>(rsx, arg); set_vertex_data_impl<NV4097_SET_VERTEX_DATA1F_M, index, 2, f32>(rsx, arg);
} }
template<u32 index> template<u32 index>
__forceinline void set_vertex_data3f_m(thread* rsx, u32 arg) force_inline void set_vertex_data3f_m(thread* rsx, u32 arg)
{ {
set_vertex_data_impl<NV4097_SET_VERTEX_DATA1F_M, index, 3, f32>(rsx, arg); set_vertex_data_impl<NV4097_SET_VERTEX_DATA1F_M, index, 3, f32>(rsx, arg);
} }
template<u32 index> template<u32 index>
__forceinline void set_vertex_data4f_m(thread* rsx, u32 arg) force_inline void set_vertex_data4f_m(thread* rsx, u32 arg)
{ {
set_vertex_data_impl<NV4097_SET_VERTEX_DATA1F_M, index, 4, f32>(rsx, arg); set_vertex_data_impl<NV4097_SET_VERTEX_DATA1F_M, index, 4, f32>(rsx, arg);
} }
template<u32 index> template<u32 index>
__forceinline void set_vertex_data2s_m(thread* rsx, u32 arg) force_inline void set_vertex_data2s_m(thread* rsx, u32 arg)
{ {
set_vertex_data_impl<NV4097_SET_VERTEX_DATA2S_M, index, 2, u16>(rsx, arg); set_vertex_data_impl<NV4097_SET_VERTEX_DATA2S_M, index, 2, u16>(rsx, arg);
} }
template<u32 index> template<u32 index>
__forceinline void set_vertex_data4s_m(thread* rsx, u32 arg) force_inline void set_vertex_data4s_m(thread* rsx, u32 arg)
{ {
set_vertex_data_impl<NV4097_SET_VERTEX_DATA4S_M, index, 4, u16>(rsx, arg); set_vertex_data_impl<NV4097_SET_VERTEX_DATA4S_M, index, 4, u16>(rsx, arg);
} }
template<u32 index> template<u32 index>
__forceinline void set_vertex_data_array_format(thread* rsx, u32 arg) force_inline void set_vertex_data_array_format(thread* rsx, u32 arg)
{ {
auto& info = rsx->vertex_arrays_info[index]; auto& info = rsx->vertex_arrays_info[index];
info.unpack(arg); info.unpack(arg);
info.array = info.size > 0; info.array = info.size > 0;
} }
__forceinline void draw_arrays(thread* rsx, u32 arg) force_inline void draw_arrays(thread* rsx, u32 arg)
{ {
u32 first = arg & 0xffffff; u32 first = arg & 0xffffff;
u32 count = (arg >> 24) + 1; u32 count = (arg >> 24) + 1;
@ -162,7 +162,7 @@ namespace rsx
rsx->load_vertex_data(first, count); rsx->load_vertex_data(first, count);
} }
__forceinline void draw_index_array(thread* rsx, u32 arg) force_inline void draw_index_array(thread* rsx, u32 arg)
{ {
u32 first = arg & 0xffffff; u32 first = arg & 0xffffff;
u32 count = (arg >> 24) + 1; u32 count = (arg >> 24) + 1;
@ -172,7 +172,7 @@ namespace rsx
} }
template<u32 index> template<u32 index>
__forceinline void set_transform_constant(thread* rsxthr, u32 arg) force_inline void set_transform_constant(thread* rsxthr, u32 arg)
{ {
u32& load = method_registers[NV4097_SET_TRANSFORM_CONSTANT_LOAD]; u32& load = method_registers[NV4097_SET_TRANSFORM_CONSTANT_LOAD];
@ -183,7 +183,7 @@ namespace rsx
} }
template<u32 index> template<u32 index>
__forceinline void set_transform_program(thread* rsx, u32 arg) force_inline void set_transform_program(thread* rsx, u32 arg)
{ {
u32& load = method_registers[NV4097_SET_TRANSFORM_PROGRAM_LOAD]; u32& load = method_registers[NV4097_SET_TRANSFORM_PROGRAM_LOAD];
@ -193,7 +193,7 @@ namespace rsx
memcpy(rsx->transform_program + load++ * count, method_registers + NV4097_SET_TRANSFORM_PROGRAM + index * count, size); memcpy(rsx->transform_program + load++ * count, method_registers + NV4097_SET_TRANSFORM_PROGRAM + index * count, size);
} }
__forceinline void set_begin_end(thread* rsx, u32 arg) force_inline void set_begin_end(thread* rsx, u32 arg)
{ {
if (arg) if (arg)
{ {
@ -241,7 +241,7 @@ namespace rsx
rsx->vertex_draw_count = 0; rsx->vertex_draw_count = 0;
} }
__forceinline void get_report(thread* rsx, u32 arg) force_inline void get_report(thread* rsx, u32 arg)
{ {
u8 type = arg >> 24; u8 type = arg >> 24;
u32 offset = arg & 0xffffff; u32 offset = arg & 0xffffff;
@ -271,7 +271,7 @@ namespace rsx
//result->padding = 0; //result->padding = 0;
} }
__forceinline void clear_report_value(thread* rsx, u32 arg) force_inline void clear_report_value(thread* rsx, u32 arg)
{ {
switch (arg) switch (arg)
{ {
@ -291,7 +291,7 @@ namespace rsx
namespace nv308a namespace nv308a
{ {
template<u32 index> template<u32 index>
__forceinline void color(u32 arg) force_inline void color(u32 arg)
{ {
u32 point = method_registers[NV308A_POINT]; u32 point = method_registers[NV308A_POINT];
u16 x = point; u16 x = point;
@ -309,7 +309,7 @@ namespace rsx
namespace nv3089 namespace nv3089
{ {
__forceinline void image_in(u32 arg) force_inline void image_in(u32 arg)
{ {
const u16 width = method_registers[NV3089_IMAGE_IN_SIZE]; const u16 width = method_registers[NV3089_IMAGE_IN_SIZE];
const u16 height = method_registers[NV3089_IMAGE_IN_SIZE] >> 16; const u16 height = method_registers[NV3089_IMAGE_IN_SIZE] >> 16;
@ -487,7 +487,7 @@ namespace rsx
namespace nv0039 namespace nv0039
{ {
__forceinline void buffer_notify(u32 arg) force_inline void buffer_notify(u32 arg)
{ {
const u32 inPitch = method_registers[NV0039_PITCH_IN]; const u32 inPitch = method_registers[NV0039_PITCH_IN];
const u32 outPitch = method_registers[NV0039_PITCH_OUT]; const u32 outPitch = method_registers[NV0039_PITCH_OUT];
@ -561,13 +561,13 @@ namespace rsx
using rsx_impl_method_t = void(*)(u32); using rsx_impl_method_t = void(*)(u32);
template<rsx_method_t impl_func> template<rsx_method_t impl_func>
__forceinline static void call_impl_func(thread *rsx, u32 arg) force_inline static void call_impl_func(thread *rsx, u32 arg)
{ {
impl_func(rsx, arg); impl_func(rsx, arg);
} }
template<rsx_impl_method_t impl_func> template<rsx_impl_method_t impl_func>
__forceinline static void call_impl_func(thread *rsx, u32 arg) force_inline static void call_impl_func(thread *rsx, u32 arg)
{ {
impl_func(arg); impl_func(arg);
} }

View file

@ -3,6 +3,10 @@
#include "Loader/Loader.h" #include "Loader/Loader.h"
#include "DbgCommand.h" #include "DbgCommand.h"
//just for frame_type
//TODO: provide better way
#include "Emu/RSX/GSRender.h"
struct EmuCallbacks struct EmuCallbacks
{ {
std::function<void(std::function<void()>)> call_after; std::function<void(std::function<void()>)> call_after;
@ -11,7 +15,7 @@ struct EmuCallbacks
std::function<std::unique_ptr<class KeyboardHandlerBase>()> get_kb_handler; std::function<std::unique_ptr<class KeyboardHandlerBase>()> get_kb_handler;
std::function<std::unique_ptr<class MouseHandlerBase>()> get_mouse_handler; std::function<std::unique_ptr<class MouseHandlerBase>()> get_mouse_handler;
std::function<std::unique_ptr<class PadHandlerBase>()> get_pad_handler; std::function<std::unique_ptr<class PadHandlerBase>()> get_pad_handler;
std::function<std::unique_ptr<class GSFrameBase>(enum class frame_type)> get_gs_frame; std::function<std::unique_ptr<class GSFrameBase>(frame_type)> get_gs_frame;
std::function<std::unique_ptr<class MsgDialogBase>()> get_msg_dialog; std::function<std::unique_ptr<class MsgDialogBase>()> get_msg_dialog;
std::function<std::unique_ptr<class SaveDialogBase>()> get_save_dialog; std::function<std::unique_ptr<class SaveDialogBase>()> get_save_dialog;
}; };