diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68ae9962b..ae848ef7a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,7 +41,6 @@ else()
endif()
if(UNIX AND NOT APPLE)
- option(USE_XRANDR "Use xrandr instead of vidmode" ON)
option(USE_ASAN "Build with Leak/Address sanitizer" OFF)
option(USE_LIBBFD "Use libbfd for crash reporting and leak check" OFF)
endif()
@@ -215,14 +214,9 @@ if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
include_directories(${X11_INCLUDE_DIR})
- if(USE_XRANDR)
- find_package(Xrandr REQUIRED)
- if(NOT XRANDR_FOUND)
- message(FATAL_ERROR "XRANDR not found.")
- endif()
- else()
- find_library(IRRLICHT_XF86VM_LIBRARY Xxf86vm)
- mark_as_advanced(IRRLICHT_XF86VM_LIBRARY)
+ find_package(Xrandr REQUIRED)
+ if(NOT XRANDR_FOUND)
+ message(FATAL_ERROR "XRANDR not found.")
endif()
if(USE_LIBBFD)
@@ -382,12 +376,7 @@ else()
endif()
if(UNIX AND NOT APPLE)
- target_link_libraries(supertuxkart ${X11_LIBRARIES})
- if(USE_XRANDR)
- target_link_libraries(supertuxkart ${XRANDR_LIBRARIES})
- else()
- target_link_libraries(supertuxkart ${IRRLICHT_XF86VM_LIBRARY})
- endif()
+ target_link_libraries(supertuxkart ${X11_LIBRARIES} ${XRANDR_LIBRARIES})
if(USE_LIBBFD)
target_link_libraries(supertuxkart ${LIBBFD_LIBRARIES})
endif()
diff --git a/data/CREDITS b/data/CREDITS
index 96165c272..d12f77486 100755
Binary files a/data/CREDITS and b/data/CREDITS differ
diff --git a/data/gui/confirm_dialog.stkgui b/data/gui/confirm_dialog.stkgui
index b1f57e61d..70334d1d1 100644
--- a/data/gui/confirm_dialog.stkgui
+++ b/data/gui/confirm_dialog.stkgui
@@ -1,15 +1,19 @@
-
+
-
+
-
+
-
+
+
+
diff --git a/data/gui/options_players.stkgui b/data/gui/options_players.stkgui
index 286b0971b..5c8de774c 100644
--- a/data/gui/options_players.stkgui
+++ b/data/gui/options_players.stkgui
@@ -30,7 +30,7 @@
diff --git a/data/shaders/bloom.frag b/data/shaders/bloom.frag
index 78bfbf965..a94402950 100644
--- a/data/shaders/bloom.frag
+++ b/data/shaders/bloom.frag
@@ -1,4 +1,5 @@
uniform sampler2D tex;
+uniform float scale;
out vec4 FragColor;
@@ -7,7 +8,7 @@ out vec4 FragColor;
void main()
{
- vec2 uv = gl_FragCoord.xy / 512.;
+ vec2 uv = gl_FragCoord.xy / (512. * scale);
vec3 col = texture(tex, uv).xyz;
vec3 Yxy = getCIEYxy(col);
vec3 WhiteYxy = getCIEYxy(vec3(1.));
diff --git a/data/supertuxkart.appdata.xml b/data/supertuxkart.appdata.xml
index 412961b51..b331807c8 100644
--- a/data/supertuxkart.appdata.xml
+++ b/data/supertuxkart.appdata.xml
@@ -1,9 +1,9 @@
-
-
- supertuxkart.desktop
+
+ supertuxkart.desktop
CC0-1.0
+ GPL-3.0+
SuperTuxKart
A racing game
@@ -25,11 +25,25 @@
against the computer or your friends, and more!
- http://supertuxkart.net/
- http://supertuxkart.sourceforge.net/persistent/images/4/4e/Supertuxkart-0.9-screenshot-2.jpg
- http://supertuxkart.sourceforge.net/persistent/images/a/a9/Supertuxkart-0.9-screenshot-1.jpg
- http://supertuxkart.sourceforge.net/persistent/images/6/63/Supertuxkart-0.9-screenshot-3.jpg
+
+ https://supertuxkart.net/images/8/83/Supertuxkart-0.9.2-screenshot-3.jpg
+ Normal Race
+
+
+ https://supertuxkart.net/images/1/1f/Supertuxkart-0.9.2-screenshot-1.jpg
+ Battle Mode
+
+
+ https://supertuxkart.net/images/2/2a/Supertuxkart-0.9.2-screenshot-2.jpg
+ Soccer Mode
+
- supertuxkart-devel@lists.sourceforge.net
-
+ SuperTuxKart Team
+ supertuxkart-devel@lists.sourceforge.net
+ https://supertuxkart.net
+ https://github.com/supertuxkart/stk-code/issues
+ https://supertuxkart.net/Donate
+ https://supertuxkart.net/Community
+ https://supertuxkart.net/Translating_STK
+
diff --git a/lib/irrlicht/CMakeLists.txt b/lib/irrlicht/CMakeLists.txt
index 07e72b2ea..2a73d0533 100644
--- a/lib/irrlicht/CMakeLists.txt
+++ b/lib/irrlicht/CMakeLists.txt
@@ -47,7 +47,7 @@ if(USE_GLES2)
endif()
# Xrandr
-if(UNIX AND USE_XRANDR)
+if(UNIX AND NOT APPLE)
add_definitions(-DNO_IRR_LINUX_X11_VIDMODE_)
add_definitions(-D_IRR_LINUX_X11_RANDR_)
endif()
diff --git a/lib/irrlicht/source/Irrlicht/CGUIButton.cpp b/lib/irrlicht/source/Irrlicht/CGUIButton.cpp
index 1d17f2651..1a946b282 100644
--- a/lib/irrlicht/source/Irrlicht/CGUIButton.cpp
+++ b/lib/irrlicht/source/Irrlicht/CGUIButton.cpp
@@ -381,7 +381,7 @@ void CGUIButton::setImage(video::ITexture* image)
Image = image;
if (image)
- ImageRect = core::rect(core::position2d(0,0), image->getOriginalSize());
+ ImageRect = core::rect(core::position2d(0,0), image->getSize());
if (!PressedImage)
setPressedImage(Image);
@@ -407,7 +407,7 @@ void CGUIButton::setPressedImage(video::ITexture* image)
PressedImage = image;
if (image)
- PressedImageRect = core::rect(core::position2d(0,0), image->getOriginalSize());
+ PressedImageRect = core::rect(core::position2d(0,0), image->getSize());
}
diff --git a/lib/irrlicht/source/Irrlicht/COGLES2Driver.cpp b/lib/irrlicht/source/Irrlicht/COGLES2Driver.cpp
index e49c275f5..e9b8e7efa 100644
--- a/lib/irrlicht/source/Irrlicht/COGLES2Driver.cpp
+++ b/lib/irrlicht/source/Irrlicht/COGLES2Driver.cpp
@@ -1314,7 +1314,7 @@ namespace video
// texcoords need to be flipped horizontally for RTTs
const bool isRTT = texture->isRenderTarget();
- const core::dimension2d& ss = texture->getOriginalSize();
+ const core::dimension2d& ss = texture->getSize();
const f32 invW = 1.f / static_cast(ss.Width);
const f32 invH = 1.f / static_cast(ss.Height);
const core::rect tcoords(
@@ -1443,10 +1443,10 @@ namespace video
// now draw it.
core::rect tcoords;
- tcoords.UpperLeftCorner.X = (((f32)sourcePos.X)) / texture->getOriginalSize().Width ;
- tcoords.UpperLeftCorner.Y = (((f32)sourcePos.Y)) / texture->getOriginalSize().Height;
- tcoords.LowerRightCorner.X = tcoords.UpperLeftCorner.X + ((f32)(sourceSize.Width) / texture->getOriginalSize().Width);
- tcoords.LowerRightCorner.Y = tcoords.UpperLeftCorner.Y + ((f32)(sourceSize.Height) / texture->getOriginalSize().Height);
+ tcoords.UpperLeftCorner.X = (((f32)sourcePos.X)) / texture->getSize().Width ;
+ tcoords.UpperLeftCorner.Y = (((f32)sourcePos.Y)) / texture->getSize().Height;
+ tcoords.LowerRightCorner.X = tcoords.UpperLeftCorner.X + ((f32)(sourceSize.Width) / texture->getSize().Width);
+ tcoords.LowerRightCorner.Y = tcoords.UpperLeftCorner.Y + ((f32)(sourceSize.Height) / texture->getSize().Height);
const core::rect poss(targetPos, sourceSize);
@@ -1496,7 +1496,7 @@ namespace video
// texcoords need to be flipped horizontally for RTTs
const bool isRTT = texture->isRenderTarget();
- const core::dimension2du& ss = texture->getOriginalSize();
+ const core::dimension2du& ss = texture->getSize();
const f32 invW = 1.f / static_cast(ss.Width);
const f32 invH = 1.f / static_cast(ss.Height);
const core::rect tcoords(
@@ -1573,7 +1573,7 @@ namespace video
clipRect->getWidth(), clipRect->getHeight());
}
- const core::dimension2du& ss = texture->getOriginalSize();
+ const core::dimension2du& ss = texture->getSize();
core::position2d targetPos(pos);
// texcoords need to be flipped horizontally for RTTs
const bool isRTT = texture->isRenderTarget();
diff --git a/lib/irrlicht/source/Irrlicht/COGLES2Texture.cpp b/lib/irrlicht/source/Irrlicht/COGLES2Texture.cpp
index ce09c1ec5..4396d6e09 100644
--- a/lib/irrlicht/source/Irrlicht/COGLES2Texture.cpp
+++ b/lib/irrlicht/source/Irrlicht/COGLES2Texture.cpp
@@ -15,6 +15,8 @@
#include "os.h"
#include "CImage.h"
#include "CColorConverter.h"
+#include "IAttributes.h"
+#include "IrrlichtDevice.h"
#include "irrString.h"
@@ -171,6 +173,17 @@ void COGLES2Texture::getImageValues(IImage* image)
ImageSize.Width = (u32)(Driver->MaxTextureSize*ratio);
}
TextureSize=ImageSize.getOptimalSize(false);
+ const core::dimension2du max_size = Driver->getDriverAttributes()
+ .getAttributeAsDimension2d("MAX_TEXTURE_SIZE");
+
+ if (max_size.Width> 0 && TextureSize.Width > max_size.Width)
+ {
+ TextureSize.Width = max_size.Width;
+ }
+ if (max_size.Height> 0 && TextureSize.Height > max_size.Height)
+ {
+ TextureSize.Height = max_size.Height;
+ }
ColorFormat = getBestColorFormat(image->getColorFormat());
}
diff --git a/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp b/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp
index f555477a6..1a1d61350 100644
--- a/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp
+++ b/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp
@@ -2006,7 +2006,7 @@ void COpenGLDriver::draw2DImageBatch(const video::ITexture* texture,
const u32 drawCount = core::min_(positions.size(), sourceRects.size());
- const core::dimension2d& ss = texture->getOriginalSize();
+ const core::dimension2d& ss = texture->getSize();
const f32 invW = 1.f / static_cast(ss.Width);
const f32 invH = 1.f / static_cast(ss.Height);
const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize();
@@ -2225,7 +2225,7 @@ void COpenGLDriver::draw2DImage(const video::ITexture* texture,
// ok, we've clipped everything.
// now draw it.
- const core::dimension2d& ss = texture->getOriginalSize();
+ const core::dimension2d& ss = texture->getSize();
const f32 invW = 1.f / static_cast(ss.Width);
const f32 invH = 1.f / static_cast(ss.Height);
const core::rect tcoords(
@@ -2268,7 +2268,7 @@ void COpenGLDriver::draw2DImage(const video::ITexture* texture, const core::rect
if (!texture)
return;
- const core::dimension2d& ss = texture->getOriginalSize();
+ const core::dimension2d& ss = texture->getSize();
const f32 invW = 1.f / static_cast(ss.Width);
const f32 invH = 1.f / static_cast(ss.Height);
const core::rect tcoords(
@@ -2361,7 +2361,7 @@ void COpenGLDriver::draw2DImage(const video::ITexture* texture,
clipRect->getWidth(),clipRect->getHeight());
}
- const core::dimension2d& ss = texture->getOriginalSize();
+ const core::dimension2d& ss = texture->getSize();
core::position2d targetPos(pos);
const f32 invW = 1.f / static_cast(ss.Width);
const f32 invH = 1.f / static_cast(ss.Height);
diff --git a/src/challenges/challenge_data.cpp b/src/challenges/challenge_data.cpp
index bc3fa8742..f1fdc2f27 100644
--- a/src/challenges/challenge_data.cpp
+++ b/src/challenges/challenge_data.cpp
@@ -251,23 +251,30 @@ ChallengeData::ChallengeData(const std::string& filename)
throw std::runtime_error("Unknown unlock entry");
}
}
-
- core::stringw description;
- if (track_node != NULL && m_minor!=RaceManager::MINOR_MODE_FOLLOW_LEADER)
- {
- //I18N: number of laps to race in a challenge
- description += _("Laps : %i", m_num_laps);
- description += core::stringw(L"\n");
- }
- else if (track_node)
- {
- // Follow the leader mode:
- description = _("Follow the leader");
- }
-
- m_challenge_description = description;
} // ChallengeData
+// ----------------------------------------------------------------------------
+
+const irr::core::stringw ChallengeData::getChallengeDescription() const
+{
+ core::stringw description;
+ if (!m_track_id.empty())
+ {
+ if (m_minor != RaceManager::MINOR_MODE_FOLLOW_LEADER)
+ {
+ //I18N: number of laps to race in a challenge
+ description += _("Laps: %i", m_num_laps);
+ description += core::stringw(L"\n");
+ }
+ else
+ {
+ // Follow the leader mode:
+ description = _("Follow the leader");
+ }
+ }
+ return description;
+} // getChallengeDescription
+
// ----------------------------------------------------------------------------
void ChallengeData::error(const char *id) const
{
diff --git a/src/challenges/challenge_data.hpp b/src/challenges/challenge_data.hpp
index f563695fb..0cebc4556 100644
--- a/src/challenges/challenge_data.hpp
+++ b/src/challenges/challenge_data.hpp
@@ -110,8 +110,6 @@ private:
/** Number of trophies required to access this challenge */
int m_num_trophies;
- irr::core::stringw m_challenge_description;
-
public:
ChallengeData(const std::string& filename);
@@ -195,10 +193,7 @@ public:
// ------------------------------------------------------------------------
/** Returns the description of this challenge.
*/
- const irr::core::stringw& getChallengeDescription() const
- {
- return m_challenge_description;
- } // getChallengeDescription
+ const irr::core::stringw getChallengeDescription() const;
// ------------------------------------------------------------------------
/** Returns the minimum position the player must have in order to win.
diff --git a/src/config/user_config.cpp b/src/config/user_config.cpp
index 40554f8b8..95f013d91 100644
--- a/src/config/user_config.cpp
+++ b/src/config/user_config.cpp
@@ -1,7 +1,7 @@
//
// SuperTuxKart - a fun racing game with go-kart
-// Copyright (C) 2006-2015 SuperTuxKart-Team
-// Modelled after Supertux's configfile.cpp
+// Copyright (C) 2006-2016 SuperTuxKart-Team
+// Modeled after Supertux's configfile.cpp
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -683,8 +683,8 @@ bool UserConfig::loadConfig()
XMLNode* root = file_manager->createXMLTree(filename);
if(!root || root->getName() != "stkconfig")
{
- Log::error("UserConfig",
- "Could not read user config file '%s'.", filename.c_str());
+ Log::info("UserConfig",
+ "Could not read user config file '%s'. A new file will be created.", filename.c_str());
if(root) delete root;
// Create a default config file - just in case that stk crashes later
// there is a config file that can be modified (to e.g. disable
diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp
index 235515e8a..a8267a858 100644
--- a/src/config/user_config.hpp
+++ b/src/config/user_config.hpp
@@ -491,6 +491,14 @@ namespace UserConfigParams
PARAM_PREFIX BoolUserConfigParam m_old_driver_popup
PARAM_DEFAULT(BoolUserConfigParam(true, "old_driver_popup",
&m_video_group, "Determines if popup message about too old drivers should be displayed."));
+ PARAM_PREFIX FloatUserConfigParam m_scale_rtts_factor
+ PARAM_DEFAULT(FloatUserConfigParam(1.0f, "scale_rtts_factor",
+ &m_video_group, "Allows to increase performance by setting lower RTTs "
+ "resolution. Value should be smaller or equal to 1.0"));
+ PARAM_PREFIX IntUserConfigParam m_max_texture_size
+ PARAM_DEFAULT(IntUserConfigParam(512, "max_texture_size",
+ &m_video_group, "Max texture size when high definition textures are "
+ "disabled"));
// ---- Debug - not saved to config file
/** If gamepad debugging is enabled. */
diff --git a/src/font/bold_face.cpp b/src/font/bold_face.cpp
index f32aea7b5..e9192de14 100644
--- a/src/font/bold_face.cpp
+++ b/src/font/bold_face.cpp
@@ -37,6 +37,7 @@ void BoldFace::init()
setFallbackFontScale(2.0f);*/
} // init
+
// ----------------------------------------------------------------------------
void BoldFace::reset()
{
diff --git a/src/font/digit_face.cpp b/src/font/digit_face.cpp
index 7b257fce5..2403c4d6d 100644
--- a/src/font/digit_face.cpp
+++ b/src/font/digit_face.cpp
@@ -33,6 +33,7 @@ void DigitFace::init()
m_font_max_height = m_glyph_max_height + 10;
} // init
+
// ----------------------------------------------------------------------------
void DigitFace::reset()
{
diff --git a/src/font/font_manager.cpp b/src/font/font_manager.cpp
index df237fb0b..82de84b3c 100644
--- a/src/font/font_manager.cpp
+++ b/src/font/font_manager.cpp
@@ -23,6 +23,8 @@
#include "font/digit_face.hpp"
#include "font/face_ttf.hpp"
#include "font/regular_face.hpp"
+#include "utils/string_utils.hpp"
+#include "utils/translation.hpp"
FontManager *font_manager = NULL;
// ----------------------------------------------------------------------------
@@ -77,3 +79,56 @@ void FontManager::checkFTError(FT_Error err, const std::string& desc) const
Log::error("FontManager", "Something wrong when %s!", desc.c_str());
}
} // checkFTError
+
+// ----------------------------------------------------------------------------
+void FontManager::unitTesting()
+{
+ std::vector list = *(translations->getLanguageList());
+ const int cur_log_level = Log::getLogLevel();
+ for (const std::string& lang : list)
+ {
+ // Hide gettext warning
+ Log::setLogLevel(5);
+ delete translations;
+#ifdef WIN32
+ std::string s=std::string("LANGUAGE=") + lang.c_str();
+ _putenv(s.c_str());
+#else
+ setenv("LANGUAGE", lang.c_str(), 1);
+#endif
+ translations = new Translations();
+ Log::setLogLevel(cur_log_level);
+ std::set used_chars = translations->getCurrentAllChar();
+ for (const wchar_t& c : used_chars)
+ {
+ // Skip non-printing characters
+ if (c < 32) continue;
+
+ unsigned int font_number = 0;
+ unsigned int glyph_index = 0;
+ while (font_number < m_normal_ttf->getTotalFaces())
+ {
+ glyph_index =
+ FT_Get_Char_Index(m_normal_ttf->getFace(font_number), c);
+ if (glyph_index > 0) break;
+ font_number++;
+ }
+ if (glyph_index > 0)
+ {
+ Log::debug("UnitTest", "Character %s in language %s"
+ " use face %s",
+ StringUtils::wideToUtf8(core::stringw(&c, 1)).c_str(),
+ lang.c_str(),
+ m_normal_ttf->getFace(font_number)->family_name);
+ }
+ else
+ {
+ Log::warn("UnitTest", "Character %s in language %s"
+ " is not supported by all fonts!",
+ StringUtils::wideToUtf8(core::stringw(&c, 1)).c_str(),
+ lang.c_str());
+ }
+ }
+ }
+
+} // unitTesting
diff --git a/src/font/font_manager.hpp b/src/font/font_manager.hpp
index aae90c0f3..f46249944 100644
--- a/src/font/font_manager.hpp
+++ b/src/font/font_manager.hpp
@@ -76,6 +76,8 @@ public:
// ------------------------------------------------------------------------
void loadFonts();
// ------------------------------------------------------------------------
+ void unitTesting();
+ // ------------------------------------------------------------------------
FT_Library getFTLibrary() const { return m_ft_library; }
}; // FontManager
diff --git a/src/font/font_with_face.cpp b/src/font/font_with_face.cpp
index 0e1659ae0..7dedffbef 100644
--- a/src/font/font_with_face.cpp
+++ b/src/font/font_with_face.cpp
@@ -116,6 +116,13 @@ void FontWithFace::createNewGlyphPage()
m_used_width = 0;
m_used_height = 0;
+ // Font textures can not be resized (besides the impact on quality in
+ // this case, the rectangles in spritebank would become wrong).
+ core::dimension2du old_max_size = irr_driver->getVideoDriver()
+ ->getDriverAttributes().getAttributeAsDimension2d("MAX_TEXTURE_SIZE");
+ irr_driver->getVideoDriver()->getNonConstDriverAttributes()
+ .setAttribute("MAX_TEXTURE_SIZE", core::dimension2du(0, 0));
+
video::ITexture* page_texture = irr_driver->getVideoDriver()
->addTexture("Glyph_page", m_page);
m_spritebank->addTexture(NULL);
@@ -127,6 +134,9 @@ void FontWithFace::createNewGlyphPage()
irr_driver->getVideoDriver()->removeTexture(page_texture);
assert(page_texture->getReferenceCount() == 1);
+ irr_driver->getVideoDriver()->getNonConstDriverAttributes()
+ .setAttribute("MAX_TEXTURE_SIZE", old_max_size);
+
} // createNewGlyphPage
// ----------------------------------------------------------------------------
@@ -172,13 +182,22 @@ void FontWithFace::insertGlyph(wchar_t c, const GlyphInfo& gi)
{
// Current glyph page is full:
// Save the old glyph page
+ core::dimension2du old_max_size = irr_driver->getVideoDriver()
+ ->getDriverAttributes().getAttributeAsDimension2d
+ ("MAX_TEXTURE_SIZE");
+ irr_driver->getVideoDriver()->getNonConstDriverAttributes()
+ .setAttribute("MAX_TEXTURE_SIZE", core::dimension2du(0, 0));
video::ITexture* page_texture = irr_driver->getVideoDriver()
->addTexture("Glyph_page", m_page);
+
m_spritebank->setTexture(m_spritebank->getTextureCount() - 1,
page_texture);
irr_driver->getVideoDriver()->removeTexture(page_texture);
assert(page_texture->getReferenceCount() == 1);
+ irr_driver->getVideoDriver()->getNonConstDriverAttributes()
+ .setAttribute("MAX_TEXTURE_SIZE", old_max_size);
+
// Clear and add a new one
createNewGlyphPage();
}
@@ -283,6 +302,11 @@ void FontWithFace::updateCharactersList()
m_new_char_holder.clear();
// Update last glyph page
+ core::dimension2du old_max_size = irr_driver->getVideoDriver()
+ ->getDriverAttributes().getAttributeAsDimension2d("MAX_TEXTURE_SIZE");
+ irr_driver->getVideoDriver()->getNonConstDriverAttributes()
+ .setAttribute("MAX_TEXTURE_SIZE", core::dimension2du(0, 0));
+
video::ITexture* page_texture = irr_driver->getVideoDriver()
->addTexture("Glyph_page", m_page);
m_spritebank->setTexture(m_spritebank->getTextureCount() - 1,
@@ -291,6 +315,9 @@ void FontWithFace::updateCharactersList()
irr_driver->getVideoDriver()->removeTexture(page_texture);
assert(page_texture->getReferenceCount() == 1);
+ irr_driver->getVideoDriver()->getNonConstDriverAttributes()
+ .setAttribute("MAX_TEXTURE_SIZE", old_max_size);
+
} // updateCharactersList
// ----------------------------------------------------------------------------
@@ -306,11 +333,11 @@ void FontWithFace::dumpGlyphPage(const std::string& name)
video::IImage* image = irr_driver->getVideoDriver()
->createImageFromData(col_format, size, data, false/*copy mem*/);
- tex->unlock();
- irr_driver->getVideoDriver()->writeImageToFile(image, std::string
- (name + "_" + StringUtils::toString(i) + ".png").c_str());
- image->drop();
- }
+ tex->unlock();
+ irr_driver->getVideoDriver()->writeImageToFile(image, std::string
+ (name + "_" + StringUtils::toString(i) + ".png").c_str());
+ image->drop();
+ }
} // dumpGlyphPage
// ----------------------------------------------------------------------------
diff --git a/src/font/font_with_face.hpp b/src/font/font_with_face.hpp
index e219c9c30..52417a03c 100644
--- a/src/font/font_with_face.hpp
+++ b/src/font/font_with_face.hpp
@@ -109,14 +109,12 @@ private:
FontWithFace* m_fallback_font;
float m_fallback_font_scale;
- /** A temporary holder stored new char to be inserted.
- */
+ /** A temporary holder stored new char to be inserted. */
std::set m_new_char_holder;
gui::IGUISpriteBank* m_spritebank;
- /** A full glyph page for this font.
- */
+ /** A full glyph page for this font. */
video::IImage* m_page;
unsigned int m_temp_height;
diff --git a/src/font/regular_face.cpp b/src/font/regular_face.cpp
index f86a9ffc1..0a5fc500a 100644
--- a/src/font/regular_face.cpp
+++ b/src/font/regular_face.cpp
@@ -33,6 +33,7 @@ void RegularFace::init()
m_font_max_height = m_glyph_max_height + 10;
} // init
+
// ----------------------------------------------------------------------------
void RegularFace::reset()
{
diff --git a/src/graphics/camera.cpp b/src/graphics/camera.cpp
index 3e6073eb0..e374c282b 100644
--- a/src/graphics/camera.cpp
+++ b/src/graphics/camera.cpp
@@ -73,7 +73,8 @@ Camera* Camera::createCamera(unsigned int index, CameraType type,
Camera *camera = NULL;
switch (type)
{
- case CM_TYPE_NORMAL: camera = new CameraNormal(index, kart); break;
+ case CM_TYPE_NORMAL: camera = new CameraNormal(CM_TYPE_NORMAL, index, kart);
+ break;
case CM_TYPE_DEBUG: camera = new CameraDebug (index, kart); break;
case CM_TYPE_FPS: camera = new CameraFPS (index, kart); break;
case CM_TYPE_END: camera = new CameraEnd (index, kart); break;
@@ -112,10 +113,11 @@ void Camera::resetAllCameras()
} // resetAllCameras
// ----------------------------------------------------------------------------
-Camera::Camera(int camera_index, AbstractKart* kart) : m_kart(NULL)
+Camera::Camera(CameraType type, int camera_index, AbstractKart* kart)
+ : m_kart(NULL)
{
m_mode = CM_NORMAL;
- m_type = CameraType::CM_TYPE_NORMAL;
+ m_type = type;
m_index = camera_index;
m_original_kart = kart;
m_camera = irr_driver->addCameraSceneNode();
diff --git a/src/graphics/camera.hpp b/src/graphics/camera.hpp
index 502918ef0..27f117557 100644
--- a/src/graphics/camera.hpp
+++ b/src/graphics/camera.hpp
@@ -126,9 +126,9 @@ protected:
AbstractKart *m_kart;
static Camera* createCamera(unsigned int index, CameraType type,
- AbstractKart* kart);
+ AbstractKart* kart);
- Camera(int camera_index, AbstractKart* kart);
+ Camera(CameraType type, int camera_index, AbstractKart* kart);
virtual ~Camera();
virtual void reset();
public:
diff --git a/src/graphics/camera_debug.cpp b/src/graphics/camera_debug.cpp
index ea0009b35..6069a6be7 100644
--- a/src/graphics/camera_debug.cpp
+++ b/src/graphics/camera_debug.cpp
@@ -32,7 +32,7 @@ CameraDebug::CameraDebugType CameraDebug::m_default_debug_Type =
// ============================================================================
CameraDebug::CameraDebug(int camera_index, AbstractKart* kart)
- : CameraNormal(camera_index, kart)
+ : CameraNormal(Camera::CM_TYPE_DEBUG, camera_index, kart)
{
reset();
} // Camera
diff --git a/src/graphics/camera_end.cpp b/src/graphics/camera_end.cpp
index d5f868747..971daaa79 100644
--- a/src/graphics/camera_end.cpp
+++ b/src/graphics/camera_end.cpp
@@ -27,7 +27,7 @@
AlignedArray CameraEnd::m_end_cameras;
// ============================================================================
CameraEnd::CameraEnd(int camera_index, AbstractKart* kart)
- : CameraNormal(camera_index, kart)
+ : CameraNormal(Camera::CM_TYPE_END, camera_index, kart)
{
reset();
if(m_end_cameras.size()>0)
diff --git a/src/graphics/camera_fps.cpp b/src/graphics/camera_fps.cpp
index 477e17d90..f66278a60 100644
--- a/src/graphics/camera_fps.cpp
+++ b/src/graphics/camera_fps.cpp
@@ -30,7 +30,7 @@ using namespace irr;
// ============================================================================
CameraFPS::CameraFPS(int camera_index, AbstractKart* kart)
- : Camera(camera_index, kart)
+ : Camera(Camera::CM_TYPE_FPS, camera_index, kart)
{
m_attached = false;
diff --git a/src/graphics/camera_normal.cpp b/src/graphics/camera_normal.cpp
index cc5231bb2..ea0bf098a 100644
--- a/src/graphics/camera_normal.cpp
+++ b/src/graphics/camera_normal.cpp
@@ -28,8 +28,17 @@
#include "tracks/track.hpp"
// ============================================================================
-CameraNormal::CameraNormal(int camera_index, AbstractKart* kart)
- : Camera(camera_index, kart)
+/** Constructor for the normal camera. This is the only camera constructor
+ * except for the base class that takes a camera type as parameter. This is
+ * because debug and end camera use the normal camera as their base class.
+ * \param type The type of the camera that is created (can be CM_TYPE_END
+ * or CM_TYPE_DEBUG).
+ * \param camera_index Index of this camera.
+ * \param Kart Pointer to the kart for which this camera is used.
+ */
+CameraNormal::CameraNormal(Camera::CameraType type, int camera_index,
+ AbstractKart* kart)
+ : Camera(type, camera_index, kart)
{
m_distance = kart ? kart->getKartProperties()->getCameraDistance() : 1000.0f;
m_ambient_light = World::getWorld()->getTrack()->getDefaultAmbientColor();
diff --git a/src/graphics/camera_normal.hpp b/src/graphics/camera_normal.hpp
index 24edea3bc..742b3aeae 100644
--- a/src/graphics/camera_normal.hpp
+++ b/src/graphics/camera_normal.hpp
@@ -61,7 +61,8 @@ private:
friend class Camera;
friend class CameraDebug;
friend class CameraEnd;
- CameraNormal(int camera_index, AbstractKart* kart);
+ CameraNormal(Camera::CameraType type, int camera_index,
+ AbstractKart* kart);
virtual ~CameraNormal() {}
public:
bool isDebug() { return false; }
diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp
index 5c754ab18..17c17a8c0 100644
--- a/src/graphics/irr_driver.cpp
+++ b/src/graphics/irr_driver.cpp
@@ -196,7 +196,6 @@ std::unique_ptr IrrDriver::createRenderTarget(const irr::core::dim
return m_renderer->createRenderTarget(dimension, name);
}
-
// ----------------------------------------------------------------------------
#if defined(__linux__) && !defined(ANDROID)
@@ -646,7 +645,9 @@ void IrrDriver::setMaxTextureSize()
if( (UserConfigParams::m_high_definition_textures & 0x01) == 0)
{
io::IAttributes &att = m_video_driver->getNonConstDriverAttributes();
- att.setAttribute("MAX_TEXTURE_SIZE", core::dimension2du(512, 512));
+ att.setAttribute("MAX_TEXTURE_SIZE", core::dimension2du(
+ UserConfigParams::m_max_texture_size,
+ UserConfigParams::m_max_texture_size));
}
} // setMaxTextureSize
diff --git a/src/graphics/material.cpp b/src/graphics/material.cpp
index fc2c37379..98a4d705b 100644
--- a/src/graphics/material.cpp
+++ b/src/graphics/material.cpp
@@ -143,6 +143,7 @@ Material::Material(const XMLNode *node, bool deprecated)
node->get("disable-z-write", &m_disable_z_write );
node->get("colorizable", &m_colorizable );
node->get("colorization-factor", &m_colorization_factor);
+ node->get("hue-settings", &m_hue_settings );
node->get("fog", &m_fog );
node->get("mask", &m_mask );
diff --git a/src/graphics/material.hpp b/src/graphics/material.hpp
index 8992e177e..735dc6614 100644
--- a/src/graphics/material.hpp
+++ b/src/graphics/material.hpp
@@ -21,6 +21,7 @@
#define HEADER_MATERIAL_HPP
#include "utils/no_copy.hpp"
+#include "utils/random_generator.hpp"
#include
#include