mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 15:40:21 +00:00
caca: updates
- added splashscreen - fixed RGB-shifts - redraw last frawme if resized
This commit is contained in:
@@ -56,6 +56,8 @@
|
||||
#include "utils/macros.h"
|
||||
#include "utils/misc.h"
|
||||
#include "utils/color_out.h"
|
||||
#include "video.h"
|
||||
#include "video_display/splashscreen.h"
|
||||
|
||||
#define STRERROR_BUF_LEN 1024
|
||||
|
||||
@@ -304,3 +306,34 @@ uint32_t parse_uint32(const char *value_str) noexcept(false)
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
struct video_frame *get_splashscreen()
|
||||
{
|
||||
struct video_desc desc;
|
||||
|
||||
desc.width = 512;
|
||||
desc.height = 512;
|
||||
desc.color_spec = RGBA;
|
||||
desc.interlacing = PROGRESSIVE;
|
||||
desc.fps = 1;
|
||||
desc.tile_count = 1;
|
||||
|
||||
struct video_frame *frame = vf_alloc_desc_data(desc);
|
||||
|
||||
const char *data = splash_data;
|
||||
memset(frame->tiles[0].data, 0, frame->tiles[0].data_len);
|
||||
for (unsigned int y = 0; y < splash_height; ++y) {
|
||||
char *line = frame->tiles[0].data;
|
||||
line += vc_get_linesize(frame->tiles[0].width,
|
||||
frame->color_spec) *
|
||||
(((frame->tiles[0].height - splash_height) / 2) + y);
|
||||
line += vc_get_linesize(
|
||||
(frame->tiles[0].width - splash_width)/2,
|
||||
frame->color_spec);
|
||||
for (unsigned int x = 0; x < splash_width; ++x) {
|
||||
HEADER_PIXEL(data,line);
|
||||
line += 4;
|
||||
}
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user