etlegacy/etlegacy — pull request #85 by zturtleman (2014-08-01 14:24:25+00:00)
Title: renderers: fix MDS/MDM LOD using frontend data in backend code

MDS/MDM level of detail (LOD) backend code uses frontend data (tr.viewParms). This commit fixes makes it use the correct backend data (backEnd.viewParms). This issue is probably why the save/restore viewparms cgame system calls were added, which hide the issue.

ProjectRadius was renamed to RB_ProjectRadius in the MDS/MDM code to make it more obviously different from MD3/MDC/etc ProjectRadius which is used by frontend.

## How to test

To witness the MDS/MDM level of detail issue, disable the syscalls in cl_cgame.c;

```c
case CG_R_SAVEVIEWPARMS:
-	re.SaveViewParms();
+	//re.SaveViewParms();
return 0;
case CG_R_RESTOREVIEWPARMS:
-	re.RestoreViewParms();
+	//re.RestoreViewParms();
return 0;
```

then run `devmap oasis`, select class in limbo menu, `cg_thirdPerson 1`, `r_bonesDebug 4`. Some places the LOD percent will start rapidly dropping (and is also visible on the player body), such as around `setviewpos 5882 7158 -343 0`.

After applying the changes in the commit, the LOD does not drop unexpectedly.

## Related note

ET added trap_R_SaveViewParms and trap_R_RestoreViewParms, which according to the comments exists "so we don't kill the LOD system" when drawing head on the HUD.

Now that the LOD issue is fixed, ETL could probably remove the client and renderer code for RE_SaveViewParms/RE_RestoreViewParms. Though I haven't tested it enough to know if there are side effects.