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:
@@ -1,6 +1,8 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "ScreenDimensions.h"
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
ThemeMetric<float> SCREEN_WIDTH("Common","ScreenWidth");
|
||||||
|
ThemeMetric<float> SCREEN_HEIGHT("Common","ScreenHeight");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2002 Chris Danford
|
* (c) 2001-2002 Chris Danford
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
#define SCREEN_DIMENSIONS_H
|
#define SCREEN_DIMENSIONS_H
|
||||||
|
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "ThemeMetric.h"
|
||||||
|
|
||||||
#define SCREEN_WIDTH THEME->GetMetricF("Common","ScreenWidth")
|
extern ThemeMetric<float> SCREEN_WIDTH;
|
||||||
#define SCREEN_HEIGHT THEME->GetMetricF("Common","ScreenHeight")
|
extern ThemeMetric<float> SCREEN_HEIGHT;
|
||||||
|
|
||||||
#define SCREEN_LEFT (0)
|
#define SCREEN_LEFT (0)
|
||||||
#define SCREEN_RIGHT (SCREEN_WIDTH)
|
#define SCREEN_RIGHT (SCREEN_WIDTH)
|
||||||
|
|||||||
Reference in New Issue
Block a user