File: canvas.h

package info (click to toggle)
qonk 0.3.1-3.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 2,296 kB
  • sloc: cpp: 14,995; sh: 3,464; makefile: 196
file content (82 lines) | stat: -rw-r--r-- 2,029 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright 2007 by Robert Schuster <robertschuster@fsfe.org>

// Basic drawing and converting operations for Qonk

// If not explicitly told otherwise coordinate values are
// in game units.

#ifndef CANVAS_H
#define CANVAS_H

#include <SDL/SDL.h>

#include "guichan/sdl.hpp"

class Coordinate;
class Font;

class Canvas
{
  public:
    static void alphaBlend( SDL_Surface* surface, Uint8 alpha );

    static void drawSelector( Coordinate&, Sint16 offset,
                              Sint16 width, Sint16 height,
			      Uint8 R, Uint8 G, Uint8 B );

    static void drawNearestPlanetSelector(Coordinate&, int);

    static void drawPlanet(Coordinate&, int size, Uint32 color);

    static void drawPlanetMapped(int x, int y, int size, Uint32 color);

    static void drawResidentShip(Coordinate& shipLocation, Coordinate& planetLocation,
				 int color);

    static void drawFlyingShip(Coordinate&, double direction, int color);

    static void drawSelection(Coordinate&);

    static void drawOrbit(Coordinate&, double rotationDistance, int color);

    static void drawBuildProgress(Coordinate&, int, double);

    static void drawText(int, int, const char *, int, int, int, int a=255);

    static int getFontHeight();

    static void drawBox(int x, int y, int w, int h, int r, int g, int b);

    static void drawRadar();

    static void drawSun();

    static void drawStar(int x, int y, int brightness);
 
    static void drawSonar(Coordinate coord, int size, double percentage, int r, int g, int b, bool circle);

    static void drawPlayerStat(int size, int index, int previousValue, int currentValue, int r, int g, int b);

    static void drawMouseSelection(Coordinate &c1, Coordinate &c2);

    static void drawCursor(int, int);

    static void updateScreen();

    static void initScreen();

    static void shutdown();

    static gcn::SDLGraphics *getSDLGraphics();

  private:

    static gcn::SDLGraphics *sdlGraphics;

    static SDL_Surface* main;

    static Font *font;

};

#endif /* CANVAS_H */