ScummVM API documentation
soft_render_surface.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  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA8_GRAPHICS_SOFTRENDERSURFACE_H
23 #define ULTIMA8_GRAPHICS_SOFTRENDERSURFACE_H
24 
25 #include "ultima/ultima8/graphics/base_soft_render_surface.h"
26 #include "graphics/managed_surface.h"
27 
28 namespace Ultima {
29 namespace Ultima8 {
30 
31 //
32 // SoftRenderSurface
33 //
34 // Desc: The class for software rendering in Pentagram
35 //
36 template<class uintX> class SoftRenderSurface : public BaseSoftRenderSurface {
37 public:
38 
39  // Create from a managed surface
41 
42  //
43  // Surface Filling
44  //
45 
46  // Fill buffer (using a RGB colour)
47  void Fill32(uint32 rgb, int32 sx, int32 sy, int32 w, int32 h) override;
48 
50  void FillAlpha(uint8 alpha, int32 sx, int32 sy, int32 w, int32 h) override;
51 
52  // Fill the region doing alpha blending
53  void FillBlended(uint32 rgba, int32 sx, int32 sy, int32 w, int32 h) override;
54 
55  //
56  // The rule for painting methods:
57  //
58  // First arg are the source object to 'draw' with
59  // Next args are any other required data to define the 'source'
60  // Next args are the destination position
61  //
62 
63  //
64  // Basic Shape Painting
65  //
66 
67  // Paint a Shape
68  void Paint(const Shape *s, uint32 frame, int32 x, int32 y, bool untformed_pal = false) override;
69 
70  // Paint an Shape without clipping
71  void PaintNoClip(const Shape *s, uint32 frame, int32 x, int32 y, bool untformed_pal = false) override;
72 
73  // Paint a Translucent Shape.
74  void PaintTranslucent(const Shape *s, uint32 frame, int32 x, int32 y, bool untformed_pal = false) override;
75 
76  // Paint a Mirrored Shape
77  void PaintMirrored(const Shape *s, uint32 frame, int32 x, int32 y, bool trans = false, bool untformed_pal = false) override;
78 
79  // Paint a Invisible Shape
80  void PaintInvisible(const Shape *s, uint32 frame, int32 x, int32 y, bool trans, bool mirrored, bool untformed_pal = false) override;
81 
82  // Paint a Highlighted Shape of using the 32 Bit Colour col32 (0xAARRGGBB Alpha is blend level)
83  void PaintHighlight(const Shape *s, uint32 frame, int32 x, int32 y, bool trans, bool mirrored, uint32 col32, bool untformed_pal = false) override;
84 
85  // Paint a Invisible Highlighted Shape of using the 32 Bit Colour col32 (0xAARRGGBB Alpha is blend level)
86  void PaintHighlightInvis(const Shape *s, uint32 frame, int32 x, int32 y, bool trans, bool mirrored, uint32 col32, bool untformed_pal = false) override;
87 
88  //
89  // Basic Line Drawing
90  //
91 
92  // Draw a RGB Line
93  void DrawLine32(uint32 rgb, int32 sx, int32 sy, int32 ex, int32 ey) override;
94 
95 
96  //
97  // Basic Texture Blitting
98  //
99 
100  // Blit a region from a Texture (Alpha == 0 -> skipped)
101  void Blit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, bool alpha_blend = false) override;
102 
103  // Blit a region from a Texture with a Colour blend (AlphaTex == 0 -> skipped. AlphaCol32 -> Blend Factors)
104  void FadedBlit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) override;
105 
106  // Blit a region from a Texture with a Colour blend masked based on DestAlpha (AlphaTex == 0 || AlphaDest == 0 -> skipped. AlphaCol32 -> Blend Factors)
107  void MaskedBlit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) override;
108 };
109 
110 } // End of namespace Ultima8
111 } // End of namespace Ultima
112 
113 #endif
Definition: managed_surface.h:45
void MaskedBlit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend=false) override
Blit a region from a Texture with a Colour blend masked based on DestAlpha (AlphaTex == 0 || AlphaDes...
void PaintInvisible(const Shape *s, uint32 frame, int32 x, int32 y, bool trans, bool mirrored, bool untformed_pal=false) override
Paint an Invisible Shape.
void Fill32(uint32 rgb, int32 sx, int32 sy, int32 w, int32 h) override
Fill buffer (using a RGB colour)
void PaintTranslucent(const Shape *s, uint32 frame, int32 x, int32 y, bool untformed_pal=false) override
Paint a Translucent Shape.
Definition: base_soft_render_surface.h:37
void FillBlended(uint32 rgba, int32 sx, int32 sy, int32 w, int32 h) override
Fill the region doing alpha blending.
void FadedBlit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend=false) override
Blit a region from a Texture with a Colour blend (AlphaTex == 0 -> skipped. AlphaCol32 -> Blend Facto...
Definition: detection.h:27
void PaintHighlight(const Shape *s, uint32 frame, int32 x, int32 y, bool trans, bool mirrored, uint32 col32, bool untformed_pal=false) override
Paint a Highlighted Shape of using the 32 Bit Colour col32 (0xAARRGGBB Alpha is blend level) ...
void PaintHighlightInvis(const Shape *s, uint32 frame, int32 x, int32 y, bool trans, bool mirrored, uint32 col32, bool untformed_pal=false) override
Paint a Invisible Highlighted Shape of using the 32 Bit Colour col32 (0xAARRGGBB Alpha is blend level...
Definition: soft_render_surface.h:36
void PaintMirrored(const Shape *s, uint32 frame, int32 x, int32 y, bool trans=false, bool untformed_pal=false) override
Paint a Mirrored Shape.
void PaintNoClip(const Shape *s, uint32 frame, int32 x, int32 y, bool untformed_pal=false) override
Paint a Shape without clipping.
Definition: shape.h:36
void Blit(const Graphics::ManagedSurface *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, bool alpha_blend=false) override
Blit a region from a Texture (Alpha == 0 -> skipped)
void FillAlpha(uint8 alpha, int32 sx, int32 sy, int32 w, int32 h) override
Fill alpha channel.
void Paint(const Shape *s, uint32 frame, int32 x, int32 y, bool untformed_pal=false) override
Paint a Shape.