1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2025-09-01 06:20:15 +02:00

zdrv v1, ready.

This commit is contained in:
oz 2020-11-14 18:13:00 +03:00
parent 2376ffcbc1
commit 79bb0adab8
6 changed files with 150 additions and 10 deletions

View file

@ -1,4 +1,5 @@
#pragma once
#include "gdrv.h"
#pragma pack(push, 1)
struct __declspec(align(1)) zmap_header_type
@ -6,17 +7,26 @@ struct __declspec(align(1)) zmap_header_type
__int16 Width;
__int16 Height;
__int16 Stride;
char* BmpBufPtr1;
char* bmpBufPtr2;
char BmpBuffer[1];
unsigned __int16* ZPtr1;
unsigned __int16* ZPtr2;
unsigned __int16 ZBuffer[1];
};
#pragma pack(pop)
static_assert(sizeof(zmap_header_type) == 15, "Wrong size of zmap_header_type");
static_assert(sizeof(zmap_header_type) == 16, "Wrong size of zmap_header_type");
class zdrv
{
public:
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);
static void fill(zmap_header_type* zmap, int width, int height, int xOff, int yOff, __int16 fillChar);
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);
};