convert Warning() and DEBUG() to GFX2_Log()
This commit is contained in:
parent
90bcffa9e2
commit
4978a7cfe2
124
src/Makefile.dep
124
src/Makefile.dep
@ -1,46 +1,49 @@
|
|||||||
$(OBJDIR)/SFont.o: SFont.c SFont.h gfx2surface.h struct.h const.h
|
$(OBJDIR)/SFont.o: SFont.c SFont.h gfx2surface.h struct.h const.h
|
||||||
$(OBJDIR)/brush.o: brush.c global.h struct.h const.h graph.h misc.h errors.h \
|
$(OBJDIR)/brush.o: brush.c global.h struct.h const.h graph.h misc.h errors.h \
|
||||||
windows.h screen.h brush.h tiles.h
|
gfx2log.h windows.h screen.h brush.h tiles.h
|
||||||
$(OBJDIR)/brush_ops.o: brush_ops.c brush.h struct.h const.h buttons.h loadsave.h \
|
$(OBJDIR)/brush_ops.o: brush_ops.c brush.h struct.h const.h buttons.h loadsave.h \
|
||||||
gfx2surface.h engine.h global.h graph.h misc.h operatio.h pages.h \
|
gfx2surface.h engine.h global.h graph.h misc.h operatio.h pages.h \
|
||||||
screen.h windows.h keyboard.h
|
screen.h windows.h keyboard.h
|
||||||
$(OBJDIR)/buttons.o: buttons.c const.h struct.h global.h misc.h graph.h engine.h \
|
$(OBJDIR)/buttons.o: buttons.c const.h struct.h global.h misc.h graph.h engine.h \
|
||||||
readline.h filesel.h loadsave.h gfx2surface.h init.h buttons.h \
|
readline.h filesel.h loadsave.h gfx2surface.h init.h buttons.h \
|
||||||
operatio.h pages.h palette.h errors.h readini.h saveini.h shade.h io.h \
|
operatio.h pages.h palette.h errors.h gfx2log.h readini.h saveini.h \
|
||||||
help.h text.h screen.h windows.h brush.h input.h keycodes.h special.h \
|
shade.h io.h help.h text.h screen.h windows.h brush.h input.h keycodes.h \
|
||||||
tiles.h setup.h unicode.h
|
special.h tiles.h setup.h unicode.h
|
||||||
$(OBJDIR)/buttons_effects.o: buttons_effects.c brush.h struct.h const.h buttons.h \
|
$(OBJDIR)/buttons_effects.o: buttons_effects.c brush.h struct.h const.h buttons.h \
|
||||||
loadsave.h gfx2surface.h engine.h global.h graph.h help.h input.h \
|
loadsave.h gfx2surface.h engine.h global.h graph.h help.h input.h \
|
||||||
keycodes.h misc.h pages.h readline.h screen.h windows.h tiles.h
|
keycodes.h misc.h pages.h readline.h screen.h windows.h tiles.h
|
||||||
$(OBJDIR)/colorred.o: colorred.c colorred.h struct.h const.h
|
$(OBJDIR)/colorred.o: colorred.c colorred.h struct.h const.h
|
||||||
$(OBJDIR)/engine.o: engine.c const.h struct.h global.h graph.h misc.h special.h \
|
$(OBJDIR)/engine.o: engine.c const.h struct.h global.h graph.h misc.h special.h \
|
||||||
buttons.h loadsave.h gfx2surface.h operatio.h shade.h errors.h screen.h \
|
buttons.h loadsave.h gfx2surface.h operatio.h shade.h errors.h gfx2log.h \
|
||||||
windows.h brush.h input.h keycodes.h engine.h pages.h layers.h factory.h \
|
screen.h windows.h brush.h input.h keycodes.h engine.h pages.h layers.h \
|
||||||
io.h pxsimple.h oldies.h
|
factory.h io.h pxsimple.h oldies.h
|
||||||
$(OBJDIR)/factory.o: factory.c brush.h struct.h const.h buttons.h loadsave.h \
|
$(OBJDIR)/factory.o: factory.c brush.h struct.h const.h buttons.h loadsave.h \
|
||||||
gfx2surface.h engine.h errors.h filesel.h global.h graph.h io.h misc.h \
|
gfx2surface.h engine.h errors.h gfx2log.h filesel.h global.h graph.h \
|
||||||
pages.h readline.h screen.h windows.h palette.h input.h keycodes.h \
|
io.h misc.h pages.h readline.h screen.h windows.h palette.h input.h \
|
||||||
help.h realpath.h setup.h tiles.h
|
keycodes.h help.h realpath.h setup.h tiles.h
|
||||||
$(OBJDIR)/fileformats.o: fileformats.c errors.h global.h struct.h const.h \
|
$(OBJDIR)/fileformats.o: fileformats.c gfx2log.h errors.h global.h struct.h const.h \
|
||||||
loadsave.h gfx2surface.h misc.h io.h pages.h windows.h fileformats.h
|
loadsave.h gfx2surface.h misc.h io.h pages.h windows.h fileformats.h
|
||||||
$(OBJDIR)/filesel.o: filesel.c const.h struct.h global.h misc.h errors.h io.h \
|
$(OBJDIR)/filesel.o: filesel.c const.h struct.h global.h misc.h errors.h gfx2log.h \
|
||||||
windows.h screen.h loadsave.h gfx2surface.h mountlist.h engine.h \
|
io.h windows.h screen.h loadsave.h gfx2surface.h mountlist.h engine.h \
|
||||||
readline.h input.h keycodes.h help.h unicode.h filesel.h
|
readline.h input.h keycodes.h help.h unicode.h filesel.h
|
||||||
$(OBJDIR)/gfx2surface.o: gfx2surface.c gfx2surface.h struct.h const.h errors.h
|
$(OBJDIR)/gfx2log.o: gfx2log.c gfx2log.h
|
||||||
|
$(OBJDIR)/gfx2surface.o: gfx2surface.c gfx2surface.h struct.h const.h errors.h \
|
||||||
|
gfx2log.h
|
||||||
$(OBJDIR)/graph.o: graph.c global.h struct.h const.h engine.h buttons.h loadsave.h \
|
$(OBJDIR)/graph.o: graph.c global.h struct.h const.h engine.h buttons.h loadsave.h \
|
||||||
gfx2surface.h pages.h errors.h screen.h graph.h misc.h pxsimple.h \
|
gfx2surface.h pages.h errors.h gfx2log.h screen.h graph.h misc.h \
|
||||||
pxtall.h pxwide.h pxdouble.h pxtriple.h pxwide2.h pxtall2.h pxtall3.h \
|
pxsimple.h pxtall.h pxwide.h pxdouble.h pxtriple.h pxwide2.h pxtall2.h \
|
||||||
pxquad.h windows.h input.h keycodes.h brush.h tiles.h
|
pxtall3.h pxquad.h windows.h input.h keycodes.h brush.h tiles.h
|
||||||
$(OBJDIR)/help.o: help.c const.h struct.h global.h misc.h engine.h helpfile.h \
|
$(OBJDIR)/help.o: help.c const.h struct.h global.h misc.h engine.h helpfile.h \
|
||||||
help.h screen.h text.h keyboard.h windows.h input.h keycodes.h hotkeys.h \
|
help.h screen.h text.h keyboard.h windows.h input.h keycodes.h hotkeys.h \
|
||||||
errors.h pages.h factory.h
|
errors.h gfx2log.h pages.h factory.h
|
||||||
$(OBJDIR)/hotkeys.o: hotkeys.c struct.h const.h global.h hotkeys.h keycodes.h
|
$(OBJDIR)/hotkeys.o: hotkeys.c struct.h const.h global.h hotkeys.h keycodes.h
|
||||||
$(OBJDIR)/init.o: init.c buttons.h struct.h const.h loadsave.h gfx2surface.h \
|
$(OBJDIR)/init.o: init.c buttons.h struct.h const.h loadsave.h gfx2surface.h \
|
||||||
errors.h global.h graph.h init.h io.h factory.h help.h hotkeys.h \
|
errors.h gfx2log.h global.h graph.h init.h io.h factory.h help.h \
|
||||||
keyboard.h misc.h mountlist.h operatio.h palette.h screen.h setup.h \
|
hotkeys.h keyboard.h misc.h mountlist.h operatio.h palette.h screen.h \
|
||||||
transform.h windows.h layers.h special.h
|
setup.h transform.h windows.h layers.h special.h
|
||||||
$(OBJDIR)/input.o: input.c global.h struct.h const.h keyboard.h screen.h windows.h \
|
$(OBJDIR)/input.o: input.c gfx2log.h global.h struct.h const.h keyboard.h screen.h \
|
||||||
errors.h misc.h buttons.h loadsave.h gfx2surface.h input.h keycodes.h
|
windows.h errors.h misc.h buttons.h loadsave.h gfx2surface.h input.h \
|
||||||
|
keycodes.h
|
||||||
$(OBJDIR)/io.o: io.c struct.h const.h io.h realpath.h unicode.h global.h
|
$(OBJDIR)/io.o: io.c struct.h const.h io.h realpath.h unicode.h global.h
|
||||||
$(OBJDIR)/keyboard.o: keyboard.c global.h struct.h const.h keyboard.h keycodes.h
|
$(OBJDIR)/keyboard.o: keyboard.c global.h struct.h const.h keyboard.h keycodes.h
|
||||||
$(OBJDIR)/layers.o: layers.c const.h struct.h global.h windows.h engine.h pages.h \
|
$(OBJDIR)/layers.o: layers.c const.h struct.h global.h windows.h engine.h pages.h \
|
||||||
@ -48,34 +51,36 @@ $(OBJDIR)/layers.o: layers.c const.h struct.h global.h windows.h engine.h pages.
|
|||||||
$(OBJDIR)/libraw2crtc.o: libraw2crtc.c const.h global.h struct.h loadsave.h \
|
$(OBJDIR)/libraw2crtc.o: libraw2crtc.c const.h global.h struct.h loadsave.h \
|
||||||
gfx2surface.h
|
gfx2surface.h
|
||||||
$(OBJDIR)/loadrecoil.o: loadrecoil.c struct.h const.h global.h loadsave.h \
|
$(OBJDIR)/loadrecoil.o: loadrecoil.c struct.h const.h global.h loadsave.h \
|
||||||
gfx2surface.h io.h errors.h recoil.h
|
gfx2surface.h io.h errors.h gfx2log.h recoil.h
|
||||||
$(OBJDIR)/loadsave.o: loadsave.c buttons.h struct.h const.h loadsave.h \
|
$(OBJDIR)/loadsave.o: loadsave.c gfx2log.h buttons.h struct.h const.h loadsave.h \
|
||||||
gfx2surface.h errors.h global.h io.h misc.h graph.h op_c.h colorred.h \
|
gfx2surface.h errors.h global.h keycodes.h io.h misc.h graph.h op_c.h \
|
||||||
pages.h palette.h screen.h windows.h engine.h brush.h setup.h filesel.h \
|
colorred.h pages.h palette.h screen.h windows.h engine.h brush.h setup.h \
|
||||||
unicode.h fileformats.h
|
filesel.h unicode.h fileformats.h
|
||||||
$(OBJDIR)/main.o: main.c const.h struct.h global.h graph.h misc.h init.h buttons.h \
|
$(OBJDIR)/main.o: main.c gfx2log.h const.h struct.h global.h graph.h misc.h init.h \
|
||||||
loadsave.h gfx2surface.h engine.h pages.h screen.h errors.h readini.h \
|
buttons.h loadsave.h gfx2surface.h engine.h pages.h screen.h errors.h \
|
||||||
saveini.h io.h text.h setup.h windows.h brush.h palette.h realpath.h \
|
readini.h saveini.h io.h text.h setup.h windows.h brush.h palette.h \
|
||||||
input.h keycodes.h help.h filesel.h
|
realpath.h input.h keycodes.h help.h filesel.h
|
||||||
$(OBJDIR)/misc.o: misc.c struct.h const.h global.h errors.h buttons.h loadsave.h \
|
$(OBJDIR)/misc.o: misc.c struct.h const.h global.h errors.h gfx2log.h buttons.h \
|
||||||
gfx2surface.h engine.h misc.h keyboard.h screen.h windows.h palette.h \
|
loadsave.h gfx2surface.h engine.h misc.h keyboard.h screen.h windows.h \
|
||||||
input.h keycodes.h graph.h pages.h
|
palette.h input.h keycodes.h graph.h pages.h
|
||||||
$(OBJDIR)/miscfileformats.o: miscfileformats.c engine.h struct.h const.h errors.h \
|
$(OBJDIR)/miscfileformats.o: miscfileformats.c engine.h struct.h const.h errors.h \
|
||||||
global.h io.h libraw2crtc.h loadsave.h gfx2surface.h misc.h screen.h \
|
gfx2log.h global.h io.h libraw2crtc.h loadsave.h gfx2surface.h misc.h \
|
||||||
windows.h oldies.h pages.h keycodes.h fileformats.h
|
screen.h windows.h oldies.h pages.h keycodes.h fileformats.h
|
||||||
$(OBJDIR)/mountlist.o: mountlist.c mountlist.h
|
$(OBJDIR)/mountlist.o: mountlist.c mountlist.h
|
||||||
$(OBJDIR)/oldies.o: oldies.c struct.h const.h global.h errors.h misc.h palette.h \
|
$(OBJDIR)/oldies.o: oldies.c struct.h const.h global.h errors.h gfx2log.h misc.h \
|
||||||
pages.h windows.h layers.h
|
palette.h pages.h windows.h layers.h
|
||||||
$(OBJDIR)/op_c.o: op_c.c op_c.h struct.h const.h colorred.h errors.h global.h \
|
$(OBJDIR)/op_c.o: op_c.c op_c.h struct.h const.h colorred.h errors.h gfx2log.h \
|
||||||
engine.h windows.h
|
global.h engine.h windows.h
|
||||||
$(OBJDIR)/operatio.o: operatio.c const.h struct.h global.h misc.h engine.h graph.h \
|
$(OBJDIR)/operatio.o: operatio.c const.h struct.h global.h misc.h engine.h graph.h \
|
||||||
operatio.h buttons.h loadsave.h gfx2surface.h pages.h errors.h screen.h \
|
operatio.h buttons.h loadsave.h gfx2surface.h pages.h errors.h gfx2log.h \
|
||||||
brush.h windows.h input.h keycodes.h special.h tiles.h keyboard.h
|
screen.h brush.h windows.h input.h keycodes.h special.h tiles.h \
|
||||||
$(OBJDIR)/pages.o: pages.c global.h struct.h const.h pages.h errors.h loadsave.h \
|
keyboard.h
|
||||||
gfx2surface.h misc.h windows.h tiles.h graph.h
|
$(OBJDIR)/pages.o: pages.c global.h struct.h const.h pages.h errors.h gfx2log.h \
|
||||||
|
loadsave.h gfx2surface.h misc.h windows.h tiles.h graph.h
|
||||||
$(OBJDIR)/palette.o: palette.c const.h struct.h global.h misc.h engine.h readline.h \
|
$(OBJDIR)/palette.o: palette.c const.h struct.h global.h misc.h engine.h readline.h \
|
||||||
buttons.h loadsave.h gfx2surface.h pages.h help.h screen.h errors.h \
|
buttons.h loadsave.h gfx2surface.h pages.h help.h screen.h errors.h \
|
||||||
op_c.h colorred.h windows.h input.h keycodes.h palette.h shade.h
|
gfx2log.h op_c.h colorred.h windows.h input.h keycodes.h palette.h \
|
||||||
|
shade.h
|
||||||
$(OBJDIR)/pversion.o: pversion.c
|
$(OBJDIR)/pversion.o: pversion.c
|
||||||
$(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h screen.h misc.h graph.h \
|
$(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h screen.h misc.h graph.h \
|
||||||
pxdouble.h pxwide.h
|
pxdouble.h pxwide.h
|
||||||
@ -95,23 +100,25 @@ $(OBJDIR)/pxwide.o: pxwide.c global.h struct.h const.h screen.h misc.h graph.h \
|
|||||||
pxwide.h
|
pxwide.h
|
||||||
$(OBJDIR)/pxwide2.o: pxwide2.c global.h struct.h const.h screen.h misc.h graph.h \
|
$(OBJDIR)/pxwide2.o: pxwide2.c global.h struct.h const.h screen.h misc.h graph.h \
|
||||||
pxwide2.h
|
pxwide2.h
|
||||||
$(OBJDIR)/readini.o: readini.c const.h errors.h global.h struct.h misc.h readini.h \
|
$(OBJDIR)/readini.o: readini.c const.h errors.h gfx2log.h global.h struct.h misc.h \
|
||||||
setup.h realpath.h io.h windows.h
|
readini.h setup.h realpath.h io.h windows.h
|
||||||
$(OBJDIR)/readline.o: readline.c const.h struct.h global.h misc.h errors.h screen.h \
|
$(OBJDIR)/readline.o: readline.c const.h struct.h global.h misc.h errors.h \
|
||||||
readline.h windows.h input.h keycodes.h engine.h unicode.h
|
gfx2log.h screen.h readline.h windows.h input.h keycodes.h engine.h \
|
||||||
|
unicode.h
|
||||||
$(OBJDIR)/realpath.o: realpath.c
|
$(OBJDIR)/realpath.o: realpath.c
|
||||||
$(OBJDIR)/recoil.o: recoil.c recoil.h
|
$(OBJDIR)/recoil.o: recoil.c recoil.h
|
||||||
$(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h readini.h io.h errors.h \
|
$(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h readini.h io.h errors.h \
|
||||||
misc.h saveini.h setup.h windows.h
|
gfx2log.h misc.h saveini.h setup.h windows.h
|
||||||
$(OBJDIR)/sdlscreen.o: sdlscreen.c global.h struct.h const.h sdlscreen.h errors.h \
|
$(OBJDIR)/sdlscreen.o: sdlscreen.c global.h struct.h const.h sdlscreen.h errors.h \
|
||||||
misc.h
|
gfx2log.h misc.h
|
||||||
$(OBJDIR)/setup.o: setup.c struct.h const.h io.h setup.h
|
$(OBJDIR)/setup.o: setup.c struct.h const.h io.h setup.h
|
||||||
$(OBJDIR)/shade.o: shade.c global.h struct.h const.h graph.h engine.h errors.h \
|
$(OBJDIR)/shade.o: shade.c global.h struct.h const.h graph.h engine.h errors.h \
|
||||||
misc.h readline.h help.h screen.h windows.h input.h keycodes.h shade.h
|
gfx2log.h misc.h readline.h help.h screen.h windows.h input.h keycodes.h \
|
||||||
|
shade.h
|
||||||
$(OBJDIR)/special.o: special.c const.h struct.h global.h graph.h engine.h windows.h \
|
$(OBJDIR)/special.o: special.c const.h struct.h global.h graph.h engine.h windows.h \
|
||||||
special.h pages.h misc.h buttons.h loadsave.h gfx2surface.h
|
special.h pages.h misc.h buttons.h loadsave.h gfx2surface.h
|
||||||
$(OBJDIR)/text.o: text.c struct.h const.h global.h io.h errors.h windows.h misc.h \
|
$(OBJDIR)/text.o: text.c struct.h const.h global.h io.h errors.h gfx2log.h \
|
||||||
setup.h loadsave.h gfx2surface.h SFont.h
|
windows.h misc.h setup.h loadsave.h gfx2surface.h SFont.h
|
||||||
$(OBJDIR)/tiles.o: tiles.c struct.h const.h global.h graph.h screen.h engine.h \
|
$(OBJDIR)/tiles.o: tiles.c struct.h const.h global.h graph.h screen.h engine.h \
|
||||||
windows.h input.h keycodes.h misc.h tiles.h
|
windows.h input.h keycodes.h misc.h tiles.h
|
||||||
$(OBJDIR)/transform.o: transform.c global.h struct.h const.h transform.h engine.h \
|
$(OBJDIR)/transform.o: transform.c global.h struct.h const.h transform.h engine.h \
|
||||||
@ -120,6 +127,7 @@ $(OBJDIR)/transform.o: transform.c global.h struct.h const.h transform.h engine.
|
|||||||
$(OBJDIR)/unicode.o: unicode.c unicode.h struct.h const.h
|
$(OBJDIR)/unicode.o: unicode.c unicode.h struct.h const.h
|
||||||
$(OBJDIR)/version.o: version.c
|
$(OBJDIR)/version.o: version.c
|
||||||
$(OBJDIR)/windows.o: windows.c windows.h struct.h const.h engine.h errors.h \
|
$(OBJDIR)/windows.o: windows.c windows.h struct.h const.h engine.h errors.h \
|
||||||
global.h graph.h input.h keycodes.h misc.h op_c.h colorred.h readline.h \
|
gfx2log.h global.h graph.h input.h keycodes.h misc.h op_c.h colorred.h \
|
||||||
screen.h palette.h unicode.h keyboard.h
|
readline.h screen.h palette.h unicode.h keyboard.h
|
||||||
$(OBJDIR)/x11screen.o: x11screen.c screen.h struct.h const.h global.h gfx2surface.h
|
$(OBJDIR)/x11screen.o: x11screen.c screen.h struct.h const.h global.h gfx2surface.h \
|
||||||
|
loadsave.h gfx2log.h
|
||||||
|
|||||||
12
src/engine.c
12
src/engine.c
@ -71,9 +71,17 @@ static byte* Window_background[8];
|
|||||||
static 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;
|
int index;
|
||||||
if(*buffer != NULL) DEBUG("WARNING : buffer already allocated !!!",0);
|
if(*buffer != NULL)
|
||||||
|
{
|
||||||
|
GFX2_Log(GFX2_WARNING, "%s() WARNING : buffer already allocated !!!\n", __func__);
|
||||||
|
free(*buffer);
|
||||||
|
}
|
||||||
*buffer=(byte *) malloc(width*Menu_factor_X*height*Menu_factor_Y*Pixel_width);
|
*buffer=(byte *) malloc(width*Menu_factor_X*height*Menu_factor_Y*Pixel_width);
|
||||||
if(*buffer==NULL) Error(0);
|
if(*buffer==NULL)
|
||||||
|
{
|
||||||
|
Error(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (index=0; index<(height*Menu_factor_Y); index++)
|
for (index=0; index<(height*Menu_factor_Y); index++)
|
||||||
Read_line(x_pos,y_pos+index,width*Menu_factor_X,(*buffer)+((int)index*width*Menu_factor_X*Pixel_width));
|
Read_line(x_pos,y_pos+index,width*Menu_factor_X,(*buffer)+((int)index*width*Menu_factor_X*Pixel_width));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,8 @@
|
|||||||
/// Functions and macros for tracing and error reporting.
|
/// Functions and macros for tracing and error reporting.
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "gfx2log.h"
|
||||||
|
|
||||||
#ifdef __VBCC__
|
#ifdef __VBCC__
|
||||||
#define __func__ "stupid compiler !"
|
#define __func__ "stupid compiler !"
|
||||||
#endif
|
#endif
|
||||||
@ -31,10 +33,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Prints the source filename, line number, function name, a string and an integer.
|
/// Prints the source filename, line number, function name, a string and an integer.
|
||||||
#define DEBUG(y,z) printf("%s %d %s | %s : %d###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
|
#define DEBUG(y,z) GFX2_Log(GFX2_DEBUG, "%s %d %s | %s : %d###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
|
||||||
|
|
||||||
/// Same as ::DEBUG but in hexadecimal
|
/// Same as ::DEBUG but in hexadecimal
|
||||||
#define DEBUGX(y,z) printf("%s %d %s | %s : %X###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
|
#define DEBUGX(y,z) GFX2_Log(GFX2_DEBUG, "%s %d %s | %s : %X###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
|
||||||
|
|
||||||
/// Helper function used by the macro ::Error
|
/// Helper function used by the macro ::Error
|
||||||
void Error_function(int error_code, const char *filename, int line_number, const char *function_name);
|
void Error_function(int error_code, const char *filename, int line_number, const char *function_name);
|
||||||
|
|||||||
@ -5318,7 +5318,7 @@ void Load_PCX(T_IO_Context * context)
|
|||||||
|| ! Read_byte(file,&(context->Palette[index].B)) )
|
|| ! Read_byte(file,&(context->Palette[index].B)) )
|
||||||
{
|
{
|
||||||
File_error=2;
|
File_error=2;
|
||||||
DEBUG("ERROR READING PCX PALETTE !",index);
|
GFX2_Log(GFX2_ERROR, "ERROR READING PCX PALETTE ! index=%d\n", index);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,12 +34,23 @@ extern void GFX2_Log(GFX2_Log_priority_T priority, const char * fmt, ...)
|
|||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
GFX2_LogV(priority, fmt, ap);
|
GFX2_LogV(priority, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
#if defined(_MSC_VER) && defined(DEBUG)
|
||||||
|
{
|
||||||
|
char message[1024];
|
||||||
|
va_start(ap, fmt);
|
||||||
|
vsnprintf(message, sizeof(message), fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
OutputDebugStringA(message);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void GFX2_LogV(GFX2_Log_priority_T priority, const char * fmt, va_list ap)
|
extern void GFX2_LogV(GFX2_Log_priority_T priority, const char * fmt, va_list ap)
|
||||||
{
|
{
|
||||||
|
#if !defined(DEBUG)
|
||||||
if ((unsigned)GFX2_verbosity_level < (unsigned)priority)
|
if ((unsigned)GFX2_verbosity_level < (unsigned)priority)
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
#if defined(USE_SDL2)
|
#if defined(USE_SDL2)
|
||||||
{
|
{
|
||||||
int sdl_priority;
|
int sdl_priority;
|
||||||
@ -62,6 +73,7 @@ extern void GFX2_LogV(GFX2_Log_priority_T priority, const char * fmt, va_list ap
|
|||||||
}
|
}
|
||||||
SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, sdl_priority, fmt, ap);
|
SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, sdl_priority, fmt, ap);
|
||||||
}
|
}
|
||||||
#endif
|
#else
|
||||||
vfprintf((unsigned)priority >= GFX2_INFO ? stdout : stderr, fmt, ap);
|
vfprintf((unsigned)priority >= GFX2_INFO ? stdout : stderr, fmt, ap);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1930,7 +1930,7 @@ static void Set_video_mode(short width,
|
|||||||
|
|
||||||
if (Nb_video_modes >= MAX_VIDEO_MODES-1)
|
if (Nb_video_modes >= MAX_VIDEO_MODES-1)
|
||||||
{
|
{
|
||||||
DEBUG("Error! Attempt to create too many videomodes. Maximum is:", MAX_VIDEO_MODES);
|
GFX2_Log(GFX2_ERROR, "Attempt to create too many videomodes. Maximum is: %d\n", MAX_VIDEO_MODES);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!fullscreen)
|
if (!fullscreen)
|
||||||
|
|||||||
@ -1093,11 +1093,13 @@ int Get_input(int sleep_time)
|
|||||||
// Drop of zero files. Thanks for the information, Bill.
|
// Drop of zero files. Thanks for the information, Bill.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
GFX2_Log(GFX2_DEBUG, "Unhandled SDL_SYSWMEVENT\n");
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
//DEBUG("Unhandled SDL event number : ",event.type);
|
GFX2_Log(GFX2_DEBUG, "Unhandled SDL event number : %d\n",event.type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
18
src/main.c
18
src/main.c
@ -164,11 +164,7 @@ void Display_syntax(void)
|
|||||||
// ---------------------------- Sortie impromptue ----------------------------
|
// ---------------------------- Sortie impromptue ----------------------------
|
||||||
void Warning_function(const char *message, const char *filename, int line_number, const char *function_name)
|
void Warning_function(const char *message, const char *filename, int line_number, const char *function_name)
|
||||||
{
|
{
|
||||||
printf("Warning in file %s, line %d, function %s : %s\n", filename, line_number, function_name, message);
|
GFX2_Log(GFX2_WARNING, "Warning in file %s, line %d, function %s : %s\n", filename, line_number, function_name, message);
|
||||||
#if defined(_MSC_VER) && defined(DEBUG)
|
|
||||||
OutputDebugStringA(message);
|
|
||||||
OutputDebugStringA("\n");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -678,6 +674,9 @@ int Init_program(int argc,char * argv[])
|
|||||||
Spare.time_of_safety_backup = 0;
|
Spare.time_of_safety_backup = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// analyse commande line as soon as possible
|
||||||
|
file_in_command_line=Analyze_command_line(argc, argv, main_filename, main_directory, spare_filename, spare_directory);
|
||||||
|
|
||||||
#if defined(USE_SDL) || defined(USE_SDL2)
|
#if defined(USE_SDL) || defined(USE_SDL2)
|
||||||
// SDL
|
// SDL
|
||||||
if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0)
|
if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0)
|
||||||
@ -687,6 +686,9 @@ int Init_program(int argc,char * argv[])
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(USE_SDL2)
|
||||||
|
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_VERBOSE);
|
||||||
|
#endif
|
||||||
Joystick = SDL_JoystickOpen(0);
|
Joystick = SDL_JoystickOpen(0);
|
||||||
#endif
|
#endif
|
||||||
#if defined(USE_SDL)
|
#if defined(USE_SDL)
|
||||||
@ -803,10 +805,10 @@ int Init_program(int argc,char * argv[])
|
|||||||
// Pas un problème, on a les valeurs par défaut.
|
// Pas un problème, on a les valeurs par défaut.
|
||||||
break;
|
break;
|
||||||
case ERROR_CFG_CORRUPTED:
|
case ERROR_CFG_CORRUPTED:
|
||||||
DEBUG("Corrupted CFG file.",0);
|
GFX2_Log(GFX2_ERROR, "Corrupted CFG file.\n");
|
||||||
break;
|
break;
|
||||||
case ERROR_CFG_OLD:
|
case ERROR_CFG_OLD:
|
||||||
DEBUG("Unknown CFG file version, not loaded.",0);
|
GFX2_Log(GFX2_WARNING, "Unknown CFG file version, not loaded.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Charger la configuration du .INI
|
// Charger la configuration du .INI
|
||||||
@ -821,8 +823,6 @@ int Init_program(int argc,char * argv[])
|
|||||||
|
|
||||||
Compute_menu_offsets();
|
Compute_menu_offsets();
|
||||||
|
|
||||||
file_in_command_line=Analyze_command_line(argc, argv, main_filename, main_directory, spare_filename, spare_directory);
|
|
||||||
|
|
||||||
Current_help_section=0;
|
Current_help_section=0;
|
||||||
Help_position=0;
|
Help_position=0;
|
||||||
|
|
||||||
|
|||||||
@ -338,7 +338,7 @@ int Save_INI_set_values(FILE * old_file,FILE * new_file,char * buffer,char * opt
|
|||||||
free(result_buffer);
|
free(result_buffer);
|
||||||
free(upper_buffer);
|
free(upper_buffer);
|
||||||
free(option_upper);
|
free(option_upper);
|
||||||
DEBUG("END OF FILE",0);
|
GFX2_Log(GFX2_WARNING, "%s(): END OF FILE\n", __func__);
|
||||||
return ERROR_INI_CORRUPTED;
|
return ERROR_INI_CORRUPTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -132,7 +132,7 @@ void GFX2_Set_mode(int *width, int *height, int fullscreen)
|
|||||||
// Check the mode we got, in case it was different from the one we requested.
|
// Check the mode we got, in case it was different from the one we requested.
|
||||||
if (Screen_SDL->w != *width || Screen_SDL->h != *height)
|
if (Screen_SDL->w != *width || Screen_SDL->h != *height)
|
||||||
{
|
{
|
||||||
DEBUG("Error: Got a different video mode than the requested one!",0);
|
GFX2_Log(GFX2_WARNING, "Got a different video mode than the requested one! %dx%d => %dx%d\n", *width, *height, Screen_SDL->w, Screen_SDL->h);
|
||||||
*width = Screen_SDL->w;
|
*width = Screen_SDL->w;
|
||||||
*height = Screen_SDL->h;
|
*height = Screen_SDL->h;
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ void GFX2_Set_mode(int *width, int *height, int fullscreen)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DEBUG("Error: Unable to change video mode!",0);
|
GFX2_Log(GFX2_ERROR, "Unable to change video mode!\n");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// SDL2
|
// SDL2
|
||||||
|
|||||||
@ -712,7 +712,7 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh
|
|||||||
font=SFont_InitFont(font_surface);
|
font=SFont_InitFont(font_surface);
|
||||||
if (!font)
|
if (!font)
|
||||||
{
|
{
|
||||||
DEBUG("Font init failed",1);
|
GFX2_Log(GFX2_ERROR, "Font init failed : %s\n", Font_name(font_number));
|
||||||
Free_GFX2_Surface(font_surface);
|
Free_GFX2_Surface(font_surface);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user