本文整理汇总了C++中SpriteCache::initFile方法的典型用法代码示例。如果您正苦于以下问题:C++ SpriteCache::initFile方法的具体用法?C++ SpriteCache::initFile怎么用?C++ SpriteCache::initFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpriteCache
的用法示例。
在下文中一共展示了SpriteCache::initFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: engine_init_sprites
int engine_init_sprites()
{
Out::FPrint("Initialize sprites");
if (spriteset.initFile ("acsprset.spr"))
{
platform->FinishedUsingGraphicsMode();
allegro_exit();
proper_exit=1;
platform->DisplayAlert("Could not load sprite set file ACSPRSET.SPR\n"
"This means that the file is missing or there is not enough free\n"
"system memory to load the file.\n");
return EXIT_NORMAL;
}
return RETURN_CONTINUE;
}
示例2: RunAGSGame
int RunAGSGame (const char *newgame, unsigned int mode, int data) {
can_run_delayed_command();
int AllowedModes = RAGMODE_PRESERVEGLOBALINT | RAGMODE_LOADNOW;
if ((mode & (~AllowedModes)) != 0)
quit("!RunAGSGame: mode value unknown");
if (use_compiled_folder_as_current_dir || editor_debugging_enabled)
{
quit("!RunAGSGame cannot be used while running the game from within the AGS Editor. You must build the game EXE and run it from there to use this function.");
}
if ((mode & RAGMODE_LOADNOW) == 0) {
// need to copy, since the script gets destroyed
get_current_dir_path(gamefilenamebuf, newgame);
game_file_name = gamefilenamebuf;
usetup.main_data_filename = game_file_name;
play.takeover_data = data;
load_new_game_restore = -1;
if (inside_script) {
curscript->queue_action(ePSARunAGSGame, mode | RAGMODE_LOADNOW, "RunAGSGame");
ccInstance::GetCurrentInstance()->Abort();
}
else
load_new_game = mode | RAGMODE_LOADNOW;
return 0;
}
int result, ee;
unload_old_room();
displayed_room = -10;
unload_game_file();
if (Common::AssetManager::SetDataFile(game_file_name) != Common::kAssetNoError)
quitprintf("!RunAGSGame: unable to load new game file '%s'", game_file_name.GetCStr());
Bitmap *ds = GetVirtualScreen();
ds->Fill(0);
show_preload();
if ((result = load_game_file ()) != 0) {
quitprintf("!RunAGSGame: error %d loading new game file", result);
}
spriteset.reset();
if (spriteset.initFile ("acsprset.spr"))
quit("!RunAGSGame: error loading new sprites");
if ((mode & RAGMODE_PRESERVEGLOBALINT) == 0) {
// reset GlobalInts
for (ee = 0; ee < MAXGSVALUES; ee++)
play.globalscriptvars[ee] = 0;
}
init_game_settings();
play.screen_is_faded_out = 1;
if (load_new_game_restore >= 0) {
load_game (load_new_game_restore);
load_new_game_restore = -1;
}
else
start_game();
return 0;
}