From 5cf0eb9465ee347abd259fd53fcf09d751c391f1 Mon Sep 17 00:00:00 2001
From: stevenaaus
Date: Sat, 12 Sep 2015 03:29:41 +0000
Subject: [PATCH] r_pos cvar: Dynamic position info, aka r_speeds + viewpos.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1252 af15c1b1-3010-417e-b628-4374ebc0bcbd
---
quakespasm/Linux/sgml/Quakespasm.sgml | 1 +
quakespasm/Quake/gl_rmain.c | 11 ++++++++++-
quakespasm/Quake/gl_rmisc.c | 1 +
quakespasm/Quake/glquake.h | 1 +
quakespasm/Quakespasm.html | 6 ++++--
quakespasm/Quakespasm.txt | 2 ++
6 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/quakespasm/Linux/sgml/Quakespasm.sgml b/quakespasm/Linux/sgml/Quakespasm.sgml
index 51bec77f..1f2b9908 100644
--- a/quakespasm/Linux/sgml/Quakespasm.sgml
+++ b/quakespasm/Linux/sgml/Quakespasm.sgml
@@ -142,6 +142,7 @@ The "game" command doesn't execute quake.rc in the new game directory being swit
- Experimental windowed fullscreen mode available with vid_desktopfullscreen 1 (only in SDL2 builds, takes effect upon entering fullscreen mode the next time.)
- Silence "exceeded standard limit" messages unless developer cvar is >= 1.
- Some spam moved from developer 1 to 2: "can't find tga/lit/ent", "trying to load ent", "bad chunk length", "meshing", "PR_AlocStringSlots: realloc'ing"
+
- r_pos command shows player position, aka r_speeds + viewpos.
Code cleanup
diff --git a/quakespasm/Quake/gl_rmain.c b/quakespasm/Quake/gl_rmain.c
index 5869030f..fad620b4 100644
--- a/quakespasm/Quake/gl_rmain.c
+++ b/quakespasm/Quake/gl_rmain.c
@@ -62,6 +62,7 @@ cvar_t r_norefresh = {"r_norefresh","0",CVAR_NONE};
cvar_t r_drawentities = {"r_drawentities","1",CVAR_NONE};
cvar_t r_drawviewmodel = {"r_drawviewmodel","1",CVAR_NONE};
cvar_t r_speeds = {"r_speeds","0",CVAR_NONE};
+cvar_t r_pos = {"r_pos","0",CVAR_NONE};
cvar_t r_fullbright = {"r_fullbright","0",CVAR_NONE};
cvar_t r_lightmap = {"r_lightmap","0",CVAR_NONE};
cvar_t r_shadows = {"r_shadows","0",CVAR_ARCHIVE};
@@ -998,7 +999,15 @@ void R_RenderView (void)
//johnfitz -- modified r_speeds output
time2 = Sys_DoubleTime ();
- if (r_speeds.value == 2)
+ if (r_pos.value)
+ Con_Printf ("x %i y %i z %i (pitch %i yaw %i roll %i)\n",
+ (int)cl_entities[cl.viewentity].origin[0],
+ (int)cl_entities[cl.viewentity].origin[1],
+ (int)cl_entities[cl.viewentity].origin[2],
+ (int)cl.viewangles[PITCH],
+ (int)cl.viewangles[YAW],
+ (int)cl.viewangles[ROLL]);
+ else if (r_speeds.value == 2)
Con_Printf ("%3i ms %4i/%4i wpoly %4i/%4i epoly %3i lmap %4i/%4i sky %1.1f mtex\n",
(int)((time2-time1)*1000),
rs_brushpolys,
diff --git a/quakespasm/Quake/gl_rmisc.c b/quakespasm/Quake/gl_rmisc.c
index 3630bae0..91a78677 100644
--- a/quakespasm/Quake/gl_rmisc.c
+++ b/quakespasm/Quake/gl_rmisc.c
@@ -191,6 +191,7 @@ void R_Init (void)
Cvar_RegisterVariable (&r_novis);
Cvar_SetCallback (&r_novis, R_VisChanged);
Cvar_RegisterVariable (&r_speeds);
+ Cvar_RegisterVariable (&r_pos);
Cvar_RegisterVariable (&gl_finish);
Cvar_RegisterVariable (&gl_clear);
diff --git a/quakespasm/Quake/glquake.h b/quakespasm/Quake/glquake.h
index 6a8480e4..9cb12ccc 100644
--- a/quakespasm/Quake/glquake.h
+++ b/quakespasm/Quake/glquake.h
@@ -127,6 +127,7 @@ extern cvar_t r_drawentities;
extern cvar_t r_drawworld;
extern cvar_t r_drawviewmodel;
extern cvar_t r_speeds;
+extern cvar_t r_pos;
extern cvar_t r_waterwarp;
extern cvar_t r_fullbright;
extern cvar_t r_lightmap;
diff --git a/quakespasm/Quakespasm.html b/quakespasm/Quakespasm.html
index 16067e10..9ebfba50 100644
--- a/quakespasm/Quakespasm.html
+++ b/quakespasm/Quakespasm.html
@@ -1,7 +1,7 @@
-
+
QuakeSpasm
@@ -110,7 +110,8 @@ sound driver, some graphical niceities, and numerous bug-fixes and other improve
There is currently no CD Music volume support and SDL2 doesn't support CD audio. cd_sdl.c needs replacing with cd_linux.c, cd_bsd.c etc..
In windows, alternative CD drives are accessible by "quakespasm -cddev F" (for example)
-Quakespasm allows loading new games (mods) on the fly with "game GAMENAME {-quoth/hipnotic/rogue}"
+Quakespasm allows loading new games (mods) on the fly with "game GAMENAME {-quoth/hipnotic/rogue}"
+
Use "quakespasm -condebug" to save console log to "qconsole.log". SDL2 builds no longer generate stdout.txt/stderr.txt.
@@ -235,6 +236,7 @@ these patched libSDL binaries may help.
Experimental windowed fullscreen mode available with vid_desktopfullscreen 1 (only in SDL2 builds, takes effect upon entering fullscreen mode the next time.)
Silence "exceeded standard limit" messages unless developer cvar is >= 1.
Some spam moved from developer 1 to 2: "can't find tga/lit/ent", "trying to load ent", "bad chunk length", "meshing", "PR_AlocStringSlots: realloc'ing"
+ r_pos command shows player position, aka r_speeds + viewpos.
diff --git a/quakespasm/Quakespasm.txt b/quakespasm/Quakespasm.txt
index 218b6846..0e0eae00 100644
--- a/quakespasm/Quakespasm.txt
+++ b/quakespasm/Quakespasm.txt
@@ -254,6 +254,8 @@
"trying to load ent", "bad chunk length", "meshing",
"PR_AlocStringSlots: realloc'ing"
+ o r_pos command shows player position, aka r_speeds + viewpos.
+
6.1.5. Code cleanup
o Clean up IDE project files to build on fresh systems.