本文整理汇总了C++中Terrain::GetTerrain方法的典型用法代码示例。如果您正苦于以下问题:C++ Terrain::GetTerrain方法的具体用法?C++ Terrain::GetTerrain怎么用?C++ Terrain::GetTerrain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terrain
的用法示例。
在下文中一共展示了Terrain::GetTerrain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parser
Terrain *TerrainCreator::createTerrain(game::GameMap *gameMap, ui::LightManager *lightManager, ui::AmbientSoundManager *ambientSoundManager, const char *configFile)
{
/*
std::string textFileName = configFile;
textFileName += "/legacy.txt";
Parser::Parser parser(textFileName.c_str());
const Parser::string_map scene_properties = parser.GetProperties();
std::string forceMapName = Parser::GetString(scene_properties, "forceheightmap");
*/
std::string forceMapName;
Terrain *terrain = new Terrain(storm3d, scene, configFile, forceMapName.c_str(), gameMap->getAreaMap(), gameMap, lightManager, ambientSoundManager);
int memRes = game::SimpleOptions::getInt(DH_OPT_I_TERRAIN_MEMORY_RESERVE);
if (memRes < 0) memRes = 0;
int preCache = game::SimpleOptions::getInt(DH_OPT_I_TERRAIN_MEMORY_PRECACHE);
if (preCache < 0)
preCache = 0;
if (preCache > memRes)
preCache = memRes;
// terrain->GetTerrain()->SetMemoryReserve(memRes);
// terrain->GetTerrain()->SetPreCache(preCache);
std::string binFileString = configFile;
binFileString += "/scene.bin";
// These maps should really come from bin file
gameMap->setData(terrain->GetHeightMap(), terrain->GetDoubleHeightMap(), terrain->getHeightMapSize(),
terrain->getTerrainSize(), terrain->getTerrainHeight(), binFileString.c_str());
gameMap->setTerrain(terrain->GetTerrain());
// set proper maps and stuff to light amount manager
util::LightAmountManager::getInstance()->setMaps(gameMap, terrain->GetTerrain());
terrain->GetTerrain()->setObstacleHeightmap(gameMap->getObstacleHeightMap(), gameMap->getAreaMap());
// Haxhax, initialize here for now
IStorm3D_Material *shadowMaterial = storm3d->CreateNewMaterial("shadow_decal");
shadowMaterial->SetBaseTexture(storm3d->CreateNewTexture("shadow_decal.tga"));
terrain->GetTerrain()->getDecalSystem().setShadowMaterial(shadowMaterial);
return terrain;
}
示例2: process
void CinematicScripting::process(util::ScriptProcess *sp,
int command, int intData, char *stringData, ScriptLastValueType *lastValue,
GameScriptData *gsd, Game *game, bool *pause)
{
switch(command)
{
case GS_CMD_HIDEGUI:
// TODO: proper handling of players in netgame
game->gameUI->setGUIVisibility(game->singlePlayerNumber, false);
break;
case GS_CMD_SHOWGUI:
// TODO: proper handling of players in netgame
game->gameUI->setGUIVisibility(game->singlePlayerNumber, true);
break;
case GS_CMD_FADED:
game->gameUI->getEffects()->setDefaultFadeImageIfHitImage();
game->gameUI->getEffects()->setFaded();
break;
case GS_CMD_NOFADE:
game->gameUI->getEffects()->setDefaultFadeImageIfHitImage();
game->gameUI->getEffects()->setNoFade();
break;
case GS_CMD_FADEIN:
if (intData >= GAME_TICK_MSEC)
{
game->gameUI->getEffects()->setDefaultFadeImageIfHitImage();
game->gameUI->getEffects()->startFadeIn(intData);
} else {
sp->error("CinematicScripting::process - fadeIn parameter invalid, fade-in duration in msec expected.");
}
break;
case GS_CMD_FADEOUT:
if (intData >= GAME_TICK_MSEC)
{
game->gameUI->getEffects()->setDefaultFadeImageIfHitImage();
game->gameUI->getEffects()->startFadeOut(intData);
} else {
sp->error("CinematicScripting::process - fadeOut parameter invalid, fade-out duration in msec expected.");
}
break;
case GS_CMD_SETFADEIMAGE:
if (stringData != NULL)
{
game->gameUI->getEffects()->setFadeImageFilename(stringData);
} else {
sp->error("CinematicScripting::process - setFadeImage parameter missing, fade image filename expected.");
}
break;
case GS_CMD_SETFADEIMAGETODEFAULT:
game->gameUI->getEffects()->setDefaultFadeImage();
break;
case GS_CMD_STARTCINEMATIC:
if(!game->gameUI->pushUIState())
{
sp->error("GameScripting::process - startCinematic failed");
}
break;
case GS_CMD_ENDCINEMATIC:
if(!game->gameUI->popUIState())
{
sp->error("GameScripting::process - endCinematic failed");
}
break;
case GS_CMD_CINEMATICSCRIPT:
if (stringData != NULL)
{
game->setCinematicScriptProcess(stringData);
game->gameUI->setPointersChangedFlag(game->singlePlayerNumber);
} else {
sp->error("GameScripting::process - cinematicScript parameter missing.");
}
break;
case GS_CMD_MOVIEASPECTRATIO:
{
Terrain *t = game->gameUI->getTerrain();
if(t && t->GetTerrain())
{
#ifdef PROJECT_SURVIVOR
// fade
game->gameUI->setMovieAspectRatio(true);
#else
t->GetTerrain()->getRenderer().setMovieAspectRatio(true, false);
#endif
}
//game->gameUI->getEffects()->setMovieAspectRatio(true);
float fovFactor = SimpleOptions::getFloat(DH_OPT_F_CAMERA_MOVIE_FOV_FACTOR);
GameCamera::setFOVFactor(fovFactor);
}
//.........这里部分代码省略.........