-
Notifications
You must be signed in to change notification settings - Fork 0
/
cursesgraphics.cpp
104 lines (98 loc) · 2.58 KB
/
cursesgraphics.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
////////////////////////////////////////////////////////////////////////////////
//
//Copyright (c) 2004 by Kevin Sadler
//
////////////////////////////////////////////////////////////////////////////////
//This file is part of Liberal Crime Squad.
//
// Liberal Crime Squad is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Liberal Crime Squad is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Liberal Crime Squad; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
////////////////////////////////////////////////////////////////////////////////
/**
* \file cursesgraphics.cpp
*
* \brief Portability Functions for CP437 Code Page Graphics Characters
*
* $Author: sadler $
* $Date: 2004/08/11 18:28:38 $
* \version $Name: HEAD $ $Revision: 1.4 $
*
* $Id: cursesgraphics.cpp,v 1.4 2004/08/11 18:28:38 sadler Exp $
*
* <HR>
* \b Liberal Crime Squad
*
*
* <HR>
*
* \par Abstract
*
* Translate character codes, stored in cp437 within files in the arts directory
* into native alternative characters.
*
* <HR>
*
* \par History
*
* \par
* $Log: cursesgraphics.cpp,v $
* Revision 1.4 2004/08/11 18:28:38 sadler
* New translateGraphicsChar() routine.
* Replace NULL with an inverse video space.
*
* Revision 1.3 2004/08/08 07:49:55 sadler
* *** empty log message ***
*
* Revision 1.2 2004/07/04 11:03:03 sadler
* no message
*
* Revision 1.1 2004/07/03 07:57:49 sadler
* Curses Graphics Tests
*
*
*
*/
#ifdef WIN32
#define CH_USE_CP437
#else
#define CH_USE_ASCII_HACK
#endif
#define CURSES_GRAPHICS
#include "cursesgraphics.h"
#ifdef CH_USE_CP437
int translateGraphicsChar(int c)
{
return c;
}
#else
int translateGraphicsChar(int c)
{
// This will be no good for Unicode...
int cin = c;
int cout = cin;
// if ((cin >= 0) && (cin <32))
// {
// cout = (cin | A_ALTCHARSET);
// }
if ((cin >= 0) && (cin < 256))
{
cout = gchar[cin].native_code;
if (cout == 0)
{
cout = cin;
}
}
return cout;
}
#endif