// BlinkGame - Hunt for the Lost Pixels
// an SDL game in honor of the BlinkenArea crew
//
// (C) 2005-06 Rene Schickbauer
//
// See License.txt for licensing information
//
#ifdef NOP_CODE
/*--------------------------------------------------------------------
					CVS AUTO-GENERATED INFO
$Author: cavac $
$Date: 2006/03/02 13:03:41 $
$Name: rel-0-3-patches $
$Revision: 1.5 $
$State: Exp $

$Log: debug.cpp,v $
Revision 1.5  2006/03/02 13:03:41  cavac
Re-formatted all .cpp and .h files a bit to get rid of the TAB/SPACE mess
that makes troubles with XCode's "re-format" feature

Revision 1.4  2006/02/10 18:56:17  cavac
Code Audit: Fixed many 64Bit based problems (mostly untested)

Revision 1.3  2006/02/10 17:50:26  cavac
Added ActionCapture feature (define ALLOW_ACTIONCAPTURE to allow this
resource-hungry extra)

Revision 1.2  2006/01/09 00:50:34  cavac
Bugfixed CVS autogenerated entries in background.cpp
Added CVS autogenerated entries to remaining .cpp and .h files
Updated copyright from "2005 Rene Schickbauer" to "2005-06 Rene Schickbauer"


--------------------------------------------------------------------*/
#endif //NOP_CODE

#include "globals.h"
#include "debug.h"
#include "showtext.h"

Uint32 fpsLastTick;
Uint32 fpsFrameCount;
Uint32 fpsLastFrameCount;
char fpsText[20];

void initFPSCounter() {
	fpsLastTick = SDL_GetTicks() + 1000;
	fpsFrameCount = 0;
	fpsLastFrameCount = 0;
	sprintf(fpsText, "FPS:");
}

void displayFPSCounter() {
	Uint32 tick = SDL_GetTicks();
	fpsFrameCount++;
	if(fpsLastTick < tick) {
		fpsLastFrameCount = fpsFrameCount;
		fpsFrameCount = 0;
		fpsLastTick = tick + 1000;
		sprintf(fpsText, "FPS: %d", fpsLastFrameCount);
	}
	drawstring(550,460,fpsText, gScreen);
}
		
