diff --git a/audio/common/wasapi.c b/audio/common/wasapi.c index 639dda79d8..c01e50eda6 100644 --- a/audio/common/wasapi.c +++ b/audio/common/wasapi.c @@ -94,15 +94,14 @@ const char *hresult_name(HRESULT hr) return ""; } -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 ""; } -const char *wave_format_name(const WAVEFORMATEXTENSIBLE *format) +static const char *wave_format_name(const WAVEFORMATEXTENSIBLE *format) { switch (format->Format.wFormatTag) { @@ -200,7 +199,7 @@ static bool wasapi_is_format_suitable(const WAVEFORMATEXTENSIBLE *format) return false; break; 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 */ return false; @@ -247,11 +246,14 @@ static bool wasapi_select_device_format(WAVEFORMATEXTENSIBLE *format, IAudioClie case S_FALSE: /* 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", - 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)) { *format = *suggested_format; - result = true; + result = true; } else { @@ -281,9 +283,11 @@ static bool wasapi_select_device_format(WAVEFORMATEXTENSIBLE *format, IAudioClie if (SUCCEEDED(format_check_hr)) { *format = possible_format; - result = true; + result = true; 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; } } @@ -336,7 +340,10 @@ static IAudioClient *wasapi_init_client_ex(IMMDevice *device, 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", 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)) { @@ -453,7 +460,10 @@ static IAudioClient *wasapi_init_client_sh(IMMDevice *device, 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", 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)) { diff --git a/audio/drivers_microphone/wasapi.c b/audio/drivers_microphone/wasapi.c index fac7f8a5ec..fc51e4f175 100644 --- a/audio/drivers_microphone/wasapi.c +++ b/audio/drivers_microphone/wasapi.c @@ -119,7 +119,7 @@ static int wasapi_microphone_fetch_fifo(wasapi_microphone_handle_t *microphone) /* If the queue has room for the packets we just got... */ if (FIFO_WRITE_AVAIL(microphone->buffer) >= bytes_read && bytes_read > 0) - { + { fifo_write(microphone->buffer, mic_input, bytes_read); /* ...then enqueue the bytes directly from the mic's buffer */ } @@ -140,11 +140,11 @@ static int wasapi_microphone_fetch_fifo(wasapi_microphone_handle_t *microphone) /* If this is a shared-mode stream and we didn't run out of room in the sample queue... */ if (!microphone->exclusive && frames_read > 0) - { + { hr = _IAudioCaptureClient_GetNextPacketSize(microphone->capture, &next_packet_size); /* Get the number of frames that the mic has for us. */ if (FAILED(hr)) - { + { RARCH_ERR("[WASAPI]: Failed to get capture device \"%s\"'s next packet size: %s\n", microphone->device_name, hresult_name(hr)); return -1; @@ -171,7 +171,7 @@ static bool wasapi_microphone_wait_for_capture_event(wasapi_microphone_handle_t { /*...then let's wait for the mic to tell us that samples are ready. */ switch (WaitForSingleObject(microphone->read_event, timeout)) - { + { case WAIT_OBJECT_0: /* Okay, there's data available. */ return true; @@ -212,7 +212,7 @@ static int wasapi_microphone_read_buffered( /* If we don't have any queued samples to give to the core... */ if (!bytes_available) - { + { /* If we couldn't wait for the microphone to signal a capture event... */ if (!wasapi_microphone_wait_for_capture_event(microphone, timeout)) return -1; @@ -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 exclusive_mode = settings->bools.microphone_wasapi_exclusive_mode; 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) return NULL; @@ -304,7 +305,7 @@ static void *wasapi_microphone_open_mic(void *driver_context, const char *device /* If we requested a particular capture device, but couldn't open it... */ if (device && !microphone->device) - { + { RARCH_WARN("[WASAPI]: Failed to open requested capture device \"%s\", attempting to open default device\n", device); microphone->device = wasapi_init_device(NULL, eCapture); } @@ -343,7 +344,7 @@ static void *wasapi_microphone_open_mic(void *driver_context, const char *device /* If this mic should be used *exclusively* by RetroArch... */ if (microphone->exclusive) - { + { microphone->buffer = fifo_new(microphone->engine_buffer_size); if (!microphone->buffer) { @@ -358,7 +359,7 @@ static void *wasapi_microphone_open_mic(void *driver_context, const char *device { /* If the user selected the "default" shared buffer length... */ if (sh_buffer_length <= 0) - { + { hr = _IAudioClient_GetDevicePeriod(microphone->client, &dev_period, NULL); if (FAILED(hr)) goto error; diff --git a/audio/microphone_driver.c b/audio/microphone_driver.c index 7174311495..3bd13ae4d4 100644 --- a/audio/microphone_driver.c +++ b/audio/microphone_driver.c @@ -561,7 +561,7 @@ static size_t microphone_driver_flush( /* If this mic provides floating-point samples... */ 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)); } else @@ -575,11 +575,12 @@ static size_t microphone_driver_flush( /* If this mic provides floating-point samples... */ if (microphone->flags & MICROPHONE_FLAG_USE_FLOAT) /* 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 { /* 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); } diff --git a/cheevos/cheevos.c b/cheevos/cheevos.c index 92e546ac76..0ff30b7bd1 100644 --- a/cheevos/cheevos.c +++ b/cheevos/cheevos.c @@ -3327,7 +3327,7 @@ bool rcheevos_load(const void *data) #endif 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 */ #ifdef HAVE_THREADS diff --git a/deps/rcheevos/src/rcheevos/runtime.c b/deps/rcheevos/src/rcheevos/runtime.c index 25e9885dcf..09c3aee217 100644 --- a/deps/rcheevos/src/rcheevos/runtime.c +++ b/deps/rcheevos/src/rcheevos/runtime.c @@ -10,7 +10,7 @@ #define RC_RICHPRESENCE_DISPLAY_BUFFER_SIZE 256 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) { rc_runtime_init(self); @@ -834,7 +834,7 @@ void rc_runtime_invalidate_address(rc_runtime_t* self, uint32_t address) { } } -void rc_runtime_validate_addresses(rc_runtime_t* self, rc_runtime_event_handler_t event_handler, +void rc_runtime_validate_addresses(rc_runtime_t* self, rc_runtime_event_handler_t event_handler, rc_runtime_validate_address_t validate_handler) { rc_memref_t** last_memref = &self->memrefs; rc_memref_t* memref = self->memrefs; diff --git a/gfx/common/d3d11_defines.h b/gfx/common/d3d11_defines.h index cf4dcca7b1..98035b21bc 100644 --- a/gfx/common/d3d11_defines.h +++ b/gfx/common/d3d11_defines.h @@ -221,7 +221,7 @@ typedef struct uint32_t flags; d3d11_shader_t shaders[GFX_MAX_SHADERS]; #ifdef HAVE_DXGI_HDR - enum dxgi_swapchain_bit_depth + enum dxgi_swapchain_bit_depth chain_bit_depth; DXGI_COLOR_SPACE_TYPE chain_color_space; DXGI_FORMAT chain_formats[DXGI_SWAPCHAIN_BIT_DEPTH_COUNT]; diff --git a/gfx/common/d3d9_common.c b/gfx/common/d3d9_common.c index c1820fd2db..d2203b2b14 100644 --- a/gfx/common/d3d9_common.c +++ b/gfx/common/d3d9_common.c @@ -30,6 +30,7 @@ #include #endif #include +#include #ifdef HAVE_THREADS #include "../video_thread_wrapper.h" @@ -1112,7 +1113,7 @@ void d3d9_set_menu_texture_frame(void *data, uint32_t *dst = (uint32_t*)d3dlr.pBits; const uint16_t *src = (const uint16_t*)frame; - for (h = 0; h < height; h++, + for (h = 0; h < height; h++, dst += d3dlr.Pitch >> 2, src += width) { @@ -1162,7 +1163,7 @@ static void d3d9_video_texture_load_d3d( if (!ti) return; - if ( (info->type == TEXTURE_FILTER_MIPMAP_LINEAR) + if ( (info->type == TEXTURE_FILTER_MIPMAP_LINEAR) || (info->type == TEXTURE_FILTER_MIPMAP_NEAREST)) want_mipmap = true; @@ -1219,7 +1220,7 @@ uintptr_t d3d9_load_texture(void *video_data, void *data, return id; } -void d3d9_unload_texture(void *data, +void d3d9_unload_texture(void *data, bool threaded, uintptr_t id) { LPDIRECT3DTEXTURE9 texid; diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index 8069fb0504..5209152dc5 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -3643,17 +3643,21 @@ static bool d3d11_gfx_read_viewport(void* data, uint8_t* buffer, bool is_idle) return false; /*This implementation produces wrong result when using HDR*/ - #ifdef HAVE_DXGI_HDR +#ifdef HAVE_DXGI_HDR if ((d3d11->flags & D3D11_ST_FLAG_HDR_ENABLE)) { RARCH_ERR("[D3D11]: HDR screenshot not supported.\n"); return false; } - #endif +#endif /* Get the back buffer. */ 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)); +#endif if (!BackBuffer) 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. */ 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); - BackBuffer->lpVtbl->QueryInterface(BackBuffer, &IID_ID3D11Resource, (void**)&BackBufferResource); +#endif /* Copy back buffer to back buffer staging. */ d3d11->context->lpVtbl->CopyResource(d3d11->context, BackBufferStaging, BackBufferResource); diff --git a/gfx/drivers_font/d3d9x_w32_font.c b/gfx/drivers_font/d3d9x_w32_font.c index 0a1534ec07..261176e941 100644 --- a/gfx/drivers_font/d3d9x_w32_font.c +++ b/gfx/drivers_font/d3d9x_w32_font.c @@ -96,7 +96,7 @@ static void *d3d9x_win32_font_init(void *video_data, &desc, (void**)&d3dfonts->font)) goto error; - font = d3dfonts->font; + font = (ID3DXFont*)d3dfonts->font; font->lpVtbl->GetTextMetrics(font, &metrics); @@ -117,7 +117,7 @@ static void d3d9x_win32_font_free(void *data, bool is_threaded) if (!d3dfonts) return; - font = d3dfonts->font; + font = (ID3DXFont*)d3dfonts->font; if (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) return 0; - font = d3dfonts->font; + font = (ID3DXFont*)d3dfonts->font; font->lpVtbl->DrawText(font, NULL, (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) return; - font = d3dfonts->font; + font = (ID3DXFont*)d3dfonts->font; width = d3dfonts->d3d->video_info.width; height = d3dfonts->d3d->video_info.height; diff --git a/gfx/font_driver.c b/gfx/font_driver.c index 5ba03ddb90..d0b7c3cf37 100644 --- a/gfx/font_driver.c +++ b/gfx/font_driver.c @@ -654,7 +654,7 @@ static INLINE unsigned font_get_arabic_replacement( next_connected = !!arabic_shape_map[next_id][1]; } - if ((result = + if ((result = arabic_shape_map[id][prev_connected | (next_connected << 1)])) return result; @@ -669,7 +669,7 @@ static char* font_driver_reshape_msg(const char* msg, unsigned char *buffer, siz size_t msg_size = (strlen(msg) * 2) + 1; /* Fallback to heap allocated buffer if the buffer is too small */ /* worst case transformations are 2 bytes to 4 bytes -- aliaspider */ - unsigned char* dst_buffer = (buffer_size < msg_size) + unsigned char* dst_buffer = (buffer_size < msg_size) ? (unsigned char*)malloc(msg_size) : buffer; unsigned char *dst = (unsigned char*)dst_buffer; @@ -733,9 +733,9 @@ static char* font_driver_reshape_msg(const char* msg, unsigned char *buffer, siz { reverse = false; src++; - while ( IS_MBCONT(src) - || IS_RTL(src) - || IS_DIR_NEUTRAL(src) + while ( IS_MBCONT(src) + || IS_RTL(src) + || IS_DIR_NEUTRAL(src) || is_misc_ws(src)) src++; } @@ -745,7 +745,7 @@ static char* font_driver_reshape_msg(const char* msg, unsigned char *buffer, siz if (IS_RTL(src)) { reverse = true; - while ( IS_MBCONT(src) + while ( IS_MBCONT(src) || IS_RTL(src) || IS_DIR_NEUTRAL(src) || is_misc_ws(src)) @@ -943,7 +943,7 @@ void font_driver_init_osd( void font_driver_free_osd(void) { if (video_font_driver) - font_driver_free(video_font_driver); + font_driver_free((font_data_t*)video_font_driver); video_font_driver = NULL; } diff --git a/gfx/include/dxsdk/d3d11.h b/gfx/include/dxsdk/d3d11.h index 40c96ce526..3d700565b9 100644 --- a/gfx/include/dxsdk/d3d11.h +++ b/gfx/include/dxsdk/d3d11.h @@ -1012,12 +1012,6 @@ extern "C"{ /* Direct3D errors are now found in winerror.h */ #define MAKE_D3D11_HRESULT( code ) MAKE_HRESULT( 1, _FACD3D11, code ) #define MAKE_D3D11_STATUS( code ) MAKE_HRESULT( 0, _FACD3D11, code ) -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_DEFAULT {}; -extern const DECLSPEC_SELECTANY CD3D11_DEFAULT D3D11_DEFAULT; -extern "C"{ -#endif typedef enum D3D11_INPUT_CLASSIFICATION { @@ -1077,17 +1071,6 @@ typedef struct D3D11_VIEWPORT FLOAT MaxDepth; } D3D11_VIEWPORT; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -inline bool operator==( const D3D11_VIEWPORT& l, const D3D11_VIEWPORT& r ) -{ - return l.TopLeftX == r.TopLeftX && l.TopLeftY == r.TopLeftY && l.Width == r.Width && - l.Height == r.Height && l.MinDepth == r.MinDepth && l.MaxDepth == r.MaxDepth; -} -inline bool operator!=( const D3D11_VIEWPORT& l, const D3D11_VIEWPORT& r ) -{ return !( l == r ); } -extern "C"{ -#endif typedef struct D3D11_DRAW_INSTANCED_INDIRECT_ARGS { UINT VertexCountPerInstance; @@ -1239,38 +1222,6 @@ enum D3D11_CLEAR_FLAG typedef RECT D3D11_RECT; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_RECT : public D3D11_RECT -{ - CD3D11_RECT() - {} - explicit CD3D11_RECT( const D3D11_RECT& o ) : - D3D11_RECT( o ) - {} - explicit CD3D11_RECT( - LONG Left, - LONG Top, - LONG Right, - LONG Bottom ) - { - left = Left; - top = Top; - right = Right; - bottom = Bottom; - } - ~CD3D11_RECT() {} - operator const D3D11_RECT&() const { return *this; } -}; -inline bool operator==( const D3D11_RECT& l, const D3D11_RECT& r ) -{ - return l.left == r.left && l.top == r.top && - l.right == r.right && l.bottom == r.bottom; -} -inline bool operator!=( const D3D11_RECT& l, const D3D11_RECT& r ) -{ return !( l == r ); } -extern "C"{ -#endif typedef struct D3D11_BOX { UINT left; @@ -1281,43 +1232,6 @@ typedef struct D3D11_BOX UINT back; } D3D11_BOX; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_BOX : public D3D11_BOX -{ - CD3D11_BOX() - {} - explicit CD3D11_BOX( const D3D11_BOX& o ) : - D3D11_BOX( o ) - {} - explicit CD3D11_BOX( - LONG Left, - LONG Top, - LONG Front, - LONG Right, - LONG Bottom, - LONG Back ) - { - left = Left; - top = Top; - front = Front; - right = Right; - bottom = Bottom; - back = Back; - } - ~CD3D11_BOX() {} - operator const D3D11_BOX&() const { return *this; } -}; -inline bool operator==( const D3D11_BOX& l, const D3D11_BOX& r ) -{ - return l.left == r.left && l.top == r.top && l.front == r.front && - l.right == r.right && l.bottom == r.bottom && l.back == r.back; -} -inline bool operator!=( const D3D11_BOX& l, const D3D11_BOX& r ) -{ return !( l == r ); } -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0000_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0000_v0_0_s_ifspec; @@ -1504,65 +1418,6 @@ typedef struct D3D11_DEPTH_STENCIL_DESC D3D11_DEPTH_STENCILOP_DESC BackFace; } D3D11_DEPTH_STENCIL_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_DEPTH_STENCIL_DESC : public D3D11_DEPTH_STENCIL_DESC -{ - CD3D11_DEPTH_STENCIL_DESC() - {} - explicit CD3D11_DEPTH_STENCIL_DESC( const D3D11_DEPTH_STENCIL_DESC& o ) : - D3D11_DEPTH_STENCIL_DESC( o ) - {} - explicit CD3D11_DEPTH_STENCIL_DESC( CD3D11_DEFAULT ) - { - DepthEnable = TRUE; - DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; - DepthFunc = D3D11_COMPARISON_LESS; - StencilEnable = FALSE; - StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; - StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; - const D3D11_DEPTH_STENCILOP_DESC defaultStencilOp = - { D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS }; - FrontFace = defaultStencilOp; - BackFace = defaultStencilOp; - } - explicit CD3D11_DEPTH_STENCIL_DESC( - BOOL depthEnable, - D3D11_DEPTH_WRITE_MASK depthWriteMask, - D3D11_COMPARISON_FUNC depthFunc, - BOOL stencilEnable, - UINT8 stencilReadMask, - UINT8 stencilWriteMask, - D3D11_STENCIL_OP frontStencilFailOp, - D3D11_STENCIL_OP frontStencilDepthFailOp, - D3D11_STENCIL_OP frontStencilPassOp, - D3D11_COMPARISON_FUNC frontStencilFunc, - D3D11_STENCIL_OP backStencilFailOp, - D3D11_STENCIL_OP backStencilDepthFailOp, - D3D11_STENCIL_OP backStencilPassOp, - D3D11_COMPARISON_FUNC backStencilFunc ) - { - DepthEnable = depthEnable; - DepthWriteMask = depthWriteMask; - DepthFunc = depthFunc; - StencilEnable = stencilEnable; - StencilReadMask = stencilReadMask; - StencilWriteMask = stencilWriteMask; - FrontFace.StencilFailOp = frontStencilFailOp; - FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; - FrontFace.StencilPassOp = frontStencilPassOp; - FrontFace.StencilFunc = frontStencilFunc; - BackFace.StencilFailOp = backStencilFailOp; - BackFace.StencilDepthFailOp = backStencilDepthFailOp; - BackFace.StencilPassOp = backStencilPassOp; - BackFace.StencilFunc = backStencilFunc; - } - ~CD3D11_DEPTH_STENCIL_DESC() {} - operator const D3D11_DEPTH_STENCIL_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0001_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0001_v0_0_s_ifspec; @@ -1743,37 +1598,6 @@ typedef struct D3D11_BLEND_DESC D3D11_RENDER_TARGET_BLEND_DESC RenderTarget[ 8 ]; } D3D11_BLEND_DESC; -/* 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_DESC : public D3D11_BLEND_DESC -{ - CD3D11_BLEND_DESC() - {} - explicit CD3D11_BLEND_DESC( const D3D11_BLEND_DESC& o ) : - D3D11_BLEND_DESC( o ) - {} - explicit CD3D11_BLEND_DESC( CD3D11_DEFAULT ) - { - AlphaToCoverageEnable = FALSE; - IndependentBlendEnable = FALSE; - const D3D11_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc = - { - FALSE, - D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, - D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, - D3D11_COLOR_WRITE_ENABLE_ALL, - }; - for (UINT i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) - RenderTarget[ i ] = defaultRenderTargetBlendDesc; - } - ~CD3D11_BLEND_DESC() {} - operator const D3D11_BLEND_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0002_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0002_v0_0_s_ifspec; @@ -1907,57 +1731,6 @@ typedef struct D3D11_RASTERIZER_DESC BOOL AntialiasedLineEnable; } D3D11_RASTERIZER_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_RASTERIZER_DESC : public D3D11_RASTERIZER_DESC -{ - CD3D11_RASTERIZER_DESC() - {} - explicit CD3D11_RASTERIZER_DESC( const D3D11_RASTERIZER_DESC& o ) : - D3D11_RASTERIZER_DESC( o ) - {} - explicit CD3D11_RASTERIZER_DESC( 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; - } - explicit CD3D11_RASTERIZER_DESC( - D3D11_FILL_MODE fillMode, - D3D11_CULL_MODE cullMode, - BOOL frontCounterClockwise, - INT depthBias, - FLOAT depthBiasClamp, - FLOAT slopeScaledDepthBias, - BOOL depthClipEnable, - BOOL scissorEnable, - BOOL multisampleEnable, - BOOL antialiasedLineEnable ) - { - FillMode = fillMode; - CullMode = cullMode; - FrontCounterClockwise = frontCounterClockwise; - DepthBias = depthBias; - DepthBiasClamp = depthBiasClamp; - SlopeScaledDepthBias = slopeScaledDepthBias; - DepthClipEnable = depthClipEnable; - ScissorEnable = scissorEnable; - MultisampleEnable = multisampleEnable; - AntialiasedLineEnable = antialiasedLineEnable; - } - ~CD3D11_RASTERIZER_DESC() {} - operator const D3D11_RASTERIZER_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0003_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0003_v0_0_s_ifspec; @@ -2077,12 +1850,6 @@ EXTERN_C const IID IID_ID3D11RasterizerState; /* interface __MIDL_itf_d3d11_0000_0004 */ /* [local] */ -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -inline UINT D3D11CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT MipLevels ) -{ return MipSlice + ArraySlice * MipLevels; } -extern "C"{ -#endif typedef struct D3D11_SUBRESOURCE_DATA { const void *pSysMem; @@ -2246,36 +2013,6 @@ typedef struct D3D11_BUFFER_DESC UINT StructureByteStride; } D3D11_BUFFER_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_BUFFER_DESC : public D3D11_BUFFER_DESC -{ - CD3D11_BUFFER_DESC() - {} - explicit CD3D11_BUFFER_DESC( const D3D11_BUFFER_DESC& o ) : - D3D11_BUFFER_DESC( o ) - {} - explicit CD3D11_BUFFER_DESC( - UINT byteWidth, - UINT bindFlags, - D3D11_USAGE usage = D3D11_USAGE_DEFAULT, - UINT cpuaccessFlags = 0, - UINT miscFlags = 0, - UINT structureByteStride = 0 ) - { - ByteWidth = byteWidth; - Usage = usage; - BindFlags = bindFlags; - CPUAccessFlags = cpuaccessFlags ; - MiscFlags = miscFlags; - StructureByteStride = structureByteStride; - } - ~CD3D11_BUFFER_DESC() {} - operator const D3D11_BUFFER_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0005_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0005_v0_0_s_ifspec; @@ -2429,40 +2166,6 @@ typedef struct D3D11_TEXTURE1D_DESC UINT MiscFlags; } D3D11_TEXTURE1D_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_TEXTURE1D_DESC : public D3D11_TEXTURE1D_DESC -{ - CD3D11_TEXTURE1D_DESC() - {} - explicit CD3D11_TEXTURE1D_DESC( const D3D11_TEXTURE1D_DESC& o ) : - D3D11_TEXTURE1D_DESC( o ) - {} - explicit CD3D11_TEXTURE1D_DESC( - DXGI_FORMAT format, - UINT width, - UINT arraySize = 1, - UINT mipLevels = 0, - UINT bindFlags = D3D11_BIND_SHADER_RESOURCE, - D3D11_USAGE usage = D3D11_USAGE_DEFAULT, - UINT cpuaccessFlags= 0, - UINT miscFlags = 0 ) - { - Width = width; - MipLevels = mipLevels; - ArraySize = arraySize; - Format = format; - Usage = usage; - BindFlags = bindFlags; - CPUAccessFlags = cpuaccessFlags; - MiscFlags = miscFlags; - } - ~CD3D11_TEXTURE1D_DESC() {} - operator const D3D11_TEXTURE1D_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0006_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0006_v0_0_s_ifspec; @@ -2618,46 +2321,6 @@ typedef struct D3D11_TEXTURE2D_DESC UINT MiscFlags; } D3D11_TEXTURE2D_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_TEXTURE2D_DESC : public D3D11_TEXTURE2D_DESC -{ - CD3D11_TEXTURE2D_DESC() - {} - explicit CD3D11_TEXTURE2D_DESC( const D3D11_TEXTURE2D_DESC& o ) : - D3D11_TEXTURE2D_DESC( o ) - {} - explicit CD3D11_TEXTURE2D_DESC( - 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 ) - { - Width = width; - Height = height; - MipLevels = mipLevels; - ArraySize = arraySize; - Format = format; - SampleDesc.Count = sampleCount; - SampleDesc.Quality = sampleQuality; - Usage = usage; - BindFlags = bindFlags; - CPUAccessFlags = cpuaccessFlags; - MiscFlags = miscFlags; - } - ~CD3D11_TEXTURE2D_DESC() {} - operator const D3D11_TEXTURE2D_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0007_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0007_v0_0_s_ifspec; @@ -2812,42 +2475,6 @@ typedef struct D3D11_TEXTURE3D_DESC UINT MiscFlags; } D3D11_TEXTURE3D_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_TEXTURE3D_DESC : public D3D11_TEXTURE3D_DESC -{ - CD3D11_TEXTURE3D_DESC() - {} - explicit CD3D11_TEXTURE3D_DESC( const D3D11_TEXTURE3D_DESC& o ) : - D3D11_TEXTURE3D_DESC( o ) - {} - explicit CD3D11_TEXTURE3D_DESC( - 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 ) - { - Width = width; - Height = height; - Depth = depth; - MipLevels = mipLevels; - Format = format; - Usage = usage; - BindFlags = bindFlags; - CPUAccessFlags = cpuaccessFlags; - MiscFlags = miscFlags; - } - ~CD3D11_TEXTURE3D_DESC() {} - operator const D3D11_TEXTURE3D_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0008_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0008_v0_0_s_ifspec; @@ -3225,213 +2852,6 @@ typedef struct D3D11_SHADER_RESOURCE_VIEW_DESC } ; } D3D11_SHADER_RESOURCE_VIEW_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_SHADER_RESOURCE_VIEW_DESC : public D3D11_SHADER_RESOURCE_VIEW_DESC -{ - CD3D11_SHADER_RESOURCE_VIEW_DESC() - {} - explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( const D3D11_SHADER_RESOURCE_VIEW_DESC& o ) : - D3D11_SHADER_RESOURCE_VIEW_DESC( o ) - {} - explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( - 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 - { - 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; - break; - case D3D11_SRV_DIMENSION_TEXTURE2DARRAY: - Texture2DArray.MostDetailedMip = mostDetailedMip; - Texture2DArray.MipLevels = mipLevels; - Texture2DArray.FirstArraySlice = firstArraySlice; - Texture2DArray.ArraySize = arraySize; - 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_DESC( - _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_DESC( - _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_DESC( - _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 - { - 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; - break; - case D3D11_SRV_DIMENSION_TEXTURE2DARRAY: - Texture2DArray.MostDetailedMip = mostDetailedMip; - Texture2DArray.MipLevels = mipLevels; - Texture2DArray.FirstArraySlice = firstArraySlice; - Texture2DArray.ArraySize = arraySize; - 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_DESC( - _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_DESC() {} - operator const D3D11_SHADER_RESOURCE_VIEW_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0010_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0010_v0_0_s_ifspec; @@ -3632,167 +3052,6 @@ typedef struct D3D11_RENDER_TARGET_VIEW_DESC } ; } D3D11_RENDER_TARGET_VIEW_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_RENDER_TARGET_VIEW_DESC : public D3D11_RENDER_TARGET_VIEW_DESC -{ - CD3D11_RENDER_TARGET_VIEW_DESC() - {} - explicit CD3D11_RENDER_TARGET_VIEW_DESC( const D3D11_RENDER_TARGET_VIEW_DESC& o ) : - D3D11_RENDER_TARGET_VIEW_DESC( o ) - {} - explicit CD3D11_RENDER_TARGET_VIEW_DESC( - 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 - { - 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; - break; - case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: - Texture2DArray.MipSlice = mipSlice; - Texture2DArray.FirstArraySlice = firstArraySlice; - Texture2DArray.ArraySize = arraySize; - 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_DESC( - _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_DESC( - _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_DESC( - _In_ ID3D11Texture2D* pTex2D, - 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_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; - break; - case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: - Texture2DArray.MipSlice = mipSlice; - Texture2DArray.FirstArraySlice = firstArraySlice; - Texture2DArray.ArraySize = arraySize; - 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_DESC( - _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_DESC() {} - operator const D3D11_RENDER_TARGET_VIEW_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0011_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0011_v0_0_s_ifspec; @@ -3920,153 +3179,6 @@ EXTERN_C const IID IID_ID3D11RenderTargetView; /* interface __MIDL_itf_d3d11_0000_0012 */ /* [local] */ -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_VIEWPORT : public D3D11_VIEWPORT -{ - CD3D11_VIEWPORT() - {} - explicit CD3D11_VIEWPORT( const D3D11_VIEWPORT& o ) : - D3D11_VIEWPORT( o ) - {} - explicit CD3D11_VIEWPORT( - FLOAT topLeftX, - FLOAT topLeftY, - FLOAT width, - FLOAT height, - FLOAT minDepth = D3D11_MIN_DEPTH, - FLOAT maxDepth = D3D11_MAX_DEPTH ) - { - TopLeftX = topLeftX; - TopLeftY = topLeftY; - Width = width; - Height = height; - MinDepth = minDepth; - MaxDepth = maxDepth; - } - explicit CD3D11_VIEWPORT( - _In_ ID3D11Buffer*, - _In_ ID3D11RenderTargetView* pRTView, - FLOAT topLeftX = 0.0f, - FLOAT minDepth = D3D11_MIN_DEPTH, - FLOAT maxDepth = D3D11_MAX_DEPTH ) - { - D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; - pRTView->GetDesc( &RTVDesc ); - UINT NumElements = 0; - switch (RTVDesc.ViewDimension) - { - case D3D11_RTV_DIMENSION_BUFFER: - NumElements = RTVDesc.Buffer.NumElements; - break; - default: break; - } - TopLeftX = topLeftX; - TopLeftY = 0.0f; - Width = NumElements - topLeftX; - Height = 1.0f; - MinDepth = minDepth; - MaxDepth = maxDepth; - } - explicit CD3D11_VIEWPORT( - _In_ ID3D11Texture1D* pTex1D, - _In_ ID3D11RenderTargetView* pRTView, - FLOAT topLeftX = 0.0f, - FLOAT minDepth = D3D11_MIN_DEPTH, - FLOAT maxDepth = D3D11_MAX_DEPTH ) - { - D3D11_TEXTURE1D_DESC TexDesc; - pTex1D->GetDesc( &TexDesc ); - D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; - pRTView->GetDesc( &RTVDesc ); - UINT MipSlice = 0; - switch (RTVDesc.ViewDimension) - { - case D3D11_RTV_DIMENSION_TEXTURE1D: - MipSlice = RTVDesc.Texture1D.MipSlice; - break; - case D3D11_RTV_DIMENSION_TEXTURE1DARRAY: - MipSlice = RTVDesc.Texture1DArray.MipSlice; - break; - default: break; - } - const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice); - TopLeftX = topLeftX; - TopLeftY = 0.0f; - Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX; - Height = 1.0f; - MinDepth = minDepth; - MaxDepth = maxDepth; - } - explicit CD3D11_VIEWPORT( - _In_ ID3D11Texture2D* pTex2D, - _In_ ID3D11RenderTargetView* pRTView, - FLOAT topLeftX = 0.0f, - FLOAT topLeftY = 0.0f, - FLOAT minDepth = D3D11_MIN_DEPTH, - FLOAT maxDepth = D3D11_MAX_DEPTH ) - { - D3D11_TEXTURE2D_DESC TexDesc; - pTex2D->GetDesc( &TexDesc ); - D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; - pRTView->GetDesc( &RTVDesc ); - UINT MipSlice = 0; - switch (RTVDesc.ViewDimension) - { - case D3D11_RTV_DIMENSION_TEXTURE2D: - MipSlice = RTVDesc.Texture2D.MipSlice; - break; - case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: - MipSlice = RTVDesc.Texture2DArray.MipSlice; - break; - case D3D11_RTV_DIMENSION_TEXTURE2DMS: - case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY: - break; - default: break; - } - const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice); - const UINT SubResourceHeight = TexDesc.Height / (UINT( 1 ) << MipSlice); - TopLeftX = topLeftX; - TopLeftY = topLeftY; - Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX; - Height = (SubResourceHeight ? SubResourceHeight : 1) - topLeftY; - MinDepth = minDepth; - MaxDepth = maxDepth; - } - explicit CD3D11_VIEWPORT( - _In_ ID3D11Texture3D* pTex3D, - _In_ ID3D11RenderTargetView* pRTView, - FLOAT topLeftX = 0.0f, - FLOAT topLeftY = 0.0f, - FLOAT minDepth = D3D11_MIN_DEPTH, - FLOAT maxDepth = D3D11_MAX_DEPTH ) - { - D3D11_TEXTURE3D_DESC TexDesc; - pTex3D->GetDesc( &TexDesc ); - D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; - pRTView->GetDesc( &RTVDesc ); - UINT MipSlice = 0; - switch (RTVDesc.ViewDimension) - { - case D3D11_RTV_DIMENSION_TEXTURE3D: - MipSlice = RTVDesc.Texture3D.MipSlice; - break; - default: break; - } - const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice); - const UINT SubResourceHeight = TexDesc.Height / (UINT( 1 ) << MipSlice); - TopLeftX = topLeftX; - TopLeftY = topLeftY; - Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX; - Height = (SubResourceHeight ? SubResourceHeight : 1) - topLeftY; - MinDepth = minDepth; - MaxDepth = maxDepth; - } - ~CD3D11_VIEWPORT() {} - operator const D3D11_VIEWPORT&() const { return *this; } -}; -extern "C"{ -#endif typedef struct D3D11_TEX1D_DSV { UINT MipSlice; @@ -4125,133 +3237,6 @@ typedef struct D3D11_DEPTH_STENCIL_VIEW_DESC } ; } D3D11_DEPTH_STENCIL_VIEW_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_DEPTH_STENCIL_VIEW_DESC : public D3D11_DEPTH_STENCIL_VIEW_DESC -{ - CD3D11_DEPTH_STENCIL_VIEW_DESC() - {} - explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( const D3D11_DEPTH_STENCIL_VIEW_DESC& o ) : - D3D11_DEPTH_STENCIL_VIEW_DESC( o ) - {} - explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( - D3D11_DSV_DIMENSION viewDimension, - DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, - UINT mipSlice = 0, - UINT firstArraySlice = 0, - UINT arraySize = -1, - UINT flags = 0 ) - { - Format = format; - ViewDimension = viewDimension; - Flags = flags; - switch (viewDimension) - { - case D3D11_DSV_DIMENSION_TEXTURE1D: - Texture1D.MipSlice = mipSlice; - break; - case D3D11_DSV_DIMENSION_TEXTURE1DARRAY: - Texture1DArray.MipSlice = mipSlice; - Texture1DArray.FirstArraySlice = firstArraySlice; - Texture1DArray.ArraySize = arraySize; - break; - case D3D11_DSV_DIMENSION_TEXTURE2D: - Texture2D.MipSlice = mipSlice; - break; - case D3D11_DSV_DIMENSION_TEXTURE2DARRAY: - Texture2DArray.MipSlice = mipSlice; - Texture2DArray.FirstArraySlice = firstArraySlice; - Texture2DArray.ArraySize = arraySize; - break; - case D3D11_DSV_DIMENSION_TEXTURE2DMS: - break; - case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY: - Texture2DMSArray.FirstArraySlice = firstArraySlice; - Texture2DMSArray.ArraySize = arraySize; - break; - default: break; - } - } - explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( - _In_ ID3D11Texture1D* pTex1D, - D3D11_DSV_DIMENSION viewDimension, - DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, - UINT mipSlice = 0, - UINT firstArraySlice = 0, - UINT arraySize = -1, - UINT flags = 0 ) - { - ViewDimension = viewDimension; - Flags = flags; - if (DXGI_FORMAT_UNKNOWN == format || - (-1 == arraySize && D3D11_DSV_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_DSV_DIMENSION_TEXTURE1D: - Texture1D.MipSlice = mipSlice; - break; - case D3D11_DSV_DIMENSION_TEXTURE1DARRAY: - Texture1DArray.MipSlice = mipSlice; - Texture1DArray.FirstArraySlice = firstArraySlice; - Texture1DArray.ArraySize = arraySize; - break; - default: break; - } - } - explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( - _In_ ID3D11Texture2D* pTex2D, - D3D11_DSV_DIMENSION viewDimension, - DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, - UINT mipSlice = 0, - UINT firstArraySlice = 0, - UINT arraySize = -1, - UINT flags = 0 ) - { - ViewDimension = viewDimension; - Flags = flags; - if (DXGI_FORMAT_UNKNOWN == format || - (-1 == arraySize && - (D3D11_DSV_DIMENSION_TEXTURE2DARRAY == viewDimension || - D3D11_DSV_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_DSV_DIMENSION_TEXTURE2D: - Texture2D.MipSlice = mipSlice; - break; - case D3D11_DSV_DIMENSION_TEXTURE2DARRAY: - Texture2DArray.MipSlice = mipSlice; - Texture2DArray.FirstArraySlice = firstArraySlice; - Texture2DArray.ArraySize = arraySize; - break; - case D3D11_DSV_DIMENSION_TEXTURE2DMS: - break; - case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY: - Texture2DMSArray.FirstArraySlice = firstArraySlice; - Texture2DMSArray.ArraySize = arraySize; - break; - default: break; - } - } - ~CD3D11_DEPTH_STENCIL_VIEW_DESC() {} - operator const D3D11_DEPTH_STENCIL_VIEW_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0012_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0012_v0_0_s_ifspec; @@ -4440,157 +3425,6 @@ typedef struct D3D11_UNORDERED_ACCESS_VIEW_DESC } ; } D3D11_UNORDERED_ACCESS_VIEW_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_UNORDERED_ACCESS_VIEW_DESC : public D3D11_UNORDERED_ACCESS_VIEW_DESC -{ - CD3D11_UNORDERED_ACCESS_VIEW_DESC() - {} - explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( const D3D11_UNORDERED_ACCESS_VIEW_DESC& o ) : - D3D11_UNORDERED_ACCESS_VIEW_DESC( o ) - {} - explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( - 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 - { - 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; - break; - case D3D11_UAV_DIMENSION_TEXTURE2DARRAY: - Texture2DArray.MipSlice = mipSlice; - Texture2DArray.FirstArraySlice = firstArraySlice; - Texture2DArray.ArraySize = arraySize; - break; - case D3D11_UAV_DIMENSION_TEXTURE3D: - Texture3D.MipSlice = mipSlice; - Texture3D.FirstWSlice = firstArraySlice; - Texture3D.WSize = arraySize; - break; - default: break; - } - } - explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( - _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_DESC( - _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_DESC( - _In_ ID3D11Texture2D* pTex2D, - 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_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; - break; - case D3D11_UAV_DIMENSION_TEXTURE2DARRAY: - Texture2DArray.MipSlice = mipSlice; - Texture2DArray.FirstArraySlice = firstArraySlice; - Texture2DArray.ArraySize = arraySize; - break; - default: break; - } - } - explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( - _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_DESC() {} - operator const D3D11_UNORDERED_ACCESS_VIEW_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0013_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0013_v0_0_s_ifspec; @@ -5557,65 +4391,6 @@ typedef struct D3D11_SAMPLER_DESC FLOAT MaxLOD; } D3D11_SAMPLER_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_SAMPLER_DESC : public D3D11_SAMPLER_DESC -{ - CD3D11_SAMPLER_DESC() - {} - explicit CD3D11_SAMPLER_DESC( const D3D11_SAMPLER_DESC& o ) : - D3D11_SAMPLER_DESC( o ) - {} - explicit CD3D11_SAMPLER_DESC( CD3D11_DEFAULT ) - { - Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; - AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; - AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; - AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; - MipLODBias = 0; - MaxAnisotropy = 1; - ComparisonFunc = D3D11_COMPARISON_NEVER; - BorderColor[ 0 ] = 1.0f; - BorderColor[ 1 ] = 1.0f; - BorderColor[ 2 ] = 1.0f; - BorderColor[ 3 ] = 1.0f; - MinLOD = -3.402823466e+38F; // -FLT_MAX - MaxLOD = 3.402823466e+38F; // FLT_MAX - } - explicit CD3D11_SAMPLER_DESC( - D3D11_FILTER filter, - D3D11_TEXTURE_ADDRESS_MODE addressU, - D3D11_TEXTURE_ADDRESS_MODE addressV, - D3D11_TEXTURE_ADDRESS_MODE addressW, - FLOAT mipLODBias, - UINT maxAnisotropy, - D3D11_COMPARISON_FUNC comparisonFunc, - _In_reads_opt_( 4 ) const FLOAT* borderColor, // RGBA - FLOAT minLOD, - FLOAT maxLOD ) - { - Filter = filter; - AddressU = addressU; - AddressV = addressV; - AddressW = addressW; - MipLODBias = mipLODBias; - MaxAnisotropy = maxAnisotropy; - ComparisonFunc = comparisonFunc; - const float defaultColor[ 4 ] = { 1.0f, 1.0f, 1.0f, 1.0f }; - if (!borderColor) borderColor = defaultColor; - BorderColor[ 0 ] = borderColor[ 0 ]; - BorderColor[ 1 ] = borderColor[ 1 ]; - BorderColor[ 2 ] = borderColor[ 2 ]; - BorderColor[ 3 ] = borderColor[ 3 ]; - MinLOD = minLOD; - MaxLOD = maxLOD; - } - ~CD3D11_SAMPLER_DESC() {} - operator const D3D11_SAMPLER_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0021_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0021_v0_0_s_ifspec; @@ -5942,28 +4717,6 @@ typedef struct D3D11_QUERY_DESC UINT MiscFlags; } D3D11_QUERY_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_QUERY_DESC : public D3D11_QUERY_DESC -{ - CD3D11_QUERY_DESC() - {} - explicit CD3D11_QUERY_DESC( const D3D11_QUERY_DESC& o ) : - D3D11_QUERY_DESC( o ) - {} - explicit CD3D11_QUERY_DESC( - D3D11_QUERY query, - UINT miscFlags = 0 ) - { - Query = query; - MiscFlags = miscFlags; - } - ~CD3D11_QUERY_DESC() {} - operator const D3D11_QUERY_DESC&() const { return *this; } -}; -extern "C"{ -#endif - extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0023_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0023_v0_0_s_ifspec; @@ -6252,27 +5005,6 @@ typedef struct D3D11_COUNTER_DESC UINT MiscFlags; } D3D11_COUNTER_DESC; -#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) -} -struct CD3D11_COUNTER_DESC : public D3D11_COUNTER_DESC -{ - CD3D11_COUNTER_DESC() - {} - explicit CD3D11_COUNTER_DESC( const D3D11_COUNTER_DESC& o ) : - D3D11_COUNTER_DESC( o ) - {} - explicit CD3D11_COUNTER_DESC( - D3D11_COUNTER counter, - UINT miscFlags = 0 ) - { - Counter = counter; - MiscFlags = miscFlags; - } - ~CD3D11_COUNTER_DESC() {} - operator const D3D11_COUNTER_DESC&() const { return *this; } -}; -extern "C"{ -#endif typedef struct D3D11_COUNTER_INFO { D3D11_COUNTER LastDeviceDependentCounter; diff --git a/gfx/include/dxsdk/d3d11_1.h b/gfx/include/dxsdk/d3d11_1.h index 9303544f52..c41ec8b829 100644 --- a/gfx/include/dxsdk/d3d11_1.h +++ b/gfx/include/dxsdk/d3d11_1.h @@ -163,38 +163,6 @@ typedef struct D3D11_BLEND_DESC1 D3D11_RENDER_TARGET_BLEND_DESC1 RenderTarget[ 8 ]; } 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_s_ifspec; @@ -337,60 +305,6 @@ typedef struct D3D11_RASTERIZER_DESC1 UINT ForcedSampleCount; } 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_s_ifspec; diff --git a/gfx/include/dxsdk/d3d11_3.h b/gfx/include/dxsdk/d3d11_3.h index 6fc17cc828..0dd710175e 100644 --- a/gfx/include/dxsdk/d3d11_3.h +++ b/gfx/include/dxsdk/d3d11_3.h @@ -160,65 +160,6 @@ typedef struct D3D11_TEXTURE2D_DESC1 D3D11_TEXTURE_LAYOUT TextureLayout; } 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_s_ifspec; @@ -382,59 +323,6 @@ typedef struct D3D11_TEXTURE3D_DESC1 D3D11_TEXTURE_LAYOUT TextureLayout; } 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_s_ifspec; @@ -607,63 +495,6 @@ typedef struct D3D11_RASTERIZER_DESC2 D3D11_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster; } 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_s_ifspec; @@ -835,219 +666,6 @@ typedef struct 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_s_ifspec; @@ -1214,173 +832,6 @@ typedef struct 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_s_ifspec; @@ -1545,163 +996,6 @@ typedef struct 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_s_ifspec; @@ -1844,30 +1138,6 @@ typedef struct D3D11_QUERY_DESC1 D3D11_CONTEXT_TYPE ContextType; } 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_s_ifspec; diff --git a/input/input_driver.c b/input/input_driver.c index 1f80f94db1..ec5668ed6f 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -1101,7 +1101,7 @@ const char **input_keyboard_start_line( } #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; 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, + input_overlay_pointer_state_t *ptr_st, unsigned idx, unsigned id) { - input_overlay_pointer_state_t *ptr_st = &ol->pointer_state; - ptr_st->device_mask |= (1 << RETRO_DEVICE_POINTER); switch (id) @@ -1246,14 +1245,16 @@ static int16_t input_overlay_pointing_device_state(settings_t *settings, switch (device) { case RETRO_DEVICE_MOUSE: - return input_overlay_mouse_state(ol, id); + return input_overlay_device_mouse_state(ol, id); case RETRO_DEVICE_LIGHTGUN: if ( settings->ints.input_overlay_lightgun_port == -1 || settings->ints.input_overlay_lightgun_port == (int)port) return input_overlay_lightgun_state(settings, ol, id); break; 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: break; } @@ -3036,14 +3037,15 @@ static void input_overlay_get_mouse_scale(settings_t *settings, * Updates button state of the overlay mouse. */ 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; - 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 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 int ptr_count = ptr_st->count; int swipe_thres_x = 0; int swipe_thres_y = 0; 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) { + 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)) input_overlay_poll_lightgun(settings, ol, old_ptr_count); 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; } - if ( OVERLAY_GET_KEY(ol_state, RETROK_LSHIFT) || - OVERLAY_GET_KEY(ol_state, RETROK_RSHIFT)) + if ( OVERLAY_GET_KEY(ol_state, RETROK_LSHIFT) + || OVERLAY_GET_KEY(ol_state, RETROK_RSHIFT)) key_mod |= RETROKMOD_SHIFT; - if ( OVERLAY_GET_KEY(ol_state, RETROK_LCTRL) || - OVERLAY_GET_KEY(ol_state, RETROK_RCTRL)) + if ( OVERLAY_GET_KEY(ol_state, RETROK_LCTRL) + || OVERLAY_GET_KEY(ol_state, RETROK_RCTRL)) key_mod |= RETROKMOD_CTRL; - if ( OVERLAY_GET_KEY(ol_state, RETROK_LALT) || - OVERLAY_GET_KEY(ol_state, RETROK_RALT)) + if ( OVERLAY_GET_KEY(ol_state, RETROK_LALT) + || OVERLAY_GET_KEY(ol_state, RETROK_RALT)) key_mod |= RETROKMOD_ALT; - if ( OVERLAY_GET_KEY(ol_state, RETROK_LMETA) || - OVERLAY_GET_KEY(ol_state, RETROK_RMETA)) + if ( OVERLAY_GET_KEY(ol_state, RETROK_LMETA) + || OVERLAY_GET_KEY(ol_state, RETROK_RMETA)) key_mod |= RETROKMOD_META; /* CAPSLOCK SCROLLOCK NUMLOCK */ diff --git a/libretro-common/file/archive_file_zlib.c b/libretro-common/file/archive_file_zlib.c index f9cd64be5c..79d0224401 100644 --- a/libretro-common/file/archive_file_zlib.c +++ b/libretro-common/file/archive_file_zlib.c @@ -130,20 +130,20 @@ static bool zlib_stream_decompress_data_to_file_init( offsetEL = read_le(local_header + 2, 2); /* extra field length */ offsetData = (int64_t)(size_t)cdata + 26 + 4 + offsetNL + offsetEL; - zip_context->fdoffset = offsetData; - zip_context->usize = size; - zip_context->csize = csize; - zip_context->boffset = 0; - zip_context->cmode = cmode; - zip_context->decompressed_data = (uint8_t*)malloc(size); - zip_context->zstream = NULL; - zip_context->tmpbuf = NULL; + zip_context->fdoffset = offsetData; + zip_context->usize = size; + zip_context->csize = csize; + zip_context->boffset = 0; + zip_context->cmode = cmode; + zip_context->decompressed_data = (uint8_t*)malloc(size); + zip_context->zstream = NULL; + zip_context->tmpbuf = NULL; if (cmode == ZIP_MODE_DEFLATED) { /* Initialize the zlib inflate machinery */ - zip_context->zstream = (z_stream*)malloc(sizeof(z_stream)); - zip_context->tmpbuf = malloc(_READ_CHUNK_SIZE); + zip_context->zstream = (z_stream*)malloc(sizeof(z_stream)); + zip_context->tmpbuf = (uint8_t*)malloc(_READ_CHUNK_SIZE); zip_context->zstream->next_in = NULL; zip_context->zstream->avail_in = 0; diff --git a/libretro-common/include/array/rhmap.h b/libretro-common/include/array/rhmap.h index 22de502e59..8bdeac4101 100644 --- a/libretro-common/include/array/rhmap.h +++ b/libretro-common/include/array/rhmap.h @@ -238,7 +238,7 @@ static char *rhmap_strdup(const char *s) while (s[count]) ++count; ++count; - out = malloc(sizeof(char) * count); + out = (char*)malloc(sizeof(char) * count); out[--count] = 0; while (--count >= 0) out[count] = s[count]; diff --git a/libretro-db/libretrodb.c b/libretro-db/libretrodb.c index a846b6d637..13bb4e8b79 100644 --- a/libretro-db/libretrodb.c +++ b/libretro-db/libretrodb.c @@ -290,7 +290,7 @@ int libretrodb_find_entry(libretrodb_t *db, const char *index_name, return -1; bufflen = idx.next; - if (!(buff = malloc(bufflen))) + if (!(buff = (uint8_t*)malloc(bufflen))) return -1; while (nread < bufflen) @@ -457,13 +457,9 @@ int libretrodb_create_index(libretrodb_t *db, int rval = -1; if (libretrodb_find_index(db, name, &idx) >= 0) - { return 1; - } if (!db->can_write) - { return -1; - } tree = bintree_new(node_compare, &field_size); diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index cc74c0d446..f785130350 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -5669,18 +5669,22 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, /* Entries with %u player index placeholder. */ info_single_list_t info_list[] = { -/* { +#if 0 + { MENU_ENUM_LABEL_INPUT_LIBRETRO_DEVICE, NULL - },*/ + }, +#endif { MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE, action_bind_sublabel_input_adc_type }, -/* { +#if 0 + { MENU_ENUM_LABEL_INPUT_DEVICE_INDEX, NULL - },*/ + }, +#endif { MENU_ENUM_LABEL_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, action_bind_sublabel_input_mouse_index }, -/* { +#if 0 + { MENU_ENUM_LABEL_INPUT_REMAP_PORT, NULL - },*/ + }, +#endif { MENU_ENUM_LABEL_INPUT_JOYPAD_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"; for (i = 0; i < ARRAY_SIZE(info_list); i++) { - int idxpos = -1; - idxpos = string_find_index_substring_string(msg_hash_to_str(info_list[i].label_idx), idx_placeholder); - if ( idxpos > 0 && - string_starts_with_size(label, msg_hash_to_str(info_list[i].label_idx), idxpos) && - (( (size_t) idxpos == strlen(msg_hash_to_str(info_list[i].label_idx)) - 2) || - ( (size_t) idxpos < strlen(msg_hash_to_str(info_list[i].label_idx)) - 2 && - string_ends_with_size(label, - msg_hash_to_str(info_list[i].label_idx)+idxpos+2, - lbl_len, - strlen(msg_hash_to_str(info_list[i].label_idx))-idxpos-2)))) + int idxpos = string_find_index_substring_string(msg_hash_to_str((enum msg_hash_enums)info_list[i].label_idx), idx_placeholder); + if ( (idxpos > 0) + && string_starts_with_size(label, msg_hash_to_str((enum msg_hash_enums)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((enum msg_hash_enums)info_list[i].label_idx)) - 2 && string_ends_with_size(label, + msg_hash_to_str((enum msg_hash_enums)info_list[i].label_idx) + idxpos + 2, + lbl_len, + strlen(msg_hash_to_str((enum msg_hash_enums)info_list[i].label_idx))-idxpos-2)))) { BIND_ACTION_SUBLABEL(cbs, info_list[i].cb); return 0; diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 7cc5a68fc7..b86445a6d5 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -1534,7 +1534,7 @@ static bool menu_input_key_bind_poll_find_hold_pad( if (!found) continue; - output->key = b; + output->key = (enum retro_key)b; return true; } @@ -1650,7 +1650,7 @@ static bool menu_input_key_bind_poll_find_trigger_pad( if (!found) continue; - output->key = b; + output->key = (enum retro_key)b; return true; } diff --git a/network/cloud_sync_driver.c b/network/cloud_sync_driver.c index 506a78b8c8..e722533c51 100644 --- a/network/cloud_sync_driver.c +++ b/network/cloud_sync_driver.c @@ -22,7 +22,7 @@ static cloud_sync_driver_t cloud_sync_null = { NULL, /* sync_end */ NULL, /* read */ NULL, /* update */ - NULL, /* delete */ + NULL, /* free */ "null" /* ident */ }; @@ -120,10 +120,10 @@ bool cloud_sync_update(const char *path, RFILE *file, 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; - if (driver && driver->delete) - return driver->delete(path, cb, user_data); + if (driver && driver->free) + return driver->free(path, cb, user_data); return false; } diff --git a/network/cloud_sync_driver.h b/network/cloud_sync_driver.h index 1ff21284a4..b69c6b9810 100644 --- a/network/cloud_sync_driver.h +++ b/network/cloud_sync_driver.h @@ -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 (*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; } cloud_sync_driver_t; diff --git a/retroarch.c b/retroarch.c index f91b15c8a7..1cd36e0535 100644 --- a/retroarch.c +++ b/retroarch.c @@ -5797,7 +5797,7 @@ void main_exit(void *args) #endif 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(); @@ -5891,7 +5891,7 @@ int rarch_main(int argc, char *argv[], void *data) frontend_driver_init_first(data); 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 sthread_tls_create(&p_rarch->rarch_tls); @@ -7295,7 +7295,7 @@ static bool retroarch_parse_input_and_config( int reinit_flags = DRIVERS_CMD_ALL & ~(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(); #ifdef HAVE_MENU @@ -7313,7 +7313,7 @@ static bool retroarch_parse_input_and_config( if (!explicit_menu) { task_queue_wait(NULL, NULL); - driver_uninit(DRIVERS_CMD_ALL, 0); + driver_uninit(DRIVERS_CMD_ALL, (enum driver_lifetime_flags)0); exit(0); } } @@ -7740,7 +7740,7 @@ bool retroarch_main_init(int argc, char *argv[]) #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 input_driver_deinit_command(input_st); input_driver_init_command(input_st, settings); diff --git a/runloop.c b/runloop.c index a4bc004f26..7be693979e 100644 --- a/runloop.c +++ b/runloop.c @@ -3110,7 +3110,7 @@ bool runloop_environment_cb(unsigned cmd, void *data) 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(); audio_driver_state_t *audio_st = audio_state_get_ptr(); diff --git a/tasks/task_patch.c b/tasks/task_patch.c index 39f3fe4152..c338859442 100644 --- a/tasks/task_patch.c +++ b/tasks/task_patch.c @@ -698,7 +698,7 @@ static enum patch_error xdelta_apply_patch( } } while (stream.avail_in); - *targetdata = malloc(*targetlength); + *targetdata = (uint8_t*)malloc(*targetlength); switch (ret = xd3_decode_memory( patchdata, patchlen, sourcedata, sourcelength,