fix performance problems due to SCREEN_WIDTH being evaluated many times per frame, leading to many Lua compilations per frame

This commit is contained in:
Glenn Maynard
2004-11-10 10:23:58 +00:00
parent 28e0500534
commit 6f82e9aad7
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -1,6 +1,8 @@
#include "global.h"
#include "ScreenDimensions.h"
ThemeMetric<float> SCREEN_WIDTH("Common","ScreenWidth");
ThemeMetric<float> SCREEN_HEIGHT("Common","ScreenHeight");
/*
* (c) 2001-2002 Chris Danford
+3 -2
View File
@@ -4,9 +4,10 @@
#define SCREEN_DIMENSIONS_H
#include "ThemeManager.h"
#include "ThemeMetric.h"
#define SCREEN_WIDTH THEME->GetMetricF("Common","ScreenWidth")
#define SCREEN_HEIGHT THEME->GetMetricF("Common","ScreenHeight")
extern ThemeMetric<float> SCREEN_WIDTH;
extern ThemeMetric<float> SCREEN_HEIGHT;
#define SCREEN_LEFT (0)
#define SCREEN_RIGHT (SCREEN_WIDTH)