Lowering the comm ambient animation rate from max of 120fps to highest known stable rate of 40

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1886 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2005-10-05 20:22:25 +00:00
parent 0fbee6a61b
commit d764520616
2 changed files with 18 additions and 4 deletions
+14 -2
View File
@@ -42,6 +42,18 @@
#include <ctype.h>
// Maximum ambient animation frame rate (actual execution rate)
// A gfx frame is not always produced during an execution frame,
// and several animations are combined into one gfx frame.
// The rate was originally 120fps which allowed for more animation
// precision which is ultimately wasted on the human eye anyway.
// The highest known stable animation rate is 40fps, so that's what we use.
#define AMBIENT_ANIM_RATE 40
// Oscilloscope frame rate
// Should be <= AMBIENT_ANIM_RATE
// XXX: was 32 picked experimentally?
#define OSCILLOSCOPE_RATE 32
static void init_xform_control (void);
static void uninit_xform_control (void);
@@ -885,7 +897,7 @@ ambient_anim_task (void *data)
BOOLEAN Change, CanTalk;
DWORD CurTime, ElapsedTicks;
SleepThreadUntil (LastTime + ONE_SECOND / 120);
SleepThreadUntil (LastTime + ONE_SECOND / AMBIENT_ANIM_RATE);
LockMutex (GraphicsLock);
BatchGraphics ();
@@ -1267,7 +1279,7 @@ ambient_anim_task (void *data)
SetContext (OldContext);
}
if (LastOscillTime + (ONE_SECOND / 32) < CurTime)
if (LastOscillTime + (ONE_SECOND / OSCILLOSCOPE_RATE) < CurTime)
{
LastOscillTime = CurTime;
UpdateSpeechGraphics (FALSE);
+4 -2
View File
@@ -23,8 +23,10 @@
/* ONE_SECOND is the LCM of all the fractions of a second the game uses.
* Battle is 24 FPS, Landers are 35 FPS, most UI-level things are 15 FPS,
* The Interplanetary flight is 30 FPS. Thus, the minimum value for
* ONE_SECOND is 840. */
* The Interplanetary flight is 30 FPS, Comm ambient animation is 40 FPS,
* (also Comm Oscilloscope is 32 FPS, but it does not require a stable
* timer and currently runs within the Comm ambient anim paradigm anyway)
* Thus, the minimum value for ONE_SECOND is 840. */
#if TIMELIB == SDL
# define ONE_SECOND 840
#endif