本文整理汇总了C++中StarSystem::GetSeed方法的典型用法代码示例。如果您正苦于以下问题:C++ StarSystem::GetSeed方法的具体用法?C++ StarSystem::GetSeed怎么用?C++ StarSystem::GetSeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StarSystem
的用法示例。
在下文中一共展示了StarSystem::GetSeed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void AmbientSounds::Update()
{
const float v_env = (Pi::worldView->GetCameraController()->IsExternal() ? 1.0f : 0.5f) * Sound::GetSfxVolume();
if (Pi::player->GetFlightState() == Ship::DOCKED) {
if (s_starNoise.IsPlaying()) {
const float target[2] = {0.0f,0.0f};
const float dv_dt[2] = {1.0f,1.0f};
s_starNoise.VolumeAnimate(target, dv_dt);
s_starNoise.SetOp(Sound::OP_REPEAT | Sound::OP_STOP_AT_TARGET_VOLUME);
}
for(int i=0; i<eMaxNumAtmosphereSounds; i++) {
if (s_atmosphereNoises[i].IsPlaying()) {
const float target[2] = {0.0f,0.0f};
const float dv_dt[2] = {1.0f,1.0f};
s_atmosphereNoises[i].VolumeAnimate(target, dv_dt);
s_atmosphereNoises[i].SetOp(Sound::OP_REPEAT | Sound::OP_STOP_AT_TARGET_VOLUME);
}
}
if (s_planetSurfaceNoise.IsPlaying()) {
const float target[2] = {0.0f,0.0f};
const float dv_dt[2] = {1.0f,1.0f};
s_planetSurfaceNoise.VolumeAnimate(target, dv_dt);
s_planetSurfaceNoise.SetOp(Sound::OP_REPEAT | Sound::OP_STOP_AT_TARGET_VOLUME);
}
if (!s_stationNoise.IsPlaying()) {
// just use a random station noise until we have a
// concept of 'station size'
s_stationNoise.Play(s_stationNoiseSounds[Pi::player->GetDockedWith()->GetSystemBody()->seed % NUM_STATION_SOUNDS],
0.3f*v_env, 0.3f*v_env, Sound::OP_REPEAT);
}
} else if (Pi::player->GetFlightState() == Ship::LANDED) {
/* Planet surface noise on rough-landing */
if (s_starNoise.IsPlaying()) {
const float target[2] = {0.0f,0.0f};
const float dv_dt[2] = {1.0f,1.0f};
s_starNoise.VolumeAnimate(target, dv_dt);
s_starNoise.SetOp(Sound::OP_REPEAT | Sound::OP_STOP_AT_TARGET_VOLUME);
}
for(int i=0; i<eMaxNumAtmosphereSounds; i++) {
if (s_atmosphereNoises[i].IsPlaying()) {
const float target[2] = {0.0f,0.0f};
const float dv_dt[2] = {1.0f,1.0f};
s_atmosphereNoises[i].VolumeAnimate(target, dv_dt);
s_atmosphereNoises[i].SetOp(Sound::OP_REPEAT | Sound::OP_STOP_AT_TARGET_VOLUME);
}
}
if (s_stationNoise.IsPlaying()) {
const float target[2] = {0.0f,0.0f};
const float dv_dt[2] = {1.0f,1.0f};
s_stationNoise.VolumeAnimate(target, dv_dt);
s_stationNoise.SetOp(Sound::OP_REPEAT | Sound::OP_STOP_AT_TARGET_VOLUME);
}
// lets try something random for the time being
if (!s_planetSurfaceNoise.IsPlaying()) {
const SystemBody *sbody = Pi::player->GetFrame()->GetSystemBody();
assert(sbody);
const char *sample = 0;
if (sbody->m_life > fixed(1,5)) {
sample = s_surfaceLifeSounds[sbody->seed % NUM_SURFACE_LIFE_SOUNDS];
}
else if (sbody->m_volatileGas > fixed(1,2)) {
sample = s_surfaceSounds[sbody->seed % NUM_SURFACE_DEAD_SOUNDS];
}
else if (sbody->m_volatileGas > fixed(1,10)) {
sample = "Wind";
}
if (sample) {
s_planetSurfaceNoise.Play(sample, 0.3f*v_env, 0.3f*v_env, Sound::OP_REPEAT);
}
}
} else if (s_planetSurfaceNoise.IsPlaying()) {
// s_planetSurfaceNoise.IsPlaying() - if we are out of the atmosphere then stop playing
if (Pi::player->GetFrame()->IsRotFrame()) {
const Body *astro = Pi::player->GetFrame()->GetBody();
if (astro->IsType(Object::PLANET)) {
const double dist = Pi::player->GetPosition().Length();
double pressure, density;
static_cast<const Planet*>(astro)->GetAtmosphericState(dist, &pressure, &density);
if (pressure < 0.001) {
// Stop playing surface noise once out of the atmosphere
s_planetSurfaceNoise.Stop();
}
}
}
} else {
if (s_stationNoise.IsPlaying()) {
const float target[2] = {0.0f,0.0f};
const float dv_dt[2] = {1.0f,1.0f};
s_stationNoise.VolumeAnimate(target, dv_dt);
s_stationNoise.SetOp(Sound::OP_REPEAT | Sound::OP_STOP_AT_TARGET_VOLUME);
}
if (Pi::game->IsNormalSpace()) {
StarSystem *s = Pi::game->GetSpace()->GetStarSystem().Get();
if (astroNoiseSeed != s->GetSeed()) {
// change sound!
//.........这里部分代码省略.........