00-10-21 latest release ...a port of ID's glQuake code to the lcc-win32 compiler with bug-fixes and improvements from many Quake source projects. |
| web site host
| player download qbexe-00-10-21.zip -executable -mod directory coder download qbism-00-10-21.zip -source + project -assembly library -executable -mod directory
DND tutorial Draw network data The code in this tutorial will display a realtime bargraph of network packet size toggled on/off by a cvar, DRAWNETDATA. The current packet size is graphed as well as size averaged over 100 packets. This feature could be upgraded to show other kinds of network info as well, such as lag. In gl_screen.c, add the following near the other global declarations at the top of the file: //qbism//jf DND 2000-02-21 variables for packet bargraph int average=0; int avsamples=0; int avtally=0; //qbism//jf DND 2000-02-21 end bargraph variables Then paste the following function underneath the SCR_DrawNet function: //qbism//jf DND 2000-02-21 draw bargraph of packet size comparison void SCR_DrawNetData() { extern cvar_t drawnetdata; if (!drawnetdata.value) return; avtally+=net_message.cursize; avsamples++; if (avsamples>99){ average=avtally/avsamples; avtally=0; avsamples=0; } Draw_String(15, 100, "0B"); Draw_String(58, 100, "512B"); Draw_String(110, 100, "1024B"); Draw_String(140, 80, "packet data size"); Draw_String(140, 90, "prev 100 average"); //guage lines Draw_Fill(71,78,1,24,12); Draw_Fill(122,78,1,24,12); //the bars Draw_Fill(20,80,net_message.cursize/10,6,30); Draw_Fill(20,90,average/10,6,180); } In SCR_updatescreen, add a call to SCR_DrawNetData just above the other two existing calls shown below: SCR_DrawNetData(); //qbism//jf DND 2000-02-21 little data meter SCR_CheckDrawCenterString (); Sbar_Draw (); Now open host.c and add the following at the top of the file near the other cvar declarations: cvar_t drawnetdata = { "drawnetdata","0"}; //qbism//2000-03-01 jf DND drawnetdata go to Host_InitLocal and add the following among the other Cvar_RegisterVariables: Cvar_RegisterVariable (&drawnetdata); //qbism//2000-03-01 jf DND drawnetdata Finally, add this prototype to quakedef.h: void SCR_DrawNetData(); //qbism//2000-03-01 jf DND drawnetdata Enjoy. | index news info screenshots links tutorials porting notes c-s prediction draw net data old news 00-01 to 00-03 00-04 to 00-05 contact email To get email notification of qbism updates, bugs, and fixes, put ADD LIST in the subject. web site qbism.telefragged.com