Lua: All usage of double converted to float (#4502)

* Lua: All usage of double converted to float. printf("%f") still uses promotion to double, (floating point va_args are always promoted to double)
Speed improvements:
 * reordering of rotable to put most used tables at the top
 * caching of last found global table
Use real pointer to rotable instead of misusing void* to pass integer value
Lua internal traces now turned on by TRACE_LUA_INTERNALS cmake option

* Replaced floating point division with multiplication (where possible), the hardware FPU is much faster at multiplication vs division.
stb_image: enabled STBI_NO_HDR and STBI_NO_LINEAR (removes code that we don't need)
This commit is contained in:
Damjan Adamic
2017-02-26 12:59:39 +01:00
committed by Bertrand Songis
parent 3b149a22d1
commit a1a58ad8f8
16 changed files with 129 additions and 107 deletions
+4 -2
View File
@@ -176,7 +176,7 @@ bool evalSlopes(int * slopes, int startAngle, int endAngle)
slopes[2] = -100000;
}
else {
float angle1 = float(startAngle) * PI / 180.0f;
float angle1 = float(startAngle) * (PI / 180.0f);
if (startAngle >= 180) {
slopes[1] = -100000;
slopes[2] = cosf(angle1) * 100 / sinf(angle1);
@@ -192,7 +192,7 @@ bool evalSlopes(int * slopes, int startAngle, int endAngle)
slopes[3] = 100000;
}
else {
float angle2 = float(endAngle) * PI / 180;
float angle2 = float(endAngle) * (PI / 180.0f);
if (endAngle >= 180) {
slopes[0] = -100000;
slopes[3] = -cosf(angle2) * 100 / sinf(angle2);
@@ -701,6 +701,8 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename)
#define STBI_ONLY_BMP
#define STBI_ONLY_GIF
#define STBI_NO_STDIO
#define STBI_NO_HDR
#define STBI_NO_LINEAR
// #define TRACE_STB_MALLOC