Merge branch 'fix_non_hd_option'
This commit is contained in:
commit
a560aafa50
@ -501,11 +501,11 @@ public:
|
||||
//! Gets an attribute as dimension2d
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
virtual core::dimension2d<u32> getAttributeAsDimension2d(const c8* attributeName) = 0;
|
||||
virtual core::dimension2d<u32> getAttributeAsDimension2d(const c8* attributeName) const = 0;
|
||||
|
||||
//! Gets an attribute as dimension2d
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) = 0;
|
||||
virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) const = 0;
|
||||
|
||||
//! Sets an attribute as dimension2d
|
||||
virtual void setAttribute(s32 index, core::dimension2d<u32> v) = 0;
|
||||
|
@ -324,6 +324,8 @@ namespace video
|
||||
AntiAlias (int) Number of Samples the driver uses for each pixel. 0 and 1 means anti aliasing is off, typical values are 2,4,8,16,32
|
||||
*/
|
||||
virtual const io::IAttributes& getDriverAttributes() const=0;
|
||||
//! Non-const version (with a different name to avoid involuntary mistakes). */
|
||||
virtual io::IAttributes& getNonConstDriverAttributes() = 0;
|
||||
|
||||
//! Check if the driver was recently reset.
|
||||
/** For d3d devices you will need to recreate the RTTs if the
|
||||
|
@ -429,7 +429,7 @@ void CAttributes::setAttribute(const c8* attributeName, core::dimension2d<u32> v
|
||||
//! Gets an attribute as dimension2d
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
core::dimension2d<u32> CAttributes::getAttributeAsDimension2d(const c8* attributeName)
|
||||
core::dimension2d<u32> CAttributes::getAttributeAsDimension2d(const c8* attributeName) const
|
||||
{
|
||||
IAttribute* att = getAttributeP(attributeName);
|
||||
if (att)
|
||||
@ -737,7 +737,7 @@ core::rect<s32> CAttributes::getAttributeAsRect(s32 index)
|
||||
|
||||
//! Gets an attribute as dimension2d
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
core::dimension2d<u32> CAttributes::getAttributeAsDimension2d(s32 index)
|
||||
core::dimension2d<u32> CAttributes::getAttributeAsDimension2d(s32 index) const
|
||||
{
|
||||
if ((u32)index < Attributes.size())
|
||||
return Attributes[index]->getDimension2d();
|
||||
|
@ -465,11 +465,11 @@ public:
|
||||
//! Gets an attribute as dimension2d
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
virtual core::dimension2d<u32> getAttributeAsDimension2d(const c8* attributeName);
|
||||
virtual core::dimension2d<u32> getAttributeAsDimension2d(const c8* attributeName) const;
|
||||
|
||||
//! Gets an attribute as dimension2d
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index);
|
||||
virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) const;
|
||||
|
||||
//! Sets an attribute as dimension2d
|
||||
virtual void setAttribute(s32 index, core::dimension2d<u32> v);
|
||||
|
@ -298,6 +298,11 @@ const io::IAttributes& CNullDriver::getDriverAttributes() const
|
||||
return *DriverAttributes;
|
||||
}
|
||||
|
||||
//! Get attributes of the actual video driver
|
||||
io::IAttributes& CNullDriver::getNonConstDriverAttributes()
|
||||
{
|
||||
return *DriverAttributes;
|
||||
}
|
||||
|
||||
//! sets transformation
|
||||
void CNullDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat)
|
||||
|
@ -64,6 +64,9 @@ namespace video
|
||||
//! Get attributes of the actual video driver
|
||||
const io::IAttributes& getDriverAttributes() const;
|
||||
|
||||
//! Non-const version (with a different name to avoid involuntary mistakes). */
|
||||
virtual io::IAttributes& getNonConstDriverAttributes();
|
||||
|
||||
//! sets transformation
|
||||
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat);
|
||||
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include "COpenGLDriver.h"
|
||||
#include "os.h"
|
||||
#include "CColorConverter.h"
|
||||
#include "IAttributes.h"
|
||||
#include "IrrlichtDevice.h"
|
||||
|
||||
#include "irrString.h"
|
||||
|
||||
@ -314,7 +316,17 @@ void COpenGLTexture::getImageValues(IImage* image)
|
||||
ImageSize.Width = (u32)(Driver->MaxTextureSize*ratio);
|
||||
}
|
||||
TextureSize=ImageSize.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT));
|
||||
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());
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect
|
||||
tex_width, tex_height,
|
||||
tex_center_pos_x, tex_center_pos_y;
|
||||
|
||||
getSize(texture->getOriginalSize().Width, texture->getOriginalSize().Height, texture->isRenderTarget(),
|
||||
getSize(texture->getSize().Width, texture->getSize().Height, texture->isRenderTarget(),
|
||||
destRect, sourceRect, width, height, center_pos_x, center_pos_y,
|
||||
tex_width, tex_height, tex_center_pos_x, tex_center_pos_y);
|
||||
|
||||
@ -206,7 +206,7 @@ void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect
|
||||
tex_width, tex_height,
|
||||
tex_center_pos_x, tex_center_pos_y;
|
||||
|
||||
getSize(texture->getOriginalSize().Width, texture->getOriginalSize().Height, texture->isRenderTarget(),
|
||||
getSize(texture->getSize().Width, texture->getSize().Height, texture->isRenderTarget(),
|
||||
destRect, sourceRect, width, height, center_pos_x, center_pos_y,
|
||||
tex_width, tex_height, tex_center_pos_x, tex_center_pos_y);
|
||||
|
||||
|
@ -592,10 +592,23 @@ void IrrDriver::initDevice()
|
||||
m_pointer_shown = true;
|
||||
} // initDevice
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
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));
|
||||
}
|
||||
} // setMaxTextureSize
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void IrrDriver::cleanSunInterposer()
|
||||
{
|
||||
delete m_sun_interposer;
|
||||
}
|
||||
} // cleanSunInterposer
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void IrrDriver::createSunInterposer()
|
||||
{
|
||||
scene::IMesh * sphere = m_scene_manager->getGeometryCreator()->createSphereMesh(1, 16, 16);
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include <SColor.h>
|
||||
#include "IrrlichtDevice.h"
|
||||
#include "ISkinnedMesh.h"
|
||||
//#include "graphics/rtts.hpp"
|
||||
#include "graphics/shaders.hpp"
|
||||
#include "graphics/wind.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
@ -354,6 +353,7 @@ public:
|
||||
~IrrDriver();
|
||||
void initDevice();
|
||||
void reset();
|
||||
void setMaxTextureSize();
|
||||
void getOpenGLData(std::string *vendor, std::string *renderer,
|
||||
std::string *version);
|
||||
|
||||
|
@ -226,8 +226,8 @@ GLuint generateCubeMapFromTextures(const std::vector<video::ITexture *> &texture
|
||||
unsigned size = 0;
|
||||
for (unsigned i = 0; i < 6; i++)
|
||||
{
|
||||
size = MAX2(size, textures[i]->getOriginalSize().Width);
|
||||
size = MAX2(size, textures[i]->getOriginalSize().Height);
|
||||
size = MAX2(size, textures[i]->getSize().Width);
|
||||
size = MAX2(size, textures[i]->getSize().Height);
|
||||
}
|
||||
|
||||
const unsigned texture_permutation[] = { 2, 3, 0, 1, 5, 4 };
|
||||
@ -299,8 +299,8 @@ void IrrDriver::generateDiffuseCoefficients()
|
||||
|
||||
for (unsigned i = 0; i < 6; i++)
|
||||
{
|
||||
sh_w = MAX2(sh_w, SphericalHarmonicsTextures[i]->getOriginalSize().Width);
|
||||
sh_h = MAX2(sh_h, SphericalHarmonicsTextures[i]->getOriginalSize().Height);
|
||||
sh_w = MAX2(sh_w, SphericalHarmonicsTextures[i]->getSize().Width);
|
||||
sh_h = MAX2(sh_h, SphericalHarmonicsTextures[i]->getSize().Height);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < 6; i++)
|
||||
|
@ -151,8 +151,8 @@ s32 STKModifiedSpriteBank::addTextureAsSprite(video::ITexture* texture)
|
||||
|
||||
u32 rectangleIndex = Rectangles.size();
|
||||
Rectangles.push_back( core::rect<s32>(0,0,
|
||||
texture->getOriginalSize().Width,
|
||||
texture->getOriginalSize().Height) );
|
||||
texture->getSize().Width,
|
||||
texture->getSize().Height) );
|
||||
|
||||
SGUISprite sprite;
|
||||
sprite.frameTime = 0;
|
||||
|
@ -4,16 +4,17 @@
|
||||
|
||||
#include "guiengine/scalable_font.hpp"
|
||||
|
||||
#include <IGUIEnvironment.h>
|
||||
#include <IXMLReader.h>
|
||||
#include <IReadFile.h>
|
||||
#include <IVideoDriver.h>
|
||||
#include <IGUISpriteBank.h>
|
||||
|
||||
#include "graphics/2dutils.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "graphics/2dutils.hpp"
|
||||
|
||||
#include <IAttributes.h>
|
||||
#include <IGUIEnvironment.h>
|
||||
#include <IGUISpriteBank.h>
|
||||
#include <IReadFile.h>
|
||||
#include <IVideoDriver.h>
|
||||
#include <IXMLReader.h>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
@ -732,7 +733,16 @@ void ScalableFont::lazyLoadTexture(int texID)
|
||||
|
||||
// load texture
|
||||
assert(m_texture_files[texID].m_file_name.size() > 0);
|
||||
|
||||
// Font textures can not be resized (besides the impact on quality in
|
||||
// this case, the indices in the xml files would become wrong).
|
||||
core::dimension2du old_max_size = Driver->getDriverAttributes()
|
||||
.getAttributeAsDimension2d("MAX_TEXTURE_SIZE");
|
||||
Driver->getNonConstDriverAttributes().setAttribute("MAX_TEXTURE_SIZE",
|
||||
core::dimension2du(0, 0));
|
||||
|
||||
SpriteBank->setTexture(texID, Driver->getTexture( m_texture_files[texID].m_file_name ));
|
||||
Driver->getNonConstDriverAttributes().setAttribute("MAX_TEXTURE_SIZE", old_max_size);
|
||||
|
||||
// set previous mip-map+filter state
|
||||
//Driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, mipmap);
|
||||
|
@ -1128,6 +1128,10 @@ void initRest()
|
||||
powerup_manager = new PowerupManager ();
|
||||
attachment_manager = new AttachmentManager ();
|
||||
highscore_manager = new HighscoreManager ();
|
||||
|
||||
// The maximum texture size can not be set earlier, since
|
||||
// e.g. the background image needs to be loaded in high res.
|
||||
irr_driver->setMaxTextureSize();
|
||||
KartPropertiesManager::addKartSearchDir(
|
||||
file_manager->getAddonsFile("karts/"));
|
||||
track_manager->addTrackSearchDir(
|
||||
|
@ -62,6 +62,7 @@ struct GFXPreset
|
||||
bool dof;
|
||||
bool global_illumination;
|
||||
bool degraded_ibl;
|
||||
int hd_textures;
|
||||
};
|
||||
|
||||
static GFXPreset GFX_PRESETS[] =
|
||||
@ -70,35 +71,35 @@ static GFXPreset GFX_PRESETS[] =
|
||||
false /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
|
||||
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, false /* weather */,
|
||||
false /* animatedScenery */, 0 /* animatedCharacters */, 0 /* anisotropy */,
|
||||
false /* depth of field */, false /* global illumination */, true /* degraded IBL */
|
||||
false /* depth of field */, false /* global illumination */, true /* degraded IBL */, 0 /* hd_textures */
|
||||
},
|
||||
|
||||
{
|
||||
false /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
|
||||
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, false /* weather */,
|
||||
true /* animatedScenery */, 1 /* animatedCharacters */, 4 /* anisotropy */,
|
||||
false /* depth of field */, false /* global illumination */, true /* degraded IBL */
|
||||
false /* depth of field */, false /* global illumination */, true /* degraded IBL */, 0 /* hd_textures */
|
||||
},
|
||||
|
||||
{
|
||||
true /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
|
||||
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, true /* weather */,
|
||||
true /* animatedScenery */, 1 /* animatedCharacters */, 4 /* anisotropy */,
|
||||
false /* depth of field */, false /* global illumination */, true /* degraded IBL */
|
||||
false /* depth of field */, false /* global illumination */, true /* degraded IBL */, 1 /* hd_textures */
|
||||
},
|
||||
|
||||
{
|
||||
true /* light */, 0 /* shadow */, false /* bloom */, true /* motionblur */,
|
||||
true /* lightshaft */, true /* glow */, true /* mlaa */, false /* ssao */, true /* weather */,
|
||||
true /* animatedScenery */, 1 /* animatedCharacters */, 8 /* anisotropy */,
|
||||
false /* depth of field */, false /* global illumination */, false /* degraded IBL */
|
||||
false /* depth of field */, false /* global illumination */, false /* degraded IBL */, 1 /* hd_textures */
|
||||
},
|
||||
|
||||
{
|
||||
true /* light */, 1024 /* shadow */, true /* bloom */, true /* motionblur */,
|
||||
true /* lightshaft */, true /* glow */, true /* mlaa */, true /* ssao */, true /* weather */,
|
||||
true /* animatedScenery */, 2 /* animatedCharacters */, 16 /* anisotropy */,
|
||||
true /* depth of field */, true /* global illumination */, false /* degraded IBL */
|
||||
true /* depth of field */, true /* global illumination */, false /* degraded IBL */, 1 /* hd_textures */
|
||||
}
|
||||
};
|
||||
|
||||
@ -397,7 +398,8 @@ void OptionsScreenVideo::updateGfxSlider()
|
||||
GFX_PRESETS[l].weather == UserConfigParams::m_weather_effects &&
|
||||
GFX_PRESETS[l].dof == UserConfigParams::m_dof &&
|
||||
GFX_PRESETS[l].global_illumination == UserConfigParams::m_gi &&
|
||||
GFX_PRESETS[l].degraded_ibl == UserConfigParams::m_degraded_IBL)
|
||||
GFX_PRESETS[l].degraded_ibl == UserConfigParams::m_degraded_IBL &&
|
||||
GFX_PRESETS[l].hd_textures == (UserConfigParams::m_high_definition_textures & 0x01))
|
||||
{
|
||||
gfx->setValue(l + 1);
|
||||
found = true;
|
||||
@ -488,7 +490,11 @@ void OptionsScreenVideo::updateTooltip()
|
||||
//I18N: in graphical options
|
||||
tooltip = tooltip + L"\n" + _("Global illumination : %s",
|
||||
UserConfigParams::m_gi ? enabled : disabled);
|
||||
|
||||
|
||||
//I18N: in graphical options
|
||||
tooltip = tooltip + L"\n" + _("Use high definition textures") + L" : " +
|
||||
((UserConfigParams::m_high_definition_textures & 0x1) == 0 ? disabled : enabled);
|
||||
|
||||
gfx->setTooltip(tooltip);
|
||||
} // updateTooltip
|
||||
|
||||
@ -570,6 +576,7 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
|
||||
UserConfigParams::m_dof = GFX_PRESETS[level].dof;
|
||||
UserConfigParams::m_gi = GFX_PRESETS[level].global_illumination;
|
||||
UserConfigParams::m_degraded_IBL = GFX_PRESETS[level].degraded_ibl;
|
||||
UserConfigParams::m_high_definition_textures = 0x02 | GFX_PRESETS[level].hd_textures;
|
||||
|
||||
updateGfxSlider();
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ void RaceGUI::drawScores()
|
||||
offsetX + (int)(m_minimap_player_size/1.25f),
|
||||
offsetY + (int)(m_minimap_player_size/1.25f));
|
||||
core::rect<s32> sourceRect(core::position2d<s32>(0,0),
|
||||
team_icon->getOriginalSize());
|
||||
team_icon->getSize());
|
||||
draw2DImage(team_icon,indicatorPos,sourceRect,
|
||||
NULL,NULL,true);
|
||||
numLeader++;
|
||||
@ -357,7 +357,7 @@ void RaceGUI::drawGlobalMiniMap()
|
||||
if (old_rtt_mini_map != NULL)
|
||||
{
|
||||
core::rect<s32> source(core::position2di(0, 0),
|
||||
old_rtt_mini_map->getOriginalSize());
|
||||
old_rtt_mini_map->getSize());
|
||||
draw2DImage(old_rtt_mini_map, dest, source,
|
||||
NULL, NULL, true);
|
||||
}
|
||||
@ -380,7 +380,7 @@ void RaceGUI::drawGlobalMiniMap()
|
||||
|
||||
video::ITexture* icon = kart->getKartProperties()->getMinimapIcon();
|
||||
|
||||
// int marker_height = m_marker->getOriginalSize().Height;
|
||||
// int marker_height = m_marker->getSize().Height;
|
||||
core::rect<s32> source(core::position2di(0, 0), icon->getSize());
|
||||
int marker_half_size = (kart->getController()->isPlayerController()
|
||||
? m_minimap_player_size
|
||||
@ -720,7 +720,7 @@ void RaceGUI::drawSpeedEnergyRank(const AbstractKart* kart,
|
||||
(int)offset.Y);
|
||||
video::ITexture *meter_texture = m_speed_meter_icon->getTexture();
|
||||
const core::rect<s32> meter_texture_coords(core::position2d<s32>(0,0),
|
||||
meter_texture->getOriginalSize());
|
||||
meter_texture->getSize());
|
||||
draw2DImage(meter_texture, meter_pos, meter_texture_coords, NULL,
|
||||
NULL, true);
|
||||
// TODO: temporary workaround, shouldn't have to use
|
||||
|
@ -327,7 +327,7 @@ void RaceGUIBase::drawPowerupIcons(const AbstractKart* kart,
|
||||
assert(powerup->getIcon() != NULL);
|
||||
video::ITexture *t=powerup->getIcon()->getTexture();
|
||||
assert(t != NULL);
|
||||
core::rect<s32> rect(core::position2di(0, 0), t->getOriginalSize());
|
||||
core::rect<s32> rect(core::position2di(0, 0), t->getSize());
|
||||
|
||||
for ( int i = 0 ; i < n ; i++ )
|
||||
{
|
||||
@ -588,7 +588,7 @@ void RaceGUIBase::drawGlobalMusicDescription()
|
||||
noteX+iconSizeX/2+20,
|
||||
noteY+iconSizeY/2+ICON_SIZE/2);
|
||||
const core::rect<s32> source(core::position2d<s32>(0,0),
|
||||
t->getOriginalSize());
|
||||
t->getSize());
|
||||
|
||||
draw2DImage(t, dest, source,
|
||||
NULL, NULL, true);
|
||||
@ -855,7 +855,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
100+(int)(100*cos(M_PI/2*i+World::getWorld()->getTime()*2)));
|
||||
}
|
||||
const core::rect<s32> rect(core::position2d<s32>(0,0),
|
||||
m_icons_frame->getTexture()->getOriginalSize());
|
||||
m_icons_frame->getTexture()->getSize());
|
||||
draw2DImage(
|
||||
m_icons_frame->getTexture(), pos, rect,NULL, colors, true);
|
||||
}
|
||||
@ -864,7 +864,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
if (icon && !kart->getKartAnimation() && !kart->isSquashed())
|
||||
{
|
||||
const core::rect<s32> rect(core::position2d<s32>(0,0),
|
||||
icon->getOriginalSize());
|
||||
icon->getSize());
|
||||
draw2DImage(icon, pos, rect,
|
||||
NULL, NULL, true);
|
||||
}
|
||||
@ -877,7 +877,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
float t = kart->getKartAnimation()->getAnimationTimer();
|
||||
float t_anim=100*sin(0.5f*M_PI*t);
|
||||
const core::rect<s32> rect1(core::position2d<s32>(0,0),
|
||||
icon->getOriginalSize());
|
||||
icon->getSize());
|
||||
const core::rect<s32> pos1((int)(x-t_anim), y,
|
||||
(int)(x+w-t_anim), y+w);
|
||||
draw2DImage(icon, pos1, rect1,
|
||||
@ -890,7 +890,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
const core::rect<s32> destRect(core::position2d<s32>(x,y+w/4),
|
||||
core::position2d<s32>(x+w,y+w*3/4));
|
||||
const core::rect<s32> sourceRect(core::position2d<s32>(0,0),
|
||||
icon->getOriginalSize());
|
||||
icon->getSize());
|
||||
draw2DImage(icon, destRect,
|
||||
sourceRect, NULL, NULL,
|
||||
true);
|
||||
@ -902,8 +902,8 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
//exploses into 4 parts
|
||||
float t = kart->getKartAnimation()->getAnimationTimer();
|
||||
float t_anim=50.0f*sin(0.5f*M_PI*t);
|
||||
u16 icon_size_x=icon->getOriginalSize().Width;
|
||||
u16 icon_size_y=icon->getOriginalSize().Height;
|
||||
u16 icon_size_x=icon->getSize().Width;
|
||||
u16 icon_size_y=icon->getSize().Height;
|
||||
|
||||
const core::rect<s32> rect1(0, 0, icon_size_x/2,icon_size_y/2);
|
||||
const core::rect<s32> pos1((int)(x-t_anim), (int)(y-t_anim),
|
||||
@ -940,7 +940,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
if (icon_plunger != NULL)
|
||||
{
|
||||
const core::rect<s32> rect(core::position2d<s32>(0,0),
|
||||
icon_plunger->getOriginalSize());
|
||||
icon_plunger->getSize());
|
||||
const core::rect<s32> pos1(x+10, y-10, x+w+10, y+w-10);
|
||||
draw2DImage(icon_plunger, pos1,
|
||||
rect, NULL, NULL,
|
||||
@ -956,7 +956,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
if (icon_attachment != NULL)
|
||||
{
|
||||
const core::rect<s32> rect(core::position2d<s32>(0,0),
|
||||
icon_attachment->getOriginalSize());
|
||||
icon_attachment->getSize());
|
||||
const core::rect<s32> pos1(x-20, y-10, x+w-20, y+w-10);
|
||||
draw2DImage(icon_attachment,
|
||||
pos1, rect, NULL,
|
||||
@ -1054,7 +1054,7 @@ void RaceGUIBase::drawPlungerInFace(const Camera *camera, float dt)
|
||||
plunger_x+plunger_size, offset_y+plunger_size);
|
||||
|
||||
const core::rect<s32> source(core::position2d<s32>(0,0),
|
||||
t->getOriginalSize());
|
||||
t->getSize());
|
||||
|
||||
draw2DImage(t, dest, source,
|
||||
&viewport /* clip */,
|
||||
|
@ -330,7 +330,7 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
|
||||
if (old_rtt_mini_map != NULL)
|
||||
{
|
||||
core::rect<s32> source(core::position2di(0, 0), old_rtt_mini_map->getOriginalSize());
|
||||
core::rect<s32> source(core::position2di(0, 0), old_rtt_mini_map->getSize());
|
||||
draw2DImage(old_rtt_mini_map, dest, source, 0, 0, true);
|
||||
}
|
||||
else if (new_rtt_mini_map != NULL)
|
||||
@ -381,7 +381,7 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
colors[i]=kart->getKartProperties()->getColor();
|
||||
}
|
||||
const core::rect<s32> rect(core::position2d<s32>(0,0),
|
||||
m_icons_frame->getTexture()->getOriginalSize());
|
||||
m_icons_frame->getTexture()->getSize());
|
||||
|
||||
draw2DImage(m_icons_frame->getTexture(), position,
|
||||
rect, NULL, colors, true);
|
||||
@ -410,7 +410,7 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
else if (c->isSolved(RaceManager::DIFFICULTY_EASY)) state = COMPLETED_EASY;
|
||||
|
||||
const core::rect<s32> source(core::position2d<s32>(0,0),
|
||||
m_icons[state]->getOriginalSize());
|
||||
m_icons[state]->getSize());
|
||||
|
||||
int marker_size = m_minimap_challenge_size;
|
||||
core::position2di mouse = irr_driver->getMouseLocation();
|
||||
|
@ -963,6 +963,8 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
// and configure the path to them before loading the mesh.
|
||||
if ( (UserConfigParams::m_high_definition_textures & 0x01) == 0x00)
|
||||
{
|
||||
#undef USE_RESIZE_CACHE
|
||||
#ifdef USE_RESIZE_CACHE
|
||||
std::string cached_textures_dir =
|
||||
irr_driver->generateSmallerTextures(m_root);
|
||||
|
||||
@ -972,10 +974,11 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
std::string texture_default_path =
|
||||
scene_params->getAttributeAsString(scene::B3D_TEXTURE_PATH).c_str();
|
||||
scene_params->setAttribute(scene::B3D_TEXTURE_PATH, cached_textures_dir.c_str());
|
||||
|
||||
#endif
|
||||
mesh = irr_driver->getMesh(full_path);
|
||||
|
||||
#ifdef USE_RESIZE_CACHE
|
||||
scene_params->setAttribute(scene::B3D_TEXTURE_PATH, texture_default_path.c_str());
|
||||
#endif
|
||||
}
|
||||
else // Load mesh with default (hd) textures
|
||||
{
|
||||
@ -1637,6 +1640,10 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
|
||||
file_manager->pushTextureSearchPath(m_root);
|
||||
file_manager->pushModelSearchPath (m_root);
|
||||
|
||||
// For now ignore the resize cache, since atm it only handles texturs in
|
||||
// the track directory.
|
||||
#undef USE_RESIZE_CACHE
|
||||
#ifdef USE_RESIZE_CACHE
|
||||
// If the hd texture option is disabled, we generate smaller textures
|
||||
// and we also add the cache directory to the texture search path
|
||||
if ( (UserConfigParams::m_high_definition_textures & 0x01) == 0x00)
|
||||
@ -1645,7 +1652,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
|
||||
irr_driver->generateSmallerTextures(m_root);
|
||||
file_manager->pushTextureSearchPath(cached_textures_dir);
|
||||
}
|
||||
|
||||
#endif
|
||||
// First read the temporary materials.xml file if it exists
|
||||
try
|
||||
{
|
||||
@ -1823,10 +1830,12 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
|
||||
World::getWorld()->setClearbackBufferColor(m_sky_color);
|
||||
}
|
||||
|
||||
#ifdef USE_RESIZE_CACHE
|
||||
if (!UserConfigParams::m_high_definition_textures)
|
||||
{
|
||||
file_manager->popTextureSearchPath();
|
||||
}
|
||||
#endif
|
||||
file_manager->popTextureSearchPath();
|
||||
file_manager->popModelSearchPath ();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user