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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user