diff --git a/2dlib/CMakeLists.txt b/2dlib/CMakeLists.txt index ab9827e2..38b84c8a 100644 --- a/2dlib/CMakeLists.txt +++ b/2dlib/CMakeLists.txt @@ -17,6 +17,7 @@ target_link_libraries(2dlib PRIVATE cfile mem misc + plog::plog ) target_include_directories(2dlib PUBLIC $> 3) @@ -167,7 +167,7 @@ inline int READ_FONT_DATA(FONTFILE ffile, void *buf, int size, int nelem) { return i; } -inline FONTFILE OPEN_FONT(char *filename, bool &success) { +inline FONTFILE OPEN_FONT(const char *filename, bool &success) { FONTFILE fp; int file_id; @@ -219,7 +219,7 @@ void grFont::close_system() { } // we should free any fonts currently allocated here. - mprintf(0, "Freeing cached fonts..."); + LOG_DEBUG << "Freeing cached fonts..."; for (int i = 0; i < MAX_FONTS; i++) { gr_font_record *ft; if (grFont::m_FontList[i].references) { @@ -389,8 +389,6 @@ void grFont::load(char *filename, int slot) { Error("Illegal font file: %s.\n", filename); } - mprintf(0, "%s font.\n", grFont::m_FontList[slot].name); - ft->width = READ_FONT_SHORT(ff); ft->height = READ_FONT_SHORT(ff); ft->flags = READ_FONT_SHORT(ff); @@ -399,8 +397,6 @@ void grFont::load(char *filename, int slot) { ft->max_ascii = READ_FONT_BYTE(ff); READ_FONT_DATA(ff, fontname, 32, 1); - mprintf(0, " ::::::", ft->height, ft->min_ascii, ft->max_ascii, ft->baseline); - num_char = ft->max_ascii - ft->min_ascii + 1; // Read in all widths @@ -408,7 +404,6 @@ void grFont::load(char *filename, int slot) { ft->char_widths = new int16_t[num_char]; for (i = 0; i < num_char; i++) ft->char_widths[i] = READ_FONT_SHORT(ff); - mprintf(0, "::proportional"); } else { ft->char_widths = NULL; } @@ -427,7 +422,6 @@ void grFont::load(char *filename, int slot) { if (ft->flags & FT_COLOR) { int off = 0; - mprintf(0, "::color"); for (i = 0; i < num_char; i++) { ft->char_data[i] = ft->raw_data + off; if (ft->flags & FT_PROPORTIONAL) @@ -437,7 +431,6 @@ void grFont::load(char *filename, int slot) { } } else { // Monochrome uint8_t *ptr = ft->raw_data; - mprintf(0, "::mono"); for (i = 0; i < num_char; i++) { ft->char_data[i] = ptr; if (ft->flags & FT_PROPORTIONAL) @@ -452,8 +445,9 @@ void grFont::load(char *filename, int slot) { // Then read in CLOSE_FONT(ff); - - mprintf(0, "\n"); + LOG_DEBUG.printf("%s font: ::::::::::", + grFont::m_FontList[slot].name, ft->height, ft->min_ascii, ft->max_ascii, ft->baseline, + ft->flags & FT_PROPORTIONAL, ft->flags & FT_COLOR); grFont::m_FontList[slot].font = fnt; diff --git a/2dlib/memsurf.cpp b/2dlib/memsurf.cpp index 6d9a1eca..cab2d97d 100644 --- a/2dlib/memsurf.cpp +++ b/2dlib/memsurf.cpp @@ -73,6 +73,7 @@ #include "bitmap.h" #include "lib2d.h" +#include "log.h" #include "mem.h" // ---------------------------------------------------------------------------- @@ -172,7 +173,7 @@ bool gr_mem_surf_Create(ddgr_surface *sf) { bm->data = (char *)mem_malloc(bm->rowsize * sf->h); if (!bm->data) { - mprintf(0, "mem_Create malloc fail <%s>\n", sf->name); + LOG_WARNING.printf("mem_Create malloc fail <%s>\n", sf->name); delete bm; return false; } diff --git a/2dlib/surface.cpp b/2dlib/surface.cpp index df72ea26..0ce7266b 100644 --- a/2dlib/surface.cpp +++ b/2dlib/surface.cpp @@ -745,8 +745,6 @@ void grSurface::add_to_list(ddgr_surface *sf) { node->prev = grSurface::surf_list_cur; grSurface::surf_list_cur = node; } - - // mprintf(0, "Allocated surface %s [%d].\n", sf->name, DDData.surfs_alloc); } void grSurface::remove_from_list(ddgr_surface *sf) { @@ -776,6 +774,4 @@ void grSurface::remove_from_list(ddgr_surface *sf) { node = node->prev; } } - - // mprintf(0, "Freed surface %s [%d].\n", sf->name, DDData.surfs_alloc); }