| 1 |
/* Emacs style mode select -*- C -*- |
| 2 |
*----------------------------------------------------------------------------- |
| 3 |
* |
| 4 |
* |
| 5 |
* PrBoom: a Doom port merged with LxDoom and LSDLDoom |
| 6 |
* based on BOOM, a modified and improved DOOM engine |
| 7 |
* Copyright (C) 1999 by |
| 8 |
* id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman |
| 9 |
* Copyright (C) 1999-2000 by |
| 10 |
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze |
| 11 |
* Copyright 2005, 2006 by |
| 12 |
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko |
| 13 |
* |
| 14 |
* This program is free software; you can redistribute it and/or |
| 15 |
* modify it under the terms of the GNU General Public License |
| 16 |
* as published by the Free Software Foundation; either version 2 |
| 17 |
* of the License, or (at your option) any later version. |
| 18 |
* |
| 19 |
* This program is distributed in the hope that it will be useful, |
| 20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
* GNU General Public License for more details. |
| 23 |
* |
| 24 |
* You should have received a copy of the GNU General Public License |
| 25 |
* along with this program; if not, write to the Free Software |
| 26 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 27 |
* 02111-1307, USA. |
| 28 |
* |
| 29 |
* DESCRIPTION: none |
| 30 |
* |
| 31 |
*-----------------------------------------------------------------------------*/ |
| 32 |
|
| 33 |
#ifndef __HULIB__ |
| 34 |
#define __HULIB__ |
| 35 |
|
| 36 |
#include "v_video.h" //jff 2/16/52 include color range defs |
| 37 |
|
| 38 |
#include "dsda/font.h" |
| 39 |
|
| 40 |
/* background and foreground screen numbers |
| 41 |
* different from other modules. */ |
| 42 |
//e6y #define BG 1 |
| 43 |
#define FG 0 |
| 44 |
|
| 45 |
#define HU_MAXLINELENGTH 80 |
| 46 |
|
| 47 |
// Text Line widget |
| 48 |
typedef struct |
| 49 |
{ |
| 50 |
// left-justified position of scrolling text window |
| 51 |
int x; |
| 52 |
int y; |
| 53 |
|
| 54 |
const patchnum_t* f; // font |
| 55 |
int sc; // start character |
| 56 |
//const char *cr; //jff 2/16/52 output color range |
| 57 |
// Proff - Made this an int again. Needed for OpenGL |
| 58 |
int cm; //jff 2/16/52 output color range |
| 59 |
|
| 60 |
// killough 1/23/98: Support multiple lines: |
| 61 |
#define MAXLINES 25 |
| 62 |
|
| 63 |
int linelen; |
| 64 |
char l[HU_MAXLINELENGTH*MAXLINES+1]; // line of text |
| 65 |
int len; // current line length |
| 66 |
|
| 67 |
// e6y: wide-res |
| 68 |
enum patch_translation_e flags; |
| 69 |
|
| 70 |
int line_height; |
| 71 |
int space_width; |
| 72 |
} hu_textline_t; |
| 73 |
|
| 74 |
// |
| 75 |
// textline code |
| 76 |
// |
| 77 |
|
| 78 |
// clear a line of text |
| 79 |
void HUlib_clearTextLine(hu_textline_t *t); |
| 80 |
|
| 81 |
void HUlib_initTextLine |
| 82 |
( |
| 83 |
hu_textline_t *t, |
| 84 |
int x, |
| 85 |
int y, |
| 86 |
const dsda_font_t *f, |
| 87 |
int cm, //jff 2/16/98 add color range parameter |
| 88 |
enum patch_translation_e flags |
| 89 |
); |
| 90 |
|
| 91 |
// returns success |
| 92 |
dboolean HUlib_addCharToTextLine(hu_textline_t *t, char ch); |
| 93 |
|
| 94 |
// draws tline |
| 95 |
void HUlib_drawTextLine(hu_textline_t *l, dboolean drawcursor); |
| 96 |
void HUlib_drawOffsetTextLine(hu_textline_t* l, int offset); |
| 97 |
|
| 98 |
//e6y |
| 99 |
void HUlib_setTextXCenter(hu_textline_t* t); |
| 100 |
|
| 101 |
char HUlib_Color(int cm); |
| 102 |
|
| 103 |
#endif |