~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/blitter/base.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Matthijs Kooijman, Jordi Mallach
  • Date: 2009-04-15 18:22:10 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090415182210-22ktb8kdbp2tf3bm
[ Matthijs Kooijman ]
* New upstream release.
* Remove Debian specific desktop file, upstream provides one now. 
* Add debian/watch file.

[ Jordi Mallach ]
* Bump Standards-Version to 3.8.1, with no changes required.
* Move to debhelper compat 7. Bump Build-Depends accordingly.
* Use dh_prep.
* Add "set -e" to config script.
* Remove a few extra doc files that get installed by upstream Makefile.
* Add more complete copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: base.hpp 11684 2007-12-23 10:56:02Z rubidium $ */
 
1
/* $Id: base.hpp 15428 2009-02-09 02:57:15Z rubidium $ */
 
2
 
 
3
/** @file base.hpp Base for all blitters. */
2
4
 
3
5
#ifndef BLITTER_BASE_HPP
4
6
#define BLITTER_BASE_HPP
52
54
        virtual void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) = 0;
53
55
 
54
56
        /**
55
 
         * Draw a colortable to the screen. This is: the color of the screen is read
56
 
         *  and is looked-up in the palette to match a new color, which then is put
 
57
         * Draw a colourtable to the screen. This is: the colour of the screen is read
 
58
         *  and is looked-up in the palette to match a new colour, which then is put
57
59
         *  on the screen again.
58
60
         * @param dst the destination pointer (video-buffer).
59
61
         * @param width the width of the buffer.
60
62
         * @param height the height of the buffer.
61
63
         * @param pal the palette to use.
62
64
         */
63
 
        virtual void DrawColorMappingRect(void *dst, int width, int height, int pal) = 0;
 
65
        virtual void DrawColourMappingRect(void *dst, int width, int height, int pal) = 0;
64
66
 
65
67
        /**
66
68
         * Convert a sprite from the loader to our own format.
78
80
        virtual void *MoveTo(const void *video, int x, int y) = 0;
79
81
 
80
82
        /**
81
 
         * Draw a pixel with a given color on the video-buffer.
82
 
         * @param video The destination pointer (video-buffer).
83
 
         * @param x The x position within video-buffer.
84
 
         * @param y The y position within video-buffer.
85
 
         * @param color A 8bpp mapping color.
86
 
         */
87
 
        virtual void SetPixel(void *video, int x, int y, uint8 color) = 0;
88
 
 
89
 
        /**
90
 
         * Draw a pixel with a given color on the video-buffer if there is currently a black pixel.
91
 
         * @param video The destination pointer (video-buffer).
92
 
         * @param x The x position within video-buffer.
93
 
         * @param y The y position within video-buffer.
94
 
         * @param color A 8bpp mapping color.
95
 
         */
96
 
        virtual void SetPixelIfEmpty(void *video, int x, int y, uint8 color) = 0;
97
 
 
98
 
        /**
99
 
         * Make a single horizontal line in a single color on the video-buffer.
 
83
         * Draw a pixel with a given colour on the video-buffer.
 
84
         * @param video The destination pointer (video-buffer).
 
85
         * @param x The x position within video-buffer.
 
86
         * @param y The y position within video-buffer.
 
87
         * @param colour A 8bpp mapping colour.
 
88
         */
 
89
        virtual void SetPixel(void *video, int x, int y, uint8 colour) = 0;
 
90
 
 
91
        /**
 
92
         * Draw a pixel with a given colour on the video-buffer if there is currently a black pixel.
 
93
         * @param video The destination pointer (video-buffer).
 
94
         * @param x The x position within video-buffer.
 
95
         * @param y The y position within video-buffer.
 
96
         * @param colour A 8bpp mapping colour.
 
97
         */
 
98
        virtual void SetPixelIfEmpty(void *video, int x, int y, uint8 colour) = 0;
 
99
 
 
100
        /**
 
101
         * Make a single horizontal line in a single colour on the video-buffer.
100
102
         * @param video The destination pointer (video-buffer).
101
103
         * @param width The lenght of the line.
102
 
         * @param color A 8bpp mapping color.
 
104
         * @param colour A 8bpp mapping colour.
103
105
         */
104
 
        virtual void DrawRect(void *video, int width, int height, uint8 color) = 0;
 
106
        virtual void DrawRect(void *video, int width, int height, uint8 colour) = 0;
105
107
 
106
108
        /**
107
 
         * Draw a line with a given color.
 
109
         * Draw a line with a given colour.
108
110
         * @param video The destination pointer (video-buffer).
109
111
         * @param x The x coordinate from where the line starts.
110
112
         * @param y The y coordinate from where the line starts.
112
114
         * @param y2 The y coordinate to where the lines goes.
113
115
         * @param screen_width The width of the screen you are drawing in (to avoid buffer-overflows).
114
116
         * @param screen_height The height of the screen you are drawing in (to avoid buffer-overflows).
115
 
         * @param color A 8bpp mapping color.
 
117
         * @param colour A 8bpp mapping colour.
116
118
         */
117
 
        virtual void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 color) = 0;
 
119
        virtual void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour) = 0;
118
120
 
119
121
        /**
120
122
         * Copy from a buffer to the screen.
181
183
        virtual Blitter::PaletteAnimation UsePaletteAnimation() = 0;
182
184
 
183
185
        /**
184
 
         * Get the naem of the blitter, the same as the Factory-instance returns.
 
186
         * Get the name of the blitter, the same as the Factory-instance returns.
185
187
         */
186
188
        virtual const char *GetName() = 0;
187
189
 
 
190
        /**
 
191
         * Get how many bytes are needed to store a pixel.
 
192
         */
 
193
        virtual int GetBytesPerPixel() = 0;
 
194
 
188
195
        virtual ~Blitter() { }
189
196
};
190
197