ScummVM API documentation
graphic_prims.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * Additional copyright for this file:
8  * Copyright (C) 1999-2000 Revolution Software Ltd.
9  * This code is based on source code created by Revolution Software,
10  * used with permission.
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef ICB_GRAPIC_PRIMS
28 #define ICB_GRAPIC_PRIMS
29 
30 #include "engines/icb/common/px_bitmap.h"
31 #include "engines/icb/common/px_types.h"
32 #include "engines/icb/p4_generic.h"
33 
34 namespace ICB {
35 
36 typedef float PXreal;
37 typedef float PXfloat;
38 typedef double PXdouble;
39 
40 typedef struct {
41  uint32 x1;
42  uint32 z1;
43  uint32 x2;
44  uint32 z2;
45 } _line;
46 
47 typedef struct {
48  PXreal x;
49  PXreal z;
50 } _point;
51 
52 // used in extrapolate line
53 typedef struct {
54  PXdouble x;
55  PXdouble z;
56 } _fpoint;
57 
58 typedef struct {
59  PXdouble x;
60  PXdouble z;
61 } _float_point;
62 
63 // Might seem silly to create yet another rectangle structure, but this one is needed to help the PSX and the PC
64 // share some of the Remora and inventory code.
65 typedef struct {
66  int32 nX, nY;
67  uint32 nWidth, nHeight;
69 
70 typedef LRECT DXrect;
71 
72 int32 twabs(int32 val);
73 
74 void Draw_horizontal_line(int32 xx, int32 yy, uint32 len, _rgb *pen, uint8 *ad, uint32 pitch);
75 void Draw_vertical_line(int32 xx, int32 yy, uint32 len, _rgb *pen, uint8 *ad, uint32 pitch);
76 void Fill_rect(int32 x, int32 y, int32 x2, int32 y2, uint32 pen, int32 z = 0);
77 void General_draw_line_24_32(int16 x0, int16 y0, int16 x1, int16 y1, _rgb *colour, uint8 *myScreenBuffer, uint32 pitch, int32 surface_width = SCREEN_WIDTH,
78  int32 surface_height = SCREEN_DEPTH);
79 
80 void General_poly_draw_24_32(_point *pVerts, int32 nNumVerts, _rgb sColour, bool8 bFill, uint8 *pSurface, int32 nPitch, int32 nSurfaceWidth, int32 nSurfaceHeight);
81 
82 // This draws a sprite to a surface, using the x, y found in the sprite itself.
83 void SpriteFrameDraw(uint8 *pSurfaceBitmap, uint32 nPitch, uint32 nSurfaceWidth, uint32 nSurfaceHeight, _pxBitmap *pBitmap, uint32 nFrameNumber, uint32 *nTransparencyRef,
84  uint8 nOpacity);
85 
86 // This draws a sprite to a surface, using a supplied x, y, so the sprite can be moved on the surface.
87 void SpriteXYFrameDraw(uint8 *pSurfaceBitmap, uint32 nPitch, uint32 nSurfaceWidth, uint32 nSurfaceHeight, _pxBitmap *pBitmap, int32 nX, int32 nY, uint32 nFrameNumber,
88  bool8 bCentre, uint32 *nTransparencyRef, uint8 nOpacity);
89 
90 // These all make LRECTs (needed by Direct-X) from various sources.
91 LRECT ConvertPxBitmapRectToRECT(const _PxBitmapRect &sBitmapRect);
92 
93 // Additive gouraud line .... what else ?
94 void AdditiveGouraudLine(int16 x0, int16 y0, _rgb c0, int16 x1, int16 y1, _rgb c1, uint32 surface_id);
95 void BlendedLine(int32 x0, int32 y0, int32 x1, int32 y1, _rgb c, uint32 surface_id);
96 void BlendedLine(int32 x0, int32 y0, int32 x1, int32 y1, _rgb c, int32 surface_width, int32 surface_height, uint32 pitch, uint8 *surface);
97 
98 DXrect MakeRECTFromSpriteSizes(int32 nX, int32 nY, uint32 nWidth, uint32 nHeight);
99 
100 } // End of namespace ICB
101 
102 #endif // #ifndef _GRAPIC_PRIMS
Definition: graphic_prims.h:58
Definition: graphic_prims.h:47
Definition: px_common.h:109
Definition: graphic_prims.h:40
Definition: actor.h:32
Definition: px_bitmap_pc.h:51
Definition: graphic_prims.h:53
Definition: graphic_prims.h:65
Definition: px_types.h:32