Skip to content

Commit

Permalink
Draw 3D correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
vittorioromeo committed Mar 15, 2013
1 parent 4198f8c commit 34574da
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
13 changes: 13 additions & 0 deletions HGGraphics.cpp
Expand Up @@ -26,6 +26,19 @@ namespace hg
if(get3D())
{
status.drawing3D = true;

float effect{styleData.get3DSkew() * get3DMultiplier() * status.pulse3D};
Vector2f skew{1.f, 1.f + effect};
backgroundCamera.setSkew(skew);

for(unsigned int i{0}; i < depthCameras.size(); ++i)
{
Camera& depthCamera(depthCameras[i]);
depthCamera.setView(backgroundCamera.getView());
depthCamera.setSkew(skew);
depthCamera.setOffset({0, styleData.get3DSpacing() * (i * styleData.get3DPerspectiveMultiplier()) * (effect * 3.6f)});
}

for(unsigned int i{0}; i < depthCameras.size(); ++i)
{
status.overrideColor = getColorDarkened(styleData.get3DOverrideColor(), styleData.get3DDarkenMultiplier());
Expand Down
12 changes: 1 addition & 11 deletions HGUpdate.cpp
Expand Up @@ -147,16 +147,6 @@ namespace hg
if(status.pulse3D > styleData.get3DPulseMax()) status.pulse3DDirection = -1;
else if(status.pulse3D < styleData.get3DPulseMin()) status.pulse3DDirection = 1;

float effect{styleData.get3DSkew() * get3DMultiplier() * status.pulse3D};
Vector2f skew{1.f, 1.f + effect};
backgroundCamera.setSkew(skew);

for(unsigned int i{0}; i < depthCameras.size(); ++i)
{
Camera& depthCamera(depthCameras[i]);
depthCamera.setView(backgroundCamera.getView());
depthCamera.setSkew(skew);
depthCamera.setOffset({0, styleData.get3DSpacing() * (i * styleData.get3DPerspectiveMultiplier()) * (effect * 3.6f)});
}

}
}
4 changes: 2 additions & 2 deletions _RELEASE/config.json
Expand Up @@ -35,8 +35,8 @@
"flash_enabled": true,

// Audio options
"no_sound": true,
"no_music": true,
"no_sound": false,
"no_music": false,
"sound_volume": 100,
"music_volume": 75,

Expand Down

0 comments on commit 34574da

Please sign in to comment.