Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
blitter.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/***********************************************************************************************
20 *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
21 ***********************************************************************************************
22 * *
23 * Project Name : Command & Conquer *
24 * *
25 * $Archive:: /Commando/Code/wwlib/blitter.h $*
26 * *
27 * $Author:: Jani_p $*
28 * *
29 * $Modtime:: 5/04/01 7:48p $*
30 * *
31 * $Revision:: 3 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36#if _MSC_VER >= 1000
37#pragma once
38#endif // _MSC_VER >= 1000
39
40#ifndef BLITTER_H
41#define BLITTER_H
42
43/*
44** This is the interface class to the blitter object. The blitter object handles moving
45** pixels. That's all it does. For every type of pixel translation, there should be a
46** blitter object created that supports this interface. The blit blitting routines will
47** call the appropriate method as the pixel are being processed.
48*/
49class Blitter {
50 public:
51
52 /*
53 ** Blits from source to dest (starts at first pixel). This is the preferred
54 ** method of pixel blitting and this routine will be called 99% of the time under
55 ** normal circumstances.
56 */
57 virtual void BlitForward(void * dest, void const * source, int length) const = 0;
58
59 /*
60 ** Copies the pixel in reverse order. This only required if the source and dest
61 ** pixel regions overlap in a certain way. This routine will rarely be called.
62 */
63 virtual void BlitBackward(void * dest, void const * source, int length) const = 0;
64
65 /*
66 ** This routine calls the appropriate blit routine. A proper overlap check cannot
67 ** be performed by this routine because the pixel size information is not present.
68 ** as such, you should call the appropriate blit routine rather than letting this
69 ** routine perform the check and call.
70 */
71 void Blit(void * dest, void const * source, int length) const {if (dest < source) BlitBackward(dest, source, length); else BlitForward(dest, source, length);}
72};
73
74
75/*
76** This is the blitter object interface for dealing with RLE compressed pixel data. For
77** every type of RLE compressed blitter operation desired, there would be an object created
78** that supports this interface.
79*/
81 public:
82
83 /*
84 ** Blits from the RLE compressed source to the destination buffer. An optional
85 ** leading pixel skip value can be supplied when a sub-section of an RLE
86 ** compressed pixel sequence is desired. This is necessary because RLE decompression
87 ** must begin at the start of the compressed data sequence.
88 */
89 virtual void Blit(void * dest, void const * source, int length, int leadskip=0) const = 0;
90};
91
92
93
94#endif
virtual void BlitForward(void *dest, void const *source, int length) const =0
virtual void BlitBackward(void *dest, void const *source, int length) const =0
void Blit(void *dest, void const *source, int length) const
Definition blitter.h:71
virtual void Blit(void *dest, void const *source, int length, int leadskip=0) const =0