[Src]->Fps Limit

Codes submitted by developers and people of outpost. Come here to get codes for your client sources.
Post Reply
Aryes
Member
Posts: 114
Joined: Tue Aug 31, 2004 10:14 pm
Location: Brazil

Post by Aryes »

A friend have asked me to make a fps limit for him, maybe it is useful for somebody else.

It's pretty simple, inside void CGame::UpdateScreen(), replace:

Code: Select all

case DEF_GAMEMODE_ONMAINGAME:
  UpdateScreen_OnGame();
  break;
With:

Code: Select all

case DEF_GAMEMODE_ONMAINGAME:
  //fps limit around 83
  if((G_dwGlobalTime - m_dwCurTime) > 12) UpdateScreen_OnGame();
  break;
All you have to do, is divide 1000 (1sec) by the limit of fps you want (in that case, around 83) and change the "12" with that number.

Make a test with a "900".
====<span style='color:red'><br>Aryes</span><br>====<br><br>HB United: www.hbuonline.net:<br><br><img src="http://hbtop50.com/button.php?u=hbkhispano" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=dcom" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=tinchocba" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=rafha_bernn" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=HB-Tere" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=Kiruku" alt="Helbreath Top 50 - Helbreath Silver" border="0" />
Warlord
Regular
Posts: 34
Joined: Sun Dec 05, 2004 11:08 am

Post by Warlord »

Silly question, but is it client.h or client.cpp ??? :lol:
BlueChristmas
Loyal fan
Posts: 216
Joined: Wed Apr 19, 2006 12:19 am

Post by BlueChristmas »

Warlord wrote: Silly question, but is it client.h or client.cpp ??? :lol:
i think you need to take a few hours and read a c++ book for once.
<img src='http://img114.imageshack.us/img114/8618 ... 2dy3lx.jpg' border='0' alt='user posted image' />
Warlord
Regular
Posts: 34
Joined: Sun Dec 05, 2004 11:08 am

Post by Warlord »

BlueChristmas wrote:
Warlord wrote: Silly question, but is it client.h or client.cpp ??? :lol:
i think you need to take a few hours and read a c++ book for once.
I don't need to read it. Damn I just woke up and now I see..It was a fucking stupid question <_< Very indeed..

And you keep your mouth shut. C and c++ are both quite different, but they have some similarities.
mkay..

Thanks for the FPS, it worked perfectly :lol:
snoopy81
Loyal fan
Posts: 338
Joined: Mon Jul 12, 2004 7:13 pm

Post by snoopy81 »

FPS seem really a strange thing in HB client...
Any clue about increasing it ?
(may be usefull for a 600x800 client !)
_\_ _<br> / , \__/ . \ Admin of Equilibrium Project<br> II\ \___ . O<br> III \_/ \ _ / <a href='http://www.equiprojet.com' target='_blank'>http://www.equiprojet.com</a><br> II I¯I
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

i have posted an idea. replacing UpdateScreen with an pointer value than contain updatescreen_XXX. I done that but mouse doesnt work and some times client crash..
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
Warlord
Regular
Posts: 34
Joined: Sun Dec 05, 2004 11:08 am

Post by Warlord »

snoopy81 wrote: (may be usefull for a 600x800 client !)
I think you thought 800*600 client? :lol:
Post Reply