2020-11-08 16:37:59 +01:00
|
|
|
#pragma once
|
2020-11-14 16:13:00 +01:00
|
|
|
#include "gdrv.h"
|
2020-11-08 16:37:59 +01:00
|
|
|
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
struct __declspec(align(1)) zmap_header_type
|
|
|
|
{
|
|
|
|
__int16 Width;
|
|
|
|
__int16 Height;
|
|
|
|
__int16 Stride;
|
2020-11-14 16:13:00 +01:00
|
|
|
unsigned __int16* ZPtr1;
|
|
|
|
unsigned __int16* ZPtr2;
|
|
|
|
unsigned __int16 ZBuffer[1];
|
2020-11-08 16:37:59 +01:00
|
|
|
};
|
2020-11-14 16:13:00 +01:00
|
|
|
|
2020-11-08 16:37:59 +01:00
|
|
|
#pragma pack(pop)
|
|
|
|
|
2020-11-14 16:13:00 +01:00
|
|
|
static_assert(sizeof(zmap_header_type) == 16, "Wrong size of zmap_header_type");
|
2020-11-08 16:37:59 +01:00
|
|
|
|
|
|
|
class zdrv
|
|
|
|
{
|
|
|
|
public:
|
2020-11-14 16:13:00 +01:00
|
|
|
static int pad(int width);
|
|
|
|
static int create_zmap(zmap_header_type* zmap, int width, int height);
|
|
|
|
static int destroy_zmap(zmap_header_type* zmap);
|
2020-11-15 15:39:00 +01:00
|
|
|
static void fill(zmap_header_type* zmap, int width, int height, int xOff, int yOff, unsigned __int16 fillChar);
|
2020-11-14 16:13:00 +01:00
|
|
|
static void paint(int width, int height, gdrv_bitmap8* dstBmp, int dstBmpXOff, int dstBmpYOff,
|
|
|
|
zmap_header_type* dstZMap, int dstZMapXOff, int dstZMapYOff, gdrv_bitmap8* srcBmp, int srcBmpXOff,
|
|
|
|
int srcBmpYOff, zmap_header_type* srcZMap, int srcZMapXOff, int srcZMapYOff);
|
|
|
|
static void paint_flat(int width, int height, gdrv_bitmap8* dstBmp, int dstBmpXOff, int dstBmpYOff,
|
|
|
|
zmap_header_type* zMap, int dstZMapXOff, int dstZMapYOff, gdrv_bitmap8* srcBmp,
|
|
|
|
int srcBmpXOff, int srcBmpYOff, unsigned __int16 depth);
|
2020-11-08 16:37:59 +01:00
|
|
|
};
|