diff -ur ScummVM-cvs20021111/tools/simon2mp3.c ScummVM-cvs20021111+hack/tools/simon2mp3.c
old
|
new
|
|
168 | 168 | |
169 | 169 | void get_wav(void) { |
170 | 170 | int length; |
171 | | int i; |
172 | 171 | FILE *f; |
173 | 172 | char fbuf[2048]; |
174 | | char fbuf_o[4096]; |
175 | 173 | int size; |
176 | 174 | char wavname[256]; |
177 | 175 | char mp3name[256]; |
… |
… |
|
179 | 177 | fseek(input, -4, SEEK_CUR); |
180 | 178 | length = get_int(); |
181 | 179 | length += 8; |
| 180 | fseek(input, -8, SEEK_CUR); |
182 | 181 | |
183 | 182 | sprintf(wavname, "tempfile.wav"); |
184 | 183 | sprintf(mp3name, oggmode ? "tempfile.ogg" : "tempfile.mp3"); |
… |
… |
|
189 | 188 | if (size <= 0) |
190 | 189 | break; |
191 | 190 | length -= size; |
192 | | for (i = 0; i < size; i++) { |
193 | | fbuf_o[2 * i] = fbuf[i] ^ 0x80; |
194 | | fbuf_o[2 * i + 1] = 0; |
195 | | } |
196 | | fwrite(fbuf_o, 1, 2 * size, f); |
| 191 | fwrite(fbuf, 1, size, f); |
197 | 192 | } |
198 | 193 | fclose(f); |
199 | 194 | |