.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Half-Life 1 SDK
Half-Life 1 SDK For developments focused around Half-Life (and its mods) Half-Life

Reply
 
Thread Tools
quake 2 screen effect
Old
  (#1)
hl_backdoor
Member
 
Status: Offline
Posts: 2
Join Date: Jul 2010
Default quake 2 screen effect - 27-07-2010

Hello, I want to know something.. if you ever played quake 1 or 2, you can remember some functions that resize the screen. I think you had to press + or - to size up or down the screen. well in CS 1.6 I cannot do that at the moment, I did a search in google and found that some commands are disabled for the game now. I tried the commands sizeup and sizedown but they have no effect. anybody knows a way to get this functionality, programatically or by a working cvar or command? thank you

  
Reply With Quote
Re: quake 2 screen effect
Old
  (#2)
Ancient
PodBot MM's Laziest Waypointer
 
Ancient's Avatar
 
Status: Offline
Posts: 1,010
Join Date: Jan 2005
Location: Nebraska, United States of America
Default Re: quake 2 screen effect - 27-07-2010

I remember Doom I and II had that effect.
But I think counter-strike disabled that so you would have to choose which resolution to pick rather than using sizeup or sizedown.


[Web Designer][Waypointer][Gamer]
CFE Games Administrator
[CFE]Games.com
[Never Trust the Untrusted]
  
Reply With Quote
Re: quake 2 screen effect
Old
  (#3)
hl_backdoor
Member
 
Status: Offline
Posts: 2
Join Date: Jul 2010
Default Re: quake 2 screen effect - 27-07-2010

I did a quick search and found that the screen resizement is handled by some internal variables (cvars) ... I was looking into the quake2 source code since it is the basesrc for hl1 src code. I am 100% sure that this can be done in CS1.6 apart of those disabled commands (sizeup and down). so I still ask if anyone knows how this can be done.

Code:
vid_dll.c
// Global variables used internally by this module
viddef_t viddef;    // global video state; used by other modules

/*
** VID_NewWindow
*/
void VID_NewWindow ( int width, int height)
{
 viddef.width  = width;
 viddef.height = height;
 cl.force_refdef = true;  // can't use a paused refdef
}
/*
============
VID_Init
============
*/
void VID_Init (void)
{
 /* Create the video variables so we know how to start the graphics drivers */
 vid_ref = Cvar_Get ("vid_ref", "soft", CVAR_ARCHIVE);
 vid_xpos = Cvar_Get ("vid_xpos", "3", CVAR_ARCHIVE);
 vid_ypos = Cvar_Get ("vid_ypos", "22", CVAR_ARCHIVE);
 vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ARCHIVE);
 vid_gamma = Cvar_Get( "vid_gamma", "1", CVAR_ARCHIVE );
 win_noalttab = Cvar_Get( "win_noalttab", "0", CVAR_ARCHIVE );
 /* Add some console commands that we want to handle */
 Cmd_AddCommand ("vid_restart", VID_Restart_f);
 Cmd_AddCommand ("vid_front", VID_Front_f);
 /*
 ** this is a gross hack but necessary to clamp the mode for 3Dfx
 */
#if 0
 {
  cvar_t *gl_driver = Cvar_Get( "gl_driver", "opengl32", 0 );
  cvar_t *gl_mode = Cvar_Get( "gl_mode", "3", 0 );
  if ( stricmp( gl_driver->string, "3dfxgl" ) == 0 )
  {
   Cvar_SetValue( "gl_mode", 3 );
   viddef.width  = 640;
   viddef.height = 480;
  }
 }
#endif
 /* Disable the 3Dfx splash screen */
 putenv("FX_GLIDE_NO_SPLASH=0");
  
 /* Start the graphics mode and load refresh DLL */
 VID_CheckChanges();
}
 
/*////////////////////*/

cl_scrn.c
 

vrect_t  scr_vrect;  // position of render window on screen

cvar_t  *scr_viewsize;
 
/*
=================
SCR_CalcVrect
Sets scr_vrect, the coordinates of the rendered window
=================
*/
static void SCR_CalcVrect (void)
{
 int  size;
 // bound viewsize
 if (scr_viewsize->value < 40)
  Cvar_Set ("viewsize","40");
 if (scr_viewsize->value > 100)
  Cvar_Set ("viewsize","100");
 size = scr_viewsize->value;
 scr_vrect.width = viddef.width*size/100;
 scr_vrect.width &= ~7;
 scr_vrect.height = viddef.height*size/100;
 scr_vrect.height &= ~1;
 scr_vrect.x = (viddef.width - scr_vrect.width)/2;
 scr_vrect.y = (viddef.height - scr_vrect.height)/2;
}

/*
=================
SCR_SizeUp_f
Keybinding command
=================
*/
void SCR_SizeUp_f (void)
{
 Cvar_SetValue ("viewsize",scr_viewsize->value+10);
}

/*
=================
SCR_SizeDown_f
Keybinding command
=================
*/
void SCR_SizeDown_f (void)
{
 Cvar_SetValue ("viewsize",scr_viewsize->value-10);
}
 

/*
==================
SCR_Init
==================
*/
void SCR_Init (void)
{
 
        scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE);

//
// register our commands
//
 Cmd_AddCommand ("timerefresh",SCR_TimeRefresh_f);
 Cmd_AddCommand ("loading",SCR_Loading_f);
 Cmd_AddCommand ("sizeup",SCR_SizeUp_f);
 Cmd_AddCommand ("sizedown",SCR_SizeDown_f);
 scr_initialized = true;
}
 
/*///////////////*/

/*
============
Cvar_Get
If the variable already exists, the value will not be set
The flags will be or'ed in if the variable exists.
============
*/
cvar_t *Cvar_Get (char *var_name, char *var_value, int flags);

/*
============
Cvar_SetValue
============
*/
void Cvar_SetValue (char *var_name, float value)
{
 char val[32];
 if (value == (int)value)
  Com_sprintf (val, sizeof(val), "%i",(int)value);
 else
  Com_sprintf (val, sizeof(val), "%f",value);
 Cvar_Set (var_name, val);
}
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com