Re: [hlcoders] Third Person Camera Tutorial

2005-07-13 Thread SB Childe Roland
I definately believe that a good compiler would and should not even
translate it, but it's still bad programming practice.

On 7/9/05, Tony Paloma [EMAIL PROTECTED] wrote:
 Actually, just as a little side note, it seems as long as there is no
 function in the expression, no machine code gets added to the program when
 an if's statement has no code. So

 if ( gpGlobals-maxClients  1 )
 {
 //return;
 }

 ..adds no real code and no cycles get added. I checked this using MSVC++ 6
 and I'm assuming it works the same for .NET.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of SB Childe
 Roland
 Sent: Friday, July 08, 2005 3:27 PM
 To: hlcoders@list.valvesoftware.com
 Subject: Re: [hlcoders] Third Person Camera Tutorial

 Why wouldn't you comment out the entire if statement??  Do you like
 wasting processor cycles?

 On 7/3/05, Kamran [EMAIL PROTECTED] wrote:
  [ Converted text/html to text/plain ]
  That's because of this function:
  /*
  ==
  CAM_ToThirdPerson
  ==
  */
  void CInput::CAM_ToThirdPerson(void)
  {
  QAngle viewangles;
  // Do allow third person in TF2 for now
  #if !defined( TF2_CLIENT_DLL )  !defined( CSTRIKE_DLL )
  #if !defined( _DEBUG )
  if ( gpGlobals-maxClients  1 )
  {
  // no thirdperson in multiplayer.
  return;
  }
  #endif
  #endif
  engine-GetViewAngles( viewangles );
  if( !m_fCameraInThirdPerson )
  {
  m_fCameraInThirdPerson = true;
 
  m_vecCameraOffset[ YAW ] = viewangles[ YAW ];
  m_vecCameraOffset[ PITCH ] = viewangles[ PITCH ];
  m_vecCameraOffset[ 2 ] = CAM_SWITCH_DIST;
  // Set model to player because when a map first loads
  // it doesn't set the model... sort of a hack.
  C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
  pPlayer-SetModel(player);
  }
  cam_command.SetValue( 0 );
  }
  Just comment out the return; under No third person in multiplayer.
  Draco wrote:
 
  Thank you, I was looking into getting a thirdperson camera working,
  but I couldn't go thridperson in multiplayer and using release dlls, I
  could never find why.
 
 
  --
  Draco
 
  ___
  To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders[1]
 
 
 
 
 
  --
  Kamran A
  Get Firefox! Safer, Faster, Better.[2]
  Down with Internet Explorer! Say NO! to Spyware! Use Firefox
 
  ===References:===
1. http://list.valvesoftware.com/mailman/listinfo/hlcoders
2. http://www.spreadfirefox.com/?q=affiliatesid=0t=85
 
  ___
  To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders
 
 


 --
 =
 SB Childe Roland
 I will show you fear in a handful of jellybeans.

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders


 ___
 To unsubscribe, edit your list preferences, or view the list archives, please 
 visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders




--
=
SB Childe Roland
I will show you fear in a handful of jellybeans.

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Third Person Camera Tutorial

2005-07-09 Thread Zach Brockway
The compiler is most assuredly clever enough to optimize away the
clause entirely considering there's no code to be executed therein.

On 7/8/05, SB Childe Roland [EMAIL PROTECTED] wrote:
 Why wouldn't you comment out the entire if statement??  Do you like
 wasting processor cycles?

 --
 =
 SB Childe Roland
 I will show you fear in a handful of jellybeans.

 ___
 To unsubscribe, edit your list preferences, or view the list archives, please 
 visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders




--
I am at the point where coffee just makes my teeth vibrate. - Tycho,
Penny-Arcade.com

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Third Person Camera Tutorial

2005-07-09 Thread Tony Paloma
Actually, just as a little side note, it seems as long as there is no
function in the expression, no machine code gets added to the program when
an if's statement has no code. So

if ( gpGlobals-maxClients  1 )
{
//return;
}

..adds no real code and no cycles get added. I checked this using MSVC++ 6
and I'm assuming it works the same for .NET.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of SB Childe
Roland
Sent: Friday, July 08, 2005 3:27 PM
To: hlcoders@list.valvesoftware.com
Subject: Re: [hlcoders] Third Person Camera Tutorial

Why wouldn't you comment out the entire if statement??  Do you like
wasting processor cycles?

