1 // Emacs style mode select -*- C++ -*- 2 //----------------------------------------------------------------------------- 3 // 4 // $Id$ 5 // 6 // Copyright (C) 2012 by Alex Mayfield. 7 // 8 // This program is free software; you can redistribute it and/or 9 // modify it under the terms of the GNU General Public License 10 // as published by the Free Software Foundation; either version 2 11 // of the License, or (at your option) any later version. 12 // 13 // This program is distributed in the hope that it will be useful, 14 // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 // GNU General Public License for more details. 17 // 18 // DESCRIPTION: 19 // HUD drawing functions. 20 // 21 //----------------------------------------------------------------------------- 22 23 #ifndef __HU_DRAWERS_H__ 24 #define __HU_DRAWERS_H__ 25 26 #include "r_defs.h" 27 28 namespace hud { 29 30 enum x_align_t { 31 X_LEFT, X_CENTER, X_RIGHT, X_ABSOLUTE 32 }; 33 34 enum y_align_t { 35 Y_TOP, Y_MIDDLE, Y_BOTTOM, Y_ABSOLUTE 36 }; 37 38 int XSize(const float scale); 39 int YSize(const float scale); 40 void Clear(int x, int y, 41 const unsigned short w, const unsigned short h, 42 const float scale, 43 const x_align_t x_align, const y_align_t y_align, 44 const x_align_t x_origin, const y_align_t y_origin, 45 const int color); 46 void Dim(int x, int y, 47 const unsigned short w, const unsigned short h, 48 const float scale, 49 const x_align_t x_align, const y_align_t y_align, 50 const x_align_t x_origin, const y_align_t y_origin); 51 void DrawText(int x, int y, const float scale, 52 const x_align_t x_align, const y_align_t y_align, 53 const x_align_t x_origin, const y_align_t y_origin, 54 const char* str, const int color, 55 const bool force_opaque = false); 56 void DrawPatch(int x, int y, const float scale, 57 const x_align_t x_align, const y_align_t y_align, 58 const x_align_t x_origin, const y_align_t y_origin, 59 const patch_t* patch, const bool force_opaque = false, 60 const bool use_patch_offsets = false); 61 void DrawTranslatedPatch(int x, int y, const float scale, 62 const x_align_t x_align, const y_align_t y_align, 63 const x_align_t x_origin, const y_align_t y_origin, 64 const patch_t* patch, byte* translation, 65 const bool force_opaque = false, 66 const bool use_patch_offsets = false); 67 void DrawPatchStretched(int x, int y, 68 const unsigned short w, const unsigned short h, 69 const float scale, 70 const x_align_t x_align, const y_align_t y_align, 71 const x_align_t x_origin, const y_align_t y_origin, 72 const patch_t* patch, const bool force_opaque = false, 73 const bool use_patch_offsets = false); 74 void DrawPatchScaled(const int x, const int y, 75 unsigned short w, unsigned short h, 76 const float scale, 77 const x_align_t x_align, const y_align_t y_align, 78 const x_align_t x_origin, const y_align_t y_origin, 79 const patch_t* patch, const bool force_opaque = false, 80 const bool use_patch_offsets = false); 81 } 82 83 #endif 84