/*
 * draw.h
 *
 *  Created on: Dec 24, 2009
 *      Author: ÓHerman van der MeulenÓ
 */

#ifndef DRAW_H_
#define DRAW_H_

#include <nds.h>
#include <stdio.h>

#include "prep.h"

#include "free_img_bin.h"
#include "nogoorange_img_bin.h"
#include "end_img_bin.h"
#include "begin_img_bin.h"
#include "horizontal_img_bin.h"
#include "vertical_img_bin.h"
#include "eton_img_bin.h"
#include "etos_img_bin.h"
#include "wton_img_bin.h"
#include "wtos_img_bin.h"
#include "font_img_bin.h"
#include "fontred_img_bin.h"
#include "rock_img_bin.h"
#include "topscreen_img_bin.h"
#include "helplevel_img_bin.h"
#include "transparent_img_bin.h"
#include "youwon_img_bin.h"

#define PIXEL(x)	(x | (1 << 15))

u16 bgColor;
u16 paintColor;
u16 alphaColor;

u16* video_buffer;

int pointInRangeLimit(u16 x, u16 y);
int offsetInRangeLimit(u16* offset);
void drawPoint(int x, int y);
void drawOffsetPoint(u16 offset);
void drawLine(int x1, int y1, int x2, int y2);
void drawRect(int x, int y, int width, int height);
void fillRect(int x, int y, int width, int height);
void drawBlock(int x, int y);
void drawLastBlockTurn(int x, int y, int turnType);
void drawField(int waitOrNot);
void drawBitmap(u16 bufferX, u16 bufferY, u16* bitmap, u8 bitmapX, u8 bitmapY, u16 width, u8 height);
void drawPartOfBitmap(u16 bufferX, u16 bufferY, u16* bitmap, u16 bitmapX, u16 bitmapY, u16 bitmapWidth, u16 bitmapHeight, u16 width, u16 height);
void drawCharacter(u16 startX, u8 startY, char whichLetter, u16* font);
void drawText(char msg[], u8 startX, u8 startY, u16* font);
void drawLevel();
void drawWarning(char* warningText);

#endif /* DRAW_H_ */
