Some user-contributed patches to cleanup the build and remove warnings.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1322 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2010-02-07 11:44:38 +00:00
parent 571cf70b58
commit 056ce73ee9
6 changed files with 11 additions and 7 deletions

View File

@@ -53,7 +53,7 @@ static byte Palette_has_changed;
static byte Brush_was_altered;
/// Helper function to clamp a double to 0-255 range
inline byte clamp_byte(double value)
static inline byte clamp_byte(double value)
{
if (value<0.0)
return 0;
@@ -233,9 +233,10 @@ int L_GetLayerPixel(lua_State* L)
int L_SetColor(lua_State* L)
{
byte c=lua_tonumber(L,1);
byte r=clamp_byte(lua_tonumber(L,2));
byte g=clamp_byte(lua_tonumber(L,3));
byte b=clamp_byte(lua_tonumber(L,4));
byte r=clamp_byte((double)lua_tonumber(L,2));
byte g=clamp_byte((double)lua_tonumber(L,3));
byte b=clamp_byte((double)lua_tonumber(L,4));
Main_palette[c].R=Round_palette_component(r);
Main_palette[c].G=Round_palette_component(g);