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 static const char cvsid
[] =
21 "$Id: main.c,v 1.60 2003/11/27 22:11:57 nsubtil Exp $";
45 int parse_resolution(char *res
, int *w
, int *h
, int *bpp
)
50 snprintf(res_copy
, sizeof(res_copy
)-1, "%s", res
);
51 p
= strtok(res_copy
, "x");
58 p
= strtok(NULL
, "x");
65 p
= strtok(NULL
, "x");
75 printf("Could not parse resolution '%s'\n", res
);
80 int main(int argc
, char **argv
)
83 int width
= 800, height
= 600, bpp
= 32, fullscreen
= 0;
86 while ((opt
= getopt(argc
, argv
, "fwr:q")) != EOF
) {
98 if (parse_resolution(optarg
, &width
, &height
,
101 printf("Set resolution to %dx%dx%d\n",
105 fprintf(stderr
, "Invalid command line option: %c\n",
115 render_reshape_window(screen->w, screen->h);
118 srand(SDL_GetTicks());
120 screen_init(fullscreen
, width
, height
, bpp
);
121 audio_init(enable_sound
);
125 object_read_file("gfx/pacman-moving.3d", &last_update);
126 object_read_file("gfx/pacman-dying.3d", &last_update);
127 object_read_file("gfx/pacman-stopped.3d", &last_update);
128 object_read_file("gfx/ghost-green-moving.3d", &last_update);
129 object_read_file("gfx/ghost-green-dying.3d", &last_update);
130 object_read_file("gfx/ghost-green-returning.3d", &last_update);
133 if(argc
> 1 && strcmp(argv
[1], "--server") == 0)
136 if(argc
> 1 && strcmp(argv
[1], "--connect") == 0)
137 net_client_init(argv
[2]);