本文整理汇总了C++中SpriteCache::precache方法的典型用法代码示例。如果您正苦于以下问题:C++ SpriteCache::precache方法的具体用法?C++ SpriteCache::precache怎么用?C++ SpriteCache::precache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpriteCache
的用法示例。
在下文中一共展示了SpriteCache::precache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: precache_view
void precache_view(int view)
{
if (view < 0)
return;
for (int i = 0; i < views[view].numLoops; i++) {
for (int j = 0; j < views[view].loops[i].numFrames; j++)
spriteset.precache (views[view].loops[i].frames[j].pic);
}
}
示例2: init_game_settings
void init_game_settings() {
int ee;
for (ee=0;ee<256;ee++) {
if (game.paluses[ee]!=PAL_BACKGROUND)
palette[ee]=game.defpal[ee];
}
if (game.options[OPT_NOSCALEFNT]) wtext_multiply=1;
for (ee = 0; ee < game.numcursors; ee++)
{
// The cursor graphics are assigned to mousecurs[] and so cannot
// be removed from memory
if (game.mcurs[ee].pic >= 0)
spriteset.precache (game.mcurs[ee].pic);
// just in case they typed an invalid view number in the editor
if (game.mcurs[ee].view >= game.numviews)
game.mcurs[ee].view = -1;
if (game.mcurs[ee].view >= 0)
precache_view (game.mcurs[ee].view);
}
// may as well preload the character gfx
if (playerchar->view >= 0)
precache_view (playerchar->view);
for (ee = 0; ee < MAX_INIT_SPR; ee++)
objcache[ee].image = NULL;
/* dummygui.guiId = -1;
dummyguicontrol.guin = -1;
dummyguicontrol.objn = -1;*/
our_eip=-6;
// game.chars[0].talkview=4;
//init_language_text(game.langcodes[0]);
for (ee = 0; ee < MAX_INIT_SPR; ee++) {
scrObj[ee].id = ee;
// 64 bit: Using the id instead
// scrObj[ee].obj = NULL;
}
for (ee=0;ee<game.numcharacters;ee++) {
memset(&game.chars[ee].inv[0],0,MAX_INV*sizeof(short));
game.chars[ee].activeinv=-1;
game.chars[ee].following=-1;
game.chars[ee].followinfo=97 | (10 << 8);
game.chars[ee].idletime=20; // can be overridden later with SetIdle or summink
game.chars[ee].idleleft=game.chars[ee].idletime;
game.chars[ee].transparency = 0;
game.chars[ee].baseline = -1;
game.chars[ee].walkwaitcounter = 0;
game.chars[ee].z = 0;
charextra[ee].xwas = INVALID_X;
charextra[ee].zoom = 100;
if (game.chars[ee].view >= 0) {
// set initial loop to 0
game.chars[ee].loop = 0;
// or to 1 if they don't have up/down frames
if (views[game.chars[ee].view].loops[0].numFrames < 1)
game.chars[ee].loop = 1;
}
charextra[ee].process_idle_this_time = 0;
charextra[ee].invorder_count = 0;
charextra[ee].slow_move_counter = 0;
charextra[ee].animwait = 0;
}
// multiply up gui positions
guibg = (Bitmap **)malloc(sizeof(Bitmap *) * game.numgui);
guibgbmp = (IDriverDependantBitmap**)malloc(sizeof(IDriverDependantBitmap*) * game.numgui);
for (ee=0;ee<game.numgui;ee++) {
guibg[ee] = NULL;
guibgbmp[ee] = NULL;
}
our_eip=-5;
for (ee=0;ee<game.numinvitems;ee++) {
if (game.invinfo[ee].flags & IFLG_STARTWITH) playerchar->inv[ee]=1;
else playerchar->inv[ee]=0;
}
play.score=0;
play.sierra_inv_color=7;
play.talkanim_speed = 5;
play.inv_item_wid = 40;
play.inv_item_hit = 22;
play.messagetime=-1;
play.disabled_user_interface=0;
play.gscript_timer=-1;
play.debug_mode=game.options[OPT_DEBUGMODE];
play.inv_top=0;
play.inv_numdisp=0;
play.obsolete_inv_numorder=0;
play.text_speed=15;
play.text_min_display_time_ms = 1000;
play.ignore_user_input_after_text_timeout_ms = 500;
play.ignore_user_input_until_time = 0;
play.lipsync_speed = 15;
//.........这里部分代码省略.........