52 lines
909 B
C
52 lines
909 B
C
#ifndef __VGA_H__
|
|
#define __VGA_H__
|
|
|
|
#include <time.h>
|
|
|
|
#include "../types.h"
|
|
#include "../bmpload.h"
|
|
|
|
#define VGA_DISPLAY_WIDTH (320)
|
|
#define VGA_DISPLAY_HEIGHT (200)
|
|
|
|
struct VGAColor {
|
|
byte red;
|
|
byte green;
|
|
byte blue;
|
|
};
|
|
|
|
struct SpriteRender {
|
|
byte* data;
|
|
int x;
|
|
int y;
|
|
unsigned int width;
|
|
unsigned int height;
|
|
int transparentColor;
|
|
unsigned int modulo;
|
|
|
|
int offsetX;
|
|
int offsetY;
|
|
};
|
|
|
|
struct SpriteBounds {
|
|
int top;
|
|
int right;
|
|
int bottom;
|
|
int left;
|
|
};
|
|
|
|
void drawPixel(int x, int y, int color);
|
|
|
|
void drawSprite(struct SpriteRender *sprite);
|
|
void buildSpriteFromSpritesheet(struct BMPImage*, struct SpriteRender*, int, int, int, int);
|
|
void getSpriteBounds(struct SpriteRender *sprite, struct SpriteBounds *bounds);
|
|
|
|
byte *initializeDrawBuffer();
|
|
byte *getDrawBuffer();
|
|
void freeDrawBuffer();
|
|
void copyDrawBufferToDisplay();
|
|
|
|
void setVGAColors(struct VGAColor[], int);
|
|
|
|
#endif
|