diff --git a/gfx/drivers_renderchain/d3d9_hlsl_renderchain.c b/gfx/drivers_renderchain/d3d9_hlsl_renderchain.c index ac1a560fc7..a57f1ebf80 100644 --- a/gfx/drivers_renderchain/d3d9_hlsl_renderchain.c +++ b/gfx/drivers_renderchain/d3d9_hlsl_renderchain.c @@ -313,7 +313,7 @@ static bool hlsl_d3d9_renderchain_init(void *data, d3d_video_t *d3d = (d3d_video_t*)data; LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev; const video_info_t *video_info = (const video_info_t*)_video_info; - const LinkInfo *link_info = (const LinkInfo*)info_data; + const struct LinkInfo *link_info = (const struct LinkInfo*)info_data; hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*) d3d->renderchain_data; unsigned fmt = (rgb32) diff --git a/gfx/drivers_shader/shader_hlsl.c b/gfx/drivers_shader/shader_hlsl.c index 19f404dfb2..792ed9135a 100644 --- a/gfx/drivers_shader/shader_hlsl.c +++ b/gfx/drivers_shader/shader_hlsl.c @@ -59,52 +59,64 @@ struct shader_program_hlsl_data typedef struct hlsl_shader_data hlsl_shader_data_t; -#ifdef __cplusplus - -#ifndef ID3DXConstantTable_SetDefaults -#define ID3DXConstantTable_SetDefaults(p,a) (p)->SetDefaults(a); -#endif - -#ifndef ID3DXConstantTable_SetFloatArray -#define ID3DXConstantTable_SetFloatArray(p,a,b,c,d) (p)->SetFloatArray(a,b,c,d) -#endif - -#ifndef ID3DXConstantTable_SetFloat -#define ID3DXConstantTable_SetFloat(p,a,b,c) (p)->SetFloat(a,b,c) -#endif - -#ifndef ID3DXConstantTable_GetBufferPointer -#define ID3DXConstantTable_GetBufferPointer(p) (p)->GetBufferPointer() -#endif - -#ifndef ID3DXBuffer_Release -#define ID3DXBuffer_Release(p) (p)->Release() -#endif - -#else - -#ifndef ID3DXConstantTable_SetDefaults -#define ID3DXConstantTable_SetDefaults(p,a) (p)->lpVtbl->SetDefaults(p,a) -#endif +#ifdef __cplusplus + +#ifndef ID3DXConstantTable_SetDefaults +#define ID3DXConstantTable_SetDefaults(p,a) (p)->SetDefaults(a); +#endif #ifndef ID3DXConstantTable_SetFloatArray -#define ID3DXConstantTable_SetFloatArray(p,a,b,c,d) (p)->lpVtbl->SetFloatArray(p,a,b,c,d) -#endif - -#ifndef ID3DXConstantTable_SetFloat -#define ID3DXConstantTable_SetFloat(p,a,b,c) (p)->lpVtbl->SetFloat(p,a,b,c) -#endif - -#ifndef ID3DXConstantTable_GetBufferPointer -#define ID3DXConstantTable_GetBufferPointer(p) (p)->lpVtbl->GetBufferPointer(p) -#endif - +#define ID3DXConstantTable_SetFloatArray(p,a,b,c,d) (p)->SetFloatArray(a,b,c,d) +#endif + +#ifndef ID3DXConstantTable_SetFloat +#define ID3DXConstantTable_SetFloat(p,a,b,c) (p)->SetFloat(a,b,c) +#endif + +#ifndef ID3DXConstantTable_GetBufferPointer +#define ID3DXConstantTable_GetBufferPointer(p) (p)->GetBufferPointer() +#endif + +#ifndef ID3DXBuffer_Release +#define ID3DXBuffer_Release(p) (p)->Release() +#endif + +#ifndef ID3DXConstantTable_GetConstantByName +#define ID3DXConstantTable_GetConstantByName(p,a,b) ((p)->GetConstantByName(a, b)) +#endif + +#else + +#ifndef ID3DXConstantTable_SetDefaults +#define ID3DXConstantTable_SetDefaults(p,a) (p)->lpVtbl->SetDefaults(p,a) +#endif + +#ifndef ID3DXConstantTable_SetFloatArray +#define ID3DXConstantTable_SetFloatArray(p,a,b,c,d) (p)->lpVtbl->SetFloatArray(p,a,b,c,d) +#endif + +#ifndef ID3DXConstantTable_SetFloat +#define ID3DXConstantTable_SetFloat(p,a,b,c) (p)->lpVtbl->SetFloat(p,a,b,c) +#endif + +#ifndef ID3DXConstantTable_GetBufferPointer +#define ID3DXConstantTable_GetBufferPointer(p) (p)->lpVtbl->GetBufferPointer(p) +#endif + #ifndef ID3DXBuffer_Release #define ID3DXBuffer_Release(p) (p)->lpVtbl->Release(p) -#endif - #endif +#ifndef ID3DXConstantTable_GetConstantByName +#define ID3DXConstantTable_GetConstantByName(p,a,b) ((p)->lpVtbl->GetConstantByName(p, a, b)) +#endif + +#endif + +#define set_param_2f(param, xy, constanttable) if (param) { ID3DXConstantTable_SetFloatArray(constanttable, d3dr, param, xy, 2); } +#define set_param_1f(param, x, constanttable) if (param) { ID3DXConstantTable_SetFloat(constanttable, d3dr, param, x); } +#define get_constant_by_name(a, b, constanttable) ID3DXConstantTable_GetConstantByName(constanttable, a, b) + struct hlsl_shader_data { d3d_video_t *d3d; @@ -164,9 +176,6 @@ static void hlsl_set_uniform_parameter( } } -#define set_param_2f(param, xy, constanttable) if (param) { ID3DXConstantTable_SetFloatArray(constanttable, d3dr, param, xy, 2); } -#define set_param_1f(param, x, constanttable) if (param) { ID3DXConstantTable_SetFloat(constanttable, d3dr, param, x); } - static void hlsl_set_params(void *data, void *shader_data, unsigned width, unsigned height, unsigned tex_width, unsigned tex_height, @@ -303,17 +312,17 @@ static void hlsl_set_program_attributes(hlsl_shader_data_t *hlsl, unsigned i) if (!hlsl) return; - hlsl->prg[i].vid_size_f = hlsl->prg[i].f_ctable->GetConstantByName(NULL, "$IN.video_size"); - hlsl->prg[i].tex_size_f = hlsl->prg[i].f_ctable->GetConstantByName(NULL, "$IN.texture_size"); - hlsl->prg[i].out_size_f = hlsl->prg[i].f_ctable->GetConstantByName(NULL, "$IN.output_size"); - hlsl->prg[i].frame_cnt_f = hlsl->prg[i].f_ctable->GetConstantByName(NULL, "$IN.frame_count"); - hlsl->prg[i].frame_dir_f = hlsl->prg[i].f_ctable->GetConstantByName(NULL, "$IN.frame_direction"); - hlsl->prg[i].vid_size_v = hlsl->prg[i].v_ctable->GetConstantByName(NULL, "$IN.video_size"); - hlsl->prg[i].tex_size_v = hlsl->prg[i].v_ctable->GetConstantByName(NULL, "$IN.texture_size"); - hlsl->prg[i].out_size_v = hlsl->prg[i].v_ctable->GetConstantByName(NULL, "$IN.output_size"); - hlsl->prg[i].frame_cnt_v = hlsl->prg[i].v_ctable->GetConstantByName(NULL, "$IN.frame_count"); - hlsl->prg[i].frame_dir_v = hlsl->prg[i].v_ctable->GetConstantByName(NULL, "$IN.frame_direction"); - hlsl->prg[i].mvp = hlsl->prg[i].v_ctable->GetConstantByName(NULL, "$modelViewProj"); + hlsl->prg[i].vid_size_f = get_constant_by_name(NULL, "$IN.video_size", hlsl->prg[i].f_ctable); + hlsl->prg[i].tex_size_f = get_constant_by_name(NULL, "$IN.texture_size", hlsl->prg[i].f_ctable); + hlsl->prg[i].out_size_f = get_constant_by_name(NULL, "$IN.output_size", hlsl->prg[i].f_ctable); + hlsl->prg[i].frame_cnt_f = get_constant_by_name(NULL, "$IN.frame_count", hlsl->prg[i].f_ctable); + hlsl->prg[i].frame_dir_f = get_constant_by_name(NULL, "$IN.frame_direction", hlsl->prg[i].f_ctable); + hlsl->prg[i].vid_size_v = get_constant_by_name(NULL, "$IN.video_size", hlsl->prg[i].v_ctable); + hlsl->prg[i].tex_size_v = get_constant_by_name(NULL, "$IN.texture_size", hlsl->prg[i].v_ctable); + hlsl->prg[i].out_size_v = get_constant_by_name(NULL, "$IN.output_size", hlsl->prg[i].v_ctable); + hlsl->prg[i].frame_cnt_v = get_constant_by_name(NULL, "$IN.frame_count", hlsl->prg[i].v_ctable); + hlsl->prg[i].frame_dir_v = get_constant_by_name(NULL, "$IN.frame_direction", hlsl->prg[i].v_ctable); + hlsl->prg[i].mvp = get_constant_by_name(NULL, "$modelViewProj", hlsl->prg[i].v_ctable); hlsl->prg[i].mvp_val = XMMatrixIdentity(); } diff --git a/input/drivers_joypad/xdk_joypad.c b/input/drivers_joypad/xdk_joypad.c index 598fda649f..e5f2fabab7 100644 --- a/input/drivers_joypad/xdk_joypad.c +++ b/input/drivers_joypad/xdk_joypad.c @@ -19,7 +19,7 @@ #include "../input_driver.h" #include "../../tasks/tasks_internal.h" -static uint32_t pad_state[MAX_PADS]; +static uint64_t pad_state[MAX_PADS]; static int16_t analog_state[MAX_PADS][2][2]; #ifdef _XBOX1 static HANDLE gamepads[MAX_PADS]; @@ -73,7 +73,7 @@ static bool xdk_joypad_button(unsigned port_num, uint16_t joykey) if (port_num >= MAX_PADS) return false; - return pad_state[port_num] & (1 << joykey); + return pad_state[port_num] & (UINT64_C(1) << joykey); } static void xdk_joypad_get_buttons(unsigned port_num, retro_bits_t *state)