From 9fafd0173f4ade16fe228f3df6163dc94910cbb4 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 23 Jan 2018 09:53:30 +0100 Subject: [PATCH] minor Restore_background() improvement --- src/engine.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/engine.c b/src/engine.c index 2a034800..c488cb12 100644 --- a/src/engine.c +++ b/src/engine.c @@ -65,10 +65,10 @@ byte Tiling_mode_before_cancel; Func_effect Effect_function_before_cancel; ///This table holds pointers to the saved window backgrounds. We can have up to 8 windows open at a time. -byte* Window_background[8]; +static byte* Window_background[8]; ///Save a screen block (usually before erasing it with a new window or a dropdown menu) -void Save_background(byte **buffer, int x_pos, int y_pos, int width, int height) +static void Save_background(byte **buffer, int x_pos, int y_pos, int width, int height) { int index; if(*buffer != NULL) DEBUG("WARNING : buffer already allocated !!!",0); @@ -79,13 +79,14 @@ void Save_background(byte **buffer, int x_pos, int y_pos, int width, int height) } ///Restores a screen block -void Restore_background(byte *buffer, int x_pos, int y_pos, int width, int height) +static void Restore_background(byte **buffer, int x_pos, int y_pos, int width, int height) { int index; + if(*buffer==NULL) return; for (index=0; index