1,23 → 1,9 |
#include <stdint.h> |
//#include <libavcodec/avcodec.h> |
//#include <libavformat/avformat.h> |
//#include <libswscale/swscale.h> |
|
#include <stdio.h> |
//#include <fcntl.h> |
#include "../winlib/winlib.h" |
//#include "fplay.h" |
#include <pixlib2.h> |
#include "system.h" |
|
typedef struct |
{ |
uint32_t width; |
uint32_t height; |
uint32_t pitch; |
uint32_t handle; |
uint8_t *data; |
}bitmap_t; |
|
|
#define DISPLAY_VERSION 0x0200 /* 2.00 */ |
|
#define SRV_GETVERSION 0 |
32,24 → 18,13 |
#define SRV_BLIT_TEXTURE 16 |
#define SRV_BLIT_VIDEO 17 |
|
|
#define BUFFER_SIZE(n) ((n)*sizeof(uint32_t)) |
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) |
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) |
|
|
#define HW_BIT_BLIT (1<<0) /* BGRX blitter */ |
#define HW_TEX_BLIT (1<<1) /* stretch blit */ |
#define HW_VID_BLIT (1<<2) /* planar and packed video */ |
|
uint32_t InitPixlib(uint32_t flags); |
|
int create_bitmap(bitmap_t *bitmap); |
int lock_bitmap(bitmap_t *bitmap); |
int resize_bitmap(bitmap_t *bitmap); |
int blit_bitmap(bitmap_t *bitmap, int dst_x, int dst_y, |
int w, int h); |
|
|
|
static uint32_t service; |
static uint32_t blit_caps; |
static uint32_t screen_width; |
114,11 → 89,8 |
return retval; |
}; |
|
#define BUFFER_SIZE(n) ((n)*sizeof(uint32_t)) |
|
|
|
uint32_t InitPixlib(uint32_t caps) |
uint32_t init_pixlib(uint32_t caps) |
{ |
uint32_t api_version; |
uint32_t screensize; |
187,7 → 159,7 |
{ |
// __asm__ __volatile__("int3"); |
|
if( blit_caps & HW_BIT_BLIT ) |
if( bitmap->flags && blit_caps & HW_BIT_BLIT ) |
{ |
struct __attribute__((packed)) /* SRV_CREATE_SURFACE */ |
{ |
232,7 → 204,6 |
// bitmap->handle, bitmap->pitch, bitmap->data); |
return 0; |
}; |
return err; |
}; |
|
uint32_t size; |
248,6 → 219,7 |
bitmap->handle = 0; |
bitmap->pitch = pitch; |
bitmap->data = buffer; |
bitmap->flags = 0; |
return 0; |
}; |
|
261,7 → 233,7 |
// __asm__ __volatile__("int3"); |
int err = 0; |
|
if( blit_caps & HW_BIT_BLIT ) |
if( bitmap->flags && blit_caps & HW_BIT_BLIT ) |
{ |
struct __attribute__((packed)) /* SRV_LOCK_SURFACE */ |
{ |
302,7 → 274,7 |
{ |
int err; |
|
if( blit_caps & HW_BIT_BLIT ) |
if( bitmap->flags && blit_caps & HW_BIT_BLIT ) |
{ |
|
/* |
369,7 → 341,7 |
{ |
// __asm__ __volatile__("int3"); |
|
if( blit_caps & HW_BIT_BLIT ) |
if( bitmap->flags && blit_caps & HW_BIT_BLIT ) |
{ |
struct __attribute__((packed)) |
{ |