1 /* Copyright (C) 1996-1997 Aleksey Volynskov
2 * Copyright (C) 2011 Rambo
3 * Copyright (C) 2020 SovietPony
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3 of the License ONLY.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
19 #include <stdio.h>
20 #include <string.h>
21 #include <stdlib.h>
22 #include <assert.h>
29 #ifdef UNIX
30 # include <sys/stat.h>
31 #endif
55 }
58 }
61 }
62 }
67 }
74 }
78 }
84 }
86 }
90 }
92 // Get sprite resource id.
93 // Sprite name has following format:
94 // (nnnn)('A'+s)('0'+d)[('A'+s)('0'+d)]
95 // Letter means animation frame
96 // A for first, B for second...
97 // Number means direction
98 // 0 = front
99 // 1 = left
100 // 2 = right
101 // Optional part means that this file can be used for differnt frame/direction.
102 // Note that if found FRONT direction for this frame than it UNCONDITIONALLY used.
103 // Note that search performed between markers S_START and S_END in order as paced in wad.
104 // int n[4] -- sprite name
105 // int s -- sprite frame
106 // int d -- sprite direction
107 // char *dir -- out flag "alternative used" (
121 }
123 }
124 }
125 }
128 }
132 }
134 /*
135 void F_nextmus (char *s) {
136 int i = F_findres(s);
137 if (i <= m_start || i >= m_end) {
138 i = m_start;
139 }
140 for (++i; ; ++i) {
141 if (i >= m_end) {
142 i = m_start + 1;
143 }
144 WADRES_getname(i, s);
145 if (cp866_strcasecmp(s, "MENU") == 0 ||
146 cp866_strcasecmp(s, "INTERMUS") == 0 ||
147 cp866_strcasecmp(s, "\x8a\x8e\x8d\x85\x96\x0") == 0) {
148 continue;
149 }
150 if (cp866_strncasecmp(s, "DMI", 3) != 0) {
151 break;
152 }
153 }
154 }
156 void F_randmus (char *s) {
157 int i;
158 int n = myrand(10);
159 for (i = 0; i < n; i++) {
160 F_nextmus(s);
161 }
162 }
163 */
173 }
176 }
177 }
183 #ifdef UNIX
189 }
192 #else
194 #endif
196 }
199 FILE_Stream rd;
206 }
211 }
212 }
213 }
216 FILE_Stream rd;
221 }
222 }
225 FILE_Stream wr;
230 }
231 }