CXX_BUILDFIX buildfixes

This commit is contained in:
libretroadmin 2024-07-20 19:42:45 +02:00
parent 60e0dd839a
commit afc9cb509a
24 changed files with 135 additions and 2191 deletions

View File

@ -94,15 +94,14 @@ const char *hresult_name(HRESULT hr)
return "<unknown>"; return "<unknown>";
} }
const char *wave_subtype_name(const GUID *guid) static const char *wave_subtype_name(const GUID *guid)
{ {
if (IsEqualGUID(guid, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)) if (!memcmp(guid, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, sizeof(GUID)))
return "KSDATAFORMAT_SUBTYPE_IEEE_FLOAT"; return "KSDATAFORMAT_SUBTYPE_IEEE_FLOAT";
return "<unknown sub-format>"; return "<unknown sub-format>";
} }
const char *wave_format_name(const WAVEFORMATEXTENSIBLE *format) static const char *wave_format_name(const WAVEFORMATEXTENSIBLE *format)
{ {
switch (format->Format.wFormatTag) switch (format->Format.wFormatTag)
{ {
@ -200,7 +199,7 @@ static bool wasapi_is_format_suitable(const WAVEFORMATEXTENSIBLE *format)
return false; return false;
break; break;
case WAVE_FORMAT_EXTENSIBLE: case WAVE_FORMAT_EXTENSIBLE:
if (!IsEqualGUID(&format->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)) if (!(!memcmp(&format->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, sizeof(GUID))))
/* RetroArch doesn't support any other subformat */ /* RetroArch doesn't support any other subformat */
return false; return false;
@ -247,11 +246,14 @@ static bool wasapi_select_device_format(WAVEFORMATEXTENSIBLE *format, IAudioClie
case S_FALSE: case S_FALSE:
/* The requested format is unsupported, but Windows has suggested a similar one. */ /* The requested format is unsupported, but Windows has suggested a similar one. */
RARCH_DBG("[WASAPI]: Windows suggests a format of (%s, %u-channel, %uHz).\n", RARCH_DBG("[WASAPI]: Windows suggests a format of (%s, %u-channel, %uHz).\n",
wave_format_name(suggested_format), suggested_format->Format.nChannels, suggested_format->Format.nSamplesPerSec); wave_format_name(suggested_format),
suggested_format->Format.nChannels,
suggested_format->Format.nSamplesPerSec);
if (wasapi_is_format_suitable(suggested_format)) if (wasapi_is_format_suitable(suggested_format))
{ {
*format = *suggested_format; *format = *suggested_format;
result = true; result = true;
} }
else else
{ {
@ -281,9 +283,11 @@ static bool wasapi_select_device_format(WAVEFORMATEXTENSIBLE *format, IAudioClie
if (SUCCEEDED(format_check_hr)) if (SUCCEEDED(format_check_hr))
{ {
*format = possible_format; *format = possible_format;
result = true; result = true;
RARCH_DBG("[WASAPI]: RetroArch suggests a format of (%s, %u-channel, %uHz).\n", RARCH_DBG("[WASAPI]: RetroArch suggests a format of (%s, %u-channel, %uHz).\n",
wave_format_name(format), format->Format.nChannels, format->Format.nSamplesPerSec); wave_format_name(format),
format->Format.nChannels,
format->Format.nSamplesPerSec);
goto done; goto done;
} }
} }
@ -336,7 +340,10 @@ static IAudioClient *wasapi_init_client_ex(IMMDevice *device,
wasapi_set_format(&wf, *float_fmt, *rate, channels); wasapi_set_format(&wf, *float_fmt, *rate, channels);
RARCH_DBG("[WASAPI]: Requesting exclusive %u-bit %u-channel client with %s samples at %uHz %ums.\n", RARCH_DBG("[WASAPI]: Requesting exclusive %u-bit %u-channel client with %s samples at %uHz %ums.\n",
wf.Format.wBitsPerSample, wf.Format.wBitsPerSample,
wf.Format.nChannels, wave_format_name(&wf), wf.Format.nSamplesPerSec, latency); wf.Format.nChannels,
wave_format_name(&wf),
wf.Format.nSamplesPerSec,
latency);
if (!wasapi_select_device_format(&wf, client, AUDCLNT_SHAREMODE_EXCLUSIVE, channels)) if (!wasapi_select_device_format(&wf, client, AUDCLNT_SHAREMODE_EXCLUSIVE, channels))
{ {
@ -453,7 +460,10 @@ static IAudioClient *wasapi_init_client_sh(IMMDevice *device,
wasapi_set_format(&wf, *float_fmt, *rate, channels); wasapi_set_format(&wf, *float_fmt, *rate, channels);
RARCH_DBG("[WASAPI]: Requesting shared %u-bit %u-channel client with %s samples at %uHz %ums.\n", RARCH_DBG("[WASAPI]: Requesting shared %u-bit %u-channel client with %s samples at %uHz %ums.\n",
wf.Format.wBitsPerSample, wf.Format.wBitsPerSample,
wf.Format.nChannels, wave_format_name(&wf), wf.Format.nSamplesPerSec, latency); wf.Format.nChannels,
wave_format_name(&wf),
wf.Format.nSamplesPerSec,
latency);
if (!wasapi_select_device_format(&wf, client, AUDCLNT_SHAREMODE_SHARED, channels)) if (!wasapi_select_device_format(&wf, client, AUDCLNT_SHAREMODE_SHARED, channels))
{ {

View File

@ -294,7 +294,8 @@ static void *wasapi_microphone_open_mic(void *driver_context, const char *device
bool float_format = settings->bools.microphone_wasapi_float_format; bool float_format = settings->bools.microphone_wasapi_float_format;
bool exclusive_mode = settings->bools.microphone_wasapi_exclusive_mode; bool exclusive_mode = settings->bools.microphone_wasapi_exclusive_mode;
unsigned sh_buffer_length = settings->uints.microphone_wasapi_sh_buffer_length; unsigned sh_buffer_length = settings->uints.microphone_wasapi_sh_buffer_length;
wasapi_microphone_handle_t *microphone = calloc(1, sizeof(wasapi_microphone_handle_t)); wasapi_microphone_handle_t *microphone = (wasapi_microphone_handle_t*)calloc(
1, sizeof(wasapi_microphone_handle_t));
if (!microphone) if (!microphone)
return NULL; return NULL;

View File

@ -561,7 +561,7 @@ static size_t microphone_driver_flush(
/* If this mic provides floating-point samples... */ /* If this mic provides floating-point samples... */
if (microphone->flags & MICROPHONE_FLAG_USE_FLOAT) if (microphone->flags & MICROPHONE_FLAG_USE_FLOAT)
{ {
convert_float_to_s16(mic_st->final_frames, mic_st->input_frames, resampler_data.input_frames); convert_float_to_s16(mic_st->final_frames, (const float*)mic_st->input_frames, resampler_data.input_frames);
fifo_write(microphone->outgoing_samples, mic_st->final_frames, frames_to_enqueue * sizeof(int16_t)); fifo_write(microphone->outgoing_samples, mic_st->final_frames, frames_to_enqueue * sizeof(int16_t));
} }
else else
@ -575,11 +575,12 @@ static size_t microphone_driver_flush(
/* If this mic provides floating-point samples... */ /* If this mic provides floating-point samples... */
if (microphone->flags & MICROPHONE_FLAG_USE_FLOAT) if (microphone->flags & MICROPHONE_FLAG_USE_FLOAT)
/* Samples are already in floating-point, so we just need to up-channel them. */ /* Samples are already in floating-point, so we just need to up-channel them. */
convert_to_dual_mono_float(mic_st->dual_mono_frames, mic_st->input_frames, resampler_data.input_frames); convert_to_dual_mono_float(mic_st->dual_mono_frames,
(const float*)mic_st->input_frames, resampler_data.input_frames);
else else
{ {
/* Samples are 16-bit, so we need to convert them first. */ /* Samples are 16-bit, so we need to convert them first. */
convert_s16_to_float(mic_st->converted_input_frames, mic_st->input_frames, resampler_data.input_frames, 1.0f); convert_s16_to_float(mic_st->converted_input_frames, (const int16_t*)mic_st->input_frames, resampler_data.input_frames, 1.0f);
convert_to_dual_mono_float(mic_st->dual_mono_frames, mic_st->converted_input_frames, resampler_data.input_frames); convert_to_dual_mono_float(mic_st->dual_mono_frames, mic_st->converted_input_frames, resampler_data.input_frames);
} }

View File

@ -3327,7 +3327,7 @@ bool rcheevos_load(const void *data)
#endif #endif
rc_client_begin_identify_and_load_game(rcheevos_locals.client, RC_CONSOLE_UNKNOWN, rc_client_begin_identify_and_load_game(rcheevos_locals.client, RC_CONSOLE_UNKNOWN,
info->path, info->data, info->size, rcheevos_client_load_game_callback, NULL); info->path, (const uint8_t*)info->data, info->size, rcheevos_client_load_game_callback, NULL);
#else /* !HAVE_RC_CLIENT */ #else /* !HAVE_RC_CLIENT */
#ifdef HAVE_THREADS #ifdef HAVE_THREADS

View File

@ -10,7 +10,7 @@
#define RC_RICHPRESENCE_DISPLAY_BUFFER_SIZE 256 #define RC_RICHPRESENCE_DISPLAY_BUFFER_SIZE 256
rc_runtime_t* rc_runtime_alloc(void) { rc_runtime_t* rc_runtime_alloc(void) {
rc_runtime_t* self = malloc(sizeof(rc_runtime_t)); rc_runtime_t* self = (rc_runtime_t*)malloc(sizeof(rc_runtime_t));
if (self) { if (self) {
rc_runtime_init(self); rc_runtime_init(self);

View File

@ -30,6 +30,7 @@
#include <dynamic/dylib.h> #include <dynamic/dylib.h>
#endif #endif
#include <string/stdstring.h> #include <string/stdstring.h>
#include <formats/image.h>
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
#include "../video_thread_wrapper.h" #include "../video_thread_wrapper.h"

View File

@ -3643,17 +3643,21 @@ static bool d3d11_gfx_read_viewport(void* data, uint8_t* buffer, bool is_idle)
return false; return false;
/*This implementation produces wrong result when using HDR*/ /*This implementation produces wrong result when using HDR*/
#ifdef HAVE_DXGI_HDR #ifdef HAVE_DXGI_HDR
if ((d3d11->flags & D3D11_ST_FLAG_HDR_ENABLE)) if ((d3d11->flags & D3D11_ST_FLAG_HDR_ENABLE))
{ {
RARCH_ERR("[D3D11]: HDR screenshot not supported.\n"); RARCH_ERR("[D3D11]: HDR screenshot not supported.\n");
return false; return false;
} }
#endif #endif
/* Get the back buffer. */ /* Get the back buffer. */
m_SwapChain = d3d11->swapChain; m_SwapChain = d3d11->swapChain;
#ifdef __cplusplus
m_SwapChain->lpVtbl->GetBuffer(m_SwapChain, 0, IID_ID3D11Texture2D, (void**)(&BackBuffer));
#else
m_SwapChain->lpVtbl->GetBuffer(m_SwapChain, 0, &IID_ID3D11Texture2D, (void*)(&BackBuffer)); m_SwapChain->lpVtbl->GetBuffer(m_SwapChain, 0, &IID_ID3D11Texture2D, (void*)(&BackBuffer));
#endif
if (!BackBuffer) if (!BackBuffer)
return false; return false;
@ -3672,9 +3676,13 @@ static bool d3d11_gfx_read_viewport(void* data, uint8_t* buffer, bool is_idle)
/* Create the back buffer staging texture. */ /* Create the back buffer staging texture. */
d3d11->device->lpVtbl->CreateTexture2D(d3d11->device, &StagingDesc, NULL, &BackBufferStagingTexture); d3d11->device->lpVtbl->CreateTexture2D(d3d11->device, &StagingDesc, NULL, &BackBufferStagingTexture);
#ifdef __cplusplus
BackBufferStagingTexture->lpVtbl->QueryInterface(BackBufferStagingTexture, IID_ID3D11Resource, (void**)&BackBufferStaging);
BackBuffer->lpVtbl->QueryInterface(BackBuffer, IID_ID3D11Resource, (void**)&BackBufferResource);
#else
BackBufferStagingTexture->lpVtbl->QueryInterface(BackBufferStagingTexture, &IID_ID3D11Resource, (void**)&BackBufferStaging); BackBufferStagingTexture->lpVtbl->QueryInterface(BackBufferStagingTexture, &IID_ID3D11Resource, (void**)&BackBufferStaging);
BackBuffer->lpVtbl->QueryInterface(BackBuffer, &IID_ID3D11Resource, (void**)&BackBufferResource); BackBuffer->lpVtbl->QueryInterface(BackBuffer, &IID_ID3D11Resource, (void**)&BackBufferResource);
#endif
/* Copy back buffer to back buffer staging. */ /* Copy back buffer to back buffer staging. */
d3d11->context->lpVtbl->CopyResource(d3d11->context, BackBufferStaging, BackBufferResource); d3d11->context->lpVtbl->CopyResource(d3d11->context, BackBufferStaging, BackBufferResource);

View File

@ -96,7 +96,7 @@ static void *d3d9x_win32_font_init(void *video_data,
&desc, (void**)&d3dfonts->font)) &desc, (void**)&d3dfonts->font))
goto error; goto error;
font = d3dfonts->font; font = (ID3DXFont*)d3dfonts->font;
font->lpVtbl->GetTextMetrics(font, &metrics); font->lpVtbl->GetTextMetrics(font, &metrics);
@ -117,7 +117,7 @@ static void d3d9x_win32_font_free(void *data, bool is_threaded)
if (!d3dfonts) if (!d3dfonts)
return; return;
font = d3dfonts->font; font = (ID3DXFont*)d3dfonts->font;
if (font) if (font)
font->lpVtbl->Release(font); font->lpVtbl->Release(font);
@ -135,7 +135,7 @@ static int d3d9x_win32_font_get_message_width(void* data, const char* msg,
if (!d3dfonts || !msg) if (!d3dfonts || !msg)
return 0; return 0;
font = d3dfonts->font; font = (ID3DXFont*)d3dfonts->font;
font->lpVtbl->DrawText(font, NULL, font->lpVtbl->DrawText(font, NULL,
(void*)msg, msg_len ? (INT)msg_len : -1, &box, DT_CALCRECT, 0); (void*)msg, msg_len ? (INT)msg_len : -1, &box, DT_CALCRECT, 0);
@ -164,7 +164,7 @@ static void d3d9x_win32_font_render_msg(
if (!d3dfonts || !msg) if (!d3dfonts || !msg)
return; return;
font = d3dfonts->font; font = (ID3DXFont*)d3dfonts->font;
width = d3dfonts->d3d->video_info.width; width = d3dfonts->d3d->video_info.width;
height = d3dfonts->d3d->video_info.height; height = d3dfonts->d3d->video_info.height;

View File

@ -943,7 +943,7 @@ void font_driver_init_osd(
void font_driver_free_osd(void) void font_driver_free_osd(void)
{ {
if (video_font_driver) if (video_font_driver)
font_driver_free(video_font_driver); font_driver_free((font_data_t*)video_font_driver);
video_font_driver = NULL; video_font_driver = NULL;
} }

File diff suppressed because it is too large Load Diff

View File

@ -163,38 +163,6 @@ typedef struct D3D11_BLEND_DESC1
D3D11_RENDER_TARGET_BLEND_DESC1 RenderTarget[ 8 ]; D3D11_RENDER_TARGET_BLEND_DESC1 RenderTarget[ 8 ];
} D3D11_BLEND_DESC1; } D3D11_BLEND_DESC1;
/* Note, the array size for RenderTarget[] above is D3D11_SIMULTANEOUS_RENDERTARGET_COUNT.
IDL processing/generation of this header replaces the define; this comment is merely explaining what happened. */
#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
}
struct CD3D11_BLEND_DESC1 : public D3D11_BLEND_DESC1
{
CD3D11_BLEND_DESC1()
{}
explicit CD3D11_BLEND_DESC1( const D3D11_BLEND_DESC1& o ) :
D3D11_BLEND_DESC1( o )
{}
explicit CD3D11_BLEND_DESC1( CD3D11_DEFAULT )
{
AlphaToCoverageEnable = FALSE;
IndependentBlendEnable = FALSE;
const D3D11_RENDER_TARGET_BLEND_DESC1 defaultRenderTargetBlendDesc =
{
FALSE,FALSE,
D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD,
D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD,
D3D11_LOGIC_OP_NOOP,
D3D11_COLOR_WRITE_ENABLE_ALL,
};
for (UINT i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
RenderTarget[ i ] = defaultRenderTargetBlendDesc;
}
~CD3D11_BLEND_DESC1() {}
operator const D3D11_BLEND_DESC1&() const { return *this; }
};
extern "C"{
#endif
extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0000_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0000_v0_0_s_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0000_v0_0_s_ifspec;
@ -337,60 +305,6 @@ typedef struct D3D11_RASTERIZER_DESC1
UINT ForcedSampleCount; UINT ForcedSampleCount;
} D3D11_RASTERIZER_DESC1; } D3D11_RASTERIZER_DESC1;
#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
}
struct CD3D11_RASTERIZER_DESC1 : public D3D11_RASTERIZER_DESC1
{
CD3D11_RASTERIZER_DESC1()
{}
explicit CD3D11_RASTERIZER_DESC1( const D3D11_RASTERIZER_DESC1& o ) :
D3D11_RASTERIZER_DESC1( o )
{}
explicit CD3D11_RASTERIZER_DESC1( CD3D11_DEFAULT )
{
FillMode = D3D11_FILL_SOLID;
CullMode = D3D11_CULL_BACK;
FrontCounterClockwise = FALSE;
DepthBias = D3D11_DEFAULT_DEPTH_BIAS;
DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP;
SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
DepthClipEnable = TRUE;
ScissorEnable = FALSE;
MultisampleEnable = FALSE;
AntialiasedLineEnable = FALSE;
ForcedSampleCount = 0;
}
explicit CD3D11_RASTERIZER_DESC1(
D3D11_FILL_MODE fillMode,
D3D11_CULL_MODE cullMode,
BOOL frontCounterClockwise,
INT depthBias,
FLOAT depthBiasClamp,
FLOAT slopeScaledDepthBias,
BOOL depthClipEnable,
BOOL scissorEnable,
BOOL multisampleEnable,
BOOL antialiasedLineEnable,
UINT forcedSampleCount )
{
FillMode = fillMode;
CullMode = cullMode;
FrontCounterClockwise = frontCounterClockwise;
DepthBias = depthBias;
DepthBiasClamp = depthBiasClamp;
SlopeScaledDepthBias = slopeScaledDepthBias;
DepthClipEnable = depthClipEnable;
ScissorEnable = scissorEnable;
MultisampleEnable = multisampleEnable;
AntialiasedLineEnable = antialiasedLineEnable;
ForcedSampleCount = forcedSampleCount;
}
~CD3D11_RASTERIZER_DESC1() {}
operator const D3D11_RASTERIZER_DESC1&() const { return *this; }
};
extern "C"{
#endif
extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0001_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0001_v0_0_s_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0001_v0_0_s_ifspec;

View File

@ -160,65 +160,6 @@ typedef struct D3D11_TEXTURE2D_DESC1
D3D11_TEXTURE_LAYOUT TextureLayout; D3D11_TEXTURE_LAYOUT TextureLayout;
} D3D11_TEXTURE2D_DESC1; } D3D11_TEXTURE2D_DESC1;
#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
}
struct CD3D11_TEXTURE2D_DESC1 : public D3D11_TEXTURE2D_DESC1
{
CD3D11_TEXTURE2D_DESC1()
{}
explicit CD3D11_TEXTURE2D_DESC1( const D3D11_TEXTURE2D_DESC1& o ) :
D3D11_TEXTURE2D_DESC1( o )
{}
explicit CD3D11_TEXTURE2D_DESC1(
DXGI_FORMAT format,
UINT width,
UINT height,
UINT arraySize = 1,
UINT mipLevels = 0,
UINT bindFlags = D3D11_BIND_SHADER_RESOURCE,
D3D11_USAGE usage = D3D11_USAGE_DEFAULT,
UINT cpuaccessFlags = 0,
UINT sampleCount = 1,
UINT sampleQuality = 0,
UINT miscFlags = 0,
D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
{
Width = width;
Height = height;
MipLevels = mipLevels;
ArraySize = arraySize;
Format = format;
SampleDesc.Count = sampleCount;
SampleDesc.Quality = sampleQuality;
Usage = usage;
BindFlags = bindFlags;
CPUAccessFlags = cpuaccessFlags;
MiscFlags = miscFlags;
TextureLayout = textureLayout;
}
explicit CD3D11_TEXTURE2D_DESC1(
const D3D11_TEXTURE2D_DESC &desc,
D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
{
Width = desc.Width;
Height = desc.Height;
MipLevels = desc.MipLevels;
ArraySize = desc.ArraySize;
Format = desc.Format;
SampleDesc.Count = desc.SampleDesc.Count;
SampleDesc.Quality = desc. SampleDesc.Quality;
Usage = desc.Usage;
BindFlags = desc.BindFlags;
CPUAccessFlags = desc.CPUAccessFlags;
MiscFlags = desc.MiscFlags;
TextureLayout = textureLayout;
}
~CD3D11_TEXTURE2D_DESC1() {}
operator const D3D11_TEXTURE2D_DESC1&() const { return *this; }
};
extern "C"{
#endif
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0000_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0000_v0_0_s_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0000_v0_0_s_ifspec;
@ -382,59 +323,6 @@ typedef struct D3D11_TEXTURE3D_DESC1
D3D11_TEXTURE_LAYOUT TextureLayout; D3D11_TEXTURE_LAYOUT TextureLayout;
} D3D11_TEXTURE3D_DESC1; } D3D11_TEXTURE3D_DESC1;
#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
}
struct CD3D11_TEXTURE3D_DESC1 : public D3D11_TEXTURE3D_DESC1
{
CD3D11_TEXTURE3D_DESC1()
{}
explicit CD3D11_TEXTURE3D_DESC1( const D3D11_TEXTURE3D_DESC1& o ) :
D3D11_TEXTURE3D_DESC1( o )
{}
explicit CD3D11_TEXTURE3D_DESC1(
DXGI_FORMAT format,
UINT width,
UINT height,
UINT depth,
UINT mipLevels = 0,
UINT bindFlags = D3D11_BIND_SHADER_RESOURCE,
D3D11_USAGE usage = D3D11_USAGE_DEFAULT,
UINT cpuaccessFlags = 0,
UINT miscFlags = 0,
D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
{
Width = width;
Height = height;
Depth = depth;
MipLevels = mipLevels;
Format = format;
Usage = usage;
BindFlags = bindFlags;
CPUAccessFlags = cpuaccessFlags;
MiscFlags = miscFlags;
TextureLayout = textureLayout;
}
explicit CD3D11_TEXTURE3D_DESC1(
const D3D11_TEXTURE3D_DESC &desc,
D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
{
Width = desc.Width;
Height = desc.Height;
Depth = desc.Depth;
MipLevels = desc.MipLevels;
Format = desc.Format;
Usage = desc.Usage;
BindFlags = desc.BindFlags;
CPUAccessFlags = desc.CPUAccessFlags;
MiscFlags = desc.MiscFlags;
TextureLayout = textureLayout;
}
~CD3D11_TEXTURE3D_DESC1() {}
operator const D3D11_TEXTURE3D_DESC1&() const { return *this; }
};
extern "C"{
#endif
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0001_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0001_v0_0_s_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0001_v0_0_s_ifspec;
@ -607,63 +495,6 @@ typedef struct D3D11_RASTERIZER_DESC2
D3D11_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster; D3D11_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
} D3D11_RASTERIZER_DESC2; } D3D11_RASTERIZER_DESC2;
#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
}
struct CD3D11_RASTERIZER_DESC2 : public D3D11_RASTERIZER_DESC2
{
CD3D11_RASTERIZER_DESC2()
{}
explicit CD3D11_RASTERIZER_DESC2( const D3D11_RASTERIZER_DESC2& o ) :
D3D11_RASTERIZER_DESC2( o )
{}
explicit CD3D11_RASTERIZER_DESC2( CD3D11_DEFAULT )
{
FillMode = D3D11_FILL_SOLID;
CullMode = D3D11_CULL_BACK;
FrontCounterClockwise = FALSE;
DepthBias = D3D11_DEFAULT_DEPTH_BIAS;
DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP;
SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
DepthClipEnable = TRUE;
ScissorEnable = FALSE;
MultisampleEnable = FALSE;
AntialiasedLineEnable = FALSE;
ForcedSampleCount = 0;
ConservativeRaster = D3D11_CONSERVATIVE_RASTERIZATION_MODE_OFF;
}
explicit CD3D11_RASTERIZER_DESC2(
D3D11_FILL_MODE fillMode,
D3D11_CULL_MODE cullMode,
BOOL frontCounterClockwise,
INT depthBias,
FLOAT depthBiasClamp,
FLOAT slopeScaledDepthBias,
BOOL depthClipEnable,
BOOL scissorEnable,
BOOL multisampleEnable,
BOOL antialiasedLineEnable,
UINT forcedSampleCount,
D3D11_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster )
{
FillMode = fillMode;
CullMode = cullMode;
FrontCounterClockwise = frontCounterClockwise;
DepthBias = depthBias;
DepthBiasClamp = depthBiasClamp;
SlopeScaledDepthBias = slopeScaledDepthBias;
DepthClipEnable = depthClipEnable;
ScissorEnable = scissorEnable;
MultisampleEnable = multisampleEnable;
AntialiasedLineEnable = antialiasedLineEnable;
ForcedSampleCount = forcedSampleCount;
ConservativeRaster = conservativeRaster;
}
~CD3D11_RASTERIZER_DESC2() {}
operator const D3D11_RASTERIZER_DESC2&() const { return *this; }
};
extern "C"{
#endif
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0002_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0002_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0002_v0_0_s_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0002_v0_0_s_ifspec;
@ -835,219 +666,6 @@ typedef struct D3D11_SHADER_RESOURCE_VIEW_DESC1
} ; } ;
} D3D11_SHADER_RESOURCE_VIEW_DESC1; } D3D11_SHADER_RESOURCE_VIEW_DESC1;
#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
}
struct CD3D11_SHADER_RESOURCE_VIEW_DESC1 : public D3D11_SHADER_RESOURCE_VIEW_DESC1
{
CD3D11_SHADER_RESOURCE_VIEW_DESC1()
{}
explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1( const D3D11_SHADER_RESOURCE_VIEW_DESC1& o ) :
D3D11_SHADER_RESOURCE_VIEW_DESC1( o )
{}
explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1(
D3D11_SRV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mostDetailedMip = 0, // FirstElement for BUFFER
UINT mipLevels = -1, // NumElements for BUFFER
UINT firstArraySlice = 0, // First2DArrayFace for TEXTURECUBEARRAY
UINT arraySize = -1, // NumCubes for TEXTURECUBEARRAY
UINT flags = 0, // BUFFEREX only
UINT planeSlice = 0 ) // Texture2D and Texture2DArray only
{
Format = format;
ViewDimension = viewDimension;
switch (viewDimension)
{
case D3D11_SRV_DIMENSION_BUFFER:
Buffer.FirstElement = mostDetailedMip;
Buffer.NumElements = mipLevels;
break;
case D3D11_SRV_DIMENSION_TEXTURE1D:
Texture1D.MostDetailedMip = mostDetailedMip;
Texture1D.MipLevels = mipLevels;
break;
case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
Texture1DArray.MostDetailedMip = mostDetailedMip;
Texture1DArray.MipLevels = mipLevels;
Texture1DArray.FirstArraySlice = firstArraySlice;
Texture1DArray.ArraySize = arraySize;
break;
case D3D11_SRV_DIMENSION_TEXTURE2D:
Texture2D.MostDetailedMip = mostDetailedMip;
Texture2D.MipLevels = mipLevels;
Texture2D.PlaneSlice = planeSlice;
break;
case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
Texture2DArray.MostDetailedMip = mostDetailedMip;
Texture2DArray.MipLevels = mipLevels;
Texture2DArray.FirstArraySlice = firstArraySlice;
Texture2DArray.ArraySize = arraySize;
Texture2DArray.PlaneSlice = planeSlice;
break;
case D3D11_SRV_DIMENSION_TEXTURE2DMS:
break;
case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
Texture2DMSArray.FirstArraySlice = firstArraySlice;
Texture2DMSArray.ArraySize = arraySize;
break;
case D3D11_SRV_DIMENSION_TEXTURE3D:
Texture3D.MostDetailedMip = mostDetailedMip;
Texture3D.MipLevels = mipLevels;
break;
case D3D11_SRV_DIMENSION_TEXTURECUBE:
TextureCube.MostDetailedMip = mostDetailedMip;
TextureCube.MipLevels = mipLevels;
break;
case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
TextureCubeArray.MostDetailedMip = mostDetailedMip;
TextureCubeArray.MipLevels = mipLevels;
TextureCubeArray.First2DArrayFace = firstArraySlice;
TextureCubeArray.NumCubes = arraySize;
break;
case D3D11_SRV_DIMENSION_BUFFEREX:
BufferEx.FirstElement = mostDetailedMip;
BufferEx.NumElements = mipLevels;
BufferEx.Flags = flags;
break;
default: break;
}
}
explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1(
_In_ ID3D11Buffer*,
DXGI_FORMAT format,
UINT firstElement,
UINT numElements,
UINT flags = 0 )
{
Format = format;
ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX;
BufferEx.FirstElement = firstElement;
BufferEx.NumElements = numElements;
BufferEx.Flags = flags;
}
explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1(
_In_ ID3D11Texture1D* pTex1D,
D3D11_SRV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mostDetailedMip = 0,
UINT mipLevels = -1,
UINT firstArraySlice = 0,
UINT arraySize = -1 )
{
ViewDimension = viewDimension;
if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels ||
(-1 == arraySize && D3D11_SRV_DIMENSION_TEXTURE1DARRAY == viewDimension))
{
D3D11_TEXTURE1D_DESC TexDesc;
pTex1D->GetDesc( &TexDesc );
if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip;
if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
}
Format = format;
switch (viewDimension)
{
case D3D11_SRV_DIMENSION_TEXTURE1D:
Texture1D.MostDetailedMip = mostDetailedMip;
Texture1D.MipLevels = mipLevels;
break;
case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
Texture1DArray.MostDetailedMip = mostDetailedMip;
Texture1DArray.MipLevels = mipLevels;
Texture1DArray.FirstArraySlice = firstArraySlice;
Texture1DArray.ArraySize = arraySize;
break;
default: break;
}
}
explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1(
_In_ ID3D11Texture2D* pTex2D,
D3D11_SRV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mostDetailedMip = 0,
UINT mipLevels = -1,
UINT firstArraySlice = 0, // First2DArrayFace for TEXTURECUBEARRAY
UINT arraySize = -1, // NumCubes for TEXTURECUBEARRAY
UINT planeSlice = 0 ) // PlaneSlice for TEXTURE2D or TEXTURE2DARRAY
{
ViewDimension = viewDimension;
if (DXGI_FORMAT_UNKNOWN == format ||
(-1 == mipLevels &&
D3D11_SRV_DIMENSION_TEXTURE2DMS != viewDimension &&
D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY != viewDimension) ||
(-1 == arraySize &&
(D3D11_SRV_DIMENSION_TEXTURE2DARRAY == viewDimension ||
D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY == viewDimension ||
D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension)))
{
D3D11_TEXTURE2D_DESC TexDesc;
pTex2D->GetDesc( &TexDesc );
if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip;
if (-1 == arraySize)
{
arraySize = TexDesc.ArraySize - firstArraySlice;
if (D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension) arraySize /= 6;
}
}
Format = format;
switch (viewDimension)
{
case D3D11_SRV_DIMENSION_TEXTURE2D:
Texture2D.MostDetailedMip = mostDetailedMip;
Texture2D.MipLevels = mipLevels;
Texture2D.PlaneSlice = planeSlice;
break;
case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
Texture2DArray.MostDetailedMip = mostDetailedMip;
Texture2DArray.MipLevels = mipLevels;
Texture2DArray.FirstArraySlice = firstArraySlice;
Texture2DArray.ArraySize = arraySize;
Texture2DArray.PlaneSlice = planeSlice;
break;
case D3D11_SRV_DIMENSION_TEXTURE2DMS:
break;
case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
Texture2DMSArray.FirstArraySlice = firstArraySlice;
Texture2DMSArray.ArraySize = arraySize;
break;
case D3D11_SRV_DIMENSION_TEXTURECUBE:
TextureCube.MostDetailedMip = mostDetailedMip;
TextureCube.MipLevels = mipLevels;
break;
case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
TextureCubeArray.MostDetailedMip = mostDetailedMip;
TextureCubeArray.MipLevels = mipLevels;
TextureCubeArray.First2DArrayFace = firstArraySlice;
TextureCubeArray.NumCubes = arraySize;
break;
default: break;
}
}
explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1(
_In_ ID3D11Texture3D* pTex3D,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mostDetailedMip = 0,
UINT mipLevels = -1 )
{
ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D;
if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels)
{
D3D11_TEXTURE3D_DESC TexDesc;
pTex3D->GetDesc( &TexDesc );
if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip;
}
Format = format;
Texture3D.MostDetailedMip = mostDetailedMip;
Texture3D.MipLevels = mipLevels;
}
~CD3D11_SHADER_RESOURCE_VIEW_DESC1() {}
operator const D3D11_SHADER_RESOURCE_VIEW_DESC1&() const { return *this; }
};
extern "C"{
#endif
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0003_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0003_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0003_v0_0_s_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0003_v0_0_s_ifspec;
@ -1214,173 +832,6 @@ typedef struct D3D11_RENDER_TARGET_VIEW_DESC1
} ; } ;
} D3D11_RENDER_TARGET_VIEW_DESC1; } D3D11_RENDER_TARGET_VIEW_DESC1;
#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
}
struct CD3D11_RENDER_TARGET_VIEW_DESC1 : public D3D11_RENDER_TARGET_VIEW_DESC1
{
CD3D11_RENDER_TARGET_VIEW_DESC1()
{}
explicit CD3D11_RENDER_TARGET_VIEW_DESC1( const D3D11_RENDER_TARGET_VIEW_DESC1& o ) :
D3D11_RENDER_TARGET_VIEW_DESC1( o )
{}
explicit CD3D11_RENDER_TARGET_VIEW_DESC1(
D3D11_RTV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0, // FirstElement for BUFFER
UINT firstArraySlice = 0, // NumElements for BUFFER, FirstWSlice for TEXTURE3D
UINT arraySize = -1, // WSize for TEXTURE3D
UINT planeSlice = 0 ) // PlaneSlice for TEXTURE2D and TEXTURE2DARRAY
{
Format = format;
ViewDimension = viewDimension;
switch (viewDimension)
{
case D3D11_RTV_DIMENSION_BUFFER:
Buffer.FirstElement = mipSlice;
Buffer.NumElements = firstArraySlice;
break;
case D3D11_RTV_DIMENSION_TEXTURE1D:
Texture1D.MipSlice = mipSlice;
break;
case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:
Texture1DArray.MipSlice = mipSlice;
Texture1DArray.FirstArraySlice = firstArraySlice;
Texture1DArray.ArraySize = arraySize;
break;
case D3D11_RTV_DIMENSION_TEXTURE2D:
Texture2D.MipSlice = mipSlice;
Texture2D.PlaneSlice = planeSlice;
break;
case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:
Texture2DArray.MipSlice = mipSlice;
Texture2DArray.FirstArraySlice = firstArraySlice;
Texture2DArray.ArraySize = arraySize;
Texture2DArray.PlaneSlice = planeSlice;
break;
case D3D11_RTV_DIMENSION_TEXTURE2DMS:
break;
case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:
Texture2DMSArray.FirstArraySlice = firstArraySlice;
Texture2DMSArray.ArraySize = arraySize;
break;
case D3D11_RTV_DIMENSION_TEXTURE3D:
Texture3D.MipSlice = mipSlice;
Texture3D.FirstWSlice = firstArraySlice;
Texture3D.WSize = arraySize;
break;
default: break;
}
}
explicit CD3D11_RENDER_TARGET_VIEW_DESC1(
_In_ ID3D11Buffer*,
DXGI_FORMAT format,
UINT firstElement,
UINT numElements )
{
Format = format;
ViewDimension = D3D11_RTV_DIMENSION_BUFFER;
Buffer.FirstElement = firstElement;
Buffer.NumElements = numElements;
}
explicit CD3D11_RENDER_TARGET_VIEW_DESC1(
_In_ ID3D11Texture1D* pTex1D,
D3D11_RTV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
UINT firstArraySlice = 0,
UINT arraySize = -1 )
{
ViewDimension = viewDimension;
if (DXGI_FORMAT_UNKNOWN == format ||
(-1 == arraySize && D3D11_RTV_DIMENSION_TEXTURE1DARRAY == viewDimension))
{
D3D11_TEXTURE1D_DESC TexDesc;
pTex1D->GetDesc( &TexDesc );
if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
}
Format = format;
switch (viewDimension)
{
case D3D11_RTV_DIMENSION_TEXTURE1D:
Texture1D.MipSlice = mipSlice;
break;
case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:
Texture1DArray.MipSlice = mipSlice;
Texture1DArray.FirstArraySlice = firstArraySlice;
Texture1DArray.ArraySize = arraySize;
break;
default: break;
}
}
explicit CD3D11_RENDER_TARGET_VIEW_DESC1(
_In_ ID3D11Texture2D* pTex2D,
D3D11_RTV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
UINT firstArraySlice = 0,
UINT arraySize = -1,
UINT planeSlice = 0 )
{
ViewDimension = viewDimension;
if (DXGI_FORMAT_UNKNOWN == format ||
(-1 == arraySize &&
(D3D11_RTV_DIMENSION_TEXTURE2DARRAY == viewDimension ||
D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY == viewDimension)))
{
D3D11_TEXTURE2D_DESC TexDesc;
pTex2D->GetDesc( &TexDesc );
if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
}
Format = format;
switch (viewDimension)
{
case D3D11_RTV_DIMENSION_TEXTURE2D:
Texture2D.MipSlice = mipSlice;
Texture2D.PlaneSlice = planeSlice;
break;
case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:
Texture2DArray.MipSlice = mipSlice;
Texture2DArray.FirstArraySlice = firstArraySlice;
Texture2DArray.ArraySize = arraySize;
Texture2DArray.PlaneSlice = planeSlice;
break;
case D3D11_RTV_DIMENSION_TEXTURE2DMS:
break;
case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:
Texture2DMSArray.FirstArraySlice = firstArraySlice;
Texture2DMSArray.ArraySize = arraySize;
break;
default: break;
}
}
explicit CD3D11_RENDER_TARGET_VIEW_DESC1(
_In_ ID3D11Texture3D* pTex3D,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
UINT firstWSlice = 0,
UINT wSize = -1 )
{
ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D;
if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize)
{
D3D11_TEXTURE3D_DESC TexDesc;
pTex3D->GetDesc( &TexDesc );
if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
if (-1 == wSize) wSize = TexDesc.Depth - firstWSlice;
}
Format = format;
Texture3D.MipSlice = mipSlice;
Texture3D.FirstWSlice = firstWSlice;
Texture3D.WSize = wSize;
}
~CD3D11_RENDER_TARGET_VIEW_DESC1() {}
operator const D3D11_RENDER_TARGET_VIEW_DESC1&() const { return *this; }
};
extern "C"{
#endif
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0004_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0004_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0004_v0_0_s_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0004_v0_0_s_ifspec;
@ -1545,163 +996,6 @@ typedef struct D3D11_UNORDERED_ACCESS_VIEW_DESC1
} ; } ;
} D3D11_UNORDERED_ACCESS_VIEW_DESC1; } D3D11_UNORDERED_ACCESS_VIEW_DESC1;
#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
}
struct CD3D11_UNORDERED_ACCESS_VIEW_DESC1 : public D3D11_UNORDERED_ACCESS_VIEW_DESC1
{
CD3D11_UNORDERED_ACCESS_VIEW_DESC1()
{}
explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1( const D3D11_UNORDERED_ACCESS_VIEW_DESC1& o ) :
D3D11_UNORDERED_ACCESS_VIEW_DESC1( o )
{}
explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1(
D3D11_UAV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0, // FirstElement for BUFFER
UINT firstArraySlice = 0, // NumElements for BUFFER, FirstWSlice for TEXTURE3D
UINT arraySize = -1, // WSize for TEXTURE3D
UINT flags = 0, // BUFFER only
UINT planeSlice = 0 ) // PlaneSlice for TEXTURE2D and TEXTURE2DARRAY
{
Format = format;
ViewDimension = viewDimension;
switch (viewDimension)
{
case D3D11_UAV_DIMENSION_BUFFER:
Buffer.FirstElement = mipSlice;
Buffer.NumElements = firstArraySlice;
Buffer.Flags = flags;
break;
case D3D11_UAV_DIMENSION_TEXTURE1D:
Texture1D.MipSlice = mipSlice;
break;
case D3D11_UAV_DIMENSION_TEXTURE1DARRAY:
Texture1DArray.MipSlice = mipSlice;
Texture1DArray.FirstArraySlice = firstArraySlice;
Texture1DArray.ArraySize = arraySize;
break;
case D3D11_UAV_DIMENSION_TEXTURE2D:
Texture2D.MipSlice = mipSlice;
Texture2D.PlaneSlice = planeSlice;
break;
case D3D11_UAV_DIMENSION_TEXTURE2DARRAY:
Texture2DArray.MipSlice = mipSlice;
Texture2DArray.FirstArraySlice = firstArraySlice;
Texture2DArray.ArraySize = arraySize;
Texture2DArray.PlaneSlice = planeSlice;
break;
case D3D11_UAV_DIMENSION_TEXTURE3D:
Texture3D.MipSlice = mipSlice;
Texture3D.FirstWSlice = firstArraySlice;
Texture3D.WSize = arraySize;
break;
default: break;
}
}
explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1(
_In_ ID3D11Buffer*,
DXGI_FORMAT format,
UINT firstElement,
UINT numElements,
UINT flags = 0 )
{
Format = format;
ViewDimension = D3D11_UAV_DIMENSION_BUFFER;
Buffer.FirstElement = firstElement;
Buffer.NumElements = numElements;
Buffer.Flags = flags;
}
explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1(
_In_ ID3D11Texture1D* pTex1D,
D3D11_UAV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
UINT firstArraySlice = 0,
UINT arraySize = -1 )
{
ViewDimension = viewDimension;
if (DXGI_FORMAT_UNKNOWN == format ||
(-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE1DARRAY == viewDimension))
{
D3D11_TEXTURE1D_DESC TexDesc;
pTex1D->GetDesc( &TexDesc );
if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
}
Format = format;
switch (viewDimension)
{
case D3D11_UAV_DIMENSION_TEXTURE1D:
Texture1D.MipSlice = mipSlice;
break;
case D3D11_UAV_DIMENSION_TEXTURE1DARRAY:
Texture1DArray.MipSlice = mipSlice;
Texture1DArray.FirstArraySlice = firstArraySlice;
Texture1DArray.ArraySize = arraySize;
break;
default: break;
}
}
explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1(
_In_ ID3D11Texture2D* pTex2D,
D3D11_UAV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
UINT firstArraySlice = 0,
UINT arraySize = -1,
UINT planeSlice = 0 )
{
ViewDimension = viewDimension;
if (DXGI_FORMAT_UNKNOWN == format ||
(-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE2DARRAY == viewDimension))
{
D3D11_TEXTURE2D_DESC TexDesc;
pTex2D->GetDesc( &TexDesc );
if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
}
Format = format;
switch (viewDimension)
{
case D3D11_UAV_DIMENSION_TEXTURE2D:
Texture2D.MipSlice = mipSlice;
Texture2D.PlaneSlice = planeSlice;
break;
case D3D11_UAV_DIMENSION_TEXTURE2DARRAY:
Texture2DArray.MipSlice = mipSlice;
Texture2DArray.FirstArraySlice = firstArraySlice;
Texture2DArray.ArraySize = arraySize;
Texture2DArray.PlaneSlice = planeSlice;
break;
default: break;
}
}
explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1(
_In_ ID3D11Texture3D* pTex3D,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
UINT firstWSlice = 0,
UINT wSize = -1 )
{
ViewDimension = D3D11_UAV_DIMENSION_TEXTURE3D;
if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize)
{
D3D11_TEXTURE3D_DESC TexDesc;
pTex3D->GetDesc( &TexDesc );
if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
if (-1 == wSize) wSize = TexDesc.Depth - firstWSlice;
}
Format = format;
Texture3D.MipSlice = mipSlice;
Texture3D.FirstWSlice = firstWSlice;
Texture3D.WSize = wSize;
}
~CD3D11_UNORDERED_ACCESS_VIEW_DESC1() {}
operator const D3D11_UNORDERED_ACCESS_VIEW_DESC1&() const { return *this; }
};
extern "C"{
#endif
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0005_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0005_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0005_v0_0_s_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0005_v0_0_s_ifspec;
@ -1844,30 +1138,6 @@ typedef struct D3D11_QUERY_DESC1
D3D11_CONTEXT_TYPE ContextType; D3D11_CONTEXT_TYPE ContextType;
} D3D11_QUERY_DESC1; } D3D11_QUERY_DESC1;
#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
}
struct CD3D11_QUERY_DESC1 : public D3D11_QUERY_DESC1
{
CD3D11_QUERY_DESC1()
{}
explicit CD3D11_QUERY_DESC1( const D3D11_QUERY_DESC1& o ) :
D3D11_QUERY_DESC1( o )
{}
explicit CD3D11_QUERY_DESC1(
D3D11_QUERY query,
UINT miscFlags = 0,
D3D11_CONTEXT_TYPE contextType = D3D11_CONTEXT_TYPE_ALL )
{
Query = query;
MiscFlags = miscFlags;
ContextType = contextType;
}
~CD3D11_QUERY_DESC1() {}
operator const D3D11_QUERY_DESC1&() const { return *this; }
};
extern "C"{
#endif
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0006_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0006_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0006_v0_0_s_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0006_v0_0_s_ifspec;

View File

@ -1101,7 +1101,7 @@ const char **input_keyboard_start_line(
} }
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
static int16_t input_overlay_mouse_state(input_overlay_t *ol, unsigned id) static int16_t input_overlay_device_mouse_state(input_overlay_t *ol, unsigned id)
{ {
input_overlay_pointer_state_t *ptr_st = &ol->pointer_state; input_overlay_pointer_state_t *ptr_st = &ol->pointer_state;
int16_t res; int16_t res;
@ -1216,10 +1216,9 @@ static int16_t input_overlay_lightgun_state(settings_t *settings,
} }
static int16_t input_overlay_pointer_state(input_overlay_t *ol, static int16_t input_overlay_pointer_state(input_overlay_t *ol,
input_overlay_pointer_state_t *ptr_st,
unsigned idx, unsigned id) unsigned idx, unsigned id)
{ {
input_overlay_pointer_state_t *ptr_st = &ol->pointer_state;
ptr_st->device_mask |= (1 << RETRO_DEVICE_POINTER); ptr_st->device_mask |= (1 << RETRO_DEVICE_POINTER);
switch (id) switch (id)
@ -1246,14 +1245,16 @@ static int16_t input_overlay_pointing_device_state(settings_t *settings,
switch (device) switch (device)
{ {
case RETRO_DEVICE_MOUSE: case RETRO_DEVICE_MOUSE:
return input_overlay_mouse_state(ol, id); return input_overlay_device_mouse_state(ol, id);
case RETRO_DEVICE_LIGHTGUN: case RETRO_DEVICE_LIGHTGUN:
if ( settings->ints.input_overlay_lightgun_port == -1 if ( settings->ints.input_overlay_lightgun_port == -1
|| settings->ints.input_overlay_lightgun_port == (int)port) || settings->ints.input_overlay_lightgun_port == (int)port)
return input_overlay_lightgun_state(settings, ol, id); return input_overlay_lightgun_state(settings, ol, id);
break; break;
case RETRO_DEVICE_POINTER: case RETRO_DEVICE_POINTER:
return input_overlay_pointer_state(ol, idx, id); return input_overlay_pointer_state(ol,
(input_overlay_pointer_state_t*)&ol->pointer_state,
idx, id);
default: default:
break; break;
} }
@ -3036,14 +3037,15 @@ static void input_overlay_get_mouse_scale(settings_t *settings,
* Updates button state of the overlay mouse. * Updates button state of the overlay mouse.
*/ */
static void input_overlay_poll_mouse(settings_t *settings, static void input_overlay_poll_mouse(settings_t *settings,
input_overlay_t *ol, const int old_ptr_count) struct input_overlay_mouse_state *mouse_st,
input_overlay_t *ol,
const int ptr_count,
const int old_ptr_count)
{ {
input_overlay_pointer_state_t *ptr_st = &ol->pointer_state; input_overlay_pointer_state_t *ptr_st = &ol->pointer_state;
struct input_overlay_mouse_state *mouse_st = &ptr_st->mouse;
const retro_time_t now_usec = cpu_features_get_time_usec(); const retro_time_t now_usec = cpu_features_get_time_usec();
const retro_time_t hold_usec = settings->uints.input_overlay_mouse_hold_msec * 1000; const retro_time_t hold_usec = settings->uints.input_overlay_mouse_hold_msec * 1000;
const retro_time_t dtap_usec = settings->uints.input_overlay_mouse_dtap_msec * 1000; const retro_time_t dtap_usec = settings->uints.input_overlay_mouse_dtap_msec * 1000;
const int ptr_count = ptr_st->count;
int swipe_thres_x = 0; int swipe_thres_x = 0;
int swipe_thres_y = 0; int swipe_thres_y = 0;
const bool hold_to_drag = settings->bools.input_overlay_mouse_hold_to_drag; const bool hold_to_drag = settings->bools.input_overlay_mouse_hold_to_drag;
@ -3435,28 +3437,33 @@ static void input_poll_overlay(
if (ol_ptr_enable) if (ol_ptr_enable)
{ {
input_overlay_pointer_state_t *ptr_st = &ol->pointer_state;
struct input_overlay_mouse_state *mouse_st = (struct input_overlay_mouse_state*)&ptr_st->mouse;
if (ptr_state->device_mask & (1 << RETRO_DEVICE_LIGHTGUN)) if (ptr_state->device_mask & (1 << RETRO_DEVICE_LIGHTGUN))
input_overlay_poll_lightgun(settings, ol, old_ptr_count); input_overlay_poll_lightgun(settings, ol, old_ptr_count);
if (ptr_state->device_mask & (1 << RETRO_DEVICE_MOUSE)) if (ptr_state->device_mask & (1 << RETRO_DEVICE_MOUSE))
input_overlay_poll_mouse(settings, ol, old_ptr_count); input_overlay_poll_mouse(settings, ol,
mouse_st,
ptr_st->count, old_ptr_count);
ptr_state->device_mask = 0; ptr_state->device_mask = 0;
} }
if ( OVERLAY_GET_KEY(ol_state, RETROK_LSHIFT) || if ( OVERLAY_GET_KEY(ol_state, RETROK_LSHIFT)
OVERLAY_GET_KEY(ol_state, RETROK_RSHIFT)) || OVERLAY_GET_KEY(ol_state, RETROK_RSHIFT))
key_mod |= RETROKMOD_SHIFT; key_mod |= RETROKMOD_SHIFT;
if ( OVERLAY_GET_KEY(ol_state, RETROK_LCTRL) || if ( OVERLAY_GET_KEY(ol_state, RETROK_LCTRL)
OVERLAY_GET_KEY(ol_state, RETROK_RCTRL)) || OVERLAY_GET_KEY(ol_state, RETROK_RCTRL))
key_mod |= RETROKMOD_CTRL; key_mod |= RETROKMOD_CTRL;
if ( OVERLAY_GET_KEY(ol_state, RETROK_LALT) || if ( OVERLAY_GET_KEY(ol_state, RETROK_LALT)
OVERLAY_GET_KEY(ol_state, RETROK_RALT)) || OVERLAY_GET_KEY(ol_state, RETROK_RALT))
key_mod |= RETROKMOD_ALT; key_mod |= RETROKMOD_ALT;
if ( OVERLAY_GET_KEY(ol_state, RETROK_LMETA) || if ( OVERLAY_GET_KEY(ol_state, RETROK_LMETA)
OVERLAY_GET_KEY(ol_state, RETROK_RMETA)) || OVERLAY_GET_KEY(ol_state, RETROK_RMETA))
key_mod |= RETROKMOD_META; key_mod |= RETROKMOD_META;
/* CAPSLOCK SCROLLOCK NUMLOCK */ /* CAPSLOCK SCROLLOCK NUMLOCK */

View File

@ -130,20 +130,20 @@ static bool zlib_stream_decompress_data_to_file_init(
offsetEL = read_le(local_header + 2, 2); /* extra field length */ offsetEL = read_le(local_header + 2, 2); /* extra field length */
offsetData = (int64_t)(size_t)cdata + 26 + 4 + offsetNL + offsetEL; offsetData = (int64_t)(size_t)cdata + 26 + 4 + offsetNL + offsetEL;
zip_context->fdoffset = offsetData; zip_context->fdoffset = offsetData;
zip_context->usize = size; zip_context->usize = size;
zip_context->csize = csize; zip_context->csize = csize;
zip_context->boffset = 0; zip_context->boffset = 0;
zip_context->cmode = cmode; zip_context->cmode = cmode;
zip_context->decompressed_data = (uint8_t*)malloc(size); zip_context->decompressed_data = (uint8_t*)malloc(size);
zip_context->zstream = NULL; zip_context->zstream = NULL;
zip_context->tmpbuf = NULL; zip_context->tmpbuf = NULL;
if (cmode == ZIP_MODE_DEFLATED) if (cmode == ZIP_MODE_DEFLATED)
{ {
/* Initialize the zlib inflate machinery */ /* Initialize the zlib inflate machinery */
zip_context->zstream = (z_stream*)malloc(sizeof(z_stream)); zip_context->zstream = (z_stream*)malloc(sizeof(z_stream));
zip_context->tmpbuf = malloc(_READ_CHUNK_SIZE); zip_context->tmpbuf = (uint8_t*)malloc(_READ_CHUNK_SIZE);
zip_context->zstream->next_in = NULL; zip_context->zstream->next_in = NULL;
zip_context->zstream->avail_in = 0; zip_context->zstream->avail_in = 0;

View File

@ -238,7 +238,7 @@ static char *rhmap_strdup(const char *s)
while (s[count]) while (s[count])
++count; ++count;
++count; ++count;
out = malloc(sizeof(char) * count); out = (char*)malloc(sizeof(char) * count);
out[--count] = 0; out[--count] = 0;
while (--count >= 0) while (--count >= 0)
out[count] = s[count]; out[count] = s[count];

View File

@ -290,7 +290,7 @@ int libretrodb_find_entry(libretrodb_t *db, const char *index_name,
return -1; return -1;
bufflen = idx.next; bufflen = idx.next;
if (!(buff = malloc(bufflen))) if (!(buff = (uint8_t*)malloc(bufflen)))
return -1; return -1;
while (nread < bufflen) while (nread < bufflen)
@ -457,13 +457,9 @@ int libretrodb_create_index(libretrodb_t *db,
int rval = -1; int rval = -1;
if (libretrodb_find_index(db, name, &idx) >= 0) if (libretrodb_find_index(db, name, &idx) >= 0)
{
return 1; return 1;
}
if (!db->can_write) if (!db->can_write)
{
return -1; return -1;
}
tree = bintree_new(node_compare, &field_size); tree = bintree_new(node_compare, &field_size);

View File

@ -5669,18 +5669,22 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
/* Entries with %u player index placeholder. */ /* Entries with %u player index placeholder. */
info_single_list_t info_list[] = { info_single_list_t info_list[] = {
/* { #if 0
{
MENU_ENUM_LABEL_INPUT_LIBRETRO_DEVICE, MENU_ENUM_LABEL_INPUT_LIBRETRO_DEVICE,
NULL NULL
},*/ },
#endif
{ {
MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE, MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE,
action_bind_sublabel_input_adc_type action_bind_sublabel_input_adc_type
}, },
/* { #if 0
{
MENU_ENUM_LABEL_INPUT_DEVICE_INDEX, MENU_ENUM_LABEL_INPUT_DEVICE_INDEX,
NULL NULL
},*/ },
#endif
{ {
MENU_ENUM_LABEL_INPUT_DEVICE_RESERVATION_TYPE, MENU_ENUM_LABEL_INPUT_DEVICE_RESERVATION_TYPE,
action_bind_sublabel_input_device_reservation_type action_bind_sublabel_input_device_reservation_type
@ -5693,10 +5697,12 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
MENU_ENUM_LABEL_INPUT_MOUSE_INDEX, MENU_ENUM_LABEL_INPUT_MOUSE_INDEX,
action_bind_sublabel_input_mouse_index action_bind_sublabel_input_mouse_index
}, },
/* { #if 0
{
MENU_ENUM_LABEL_INPUT_REMAP_PORT, MENU_ENUM_LABEL_INPUT_REMAP_PORT,
NULL NULL
},*/ },
#endif
{ {
MENU_ENUM_LABEL_INPUT_JOYPAD_INDEX, MENU_ENUM_LABEL_INPUT_JOYPAD_INDEX,
action_bind_sublabel_input_device_index action_bind_sublabel_input_device_index
@ -5718,16 +5724,14 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
const char* idx_placeholder = "%u"; const char* idx_placeholder = "%u";
for (i = 0; i < ARRAY_SIZE(info_list); i++) for (i = 0; i < ARRAY_SIZE(info_list); i++)
{ {
int idxpos = -1; int idxpos = string_find_index_substring_string(msg_hash_to_str((enum msg_hash_enums)info_list[i].label_idx), idx_placeholder);
idxpos = string_find_index_substring_string(msg_hash_to_str(info_list[i].label_idx), idx_placeholder); if ( (idxpos > 0)
if ( idxpos > 0 && && string_starts_with_size(label, msg_hash_to_str((enum msg_hash_enums)info_list[i].label_idx), idxpos)
string_starts_with_size(label, msg_hash_to_str(info_list[i].label_idx), idxpos) && && (((size_t)idxpos == strlen(msg_hash_to_str((enum msg_hash_enums)info_list[i].label_idx)) - 2)
(( (size_t) idxpos == strlen(msg_hash_to_str(info_list[i].label_idx)) - 2) || || ((size_t)idxpos < strlen(msg_hash_to_str((enum msg_hash_enums)info_list[i].label_idx)) - 2 && string_ends_with_size(label,
( (size_t) idxpos < strlen(msg_hash_to_str(info_list[i].label_idx)) - 2 && msg_hash_to_str((enum msg_hash_enums)info_list[i].label_idx) + idxpos + 2,
string_ends_with_size(label, lbl_len,
msg_hash_to_str(info_list[i].label_idx)+idxpos+2, strlen(msg_hash_to_str((enum msg_hash_enums)info_list[i].label_idx))-idxpos-2))))
lbl_len,
strlen(msg_hash_to_str(info_list[i].label_idx))-idxpos-2))))
{ {
BIND_ACTION_SUBLABEL(cbs, info_list[i].cb); BIND_ACTION_SUBLABEL(cbs, info_list[i].cb);
return 0; return 0;

View File

@ -1534,7 +1534,7 @@ static bool menu_input_key_bind_poll_find_hold_pad(
if (!found) if (!found)
continue; continue;
output->key = b; output->key = (enum retro_key)b;
return true; return true;
} }
@ -1650,7 +1650,7 @@ static bool menu_input_key_bind_poll_find_trigger_pad(
if (!found) if (!found)
continue; continue;
output->key = b; output->key = (enum retro_key)b;
return true; return true;
} }

View File

@ -22,7 +22,7 @@ static cloud_sync_driver_t cloud_sync_null = {
NULL, /* sync_end */ NULL, /* sync_end */
NULL, /* read */ NULL, /* read */
NULL, /* update */ NULL, /* update */
NULL, /* delete */ NULL, /* free */
"null" /* ident */ "null" /* ident */
}; };
@ -120,10 +120,10 @@ bool cloud_sync_update(const char *path, RFILE *file,
return false; return false;
} }
bool cloud_sync_delete(const char *path, cloud_sync_complete_handler_t cb, void *user_data) bool cloud_sync_free(const char *path, cloud_sync_complete_handler_t cb, void *user_data)
{ {
const cloud_sync_driver_t *driver = cloud_sync_state_get_ptr()->driver; const cloud_sync_driver_t *driver = cloud_sync_state_get_ptr()->driver;
if (driver && driver->delete) if (driver && driver->free)
return driver->delete(path, cb, user_data); return driver->free(path, cb, user_data);
return false; return false;
} }

View File

@ -38,7 +38,7 @@ typedef struct cloud_sync_driver
bool (*read)(const char *path, const char *file, cloud_sync_complete_handler_t cb, void *user_data); bool (*read)(const char *path, const char *file, cloud_sync_complete_handler_t cb, void *user_data);
bool (*update)(const char *path, RFILE *file, cloud_sync_complete_handler_t cb, void *user_data); bool (*update)(const char *path, RFILE *file, cloud_sync_complete_handler_t cb, void *user_data);
bool (*delete)(const char *path, cloud_sync_complete_handler_t cb, void *user_data); bool (*free)(const char *path, cloud_sync_complete_handler_t cb, void *user_data);
const char *ident; const char *ident;
} cloud_sync_driver_t; } cloud_sync_driver_t;

View File

@ -5797,7 +5797,7 @@ void main_exit(void *args)
#endif #endif
runloop_msg_queue_deinit(); runloop_msg_queue_deinit();
driver_uninit(DRIVERS_CMD_ALL, 0); driver_uninit(DRIVERS_CMD_ALL, (enum driver_lifetime_flags)0);
retro_main_log_file_deinit(); retro_main_log_file_deinit();
@ -5891,7 +5891,7 @@ int rarch_main(int argc, char *argv[], void *data)
frontend_driver_init_first(data); frontend_driver_init_first(data);
if (runloop_st->flags & RUNLOOP_FLAG_IS_INITED) if (runloop_st->flags & RUNLOOP_FLAG_IS_INITED)
driver_uninit(DRIVERS_CMD_ALL, 0); driver_uninit(DRIVERS_CMD_ALL, (enum driver_lifetime_flags)0);
#ifdef HAVE_THREAD_STORAGE #ifdef HAVE_THREAD_STORAGE
sthread_tls_create(&p_rarch->rarch_tls); sthread_tls_create(&p_rarch->rarch_tls);
@ -7295,7 +7295,7 @@ static bool retroarch_parse_input_and_config(
int reinit_flags = DRIVERS_CMD_ALL & int reinit_flags = DRIVERS_CMD_ALL &
~(DRIVER_VIDEO_MASK | DRIVER_AUDIO_MASK | DRIVER_MICROPHONE_MASK | DRIVER_INPUT_MASK | DRIVER_MIDI_MASK); ~(DRIVER_VIDEO_MASK | DRIVER_AUDIO_MASK | DRIVER_MICROPHONE_MASK | DRIVER_INPUT_MASK | DRIVER_MIDI_MASK);
drivers_init(settings, reinit_flags, 0, false); drivers_init(settings, reinit_flags, (enum driver_lifetime_flags)0, false);
retroarch_init_task_queue(); retroarch_init_task_queue();
#ifdef HAVE_MENU #ifdef HAVE_MENU
@ -7313,7 +7313,7 @@ static bool retroarch_parse_input_and_config(
if (!explicit_menu) if (!explicit_menu)
{ {
task_queue_wait(NULL, NULL); task_queue_wait(NULL, NULL);
driver_uninit(DRIVERS_CMD_ALL, 0); driver_uninit(DRIVERS_CMD_ALL, (enum driver_lifetime_flags)0);
exit(0); exit(0);
} }
} }
@ -7740,7 +7740,7 @@ bool retroarch_main_init(int argc, char *argv[])
#endif #endif
); );
#endif #endif
drivers_init(settings, DRIVERS_CMD_ALL, 0, verbosity_enabled); drivers_init(settings, DRIVERS_CMD_ALL, (enum driver_lifetime_flags)0, verbosity_enabled);
#ifdef HAVE_COMMAND #ifdef HAVE_COMMAND
input_driver_deinit_command(input_st); input_driver_deinit_command(input_st);
input_driver_init_command(input_st, settings); input_driver_init_command(input_st, settings);

View File

@ -3110,7 +3110,7 @@ bool runloop_environment_cb(unsigned cmd, void *data)
case RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE: case RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE:
{ {
enum retro_av_enable_flags result = 0; enum retro_av_enable_flags result = (enum retro_av_enable_flags)0;
video_driver_state_t *video_st = video_state_get_ptr(); video_driver_state_t *video_st = video_state_get_ptr();
audio_driver_state_t *audio_st = audio_state_get_ptr(); audio_driver_state_t *audio_st = audio_state_get_ptr();

View File

@ -698,7 +698,7 @@ static enum patch_error xdelta_apply_patch(
} }
} while (stream.avail_in); } while (stream.avail_in);
*targetdata = malloc(*targetlength); *targetdata = (uint8_t*)malloc(*targetlength);
switch (ret = xd3_decode_memory( switch (ret = xd3_decode_memory(
patchdata, patchlen, patchdata, patchlen,
sourcedata, sourcelength, sourcedata, sourcelength,