Skip to content

Commit

Permalink
Swap to internal C++ logging.h
Browse files Browse the repository at this point in the history
Along with some other minor merge / C++ fixes.`
  • Loading branch information
simotek committed Feb 26, 2024
1 parent 37cb6aa commit e169536
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 48 deletions.
2 changes: 1 addition & 1 deletion lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if(BUILD_X11)
endif(BUILD_LUA_CAIRO)

if(BUILD_LUA_IMLIB2)
include_directories(${luaimlib2_includes} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${luaimlib2_includes} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ../src)

if(IMLIB2_VERSION VERSION_GREATER_EQUAL "1.10.0")
wrap_tolua(luaimlib2_src imlib2.pkg)
Expand Down
9 changes: 4 additions & 5 deletions lua/libcairo_imlib2_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void cairo_place_image(const char *file, cairo_t *cr, int x, int y,
return;
}

image = imlib_load_image(file);
image = (Imlib_Image *)imlib_load_image(file);
if (!image) {
NORM_ERR("cairoimagehelper: Couldn't load %s\n", file);
return;
Expand All @@ -62,7 +62,7 @@ void cairo_place_image(const char *file, cairo_t *cr, int x, int y,
}

/* create scaled version of image to later extract the alpha channel */
alpha_image = imlib_create_cropped_scaled_image (0, 0, w, h, width, height);
alpha_image = imlib_create_cropped_scaled_image(0, 0, w, h, width, height);

/* create temporary image */
premul = imlib_create_image(width, height);
Expand All @@ -88,7 +88,7 @@ void cairo_place_image(const char *file, cairo_t *cr, int x, int y,
/* now pass the result to cairo */
result = cairo_image_surface_create_for_data(
(unsigned char *)imlib_image_get_data_for_reading_only(), CAIRO_FORMAT_ARGB32,
scaled_w, scaled_h, sizeof(DATA32) * scaled_w);
width, height, stride);

cairo_set_source_surface(cr, result, x, y);
cairo_paint_with_alpha(cr, alpha);
Expand Down Expand Up @@ -124,7 +124,7 @@ void cairo_draw_image(const char *file, cairo_surface_t *cs, int x, int y,
return;
}

Imlib_Image *image = imlib_load_image(file);
Imlib_Image *image = (Imlib_Image *)imlib_load_image(file);
if (!image) {
NORM_ERR("cairoimagehelper: Couldn't load %s\n", file);
return;
Expand All @@ -151,7 +151,6 @@ void cairo_draw_image(const char *file, cairo_surface_t *cs, int x, int y,
cairo_place_image(file, cr, x, y, scaled_w, scaled_h, 1.0);

cairo_destroy(cr);
cairo_surface_destroy(result);
}

#endif /* _LIBCAIRO_IMAGE_HELPER_H_ */
42 changes: 0 additions & 42 deletions lua/logging.h

This file was deleted.

0 comments on commit e169536

Please sign in to comment.