Debian Codegraph @

common/2d/rect.cpp

raw
1 /*
2 * Portions of this file are copyright Rebirth contributors and licensed as
3 * described in COPYING.txt.
4 * Portions of this file are copyright Parallax Software and licensed
5 * according to the Parallax license below.
6 * See COPYING.txt for license details.
7
8 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
9 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
10 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
11 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
12 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
13 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
14 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
15 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
16 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
17 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
18 */
19 /*
20 *
21 * Graphical routines for drawing rectangles.
22 *
23 */
24
25 #include "u_mem.h"
26 #include "gr.h"
27
28 #if DXX_USE_OGL
29 #include "ogl_init.h"
30 #endif
31
32 namespace dcx {
33
34 void gr_urect(grs_canvas &canvas, const int left, const int top, const int right, const int bot, const color_palette_index color)
35 {
36 #if DXX_USE_OGL
37 if (canvas.cv_bitmap.get_type() == bm_mode::ogl)
38 {
39 ogl_urect(canvas, left, top, right, bot, color);
40 return;
41 }
42 #else
43 for ( int i=top; i<=bot; i++ )
44 gr_uscanline(canvas, left, right, i, color);
45 #endif
46 }
47
48 void gr_rect(grs_canvas &canvas, const int left, const int top, const int right, const int bot, const color_palette_index color)
49 {
50 #if DXX_USE_OGL
51 if (canvas.cv_bitmap.get_type() == bm_mode::ogl)
52 {
53 ogl_urect(canvas, left, top, right, bot, color);
54 return;
55 }
56 #endif
57 for ( int i=top; i<=bot; i++ )
58 gr_scanline(canvas, left, right, i, color);
59 }
60
61 }