Style nits.

This commit is contained in:
Themaister 2012-04-16 18:11:20 +02:00
parent a8af68217f
commit dcbd252c38
2 changed files with 32 additions and 28 deletions

View File

@ -85,9 +85,9 @@ void hlsl_set_proj_matrix(XMMATRIX rotation_value)
}
#define set_param_2f(param, xy, constanttable) \
if (param) constanttable->SetFloatArray(d3d_device_ptr, param, xy, 2);
if (param) constanttable->SetFloatArray(d3d_device_ptr, param, xy, 2)
#define set_param_1f(param, x, constanttable) \
if (param) constanttable->SetFloat(d3d_device_ptr, param, x);
if (param) constanttable->SetFloat(d3d_device_ptr, param, x)
void hlsl_set_params(unsigned width, unsigned height,
unsigned tex_width, unsigned tex_height,
@ -98,8 +98,8 @@ void hlsl_set_params(unsigned width, unsigned height,
return;
const float ori_size[2] = { (float)width, (float)height };
const float out_size[2] = {(float)out_width, (float)out_height};
const float tex_size[2] = { (float)tex_width, (float)tex_height };
const float out_size[2] = { (float)out_width, (float)out_height };
set_param_2f(prg[active_index].vid_size_f, ori_size, prg[active_index].f_ctable);
set_param_2f(prg[active_index].tex_size_f, tex_size, prg[active_index].f_ctable);
@ -133,14 +133,18 @@ static bool load_program(unsigned index, const char *prog, bool path_is_file)
if (path_is_file)
{
ret_fp = D3DXCompileShaderFromFile(prog, NULL, NULL, "main_fragment", "ps_2_0", 0, &code_f, &listing_f, &prg[index].f_ctable);
ret_vp = D3DXCompileShaderFromFile(prog, NULL, NULL, "main_vertex", "vs_2_0", 0, &code_v, &listing_v, &prg[index].v_ctable);
ret_fp = D3DXCompileShaderFromFile(prog, NULL, NULL,
"main_fragment", "ps_2_0", 0, &code_f, &listing_f, &prg[index].f_ctable);
ret_vp = D3DXCompileShaderFromFile(prog, NULL, NULL,
"main_vertex", "vs_2_0", 0, &code_v, &listing_v, &prg[index].v_ctable);
}
else
{
/* TODO - crashes currently - to do with 'end of line' of stock shader */
ret_fp = D3DXCompileShader(prog, (UINT)strlen(prog), NULL, NULL, "main_fragment", "ps_2_0", 0, &code_f, &listing_f, &prg[index].f_ctable );
ret_vp = D3DXCompileShader(prog, (UINT)strlen(prog), NULL, NULL, "main_vertex", "vs_2_0", 0, &code_v, &listing_v, &prg[index].v_ctable );
ret_fp = D3DXCompileShader(prog, (UINT)strlen(prog), NULL, NULL,
"main_fragment", "ps_2_0", 0, &code_f, &listing_f, &prg[index].f_ctable );
ret_vp = D3DXCompileShader(prog, (UINT)strlen(prog), NULL, NULL,
"main_vertex", "vs_2_0", 0, &code_v, &listing_v, &prg[index].v_ctable );
}
if (FAILED(ret_fp) || FAILED(ret_vp) || listing_v || listing_f)
@ -200,8 +204,7 @@ static bool load_plain(const char *path)
}
static void hlsl_deinit_progs(void)
{
}
{}
static void hlsl_deinit_state(void)
{
@ -275,3 +278,4 @@ void hlsl_deinit(void)
hlsl_deinit_state();
}