On 7/3/05, Kamran [EMAIL PROTECTED] wrote:
 [ Converted text/html to text/plain ]
 That's because of this function:
 /*
 ==
 CAM_ToThirdPerson
 ==
 */
 void CInput::CAM_ToThirdPerson(void)
 {
 QAngle viewangles;
 // Do allow third person in TF2 for now
 #if !defined( TF2_CLIENT_DLL )  !defined( CSTRIKE_DLL )
 #if !defined( _DEBUG )
 if ( gpGlobals-maxClients  1 )
 {
 // no thirdperson in multiplayer.
 return;
 }
 #endif
 #endif
 engine-GetViewAngles( viewangles );
 if( !m_fCameraInThirdPerson )
 {
 m_fCameraInThirdPerson = true;

 m_vecCameraOffset[ YAW ] = viewangles[ YAW ];
 m_vecCameraOffset[ PITCH ] = viewangles[ PITCH ];
 m_vecCameraOffset[ 2 ] = CAM_SWITCH_DIST;
 // Set model to player because when a map first loads
 // it doesn't set the model... sort of a hack.
 C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
 pPlayer-SetModel(player);
 }
 cam_command.SetValue( 0 );
 }
 Just comment out the return; under No third person in multiplayer.
 Draco wrote:

 Thank you, I was looking into getting a thirdperson camera working,
 but I couldn't go thridperson in multiplayer and using release dlls, I
 could never find why.


 --
 Draco

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders[1]





 --
 Kamran A
 Get Firefox! Safer, Faster, Better.[2]
 Down with Internet Explorer! Say NO! to Spyware! Use Firefox

 ===References:===
   1. http://list.valvesoftware.com/mailman/listinfo/hlcoders
   2. http://www.spreadfirefox.com/?q=affiliatesamp;id=0amp;t=85

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders




--
=
SB Childe Roland
I will show you fear in a handful of jellybeans.

___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Third Person Camera Tutorial

2005-07-09 Thread Zach Brockway
Like I said. :P

Thanks for confirming it.

On 7/9/05, Tony Paloma [EMAIL PROTECTED] wrote:
 Actually, just as a little side note, it seems as long as there is no
 function in the expression, no machine code gets added to the program when
 an if's statement has no code. So

 if ( gpGlobals-maxClients  1 )
 {
 //return;
 }

 ..adds no real code and no cycles get added. I checked this using MSVC++ 6
 and I'm assuming it works the same for .NET.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of SB Childe
 Roland
 Sent: Friday, July 08, 2005 3:27 PM
 To: hlcoders@list.valvesoftware.com
 Subject: Re: [hlcoders] Third Person Camera Tutorial

 Why wouldn't you comment out the entire if statement??  Do you like
 wasting processor cycles?

 On 7/3/05, Kamran [EMAIL PROTECTED] wrote:
  [ Converted text/html to text/plain ]
  That's because of this function:
  /*
  ==
  CAM_ToThirdPerson
  ==
  */
  void CInput::CAM_ToThirdPerson(void)
  {
  QAngle viewangles;
  // Do allow third person in TF2 for now
  #if !defined( TF2_CLIENT_DLL )  !defined( CSTRIKE_DLL )
  #if !defined( _DEBUG )
  if ( gpGlobals-maxClients  1 )
  {
  // no thirdperson in multiplayer.
  return;
  }
  #endif
  #endif
  engine-GetViewAngles( viewangles );
  if( !m_fCameraInThirdPerson )
  {
  m_fCameraInThirdPerson = true;
 
  m_vecCameraOffset[ YAW ] = viewangles[ YAW ];
  m_vecCameraOffset[ PITCH ] = viewangles[ PITCH ];
  m_vecCameraOffset[ 2 ] = CAM_SWITCH_DIST;
  // Set model to player because when a map first loads
  // it doesn't set the model... sort of a hack.
  C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
  pPlayer-SetModel(player);
  }
  cam_command.SetValue( 0 );
  }
  Just comment out the return; under No third person in multiplayer.
  Draco wrote:
 
  Thank you, I was looking into getting a thirdperson camera working,
  but I couldn't go thridperson in multiplayer and using release dlls, I
  could never find why.
 
 
  --
  Draco
 
  ___
  To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders[1]
 
 
 
 
 
  --
  Kamran A
  Get Firefox! Safer, Faster, Better.[2]
  Down with Internet Explorer! Say NO! to Spyware! Use Firefox
 
  ===References:===
1. http://list.valvesoftware.com/mailman/listinfo/hlcoders
2. http://www.spreadfirefox.com/?q=affiliatesid=0t=85
 
  ___
  To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders
 
 


 --
 =
 SB Childe Roland
 I will show you fear in a handful of jellybeans.

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders


 ___
 To unsubscribe, edit your list preferences, or view the list archives, please 
 visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders




