diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-19 03:50:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-19 03:50:21 +0300 |
commit | d9de6fca6cda2a7ddeeb936692b529182a14dec9 (patch) | |
tree | 63b5384fe03297bdfb40205c280b36ec043d0ed1 /source/gameengine/GamePlayer/ghost | |
parent | ea81c58429ecd51752e2abb7d756ef1d09514b84 (diff) |
2.5: Change blenloader module to use the Report system for reporting errors.
Diffstat (limited to 'source/gameengine/GamePlayer/ghost')
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 0bf0317d8f2..8293cfeb36d 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -58,6 +58,7 @@ extern "C" #include "BKE_global.h" #include "BKE_icons.h" #include "BKE_node.h" +#include "BKE_report.h" #include "BLI_blenlib.h" #include "DNA_scene_types.h" #include "BLO_readfile.h" @@ -251,35 +252,33 @@ static void get_filename(int argc, char **argv, char *filename) #endif // !_APPLE } -static BlendFileData *load_game_data(char *progname, char *filename = NULL, char *relativename = NULL) { - BlendReadError error; +static BlendFileData *load_game_data(char *progname, char *filename = NULL, char *relativename = NULL) +{ + ReportList reports; BlendFileData *bfd = NULL; + + BKE_reports_init(&reports, RPT_STORE); /* try to load ourself, will only work if we are a runtime */ if (blo_is_a_runtime(progname)) { - bfd= blo_read_runtime(progname, &error); + bfd= blo_read_runtime(progname, &reports); if (bfd) { bfd->type= BLENFILETYPE_RUNTIME; strcpy(bfd->main->name, progname); } } else { - bfd= BLO_read_from_file(progname, &error); - } - - /* - if (bfd && bfd->type == BLENFILETYPE_BLEND) { - BLO_blendfiledata_free(bfd); - bfd = NULL; - error = BRE_NOT_A_PUBFILE; + bfd= BLO_read_from_file(progname, &reports); } - */ if (!bfd && filename) { bfd = load_game_data(filename); if (!bfd) { - printf("Loading %s failed: %s\n", filename, BLO_bre_as_string(error)); + printf("Loading %s failed: ", filename); + BKE_reports_print(&reports, RPT_ERROR); } } + + BKE_reports_clear(&reports); return bfd; } |