| 1 | /* |
| 2 | C-Dogs SDL |
| 3 | A port of the legendary (and fun) action/arcade cdogs. |
| 4 | Copyright (C) 2003-2007 Lucas Martin-King |
| 5 | |
| 6 | This program is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 2 of the License, or |
| 9 | (at your option) any later version. |
| 10 | |
| 11 | This program is distributed in the hope that it will be useful, |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | GNU General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU General Public License |
| 17 | along with this program; if not, write to the Free Software |
| 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | |
| 20 | This file incorporates work covered by the following copyright and |
| 21 | permission notice: |
| 22 | |
| 23 | Copyright (c) 2013-2014, 2018-2019 Cong Xu |
| 24 | All rights reserved. |
| 25 | |
| 26 | Redistribution and use in source and binary forms, with or without |
| 27 | modification, are permitted provided that the following conditions are met: |
| 28 | |
| 29 | Redistributions of source code must retain the above copyright notice, this |
| 30 | list of conditions and the following disclaimer. |
| 31 | Redistributions in binary form must reproduce the above copyright notice, |
| 32 | this list of conditions and the following disclaimer in the documentation |
| 33 | and/or other materials provided with the distribution. |
| 34 | |
| 35 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 36 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 37 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 38 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 39 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 40 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 41 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 42 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 43 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 44 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 45 | POSSIBILITY OF SUCH DAMAGE. |
| 46 | */ |
| 47 | #pragma once |
| 48 | |
| 49 | #include "grafx.h" |
| 50 | |
| 51 | void DrawPoint(const struct vec2i pos, const color_t c); |
| 52 | void Draw_Line( |
| 53 | const int x1, const int y1, const int x2, const int y2, color_t c); |
| 54 | void DrawLine(const struct vec2i from, const struct vec2i to, color_t c); |
| 55 | |
| 56 | #define PixelIndex(x, y, w, h) (y * w + x) |
| 57 | |
| 58 | void DrawRectangle( |
| 59 | GraphicsDevice *g, const struct vec2i pos, const struct vec2i size, |
| 60 | const color_t color, const bool filled); |
| 61 | |
| 62 | // * |
| 63 | // *** |
| 64 | // * |
| 65 | void DrawCross(GraphicsDevice *g, const struct vec2i pos, const color_t c); |
| 66 | |
| 67 | // Note: shadow is centered, size is half-size |
| 68 | void DrawShadow( |
| 69 | GraphicsDevice *g, const struct vec2i pos, const struct vec2 scale, |
| 70 | const color_t mask); |