--
I am at the point where coffee just makes my teeth vibrate. - Tycho,
Penny-Arcade.com

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Third Person Camera Tutorial

2005-07-08 Thread SB Childe Roland
Why wouldn't you comment out the entire if statement??  Do you like
wasting processor cycles?

On 7/3/05, Kamran [EMAIL PROTECTED] wrote:
 [ Converted text/html to text/plain ]
 That's because of this function:
 /*
 ==
 CAM_ToThirdPerson
 ==
 */
 void CInput::CAM_ToThirdPerson(void)
 {
 QAngle viewangles;
 // Do allow third person in TF2 for now
 #if !defined( TF2_CLIENT_DLL )  !defined( CSTRIKE_DLL )
 #if !defined( _DEBUG )
 if ( gpGlobals-maxClients  1 )
 {
 // no thirdperson in multiplayer.
 return;
 }
 #endif
 #endif
 engine-GetViewAngles( viewangles );
 if( !m_fCameraInThirdPerson )
 {
 m_fCameraInThirdPerson = true;

 m_vecCameraOffset[ YAW ] = viewangles[ YAW ];
 m_vecCameraOffset[ PITCH ] = viewangles[ PITCH ];
 m_vecCameraOffset[ 2 ] = CAM_SWITCH_DIST;
 // Set model to player because when a map first loads
 // it doesn't set the model... sort of a hack.
 C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
 pPlayer-SetModel(player);
 }
 cam_command.SetValue( 0 );
 }
 Just comment out the return; under No third person in multiplayer.
 Draco wrote:

 Thank you, I was looking into getting a thirdperson camera working,
 but I couldn't go thridperson in multiplayer and using release dlls, I
 could never find why.


 --
 Draco

 ___
 To unsubscribe, edit your list preferences, or view the list archives, please 
 visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders[1]





 --
 Kamran A
 Get Firefox! Safer, Faster, Better.[2]
 Down with Internet Explorer! Say NO! to Spyware! Use Firefox

 ===References:===
   1. http://list.valvesoftware.com/mailman/listinfo/hlcoders
   2. http://www.spreadfirefox.com/?q=affiliatesamp;id=0amp;t=85

 ___
 To unsubscribe, edit your list preferences, or view the list archives, please 
 visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders




--
=
SB Childe Roland
I will show you fear in a handful of jellybeans.

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Third Person Camera Tutorial

2005-07-03 Thread Draco
Thank you, I was looking into getting a thirdperson camera working,
but I couldn't go thridperson in multiplayer and using release dlls, I
could never find why.


--
Draco

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Third Person Camera Tutorial

2005-07-03 Thread Kamran
[ Converted text/html to text/plain ]
That's because of this function:
/*
==
CAM_ToThirdPerson
==
*/
void CInput::CAM_ToThirdPerson(void)
{
QAngle viewangles;
// Do allow third person in TF2 for now
#if !defined( TF2_CLIENT_DLL )  !defined( CSTRIKE_DLL )
#if !defined( _DEBUG )
if ( gpGlobals-maxClients  1 )
{
// no thirdperson in multiplayer.
return;
}
#endif
#endif
engine-GetViewAngles( viewangles );
if( !m_fCameraInThirdPerson )
{
m_fCameraInThirdPerson = true;

m_vecCameraOffset[ YAW ] = viewangles[ YAW ];
m_vecCameraOffset[ PITCH ] = viewangles[ PITCH ];
m_vecCameraOffset[ 2 ] = CAM_SWITCH_DIST;
// Set model to player because when a map first loads
// it doesn't set the model... sort of a hack.
C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
pPlayer-SetModel(player);
}
cam_command.SetValue( 0 );
}
Just comment out the return; under No third person in multiplayer.
Draco wrote:

Thank you, I was looking into getting a thirdperson camera working,
but I couldn't go thridperson in multiplayer and using release dlls, I
could never find why.


--
Draco

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders[1]





--
Kamran A
Get Firefox! Safer, Faster, Better.[2]
Down with Internet Explorer! Say NO! to Spyware! Use Firefox

===References:===
  1. http://list.valvesoftware.com/mailman/listinfo/hlcoders
  2. http://www.spreadfirefox.com/?q=affiliatesamp;id=0amp;t=85

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Third Person Camera Tutorial

2005-07-03 Thread Andrew (British_Bomber)
lol, it's amazing just how much of a headache one little return can cause

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Third Person Camera Tutorial

2005-07-03 Thread Draco
I commented those out ages ago, It doesn't help


--
Draco

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Third Person Camera Tutorial

2005-07-03 Thread Draco
its also amazing how following this tute still didn't help, I assume
that this is for the bare bones codebase?


--
Draco

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders