projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Got rid of a superfluous debug message
[supertux.git]
/
src
/
main.cpp
diff --git
a/src/main.cpp
b/src/main.cpp
index
a8aab06
..
3f43c6f
100644
(file)
--- a/
src/main.cpp
+++ b/
src/main.cpp
@@
-25,13
+25,11
@@
#include <stdexcept>
#include <sstream>
#include <stdexcept>
#include <sstream>
-#include <
time.h
>
-#include <
stdlib.h
>
+#include <
ctime
>
+#include <
cstdlib
>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <dirent.h>
#include <unistd.h>
#include <unistd.h>
-#include <assert.h>
#include <physfs.h>
#include <SDL.h>
#include <SDL_image.h>
#include <physfs.h>
#include <SDL.h>
#include <SDL_image.h>
@@
-176,17
+174,21
@@
static void init_physfs(const char* argv0)
}
#endif
}
#endif
+#ifdef _WIN32
+ PHYSFS_addToSearchPath(".\\data", 1);
+#endif
+
if(!sourcedir) {
#if defined(APPDATADIR) || defined(ENABLE_BINRELOC)
std::string datadir;
#ifdef ENABLE_BINRELOC
char* dir;
if(!sourcedir) {
#if defined(APPDATADIR) || defined(ENABLE_BINRELOC)
std::string datadir;
#ifdef ENABLE_BINRELOC
char* dir;
- br_init (NULL);
- dir = br_find_data_dir(APPDATADIR);
+ br_init (NULL);
+ dir = br_find_data_dir(APPDATADIR);
datadir = dir;
datadir += "/" PACKAGE_NAME;
datadir = dir;
datadir += "/" PACKAGE_NAME;
- free(dir);
+ free(dir);
#else
datadir = APPDATADIR;
#else
datadir = APPDATADIR;
@@
-201,8
+203,10
@@
static void init_physfs(const char* argv0)
PHYSFS_permitSymbolicLinks(1);
//show search Path
PHYSFS_permitSymbolicLinks(1);
//show search Path
- for(char** i = PHYSFS_getSearchPath(); *i != NULL; i++)
+ char** searchpath = PHYSFS_getSearchPath();
+ for(char** i = searchpath; *i != NULL; i++)
log_info << "[" << *i << "] is in the search path" << std::endl;
log_info << "[" << *i << "] is in the search path" << std::endl;
+ PHYSFS_freeList(searchpath);
}
static void print_usage(const char* argv0)
}
static void print_usage(const char* argv0)
@@
-338,11
+342,10
@@
static void init_sdl()
static void init_rand()
{
static void init_rand()
{
- const char *how = config->random_seed? ", user fixed.": ", from time().";
-
config->random_seed = systemRandom.srand(config->random_seed);
config->random_seed = systemRandom.srand(config->random_seed);
- log_info << "Using random seed " << config->random_seed << how << std::endl;
+ //const char *how = config->random_seed? ", user fixed.": ", from time().";
+ //log_info << "Using random seed " << config->random_seed << how << std::endl;
}
void init_video()
}
void init_video()
@@
-500,7
+503,9
@@
int main(int argc, char** argv)
{
int result = 0;
{
int result = 0;
+#ifndef NO_CATCH
try {
try {
+#endif
if(pre_parse_commandline(argc, argv))
return 0;
if(pre_parse_commandline(argc, argv))
return 0;
@@
-564,6
+569,7
@@
int main(int argc, char** argv)
//init_rand(); PAK: this call might subsume the above 3, but I'm chicken!
main_loop->run();
//init_rand(); PAK: this call might subsume the above 3, but I'm chicken!
main_loop->run();
+#ifndef NO_CATCH
} catch(std::exception& e) {
log_fatal << "Unexpected exception: " << e.what() << std::endl;
result = 1;
} catch(std::exception& e) {
log_fatal << "Unexpected exception: " << e.what() << std::endl;
result = 1;
@@
-571,6
+577,7
@@
int main(int argc, char** argv)
log_fatal << "Unexpected exception" << std::endl;
result = 1;
}
log_fatal << "Unexpected exception" << std::endl;
result = 1;
}
+#endif
delete main_loop;
main_loop = NULL;
delete main_loop;
main_loop = NULL;