Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | pmbaty | 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 | |||
| 27 | #include "gr.h" |
||
| 28 | #include "grdef.h" |
||
| 29 | |||
| 30 | #if DXX_USE_OGL |
||
| 31 | #include "ogl_init.h" |
||
| 32 | #endif |
||
| 33 | |||
| 34 | namespace dcx { |
||
| 35 | |||
| 36 | void gr_urect(grs_canvas &canvas, const int left, const int top, const int right, const int bot, const color_palette_index color) |
||
| 37 | { |
||
| 38 | #if DXX_USE_OGL |
||
| 39 | if (canvas.cv_bitmap.get_type() == bm_mode::ogl) |
||
| 40 | { |
||
| 41 | ogl_urect(canvas, left, top, right, bot, color); |
||
| 42 | return; |
||
| 43 | } |
||
| 44 | #else |
||
| 45 | for ( int i=top; i<=bot; i++ ) |
||
| 46 | gr_uscanline(canvas, left, right, i, color); |
||
| 47 | #endif |
||
| 48 | } |
||
| 49 | |||
| 50 | void gr_rect(grs_canvas &canvas, const int left, const int top, const int right, const int bot, const color_palette_index color) |
||
| 51 | { |
||
| 52 | #if DXX_USE_OGL |
||
| 53 | if (canvas.cv_bitmap.get_type() == bm_mode::ogl) |
||
| 54 | { |
||
| 55 | ogl_urect(canvas, left, top, right, bot, color); |
||
| 56 | return; |
||
| 57 | } |
||
| 58 | #endif |
||
| 59 | for ( int i=top; i<=bot; i++ ) |
||
| 60 | gr_scanline(canvas, left, right, i, color); |
||
| 61 | } |
||
| 62 | |||
| 63 | } |