CHUD.h 983 Bytes
Newer Older
Gerhard Stein's avatar
Gerhard Stein committed
1 2 3 4 5 6 7 8 9 10 11 12
/*
 * CHUD.h
 *
 *  Created on: 01.07.2010
 *      Author: gerstrong
 *
 *  This is the class which process the code of the HUD.
 *  It is meant to be used, so both Vorticon and Galaxy Engine
 *  or even another game can use it.
 */

#include <SDL.h>
13
#include <string>
Gerhard Stein's avatar
Gerhard Stein committed
14
#include "Playerdefines.h"
Gerhard Stein's avatar
Gerhard Stein committed
15
#include "engine/spritedefines.h"
16
#include "SmartPointer.h"
17
#include "graphics/CSprite.h"
Gerhard Stein's avatar
Gerhard Stein committed
18 19 20

#ifndef CHUD_H_
#define CHUD_H_
Gerhard Stein's avatar
Gerhard Stein committed
21 22 23

class CHUD {
public:
24 25 26 27
	CHUD(unsigned long &score,
		 signed char &lives,
		 unsigned int &charges,
		 int *camlead = NULL); // TODO: Must be removed later and replaced by a reference
Gerhard Stein's avatar
Gerhard Stein committed
28 29 30 31 32 33

	void render();

private:

	void CreateBackground();
34 35
	void renderGalaxy();
	void renderVorticon();
36
	void DrawCircle(int x, int y, int width);
Gerhard Stein's avatar
Gerhard Stein committed
37 38 39 40 41 42

	SDL_Rect m_Rect;

	unsigned long &m_score;
	signed char &m_lives;
	unsigned int &m_charges;
43
	CSprite *mpHUDBox;
Gerhard Stein's avatar
Gerhard Stein committed
44

45 46
	SmartPointer <SDL_Surface> mpBackground;
	SmartPointer <SDL_Surface> mpHUDBlit;
47
	int *mpCamlead;
Gerhard Stein's avatar
Gerhard Stein committed
48 49 50
};

#endif /* CHUD_H_ */