Clean up the array copying for the new high scores list. It was way
[attac-man.git] / 3dsconv.c
blob0337102c9d196ae22c607fe1860520e37e23ab9b
1 /*
2 Pacman Arena
3 Copyright (C) 2003 Nuno Subtil
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifdef _WIN32
21 #include <windows.h>
22 #endif
24 #include <GL/gl.h>
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <string.h>
29 #include "object.h"
30 #include "tds.h"
32 static const char cvsid[] =
33 "$Id: 3dsconv.c,v 1.16 2003/07/19 01:10:17 nsubtil Exp $";
35 void convert(char *format, char *out, int start, int end)
37 char fname[100];
38 int c;
39 struct object *objects;
41 objects = malloc(sizeof(struct object) * (end - start + 1));
42 printf("%s (%d frames):\n", out, end - start + 1);
44 for(c = 0; c < end - start + 1; c++)
46 struct object *tmp;
48 sprintf(fname, format, c + start);
49 tmp = tds_load(fname);
50 memcpy(&objects[c], tmp, sizeof(struct object));
53 object_write_file(out, objects, end - start + 1);
55 printf("\n");
58 int main(int argc, char **argv)
60 convert("3ds/wall-vertical.3ds", "gfx/wall-vertical.3d", 0, 0);
61 convert("3ds/wall-horizontal.3ds", "gfx/wall-horizontal.3d", 0, 0);
62 convert("3ds/wall-ul.3ds", "gfx/wall-ul.3d", 0, 0);
63 convert("3ds/wall-ur.3ds", "gfx/wall-ur.3d", 0, 0);
64 convert("3ds/wall-lr.3ds", "gfx/wall-lr.3d", 0, 0);
65 convert("3ds/wall-ll.3ds", "gfx/wall-ll.3d", 0, 0);
66 convert("3ds/bomb.3ds", "gfx/bomb.3d", 0, 0);
67 convert("3ds/rocket.3ds", "gfx/rocket.3d", 0, 0);
69 convert("3ds/pacman-moving-%d.3ds", "gfx/pacman-moving.3d", 0, 29);
70 convert("3ds/pacman-stopped-%d.3ds", "gfx/pacman-stopped.3d", 30, 59);
71 convert("3ds/pacman-dying-%d.3ds", "gfx/pacman-dying.3d", 60, 99);
72 convert("3ds/pacman-jumping-%d.3ds", "gfx/pacman-jumping.3d", 101, 130);
73 convert("3ds/ghost-green-moving-%d.3ds", "gfx/ghost-green-moving.3d", 0, 29);
74 convert("3ds/ghost-green-dying-%d.3ds", "gfx/ghost-green-dying.3d", 30, 64);
75 convert("3ds/ghost-green-returning-%d.3ds", "gfx/ghost-green-returning.3d", 65, 90);
77 return 0;