made cl_viewmodel_scale apply to csqc and gettaginfo
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 15 Nov 2006 11:23:55 +0000 (11:23 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 15 Nov 2006 11:23:55 +0000 (11:23 +0000)
fixed bug with concat order in stereo rendering (it was offseting along X in worldspace due to wrong concat order)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6620 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
clvm_cmds.c
quakedef.h
svvm_cmds.c

index 8ab102b..164ed0c 100644 (file)
@@ -1748,7 +1748,7 @@ void CL_UpdateScreen(void)
                matrix4x4_t originalmatrix = r_view.matrix;
                matrix4x4_t offsetmatrix;
                Matrix4x4_CreateTranslate(&offsetmatrix, 0, r_stereo_separation.value * -0.5f, 0);
                matrix4x4_t originalmatrix = r_view.matrix;
                matrix4x4_t offsetmatrix;
                Matrix4x4_CreateTranslate(&offsetmatrix, 0, r_stereo_separation.value * -0.5f, 0);
-               Matrix4x4_Concat(&r_view.matrix, &offsetmatrix, &originalmatrix);
+               Matrix4x4_Concat(&r_view.matrix, &originalmatrix, &offsetmatrix);
 
                if (r_stereo_sidebyside.integer)
                        r_stereo_side = 0;
 
                if (r_stereo_sidebyside.integer)
                        r_stereo_side = 0;
@@ -1766,7 +1766,7 @@ void CL_UpdateScreen(void)
                SCR_DrawScreen();
 
                Matrix4x4_CreateTranslate(&offsetmatrix, 0, r_stereo_separation.value * 0.5f, 0);
                SCR_DrawScreen();
 
                Matrix4x4_CreateTranslate(&offsetmatrix, 0, r_stereo_separation.value * 0.5f, 0);
-               Matrix4x4_Concat(&r_view.matrix, &offsetmatrix, &originalmatrix);
+               Matrix4x4_Concat(&r_view.matrix, &originalmatrix, &offsetmatrix);
 
                if (r_stereo_sidebyside.integer)
                        r_stereo_side = 1;
 
                if (r_stereo_sidebyside.integer)
                        r_stereo_side = 1;
index 4f9f368..0e5a9e2 100644 (file)
@@ -773,7 +773,7 @@ static void CSQC_R_RecalcView (void)
        viewmodelmatrix = identitymatrix;
        r_view.matrix = identitymatrix;
        Matrix4x4_CreateFromQuakeEntity(&r_view.matrix, csqc_origin[0], csqc_origin[1], csqc_origin[2], csqc_angles[0], csqc_angles[1], csqc_angles[2], 1);
        viewmodelmatrix = identitymatrix;
        r_view.matrix = identitymatrix;
        Matrix4x4_CreateFromQuakeEntity(&r_view.matrix, csqc_origin[0], csqc_origin[1], csqc_origin[2], csqc_angles[0], csqc_angles[1], csqc_angles[2], 1);
-       Matrix4x4_CreateFromQuakeEntity(&viewmodelmatrix, csqc_origin[0], csqc_origin[1], csqc_origin[2], csqc_angles[0], csqc_angles[1], csqc_angles[2], 0.3);
+       Matrix4x4_CreateFromQuakeEntity(&viewmodelmatrix, csqc_origin[0], csqc_origin[1], csqc_origin[2], csqc_angles[0], csqc_angles[1], csqc_angles[2], cl_viewmodel_scale.value);
 }
 
 //#300 void() clearscene (EXT_CSQC)
 }
 
 //#300 void() clearscene (EXT_CSQC)
index 6759140..cd43b7d 100644 (file)
@@ -254,6 +254,7 @@ extern int current_skill;
 // chase
 //
 extern cvar_t chase_active;
 // chase
 //
 extern cvar_t chase_active;
+extern cvar_t cl_viewmodel_scale;
 
 void Chase_Init (void);
 void Chase_Reset (void);
 
 void Chase_Init (void);
 void Chase_Reset (void);
index 524eb60..f8bc0d8 100644 (file)
@@ -2384,7 +2384,7 @@ void SV_GetEntityMatrix (prvm_edict_t *ent, matrix4x4_t *out, qboolean viewmatri
        if (viewmatrix)
                Matrix4x4_CreateFromQuakeEntity(out, ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2] + ent->fields.server->view_ofs[2], ent->fields.server->v_angle[0], ent->fields.server->v_angle[1], ent->fields.server->v_angle[2], scale);
        else
        if (viewmatrix)
                Matrix4x4_CreateFromQuakeEntity(out, ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2] + ent->fields.server->view_ofs[2], ent->fields.server->v_angle[0], ent->fields.server->v_angle[1], ent->fields.server->v_angle[2], scale);
        else
-               Matrix4x4_CreateFromQuakeEntity(out, ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2], -ent->fields.server->angles[0], ent->fields.server->angles[1], ent->fields.server->angles[2], scale * 0.333);
+               Matrix4x4_CreateFromQuakeEntity(out, ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2], -ent->fields.server->angles[0], ent->fields.server->angles[1], ent->fields.server->angles[2], scale * cl_viewmodel_scale.value);
 }
 
 int SV_GetEntityLocalTagMatrix(prvm_edict_t *ent, int tagindex, matrix4x4_t *out)
 }
 
 int SV_GetEntityLocalTagMatrix(prvm_edict_t *ent, int tagindex, matrix4x4_t *out)