DRAWRECT.CPP (4202B)
1 // 2 // Copyright 2020 Electronic Arts Inc. 3 // 4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 5 // software: you can redistribute it and/or modify it under the terms of 6 // the GNU General Public License as published by the Free Software Foundation, 7 // either version 3 of the License, or (at your option) any later version. 8 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 /*************************************************************************** 17 ** C O N F I D E N T I A L --- W E S T W O O D A S S O C I A T E S ** 18 *************************************************************************** 19 * * 20 * Project Name : Westwood 32 Bit Library * 21 * * 22 * File Name : DRAWRECT.C * 23 * * 24 * Programmer : Christopher Yates * 25 * * 26 * Last Update : August 20, 1993 [JLB] * 27 * * 28 *-------------------------------------------------------------------------* 29 * Functions: * 30 * Draw_Rect -- Draws a rectangle to the LogicPage. * 31 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 32 33 #ifndef GBUFFER_H 34 #include "gbuffer.h" 35 #include "misc.h" 36 #endif 37 38 /*************************************************************************** 39 * Draw_Rect -- Draws a rectangle to the LogicPage. * 40 * * 41 * This routine will draw a rectangle to the LogicPage. The rectangle * 42 * doesn't have to be aligned on the vertical or horizontal axis. In * 43 * fact, it doesn't even have to be a rectangle. The "square" can be * 44 * skewed. * 45 * * 46 * INPUT: x1_pixel, y1_pixel -- One corner. * 47 * * 48 * x2_pixel, y2_pixel -- The other corner. * 49 * * 50 * color -- The color to draw the lines. * 51 * * 52 * OUTPUT: none * 53 * * 54 * WARNINGS: None, but the rectangle will be clipped to the current * 55 * draw line clipping rectangle. * 56 * * 57 * HISTORY: * 58 * 08/20/1993 JLB : Created. * 59 *=========================================================================*/ 60 VOID GraphicViewPortClass::Draw_Rect(int x1_pixel, int y1_pixel, int x2_pixel, int y2_pixel, unsigned char color) 61 { 62 Lock(); 63 Draw_Line(x1_pixel, y1_pixel, x2_pixel, y1_pixel, color); 64 Draw_Line(x1_pixel, y2_pixel, x2_pixel, y2_pixel, color); 65 Draw_Line(x1_pixel, y1_pixel, x1_pixel, y2_pixel, color); 66 Draw_Line(x2_pixel, y1_pixel, x2_pixel, y2_pixel, color); 67 Unlock(); 68 } 69