1 /* 2 3 Copyright (C) 2015-2018 Night Dive Studios, LLC. 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 */ 19 /* 20 * $Source: n:/project/lib/src/2d/RCS/fl8pnt.c $ 21 * $Revision: 1.4 $ 22 * $Author: kaboom $ 23 * $Date: 1993/10/19 09:50:51 $ 24 * 25 * Routines for drawing points into a flat 8 canvas. 26 * 27 * This file is part of the 2d library. 28 * 29 * $Log: fl8pnt.c $ 30 * Revision 1.4 1993/10/19 09:50:51 kaboom 31 * Replaced #include <grd.h" with new headers split from grd.h. 32 * 33 * Revision 1.3 1993/10/01 16:00:46 kaboom 34 * Converted to include clpcon.h instead of clip.h 35 * 36 * Revision 1.2 1993/05/16 00:33:03 kaboom 37 * Fixed clipped case to handle new padded clipping rectangle. 38 * 39 * Revision 1.1 1993/02/16 14:16:27 kaboom 40 * Initial revision 41 */ 42 43 #include "clpcon.h" 44 #include "cnvdat.h" 45 flat8_upoint(short x,short y)46void flat8_upoint(short x, short y) { 47 uchar *p; 48 49 p = grd_bm.bits + y * grd_bm.row + x; 50 *p = grd_gc.fcolor; 51 } 52 flat8_point(short x,short y)53int flat8_point(short x, short y) { 54 uchar *p; 55 56 if (x < grd_clip.left || x >= grd_clip.right || y < grd_clip.top || y >= grd_clip.bot) 57 return CLIP_ALL; 58 59 p = grd_bm.bits + grd_bm.row * y + x; 60 *p = grd_gc.fcolor; 61 return CLIP_NONE; 62 } 63