Skip to content

Commit

Permalink
tweakages
Browse files Browse the repository at this point in the history
  • Loading branch information
fallahn committed Apr 26, 2024
1 parent e1e94cf commit 8e17bef
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions samples/golf/buildnumber.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef BUILD_NUMBER_H_
#define BUILD_NUMBER_H_

#define BUILDNUMBER 5438
#define BUILDNUMBER_STR "5438"
#define BUILDNUMBER 5448
#define BUILDNUMBER_STR "5448"

#endif /* BUILD_NUMBER_H_ */
9 changes: 7 additions & 2 deletions samples/golf/src/golf/GolfState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6254,7 +6254,8 @@ void GolfState::startFlyBy()
data.speeds[2] *= 1.f / SpeedMultiplier;

//play the transition music
if (m_sharedData.gameMode == GameMode::Tutorial)
if (m_sharedData.gameMode == GameMode::Tutorial
&& cro::AudioMixer::getVolume(MixerChannel::UserMusic) < 0.01f)
{
m_cameras[CameraID::Player].getComponent<cro::AudioEmitter>().play();
}
Expand All @@ -6277,7 +6278,11 @@ void GolfState::startFlyBy()
{
showScoreboard(true);
m_newHole = true;
m_cameras[CameraID::Player].getComponent<cro::AudioEmitter>().play();

if (cro::AudioMixer::getVolume(MixerChannel::UserMusic) < 0.01f)
{
m_cameras[CameraID::Player].getComponent<cro::AudioEmitter>().play();
}

//delayed ent just to show the score board for a while
auto de = m_gameScene.createEntity();
Expand Down
6 changes: 3 additions & 3 deletions samples/golf/src/golf/GolfStateUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ void GolfState::buildUI()
const auto BarWidth = bounds.width - 8.f;
const auto BarHeight = bounds.height;
entity = m_uiScene.createEntity();
entity.addComponent<cro::Transform>().setPosition(glm::vec3(5.f, 0.f, 0.1f)); //TODO expell the magic number!!
entity.addComponent<cro::Transform>().setPosition(glm::vec3(5.f, 0.f, 0.3f)); //TODO expell the magic number!!
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Sprite>() = m_sprites[SpriteID::PowerBarInner];
bounds = entity.getComponent<cro::Sprite>().getTextureBounds();
Expand All @@ -851,7 +851,7 @@ void GolfState::buildUI()

//hook/slice indicator
entity = m_uiScene.createEntity();
entity.addComponent<cro::Transform>().setPosition(glm::vec3(BarCentre, 8.f, 0.25f));
entity.addComponent<cro::Transform>().setPosition(glm::vec3(BarCentre, 8.f, 0.55f));
entity.addComponent<cro::Drawable2D>();
entity.addComponent<cro::Sprite>() = m_sprites[SpriteID::HookBar];
bounds = entity.getComponent<cro::Sprite>().getTextureBounds();
Expand All @@ -860,7 +860,7 @@ void GolfState::buildUI()
entity.getComponent<cro::Callback>().function =
[&, BarCentre](cro::Entity e, float)
{
glm::vec3 pos(std::round(BarCentre + (BarCentre * m_inputParser.getHook())), 8.f, 0.25f);
glm::vec3 pos(std::round(BarCentre + (BarCentre * m_inputParser.getHook())), 8.f, 0.55f);
e.getComponent<cro::Transform>().setPosition(pos);
};
barEnt.getComponent<cro::Transform>().addChild(entity.getComponent<cro::Transform>());
Expand Down
10 changes: 5 additions & 5 deletions samples/golf/src/golf/OptionsState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ namespace
const std::array<cro::String, MixerChannel::Count> MixerLabels =
{
"Menu Music",
"Effects Volume",
"Menu Volume",
"Voice Volume",
"Vehicle Volume",
"Effects",
"Menu Sounds",
"Voice",
"Vehicles",
"Environment",
"Game Music"
};
Expand Down Expand Up @@ -1313,7 +1313,7 @@ void OptionsState::buildAVMenu(cro::Entity parent, const cro::SpriteSheet& sprit
};

//audio label
auto audioLabel = createLabel(glm::vec2((bgBounds.width / 2.f) - 101.f, 156.f), "Music Volume");
auto audioLabel = createLabel(glm::vec2((bgBounds.width / 2.f) - 101.f, 156.f), MixerLabels[mixerChannelIndex]);
centreText(audioLabel);
audioLabel.addComponent<cro::Callback>().active = true;
audioLabel.getComponent<cro::Callback>().function =
Expand Down
2 changes: 1 addition & 1 deletion samples/golf/src/golf/Weather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void GolfState::createWeather(std::int32_t weatherType)
else
{
m_resources.shaders.loadFromString(ShaderID::Weather, WeatherVertex, RainFragment);
weatherColour = cro::Colour(0.86f, 0.87f, 0.873f);
weatherColour = cro::Colour(0.86f, 0.87f, 0.873f, 0.6f);
//blendMode = cro::Material::BlendMode::Custom;

//create audio entity
Expand Down

0 comments on commit 8e17bef

Please sign in to comment.