本文整理汇总了C++中DataLoader::IsFileSystemEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ DataLoader::IsFileSystemEnabled方法的具体用法?C++ DataLoader::IsFileSystemEnabled怎么用?C++ DataLoader::IsFileSystemEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataLoader
的用法示例。
在下文中一共展示了DataLoader::IsFileSystemEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
if (image.Width() && image.Height())
disp_view->AddImage( &image,
color,
Video::BLEND_ALPHA,
event_rect,
event_point.y,
event_point.x,
event_point.z);
}
}
}
break;
case FIRE_WEAPON:
if (ship) {
// fire single weapon:
if (event_param[0] >= 0) {
ship->FireWeapon(event_param[0]);
}
// fire all weapons:
else {
ListIter<WeaponGroup> g_iter = ship->Weapons();
while (++g_iter) {
ListIter<Weapon> w_iter = g_iter->GetWeapons();
while (++w_iter) {
Weapon* w = w_iter.value();
w->Fire();
}
}
}
}
break;
default:
break;
}
sim->ProcessEventTrigger(TRIGGER_EVENT, id);
if (!silent && !sound && event_sound.length()) {
DataLoader* loader = DataLoader::GetLoader();
bool use_fs = loader->IsFileSystemEnabled();
DWORD flags = pan ? Sound::LOCKED|Sound::LOCALIZED :
Sound::LOCKED|Sound::AMBIENT;
loader->UseFileSystem(true);
loader->SetDataPath("Sounds/");
loader->LoadSound(event_sound, sound, flags);
loader->SetDataPath(0);
if (!sound) {
loader->SetDataPath("Mods/Sounds/");
loader->LoadSound(event_sound, sound, flags);
loader->SetDataPath(0);
}
if (!sound) {
loader->LoadSound(event_sound, sound, flags);
}
loader->UseFileSystem(use_fs);
// fire and forget:
if (sound) {
if (sound->GetFlags() & Sound::STREAMED) {
sound->SetFlags(flags | sound->GetFlags());
sound->SetVolume(AudioConfig::VoxVolume());
sound->Play();
}
else {
sound->SetFlags(flags);
sound->SetVolume(AudioConfig::VoxVolume());
sound->SetPan(pan);
sound->SetFilename(event_sound);
sound->AddToSoundCard();
sound->Play();
}
}
}
status = COMPLETE;
if (end_mission) {
StarServer* server = StarServer::GetInstance();
if (stars) {
stars->EndMission();
}
else if (server) {
// end mission event uses event_target member
// to forward server to next mission in the chain:
if (event_target.length())
server->SetNextMission(event_target);
server->SetGameMode(StarServer::MENU_MODE);
}
}
}
示例2: if
void
MusicDirector::ScanTracks()
{
DataLoader* loader = DataLoader::GetLoader();
bool old_file_system = loader->IsFileSystemEnabled();
loader->UseFileSystem(true);
loader->SetDataPath("Music/");
List<Text> files;
loader->ListFiles("*.ogg", files, true);
if (files.size() == 0) {
loader->UseFileSystem(old_file_system);
no_music = true;
return;
}
no_music = false;
ListIter<Text> iter = files;
while (++iter) {
Text* name = iter.value();
Text* file = new(__FILE__,__LINE__) Text("Music/");
name->setSensitive(false);
file->append(*name);
if (name->indexOf("Menu") == 0) {
menu_tracks.append(file);
}
else if (name->indexOf("Intro") == 0) {
intro_tracks.append(file);
}
else if (name->indexOf("Brief") == 0) {
brief_tracks.append(file);
}
else if (name->indexOf("Debrief") == 0) {
debrief_tracks.append(file);
}
else if (name->indexOf("Promot") == 0) {
promote_tracks.append(file);
}
else if (name->indexOf("Flight") == 0) {
flight_tracks.append(file);
}
else if (name->indexOf("Combat") == 0) {
combat_tracks.append(file);
}
else if (name->indexOf("Launch") == 0) {
launch_tracks.append(file);
}
else if (name->indexOf("Recovery") == 0) {
recovery_tracks.append(file);
}
else if (name->indexOf("Victory") == 0) {
victory_tracks.append(file);
}
else if (name->indexOf("Defeat") == 0) {
defeat_tracks.append(file);
}
else if (name->indexOf("Credit") == 0) {
credit_tracks.append(file);
}
else {
menu_tracks.append(file);
}
delete iter.removeItem();
}
loader->UseFileSystem(old_file_system);
menu_tracks.sort();
intro_tracks.sort();
brief_tracks.sort();
debrief_tracks.sort();
promote_tracks.sort();
flight_tracks.sort();
combat_tracks.sort();
launch_tracks.sort();
recovery_tracks.sort();
victory_tracks.sort();
defeat_tracks.sort();
credit_tracks.sort();
}