#ifndef RENDER_H
#define RENDER_H

#define MAXATOMPOINTS 2048
#define MAXTRIANGLES 512

#define FPSHR  16
#define FPAND  65535

#include "images.h"
#include <SDL/SDL.h>

typedef struct colorARGB
{
    unsigned char a, r, g, b;
} colorARGB;

typedef struct atompoint
{
    int a;
    int u, v;
} atompoint;

typedef struct triangle2d
{
    int p0, p1, p2;
}triangle2d;

typedef struct vertex
{
    short x, y;
} vertex;

void DrawLine (int x1, int y1, int x2, int y2, unsigned int *vram, int c, bool antialiased);
void DrawFlatTriangleBlob(triangle2d *triangle, unsigned char *src, unsigned int *vram);
void Blit(SDL_Surface *src, SDL_Surface *dst, int xp, int yp);
void RenderBackground(image *img, unsigned int *vram);
void RenderSprite(int px, int py, image *img, unsigned int *vram, int surf_width, int surf_height);
void RenderCursor(int px, int py, image *img, unsigned int *vram);
void RenderZoomSprite(int px, int py, float zx, float zy, image *img, unsigned int *vram, int surf_width, int surf_height, bool filtering);
void RenderBox(int x1, int y1, int x2, int y2, unsigned int c, unsigned int *vram);
void RenderBoxLine(int x1, int y1, int x2, int y2, unsigned int c, unsigned int *vram, int swidth);
void ColorInterpolation(colorARGB c1, colorARGB c2, float percentage, colorARGB *c);
void CopyColor(colorARGB c1, colorARGB *c);
unsigned int ColorARGB2int(colorARGB *col);

#endif
