diff options
author | Stefan Hacker <dd0t@users.sourceforge.net> | 2010-04-29 17:28:05 +0400 |
---|---|---|
committer | Stefan Hacker <dd0t@users.sourceforge.net> | 2010-04-29 17:53:43 +0400 |
commit | 6380a88687534f241d8c882148abd2fb3faa0b2f (patch) | |
tree | c9cb7b6677f95f0f1124491b36560236abfd005f /overlay/d3d10.cpp | |
parent | 02811bc2851fba9ad70c2c2b15d3e97c1c160b2b (diff) |
Transmit fps more often and represent them as float
Diffstat (limited to 'overlay/d3d10.cpp')
-rw-r--r-- | overlay/d3d10.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/overlay/d3d10.cpp b/overlay/d3d10.cpp index 0d0ee7ea3..f2f131077 100644 --- a/overlay/d3d10.cpp +++ b/overlay/d3d10.cpp @@ -152,7 +152,7 @@ void D10State::blit(unsigned int x, unsigned int y, unsigned int w, unsigned int UCHAR* pTexels = (UCHAR*)mappedTex.pData; - for (int r=0;r< uiHeight; ++r) { + for (unsigned int r=0;r< uiHeight; ++r) { unsigned char *sptr = a_ucTexture + r * uiWidth * 4; unsigned char *dptr = reinterpret_cast<unsigned char *>(pTexels) + r * mappedTex.RowPitch; memcpy(dptr, sptr, uiWidth * 4); @@ -387,12 +387,12 @@ void D10State::draw() { clock_t t = clock(); float elapsed = static_cast<float>(t - timeT) / CLOCKS_PER_SEC; ++frameCount; - if (elapsed > 1.0) { // Send FPS update every second + if (elapsed > OVERLAY_FPS_INTERVAL) { OverlayMsg om; om.omh.uiMagic = OVERLAY_MAGIC_NUMBER; om.omh.uiType = OVERLAY_MSGTYPE_FPS; om.omh.iLength = sizeof(OverlayMsgFps); - om.omf.fps = static_cast<unsigned int>(frameCount * elapsed); + om.omf.fps = frameCount / elapsed; sendMessage(om); |