r5038 - trunk/data/qcsrc/client
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Nov 12 02:10:03 EST 2008
Author: div0
Date: 2008-11-12 02:10:03 -0500 (Wed, 12 Nov 2008)
New Revision: 5038
Modified:
trunk/data/qcsrc/client/Defs.qc
trunk/data/qcsrc/client/Main.qc
trunk/data/qcsrc/client/View.qc
Log:
detect screen size using new DP feature
Modified: trunk/data/qcsrc/client/Defs.qc
===================================================================
--- trunk/data/qcsrc/client/Defs.qc 2008-11-10 19:22:58 UTC (rev 5037)
+++ trunk/data/qcsrc/client/Defs.qc 2008-11-12 07:10:03 UTC (rev 5038)
@@ -59,7 +59,7 @@
void() CSQC_Init;
void() CSQC_Shutdown;
float(float f, float t, float n) CSQC_InputEvent;
-void() CSQC_UpdateView;
+void(float w, float h) CSQC_UpdateView;
float(string s) CSQC_ConsoleCommand;
//these fields are read and set by the default player physics
Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc 2008-11-10 19:22:58 UTC (rev 5037)
+++ trunk/data/qcsrc/client/Main.qc 2008-11-12 07:10:03 UTC (rev 5038)
@@ -580,9 +580,23 @@
precache_pic("gfx/sb_key_carrying_outline");
}
}
+
+void Net_FileInfo(float challenge, string fn)
+{
+ if(fn == "<")
+ FileInfo_Init();
+ else if(fn == ">")
+ localcmd(strcat("\ncmd fileinfo ", ftos(FileInfo_Value), "\n"));
+ else
+ FileInfo_Add(challenge, fn);
+}
+
// CSQC_Parse_StuffCmd : Provides the stuffcmd string in the first parameter that the server provided. To execute standard behavior, simply execute localcmd with the string.
void CSQC_Parse_StuffCmd(string strMessage)
{
+ tokenizebyseparator(strMessage, " ");
+ if(argv(0) == "\n//fileinfo")
+ Net_FileInfo(stof(argv(1)), argv(2));
localcmd(strMessage);
}
// CSQC_Parse_Print : Provides the print string in the first parameter that the server provided. To execute standard behavior, simply execute print with the string.
Modified: trunk/data/qcsrc/client/View.qc
===================================================================
--- trunk/data/qcsrc/client/View.qc 2008-11-10 19:22:58 UTC (rev 5037)
+++ trunk/data/qcsrc/client/View.qc 2008-11-12 07:10:03 UTC (rev 5038)
@@ -189,11 +189,13 @@
void PostInit(void);
float Sbar_WouldDrawScoreboard ();
float zoomscript_caught;
-void CSQC_UpdateView(void)
+void CSQC_UpdateView(float w, float h)
{
entity e;
float fov;
float f;
+ vector v1, v2;
+
dprint_load();
WaypointSprite_Load();
@@ -205,23 +207,24 @@
view_right = v_right;
view_up = v_up;
-#if 0
- if(cs_project_is_b0rked)
+ f = floor(cvar("v_flipped"));
+ cvar_set("v_flipped", ftos(!f));
+ v1 = cs_unproject('-100 -100 1000');
+ cvar_set("v_flipped", ftos(f));
+ v2 = cs_unproject('-100 -100 1000');
+
+ if(v1 == v2)
{
-#endif
+ // non-supporting engine
vid_width = cvar("vid_width");
vid_height = cvar("vid_height");
-#if 0
}
else
{
- // THIS IS BROKEN if you had just shot (kicktime)
- vector v;
- v = cs_project(view_origin + 1024 * view_forward);
- vid_width = floor(v_x * 2 + 0.5);
- vid_height = floor(v_y * 2 + 0.5);
+ // supporting engine
+ vid_width = w;
+ vid_height = h;
}
-#endif
Fog_Force();
More information about the nexuiz-commits
mailing list