forked from ViewTouch/viewtouch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimage_data.cc
More file actions
130 lines (118 loc) · 2.92 KB
/
Copy pathimage_data.cc
File metadata and controls
130 lines (118 loc) · 2.92 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
* Copyright ViewTouch, Inc., 1995, 1996, 1997, 1998
* This program 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 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
* image_data.cc - revision 25 (9/7/98)
* implementation of image_data module
*/
#include "basic.hh"
#include "image_data.hh"
#ifdef DMALLOC
#include <dmalloc.h>
#endif
/**** Textures ****/
#include "xpm/darksand-6.xpm"
#include "xpm/darkwood-10.xpm"
#include "xpm/grayparchment-8.xpm"
#include "xpm/graymarble-12.xpm"
#include "xpm/greenmarble-12.xpm"
#include "xpm/litewood-8.xpm"
#include "xpm/litsand-6.xpm"
#include "xpm/sand-8.xpm"
#include "xpm/wood-10.xpm"
#include "xpm/canvas-8.xpm"
#include "xpm/pearl-8.xpm"
#include "xpm/parchment-6.xpm"
#include "xpm/tanparchment-8.xpm"
#include "xpm/smoke-4.xpm"
#include "xpm/leather-8.xpm"
#include "xpm/gradient-8.xpm"
#include "xpm/black.xpm"
#include "xpm/gradient-brown.xpm"
#include "xpm/blueparchment.xpm"
#include "xpm/greySand.xpm"
#include "xpm/whiteMesh.xpm"
/**** Image Values ****/
int ImageValue[] = {
IMAGE_SAND,
IMAGE_LIT_SAND,
IMAGE_DARK_SAND,
IMAGE_LITE_WOOD,
IMAGE_WOOD,
IMAGE_DARK_WOOD,
IMAGE_GRAY_PARCHMENT,
IMAGE_GRAY_MARBLE,
IMAGE_GREEN_MARBLE,
IMAGE_PARCHMENT,
IMAGE_PEARL,
IMAGE_CANVAS,
IMAGE_TAN_PARCHMENT,
IMAGE_SMOKE,
IMAGE_LEATHER,
IMAGE_BLUE_PARCHMENT,
IMAGE_GRADIENT,
IMAGE_GRADIENTBROWN,
IMAGE_BLACK,
IMAGE_GREYSAND,
IMAGE_WHITEMESH,
-1};
const char* *ImageData[] = {
SandData,
LitSandData,
DarkSandData,
LiteWoodData,
WoodData,
DarkWoodData,
GrayParchmentData,
GrayMarbleData,
GreenMarbleData,
ParchmentData,
PearlData,
CanvasData,
TanParchmentData,
smokeData,
LeatherData,
BlueParchementData,
gradient_8_xpm,
gradient_brown_xpm,
black_xpm,
greySand,
whiteMesh,
NULL};
/**** Functions ****/
int ImageColorsUsed()
{
int colors = 0;
int tmp;
int c;
for (int i = 0; ImageData[i] != NULL; ++i)
{
sscanf(ImageData[i][0], "%d %d %d", &tmp, &tmp, &c);
colors += c;
}
return colors;
}
int ImageWidth(int image)
{
int width = 0;
sscanf(ImageData[image][0], "%d", &width);
return width;
}
int ImageHeight(int image)
{
int height = 0;
int tmp;
sscanf(ImageData[image][0], "%d %d", &tmp, &height);
return height;
}