Merge branch 'master' of github.com:supertuxkart/stk-code
This commit is contained in:
commit
ce0d713dd3
@ -26,11 +26,11 @@ Hope you enjoy the game.
|
||||
##Compiling SuperTuxKart
|
||||
|
||||
###Windows
|
||||
1. Install VS 2012 or later. The free express versions work fine.
|
||||
1. Install VS 2013 (or later). The free express versions work fine.
|
||||
2. Download and install a source package - either a released package or from our [git/svn repositories](http://supertuxkart.sourceforge.net/Source_control)
|
||||
3. Download the latest dependency package depdendencies_for_0.8.2.zip from [here](https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart%20Dependencies/Windows/). Unzip it in the root directory, so that the dependencies directory is next to the src and data directory (if you are updating from a previous dependency package, you can delete the .dll files in the root directory, they are not needed anymore).
|
||||
4. Download cmake and install it. Then start cmake-gui and select the STK root directory as 'Where is the source code', and a new directory in the root directory (next to src, data etc) as build directory (for now I assume that this directory is called bld).
|
||||
5. Click on configure. You will be asked to create the directory (yes), then for your VS version. Make sure to select the right version (be aware of the easy to confuse version numbers: VS 2012 = version 11; VS 2013 = version 12). Click on configure, then generate. This will create the directory 'bld', and a VS solution in that directory.
|
||||
5. Click on configure. You will be asked to create the directory (yes), then for your VS version. Make sure to select the right version (be aware of the easy to confuse version numbers: VS 2013 = version 12). Click on configure, then generate. This will create the directory 'bld', and a VS solution in that directory.
|
||||
6. In Visual Studio open the project file generated in the 'bld' folder
|
||||
7. Right click on the supertuxkart project in the solution explorer, and select "Set as StartUp Project".
|
||||
8. Select Build->Build Solution (or press F7) to compile.
|
||||
|
@ -4,7 +4,7 @@
|
||||
<track id="fortmagma" laps="3" reverse="false" />
|
||||
<track id="minigolf" laps="3" reverse="false" />
|
||||
<track id="xr591" laps="3" reverse="false" />
|
||||
<track id="mines" laps="3" reverse="false" />
|
||||
<track id="minel" laps="3" reverse="false" />
|
||||
<track id="lighthouse" laps="4" reverse="false" />
|
||||
|
||||
</supertuxkart_grand_prix>
|
||||
|
@ -4,7 +4,7 @@ uniform sampler2D tex;
|
||||
uniform sampler2D logluminancetex;
|
||||
uniform float exposure = .09;
|
||||
uniform float Lwhite = 1.;
|
||||
uniform float vignette_weight = 0.;
|
||||
uniform float vignette_weight;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
|
@ -1709,7 +1709,7 @@ bool CIrrDeviceMacOSX::activateJoysticks(core::array<SJoystickInfo> & joystickIn
|
||||
|
||||
SJoystickInfo returnInfo;
|
||||
returnInfo.Joystick = jindex;
|
||||
returnInfo..HasGenericName = false;
|
||||
returnInfo.HasGenericName = false;
|
||||
returnInfo.Axes = info.axes;
|
||||
//returnInfo.Hats = info.hats;
|
||||
returnInfo.Buttons = info.buttons;
|
||||
|
@ -535,11 +535,11 @@ static void renderGodRay(GLuint tex, const core::vector2df &sunpos)
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
}
|
||||
|
||||
static void toneMap(FrameBuffer &fbo, GLuint rtt)
|
||||
static void toneMap(FrameBuffer &fbo, GLuint rtt, float vignette_weight)
|
||||
{
|
||||
fbo.Bind();
|
||||
FullScreenShader::ToneMapShader::getInstance()->SetTextureUnits(rtt);
|
||||
DrawFullScreenEffect<FullScreenShader::ToneMapShader>();
|
||||
DrawFullScreenEffect<FullScreenShader::ToneMapShader>(vignette_weight);
|
||||
}
|
||||
|
||||
static void renderDoF(FrameBuffer &fbo, GLuint rtt)
|
||||
@ -737,7 +737,15 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode, boo
|
||||
{
|
||||
PROFILER_PUSH_CPU_MARKER("- Tonemap", 0xFF, 0x00, 0x00);
|
||||
ScopedGPUTimer Timer(irr_driver->getGPUTimer(Q_TONEMAP));
|
||||
toneMap(*out_fbo, in_fbo->getRTT()[0]);
|
||||
// only enable vignette during race
|
||||
if(isRace)
|
||||
{
|
||||
toneMap(*out_fbo, in_fbo->getRTT()[0], 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
toneMap(*out_fbo, in_fbo->getRTT()[0], 0.0);
|
||||
}
|
||||
std::swap(in_fbo, out_fbo);
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ core::matrix4 getTighestFitOrthoProj(const core::matrix4 &transform, const std::
|
||||
return tmp_matrix;
|
||||
tmp_matrix.buildProjectionMatrixOrthoLH(left, right,
|
||||
down, up,
|
||||
30, zmax);
|
||||
zmin - 100, zmax);
|
||||
return tmp_matrix;
|
||||
}
|
||||
|
||||
|
@ -1569,7 +1569,7 @@ namespace FullScreenShader
|
||||
GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getRGBfromCIEXxy.frag").c_str(),
|
||||
GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getCIEXYZ.frag").c_str(),
|
||||
GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/tonemap.frag").c_str());
|
||||
AssignUniforms();
|
||||
AssignUniforms("vignette_weight");
|
||||
|
||||
AssignSamplerNames(Program, 0, "text");
|
||||
}
|
||||
|
@ -377,9 +377,10 @@ public:
|
||||
BloomBlendShader();
|
||||
};
|
||||
|
||||
class ToneMapShader : public ShaderHelperSingleton<ToneMapShader>, public TextureRead<Nearest_Filtered>
|
||||
class ToneMapShader : public ShaderHelperSingleton<ToneMapShader, float>, public TextureRead<Nearest_Filtered>
|
||||
{
|
||||
public:
|
||||
|
||||
ToneMapShader();
|
||||
};
|
||||
|
||||
|
@ -127,7 +127,6 @@ Kart::Kart (const std::string& ident, unsigned int world_kart_id,
|
||||
m_flying = false;
|
||||
m_sky_particles_emitter= NULL;
|
||||
m_stars_effect = NULL;
|
||||
m_jump_time = 0;
|
||||
m_is_jumping = false;
|
||||
m_min_nitro_time = 0.0f;
|
||||
m_fire_clicked = 0;
|
||||
@ -1329,17 +1328,18 @@ void Kart::update(float dt)
|
||||
// is rescued isOnGround might still be true, since the kart rigid
|
||||
// body was removed from the physics, but still retain the old
|
||||
// values for the raycasts).
|
||||
if (!isOnGround())
|
||||
if (!isOnGround() && !getKartAnimation())
|
||||
{
|
||||
const Material *m = getMaterial();
|
||||
const Material *last_m = getLastMaterial();
|
||||
|
||||
// A jump starts only the kart isn't already jumping, is on a new
|
||||
// (or no) texture.
|
||||
if(!m_is_jumping && last_m && last_m!=m )
|
||||
if (!m_is_jumping && last_m && last_m != m &&
|
||||
m_kart_model->getAnimation() == KartModel::AF_DEFAULT)
|
||||
{
|
||||
float v = getVelocity().getY();
|
||||
float force = World::getWorld()->getTrack()->getGravity();;
|
||||
float force = World::getWorld()->getTrack()->getGravity();
|
||||
// Velocity / force is the time it takes to reach the peak
|
||||
// of the jump (i.e. when vertical speed becomes 0). Assuming
|
||||
// that jump start height and end height are the same, it will
|
||||
@ -1348,22 +1348,27 @@ void Kart::update(float dt)
|
||||
|
||||
// Jump if either the jump is estimated to be long enough, or
|
||||
// the texture has the jump property set.
|
||||
if(t>getKartProperties()->getJumpAnimationTime() ||
|
||||
last_m->isJumpTexture() )
|
||||
if (t > getKartProperties()->getJumpAnimationTime() ||
|
||||
last_m->isJumpTexture())
|
||||
{
|
||||
m_kart_model->setAnimation(KartModel::AF_JUMP_START);
|
||||
}
|
||||
|
||||
m_is_jumping = true;
|
||||
}
|
||||
m_jump_time+=dt;
|
||||
}
|
||||
else if (m_is_jumping)
|
||||
{
|
||||
// Kart touched ground again
|
||||
m_is_jumping = false;
|
||||
HitEffect *effect = new Explosion(getXYZ(), "jump",
|
||||
"jump_explosion.xml");
|
||||
projectile_manager->addHitEffect(effect);
|
||||
m_kart_model->setAnimation(KartModel::AF_DEFAULT);
|
||||
m_jump_time = 0;
|
||||
|
||||
if (!getKartAnimation())
|
||||
{
|
||||
HitEffect *effect = new Explosion(getXYZ(), "jump",
|
||||
"jump_explosion.xml");
|
||||
projectile_manager->addHitEffect(effect);
|
||||
}
|
||||
}
|
||||
|
||||
//const bool dyn_shadows = World::getWorld()->getTrack()->hasShadows() &&
|
||||
|
@ -166,8 +166,6 @@ private:
|
||||
|
||||
// Graphical effects
|
||||
// -----------------
|
||||
/** Time a kart is jumping. */
|
||||
float m_jump_time;
|
||||
|
||||
/** Is time flying activated */
|
||||
bool m_is_jumping;
|
||||
|
@ -302,6 +302,9 @@ public:
|
||||
/** Lowest coordinate on up axis */
|
||||
float getLowestPoint () const { return m_kart_lowest_point; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns information about currently played animation */
|
||||
AnimationFrameType getAnimation() { return m_current_animation; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Enables- or disables the end animation. */
|
||||
void setAnimation(AnimationFrameType type);
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -77,6 +77,9 @@ void Skidding::reset()
|
||||
m_kart->getKartGFX()->setCreationRateAbsolute(KartGFX::KGFX_SKIDL, 0);
|
||||
m_kart->getKartGFX()->setCreationRateAbsolute(KartGFX::KGFX_SKIDR, 0);
|
||||
m_kart->getControls().m_skid = KartControl::SC_NONE;
|
||||
|
||||
btVector3 rot(0, 0, 0);
|
||||
m_kart->getVehicle()->setTimedRotation(0, rot);
|
||||
} // reset
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -120,8 +123,8 @@ void Skidding::updateSteering(float steer, float dt)
|
||||
break;
|
||||
case SKID_BREAK:
|
||||
m_real_steering = steer;
|
||||
if (m_visual_rotation > 0.05f) m_visual_rotation -= 0.05f;
|
||||
else if (m_visual_rotation < -0.05f) m_visual_rotation += 0.05f;
|
||||
if (m_visual_rotation > 0.1f) m_visual_rotation -= 0.1f;
|
||||
else if (m_visual_rotation < -0.1f) m_visual_rotation += 0.1f;
|
||||
else
|
||||
{
|
||||
reset();
|
||||
@ -212,7 +215,7 @@ void Skidding::update(float dt, bool is_on_ground,
|
||||
}
|
||||
|
||||
// No skidding backwards or while stopped
|
||||
if(m_kart->getSpeed() < 0.001f &&
|
||||
if(m_kart->getSpeed() < m_min_skid_speed &&
|
||||
m_skid_state != SKID_NONE && m_skid_state != SKID_BREAK)
|
||||
{
|
||||
m_skid_state = SKID_BREAK;
|
||||
@ -355,7 +358,6 @@ void Skidding::update(float dt, bool is_on_ground,
|
||||
}
|
||||
case SKID_BREAK:
|
||||
{
|
||||
updateSteering(steering, dt);
|
||||
break;
|
||||
}
|
||||
case SKID_ACCUMULATE_LEFT:
|
||||
|
@ -106,6 +106,9 @@ void GrandPrixData::changeTrackNumber(const unsigned int number_of_tracks,
|
||||
// Ignore no-racing tracks:
|
||||
if(!track->isRaceTrack())
|
||||
continue;
|
||||
|
||||
if (PlayerManager::getCurrentPlayer()->isLocked(track->getIdent()))
|
||||
continue;
|
||||
|
||||
// Only add tracks that are not already picked.
|
||||
if(std::find(m_tracks.begin(), m_tracks.end(), track->getIdent())==
|
||||
@ -129,10 +132,27 @@ void GrandPrixData::changeTrackNumber(const unsigned int number_of_tracks,
|
||||
|
||||
const Track *track = track_manager->getTrack(track_index);
|
||||
std::string id = track->getIdent();
|
||||
|
||||
if (PlayerManager::getCurrentPlayer()->isLocked(track->getIdent()))
|
||||
continue;
|
||||
|
||||
bool is_already_added = false;
|
||||
for (unsigned int i = 0; i < m_tracks.size(); i++)
|
||||
{
|
||||
if (m_tracks[i] == id)
|
||||
{
|
||||
is_already_added = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_already_added)
|
||||
{
|
||||
m_tracks.push_back(id);
|
||||
m_laps.push_back(track->getDefaultNumberOfLaps());
|
||||
m_reversed.push_back(false); // This will be changed later in the code
|
||||
}
|
||||
|
||||
m_tracks.push_back(id);
|
||||
m_laps.push_back(track->getDefaultNumberOfLaps());
|
||||
m_reversed.push_back(false); // This will be changed later in the code
|
||||
track_indices.erase(track_indices.begin()+index);
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ GPInfoScreen::GPInfoScreen() : Screen("gp_info.stkgui")
|
||||
// Necessary to test if loadedFroMFile() was executed (in setGP)
|
||||
m_reverse_spinner = NULL;
|
||||
m_screenshot_widget = NULL;
|
||||
m_max_num_tracks = 0;
|
||||
} // GPInfoScreen
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -192,16 +193,12 @@ void GPInfoScreen::init()
|
||||
else
|
||||
m_group_name = stringc(m_group_spinner->getStringValue().c_str()).c_str();
|
||||
|
||||
// If there are more tracks selected atm as in the group (which can
|
||||
// happen if the group has been changed since last time this screen
|
||||
// was shown), adjust it:
|
||||
int max_num_tracks = m_group_name=="all"
|
||||
? track_manager->getNumberOfRaceTracks()
|
||||
: (int)track_manager->getTracksInGroup(m_group_name).size();
|
||||
m_num_tracks_spinner->setMax(max_num_tracks);
|
||||
if(m_num_tracks_spinner->getValue() > max_num_tracks)
|
||||
m_max_num_tracks = getMaxNumTracks(m_group_name);
|
||||
|
||||
m_num_tracks_spinner->setMax(m_max_num_tracks);
|
||||
if(m_num_tracks_spinner->getValue() > m_max_num_tracks)
|
||||
{
|
||||
m_num_tracks_spinner->setValue(max_num_tracks);
|
||||
m_num_tracks_spinner->setValue(m_max_num_tracks);
|
||||
}
|
||||
|
||||
// Now create the random GP:
|
||||
@ -330,16 +327,11 @@ void GPInfoScreen::eventCallback(Widget *, const std::string &name,
|
||||
{
|
||||
m_group_name = stringc(m_group_spinner->getStringValue()).c_str();
|
||||
|
||||
// Update the maximum for the number of tracks since it's depending on
|
||||
// the current track. The current value in the Number-of-tracks-spinner
|
||||
// has to be updated, since otherwise the displayed (and used) value
|
||||
// can be bigger than the maximum. (Might be a TODO to fix this)
|
||||
int max_num_tracks = m_group_name=="all"
|
||||
? track_manager->getNumberOfRaceTracks()
|
||||
: (int)track_manager->getTracksInGroup(m_group_name).size();
|
||||
m_num_tracks_spinner->setMax(max_num_tracks);
|
||||
if (m_num_tracks_spinner->getValue() > max_num_tracks)
|
||||
m_num_tracks_spinner->setValue(max_num_tracks);
|
||||
m_max_num_tracks = getMaxNumTracks(m_group_name);
|
||||
|
||||
m_num_tracks_spinner->setMax(m_max_num_tracks);
|
||||
if (m_num_tracks_spinner->getValue() > m_max_num_tracks)
|
||||
m_num_tracks_spinner->setValue(m_max_num_tracks);
|
||||
// Create a new (i.e. with new tracks) random gp, since the old
|
||||
// tracks might not all belong to the newly selected group.
|
||||
|
||||
@ -389,3 +381,41 @@ void GPInfoScreen::onUpdate(float dt)
|
||||
m_screenshot_widget->setImage(file, IconButtonWidget::ICON_PATH_TYPE_ABSOLUTE);
|
||||
m_screenshot_widget->m_properties[PROP_ICON] = file;
|
||||
} // onUpdate
|
||||
|
||||
/** Get number of available tracks for random GPs
|
||||
*/
|
||||
int GPInfoScreen::getMaxNumTracks(std::string group)
|
||||
{
|
||||
int max_num_tracks = 0;
|
||||
|
||||
if (group == "all")
|
||||
{
|
||||
for (unsigned int i = 0; i < track_manager->getNumberOfTracks(); i++)
|
||||
{
|
||||
std::string id = track_manager->getTrack(i)->getIdent();
|
||||
|
||||
if (!PlayerManager::getCurrentPlayer()->isLocked(id) &&
|
||||
track_manager->getTrack(i)->isRaceTrack())
|
||||
{
|
||||
max_num_tracks++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<int> tracks = track_manager->getTracksInGroup(group);
|
||||
|
||||
for (unsigned int i = 0; i < tracks.size(); i++)
|
||||
{
|
||||
std::string id = track_manager->getTrack(tracks[i])->getIdent();
|
||||
|
||||
if (!PlayerManager::getCurrentPlayer()->isLocked(id) &&
|
||||
track_manager->getTrack(tracks[i])->isRaceTrack())
|
||||
{
|
||||
max_num_tracks++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return max_num_tracks;
|
||||
}
|
||||
|
@ -53,6 +53,12 @@ private:
|
||||
|
||||
/** The currently selected group name. */
|
||||
std::string m_group_name;
|
||||
|
||||
/** Number of available tracks */
|
||||
int m_max_num_tracks;
|
||||
|
||||
/** Get number of available tracks for random GPs */
|
||||
int getMaxNumTracks(std::string group);
|
||||
|
||||
protected: // Necessary for RandomGPInfoScreen
|
||||
GUIEngine::IconButtonWidget* m_screenshot_widget;
|
||||
|
@ -97,7 +97,7 @@ static GFXPreset GFX_PRESETS[] =
|
||||
{
|
||||
true /* light */, 2 /* shadow */, true /* bloom */, true /* motionblur */,
|
||||
true /* lightshaft */, true /* glow */, true /* mlaa */, true /* ssao */, true /* weather */,
|
||||
true /* animatedScenery */, 2 /* animatedCharacters */, 8 /* anisotropy */,
|
||||
true /* animatedScenery */, 2 /* animatedCharacters */, 16 /* anisotropy */,
|
||||
true /* depth of field */, true /* global illumination */
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user