Fix warnings in MSVC 2010.

This commit is contained in:
rude
2011-07-24 18:32:11 +02:00
parent 71d4c4a565
commit e1d1ebb2f1
8 changed files with 42 additions and 19 deletions
+5 -9
View File
@@ -78,14 +78,10 @@ namespace opengl
DisplayState Graphics::saveState()
{
DisplayState s;
//create a table in which to store the color data in float format, before converting it
float color[4];
//get the color
glGetFloatv(GL_CURRENT_COLOR, color);
s.color.set( (color[0]*255.0f), (color[1]*255.0f), (color[2]*255.0f), (color[3]*255.0f) );
//get the background color
glGetFloatv(GL_COLOR_CLEAR_VALUE, color);
s.backgroundColor.set( color[0]*255.0f, color[1]*255.0f, color[2]*255.0f, color[3]*255.0f );
s.color = getColor();
s.backgroundColor = getBackgroundColor();
//store modes here
GLint mode;
//get blend mode
@@ -276,7 +272,7 @@ namespace opengl
currentMode.colorDepth = 32;
currentMode.fsaa = fsaa;
currentMode.fullscreen = fullscreen;
currentMode.vsync = real_vsync;
currentMode.vsync = (real_vsync != 0);
// Reload all volatile objects.
if(!Volatile::loadAll())
@@ -114,7 +114,7 @@ namespace opengl
pLast->tangentialAcceleration = (rand() / (float(RAND_MAX)+1)) * (max - min) + min;
pLast->sizeOffset = (rand() / (float(RAND_MAX)+1)) * sizeVariation; // time offset for size change
pLast->sizeIntervalSize = (1.0 - (rand() / (float(RAND_MAX)+1)) * sizeVariation) - pLast->sizeOffset;
pLast->sizeIntervalSize = (1.0f - (rand() / (float(RAND_MAX)+1)) * sizeVariation) - pLast->sizeOffset;
pLast->size = sizes[(size_t)(pLast->sizeOffset - .5f) * (sizes.size() - 1)];
min = rotationMin;
@@ -926,12 +926,12 @@ namespace opengl
for (int i = 0; i < args; ++i) {
lua_pushnumber(L, i + 1);
lua_rawget(L, 1);
coords[i] = lua_tonumber(L, -1);
coords[i] = luax_tofloat(L, -1);
lua_pop(L, 1);
}
} else {
for (int i = 0; i < args; ++i)
coords[i] = lua_tonumber(L, i + 1);
coords[i] = luax_tofloat(L, i + 1);
}
instance->polyline(coords, args);
@@ -1050,12 +1050,12 @@ namespace opengl
for (int i = 0; i < args; ++i) {
lua_pushnumber(L, i + 1);
lua_rawget(L, 2);
coords[i] = lua_tonumber(L, -1);
coords[i] = luax_tofloat(L, -1);
lua_pop(L, 1);
}
} else {
for (int i = 0; i < args; ++i)
coords[i] = lua_tonumber(L, i + 2);
coords[i] = luax_tofloat(L, i + 2);
}
// make a closed loop
@@ -148,11 +148,11 @@ namespace opengl
ParticleSystem * t = luax_checkparticlesystem(L, 1);
size_t nSizes = lua_gettop(L) - 1;
if (nSizes == 1) {
t->setSize(luaL_checknumber(L, 2));
t->setSize(luax_checkfloat(L, 2));
} else {
std::vector<float> sizes(nSizes);
for (size_t i = 0; i < nSizes; ++i)
sizes[i] = luaL_checknumber(L, 1 + i + 1);
sizes[i] = luax_checkfloat(L, 1 + i + 1);
t->setSize(sizes);
}