1 /*
2     C-Dogs SDL
3     A port of the legendary (and fun) action/arcade cdogs.
4     Copyright (C) 1995 Ronny Wester
5     Copyright (C) 2003 Jeremy Chin
6     Copyright (C) 2003-2007 Lucas Martin-King
7 
8     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 2 of the License, or
11     (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     You should have received a copy of the GNU General Public License
19     along with this program; if not, write to the Free Software
20     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 */
22 #include "pics.h"
23 
24 #include <stdlib.h>
25 
26 
IntWallType(const int i)27 const char *IntWallType(const int i)
28 {
29 	static const char *wallTypes[] = {
30 		"o", "w", "e", "n", "s", "nw", "ne", "sw", "se",
31 		"wt", "et", "nt", "st", "v", "h", "x"
32 	};
33 	return wallTypes[i];
34 }
IntWallStyle(const int i)35 const char *IntWallStyle(const int i)
36 {
37 	static const char *wallStyles[] = {
38 		"steel", "brick", "carbon", "steelwood", "stone", "plasteel",
39 		"granite"
40 	};
41 	return wallStyles[abs(i) % WALL_STYLE_COUNT];
42 }
43 
IntTileType(const int i)44 const char *IntTileType(const int i)
45 {
46 	static const char *tileTypes[] = { "shadow", "normal", "alt1", "alt2" };
47 	return tileTypes[abs(i) % FLOOR_TYPES];
48 }
IntFloorStyle(const int i)49 const char *IntFloorStyle(const int i)
50 {
51 	static const char *floorStyles[] = {
52 		"recessed", "tile", "dirt", "flat", "striped", "smallsquare", "stone",
53 		"wood", "biggrid", "grid"
54 	};
55 	return floorStyles[abs(i) % FLOOR_STYLE_COUNT];
56 }
57 // Note: room styles subtly different from floor styles
IntRoomStyle(const int i)58 const char *IntRoomStyle(const int i)
59 {
60 	static const char *roomStyles[] = {
61 		"recessed", "tile", "dirt", "flat", "striped", "smallsquare", "stone",
62 		"wood", "grid", "biggrid", "checker"
63 	};
64 	return roomStyles[abs(i) % ROOM_STYLE_COUNT];
65 }
66