diff --git a/brush_ops.c b/brush_ops.c index c1227d55..ed546ea0 100644 --- a/brush_ops.c +++ b/brush_ops.c @@ -34,6 +34,7 @@ #include "misc.h" #include "operatio.h" #include "pages.h" +#include "sdlscreen.h" #include "windows.h" diff --git a/factory.c b/factory.c index 95d468ea..213ab606 100644 --- a/factory.c +++ b/factory.c @@ -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); diff --git a/helpfile.h b/helpfile.h index de165ce8..df27a0c0 100644 --- a/helpfile.h +++ b/helpfile.h @@ -422,7 +422,7 @@ static const T_Help_table helptable_credits[] = HELP_TEXT (" Pasi Kallinen the Peach petter ") HELP_TEXT (" richienyhus tape.wyrm TeeEmCee ") HELP_TEXT (" tempest Timo Kurrpa titus^Rab ") - HELP_TEXT (" Tobé 00ai99 ") + HELP_TEXT (" Tobé yakumo9275 00ai99 ") HELP_TEXT ("") HELP_TEXT ("") HELP_TEXT (" ... posted the annoying bug reports.") diff --git a/loadsave.c b/loadsave.c index 79a2097a..1cbbcd25 100644 --- a/loadsave.c +++ b/loadsave.c @@ -1344,7 +1344,7 @@ void Rotate_safety_backups(void) sprintf(deleted_file, "%s%c%6.6d.bkp", Config_directory, Main_safety_backup_prefix, - (Main_safety_number + 1000000l - Rotation_safety_backup) % 1000000l); + (Uint32)(Main_safety_number + 1000000l - Rotation_safety_backup) % (Uint32)1000000l); remove(deleted_file); // no matter if fail // Reset counters @@ -1354,7 +1354,7 @@ void Rotate_safety_backups(void) // Create a new file name and save sprintf(file_name, "%c%6.6d.bkp", Main_safety_backup_prefix, - Main_safety_number); + (Unit32)Main_safety_number); Init_context_layered_image(&context, file_name, Config_directory); context.Format=FORMAT_GIF; Save_image(&context); diff --git a/loadsave.h b/loadsave.h index 27b52bcc..50648ef0 100644 --- a/loadsave.h +++ b/loadsave.h @@ -229,5 +229,6 @@ void Init_preview(short width,short height,long size,int format,enum PIXEL_RATIO void Init_write_buffer(void); void Write_one_byte(FILE *file, byte b); void End_write(FILE *file); +void Rotate_safety_backups(void); #endif diff --git a/pages.c b/pages.c index 6ff1ffb2..0c5ae407 100644 --- a/pages.c +++ b/pages.c @@ -30,6 +30,7 @@ #include "global.h" #include "pages.h" #include "errors.h" +#include "loadsave.h" #include "misc.h" #include "windows.h"