32bool display_image_at(
const char* filename,
int x,
int y,
int height,
int width, scale_type_t scale_type) {
34 if (!filename || height < 0) {
36 log_msg(ERROR,
"media_output",
"Invalid parameters for display_png_at");
41 log_msg(ERROR,
"media_output",
"Failed to load image for display");
44 return display_image(resource);
57 log_msg(ERROR,
"media_output",
"Invalid filename for fill_cell_with_png");
62 log_msg(ERROR,
"media_output",
"Failed to load image for cell");
65 return display_image(resource);
122 if (!resource || !resource->visual) {
123 log_msg(ERROR,
"media_output",
"Invalid parameters for display_image");
127 if (resource->media_type == MEDIA_GIF) {
133 if (resource->plane) {
134 ncplane_destroy(resource->plane);
135 resource->plane = NULL;
139 struct ncplane_options opts = {0};
140 opts.y = resource->options.y;
141 opts.x = resource->options.x;
142 opts.rows = resource->options.leny > 0 ? resource->options.leny : resource->og_height;
143 opts.cols = resource->options.lenx > 0 ? resource->options.lenx : resource->og_width;
145 resource->plane = ncplane_create(stdplane, &opts);
146 if (!resource->plane) {
147 log_msg(ERROR,
"media_output",
"Failed to create plane for image at (%d, %d)",
148 resource->options.x, resource->options.y);
153 struct ncvisual_options vopts = {0};
154 vopts.n = resource->plane;
157 vopts.scaling = resource->options.scaling;
158 vopts.blitter = NCBLIT_2x2;
161 if (!ncvisual_blit(nc, resource->visual, &vopts)) {
162 log_msg(ERROR,
"media_output",
"Failed to blit visual to plane");
163 ncplane_destroy(resource->plane);
164 resource->plane = NULL;
169 ncplane_move_top(resource->plane);
172 notcurses_render(nc);
Exposes functions for the IO-Handler.
void log_msg(const log_level_t level, const char *module, const char *format,...)
Logs a formatted message with a specified log level and module.
Header file for logging functionality of the game.
Exposes functions for outputting to the console.