Newbie Spellweaver
- Joined
- Apr 22, 2009
- Messages
- 62
- Reaction score
- 54
This simple addon will display a real time FPS counter in the top right corner of the screen during gameplay
This is just a quick draft. I'll make it togglable from the options or with a chat command in the near future. Feel free to modify this as you like and maybe give me some credits if you learn anything from it.
Note: my fps are locked to 60 in this screenshot probabilly because I'm in window mode
Installing (detailed version for newbyes):
Installing (short version):
EDIT: fixed a mistake in the code (copypaste messed up LOL) recopypaste the .cpp file
EDIT2: Fixed a weird-butt bug that caused the counter to randomly not display. Please re-copypaste the .cpp file
This is just a quick draft. I'll make it togglable from the options or with a chat command in the near future. Feel free to modify this as you like and maybe give me some credits if you learn anything from it.
Note: my fps are locked to 60 in this screenshot probabilly because I'm in window mode
Installing (detailed version for newbyes):
- Open your Gunz.sln in visual studio
- If you don't have a folder named Addons, Right click Gunz -> Add -> New filter and name it Addons
- Right click the Addons folder -> Add -> New filter and name it FPS Overlay
- Right click the FPS Overlay folder -> Add -> New item... -> Header File and name it FPSOverlay.h
- Paste this code in the file you just created and save it:
You must be registered to see links
- Right click the FPS Overlay folder -> Add -> New item... -> C++ File and name it FPSOverlay.cpp
- Paste this code in the file you just created and save it:
You must be registered to see links
- Open Game -> ZGame.cpp
- Find
Code:#ifdef LOCALE_NHNUSA #include "ZNHN_USA_Report.h" #endif
And add this below it:
Code:#include "FPSOverlay.h" // [addon] real-time fps counter overlay
- Find
Code:void ZGame::Draw() {
and scroll down to the bottom of the function, which should look something like this
Code:__BP(505, "ZGame::Draw::RenderStencilLight"); if(Z_VIDEO_DYNAMICLIGHT) ZGetStencilLight()->Render(); __EP(505); __EP(37); __BP(38,"ZGame::Draw::DrawGameMessage"); m_Match.OnDrawGameMessage(); // m_HelpScreen.DrawHelpScreen(); __EP(38); __EP(20); *more commented out code* }
- Add the following code before that final closed curly bracket
Code:// [addon] real-time fps counter overlay ZAddons::Francesco::FPSOverlay::Get()->Draw();
- Right click Gunz -> Project only -> Rebuild Only Gunz and you're ready to go! Just copy Gunz.exe from your Gunz/Runtime folder to your client
Installing (short version):
- Add an "Addons" folder/filter to your Gunz solution (if you don't have one already)
- Add an "FPS Overlay" folder/filter inside the Addons folder/filter
- Add these two files under FPS Overlay:
FPSOverlay.h:You must be registered to see links
FPSOverlay.cpp:You must be registered to see links - Include FPSOverlay.h in ZGame.cpp
- Add
Code:ZAddons::Francesco::FPSOverlay::Get()->Draw();
- Rebuild Gunz (or rebuild all if you want)
EDIT: fixed a mistake in the code (copypaste messed up LOL) recopypaste the .cpp file
EDIT2: Fixed a weird-butt bug that caused the counter to randomly not display. Please re-copypaste the .cpp file
Attachments
You must be registered for see attachments list