Merge branch '1954-fix'
This commit is contained in:
commit
c8ae3d117a
@ -65,10 +65,9 @@ float &tex_width, float &tex_height,
|
||||
float &tex_center_pos_x, float &tex_center_pos_y
|
||||
)
|
||||
{
|
||||
core::dimension2d<u32> frame_size =
|
||||
irr_driver->getVideoDriver()->getCurrentRenderTargetSize();
|
||||
core::dimension2d<u32> frame_size = irr_driver->getActualScreenSize();
|
||||
const int screen_w = frame_size.Width;
|
||||
const int screen_h = frame_size.Height;
|
||||
const int screen_h = frame_size.Height;
|
||||
center_pos_x = float(destRect.UpperLeftCorner.X + destRect.LowerRightCorner.X);
|
||||
center_pos_x /= screen_w;
|
||||
center_pos_x -= 1.;
|
||||
@ -137,7 +136,7 @@ void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect
|
||||
return;
|
||||
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
const core::dimension2d<u32>& renderTargetSize = irr_driver->getVideoDriver()->getCurrentRenderTargetSize();
|
||||
const core::dimension2d<u32>& renderTargetSize = irr_driver->getActualScreenSize();
|
||||
glScissor(clipRect->UpperLeftCorner.X, renderTargetSize.Height - clipRect->LowerRightCorner.Y,
|
||||
clipRect->getWidth(), clipRect->getHeight());
|
||||
}
|
||||
@ -226,7 +225,7 @@ void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect
|
||||
return;
|
||||
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
const core::dimension2d<u32>& renderTargetSize = irr_driver->getVideoDriver()->getCurrentRenderTargetSize();
|
||||
const core::dimension2d<u32>& renderTargetSize = irr_driver->getActualScreenSize();
|
||||
glScissor(clipRect->UpperLeftCorner.X, renderTargetSize.Height - clipRect->LowerRightCorner.Y,
|
||||
clipRect->getWidth(), clipRect->getHeight());
|
||||
}
|
||||
@ -288,8 +287,7 @@ void GL32_draw2DRectangle(video::SColor color, const core::rect<s32>& position,
|
||||
return;
|
||||
}
|
||||
|
||||
core::dimension2d<u32> frame_size =
|
||||
irr_driver->getVideoDriver()->getCurrentRenderTargetSize();
|
||||
core::dimension2d<u32> frame_size = irr_driver->getActualScreenSize();
|
||||
const int screen_w = frame_size.Width;
|
||||
const int screen_h = frame_size.Height;
|
||||
float center_pos_x = float(position.UpperLeftCorner.X + position.LowerRightCorner.X);
|
||||
@ -319,7 +317,7 @@ void GL32_draw2DRectangle(video::SColor color, const core::rect<s32>& position,
|
||||
return;
|
||||
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
const core::dimension2d<u32>& renderTargetSize = irr_driver->getVideoDriver()->getCurrentRenderTargetSize();
|
||||
const core::dimension2d<u32>& renderTargetSize = irr_driver->getActualScreenSize();
|
||||
glScissor(clip->UpperLeftCorner.X, renderTargetSize.Height - clip->LowerRightCorner.Y,
|
||||
clip->getWidth(), clip->getHeight());
|
||||
}
|
||||
|
@ -164,21 +164,21 @@ void Camera::readEndCamera(const XMLNode &root)
|
||||
*/
|
||||
void Camera::setupCamera()
|
||||
{
|
||||
m_aspect = (float)(UserConfigParams::m_width)/UserConfigParams::m_height;
|
||||
m_aspect = (float)(irr_driver->getActualScreenSize().Width)/irr_driver->getActualScreenSize().Height;
|
||||
switch(race_manager->getNumLocalPlayers())
|
||||
{
|
||||
case 1: m_viewport = core::recti(0, 0,
|
||||
UserConfigParams::m_width,
|
||||
UserConfigParams::m_height);
|
||||
irr_driver->getActualScreenSize().Width,
|
||||
irr_driver->getActualScreenSize().Height);
|
||||
m_scaling = core::vector2df(1.0f, 1.0f);
|
||||
m_fov = DEGREE_TO_RAD*75.0f;
|
||||
break;
|
||||
case 2: m_viewport = core::recti(0,
|
||||
m_index==0 ? 0
|
||||
: UserConfigParams::m_height>>1,
|
||||
UserConfigParams::m_width,
|
||||
m_index==0 ? UserConfigParams::m_height>>1
|
||||
: UserConfigParams::m_height);
|
||||
: irr_driver->getActualScreenSize().Height>>1,
|
||||
irr_driver->getActualScreenSize().Width,
|
||||
m_index==0 ? irr_driver->getActualScreenSize().Height>>1
|
||||
: irr_driver->getActualScreenSize().Height);
|
||||
m_scaling = core::vector2df(1.0f, 0.5f);
|
||||
m_aspect *= 2.0f;
|
||||
m_fov = DEGREE_TO_RAD*65.0f;
|
||||
@ -188,19 +188,19 @@ void Camera::setupCamera()
|
||||
if(m_index<2)
|
||||
{
|
||||
m_viewport = core::recti(m_index==0 ? 0
|
||||
: UserConfigParams::m_width>>1,
|
||||
: irr_driver->getActualScreenSize().Width>>1,
|
||||
0,
|
||||
m_index==0 ? UserConfigParams::m_width>>1
|
||||
: UserConfigParams::m_width,
|
||||
UserConfigParams::m_height>>1);
|
||||
m_index==0 ? irr_driver->getActualScreenSize().Width>>1
|
||||
: irr_driver->getActualScreenSize().Width,
|
||||
irr_driver->getActualScreenSize().Height>>1);
|
||||
m_scaling = core::vector2df(0.5f, 0.5f);
|
||||
m_fov = DEGREE_TO_RAD*50.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_viewport = core::recti(0, UserConfigParams::m_height>>1,
|
||||
UserConfigParams::m_width,
|
||||
UserConfigParams::m_height);
|
||||
m_viewport = core::recti(0, irr_driver->getActualScreenSize().Height>>1,
|
||||
irr_driver->getActualScreenSize().Width,
|
||||
irr_driver->getActualScreenSize().Height);
|
||||
m_scaling = core::vector2df(1.0f, 0.5f);
|
||||
m_fov = DEGREE_TO_RAD*65.0f;
|
||||
m_aspect *= 2.0f;
|
||||
@ -208,10 +208,10 @@ void Camera::setupCamera()
|
||||
break;*/
|
||||
case 4:
|
||||
{ // g++ 4.3 whines about the variables in switch/case if not {}-wrapped (???)
|
||||
const int x1 = (m_index%2==0 ? 0 : UserConfigParams::m_width>>1);
|
||||
const int y1 = (m_index<2 ? 0 : UserConfigParams::m_height>>1);
|
||||
const int x2 = (m_index%2==0 ? UserConfigParams::m_width>>1 : UserConfigParams::m_width);
|
||||
const int y2 = (m_index<2 ? UserConfigParams::m_height>>1 : UserConfigParams::m_height);
|
||||
const int x1 = (m_index%2==0 ? 0 : irr_driver->getActualScreenSize().Width>>1);
|
||||
const int y1 = (m_index<2 ? 0 : irr_driver->getActualScreenSize().Height>>1);
|
||||
const int x2 = (m_index%2==0 ? irr_driver->getActualScreenSize().Width>>1 : irr_driver->getActualScreenSize().Width);
|
||||
const int y2 = (m_index<2 ? irr_driver->getActualScreenSize().Height>>1 : irr_driver->getActualScreenSize().Height);
|
||||
m_viewport = core::recti(x1, y1, x2, y2);
|
||||
m_scaling = core::vector2df(0.5f, 0.5f);
|
||||
m_fov = DEGREE_TO_RAD*50.0f;
|
||||
@ -222,8 +222,8 @@ void Camera::setupCamera()
|
||||
Log::warn("Camera", "Incorrect number of players: '%d' - assuming 1.",
|
||||
race_manager->getNumLocalPlayers());
|
||||
m_viewport = core::recti(0, 0,
|
||||
UserConfigParams::m_width,
|
||||
UserConfigParams::m_height);
|
||||
irr_driver->getActualScreenSize().Width,
|
||||
irr_driver->getActualScreenSize().Height);
|
||||
m_scaling = core::vector2df(1.0f, 1.0f);
|
||||
m_fov = DEGREE_TO_RAD*75.0f;
|
||||
break;
|
||||
|
@ -478,6 +478,9 @@ void IrrDriver::initDevice()
|
||||
m_gui_env = m_device->getGUIEnvironment();
|
||||
m_video_driver = m_device->getVideoDriver();
|
||||
m_sync = 0;
|
||||
|
||||
m_actual_screen_size = m_video_driver->getCurrentRenderTargetSize();
|
||||
|
||||
CVS->init();
|
||||
|
||||
|
||||
|
@ -211,6 +211,7 @@ private:
|
||||
bool m_rsm_matrix_initialized;
|
||||
bool m_rsm_map_available;
|
||||
core::vector2df m_current_screen_size;
|
||||
core::dimension2du m_actual_screen_size;
|
||||
|
||||
/** Additional details to be shown in case that a texture is not found.
|
||||
* This is used to specify details like: "while loading kart '...'" */
|
||||
@ -684,6 +685,7 @@ public:
|
||||
const core::matrix4 &getProjViewMatrix() const { return m_ProjViewMatrix; }
|
||||
const core::matrix4 &getInvProjViewMatrix() const { return m_InvProjViewMatrix; }
|
||||
const core::vector2df &getCurrentScreenSize() const { return m_current_screen_size; }
|
||||
const core::dimension2du getActualScreenSize() const { return m_actual_screen_size; }
|
||||
// ------------------------------------------------------------------------
|
||||
float getSSAORadius() const
|
||||
{
|
||||
|
@ -98,11 +98,11 @@ void PostProcessing::reset()
|
||||
const core::recti &vp = Camera::getCamera(i)->getViewport();
|
||||
// Map viewport to [-1,1] x [-1,1]. First define the coordinates
|
||||
// left, right, top, bottom:
|
||||
float right = vp.LowerRightCorner.X < UserConfigParams::m_width
|
||||
float right = vp.LowerRightCorner.X < irr_driver->getActualScreenSize().Width
|
||||
? 0.0f : 1.0f;
|
||||
float left = vp.UpperLeftCorner.X > 0.0f ? 0.0f : -1.0f;
|
||||
float top = vp.UpperLeftCorner.Y > 0.0f ? 0.0f : 1.0f;
|
||||
float bottom = vp.LowerRightCorner.Y < UserConfigParams::m_height
|
||||
float bottom = vp.LowerRightCorner.Y < irr_driver->getActualScreenSize().Height
|
||||
? 0.0f : -1.0f;
|
||||
|
||||
// Use left etc to define 4 vertices on which the rendered screen
|
||||
@ -672,7 +672,7 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode, boo
|
||||
|
||||
// Fade to quarter
|
||||
irr_driver->getFBO(FBO_QUARTER1).Bind();
|
||||
glViewport(0, 0, UserConfigParams::m_width / 4, UserConfigParams::m_height / 4);
|
||||
glViewport(0, 0, irr_driver->getActualScreenSize().Width / 4, irr_driver->getActualScreenSize().Height / 4);
|
||||
renderGodFade(out_fbo->getRTT()[0], col);
|
||||
|
||||
// Blur
|
||||
|
@ -282,8 +282,8 @@ void IrrDriver::renderGLSL(float dt)
|
||||
|
||||
// Use full screen size
|
||||
float tmp[2];
|
||||
tmp[0] = float(UserConfigParams::m_width);
|
||||
tmp[1] = float(UserConfigParams::m_height);
|
||||
tmp[0] = float(m_actual_screen_size.Width);
|
||||
tmp[1] = float(m_actual_screen_size.Height);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, SharedObject::ViewProjectionMatrixesUBO);
|
||||
glBufferSubData(GL_UNIFORM_BUFFER, (16 * 9) * sizeof(float), 2 * sizeof(float), tmp);
|
||||
|
||||
@ -294,8 +294,8 @@ void IrrDriver::renderGLSL(float dt)
|
||||
|
||||
// Set the viewport back to the full screen for race gui
|
||||
m_video_driver->setViewPort(core::recti(0, 0,
|
||||
UserConfigParams::m_width,
|
||||
UserConfigParams::m_height));
|
||||
irr_driver->getActualScreenSize().Width,
|
||||
irr_driver->getActualScreenSize().Height));
|
||||
|
||||
for(unsigned int i=0; i<Camera::getNumCameras(); i++)
|
||||
{
|
||||
|
@ -310,7 +310,9 @@ FrameBuffer* RTT::render(scene::ICameraSceneNode* camera, float dt)
|
||||
FrameBuffer* frame_buffer = irr_driver->getPostProcessing()->render(camera, false);
|
||||
|
||||
// reset
|
||||
glViewport(0, 0, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glViewport(0, 0,
|
||||
irr_driver->getActualScreenSize().Width,
|
||||
irr_driver->getActualScreenSize().Height);
|
||||
irr_driver->setRTT(NULL);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "guiengine/screen.hpp"
|
||||
|
||||
#include "io/file_manager.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/layout_manager.hpp"
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
@ -234,16 +235,14 @@ void Screen::manualRemoveWidget(Widget* w)
|
||||
/** \brief Implementing method from AbstractTopLevelContainer */
|
||||
int Screen::getWidth()
|
||||
{
|
||||
core::dimension2d<u32> frame_size = GUIEngine::getDriver()->getCurrentRenderTargetSize();
|
||||
return frame_size.Width;
|
||||
return irr_driver->getActualScreenSize().Width;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/** \brief Implementing method from AbstractTopLevelContainer */
|
||||
int Screen::getHeight()
|
||||
{
|
||||
core::dimension2d<u32> frame_size = GUIEngine::getDriver()->getCurrentRenderTargetSize();
|
||||
return frame_size.Height;
|
||||
return irr_driver->getActualScreenSize().Height;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -346,8 +346,7 @@ void Skin::drawBgImage()
|
||||
|
||||
source_area = core::recti(0, 0, texture_w, texture_h);
|
||||
|
||||
core::dimension2d<u32> frame_size =
|
||||
GUIEngine::getDriver()->getCurrentRenderTargetSize();
|
||||
core::dimension2d<u32> frame_size = irr_driver->getActualScreenSize();
|
||||
const int screen_w = frame_size.Width;
|
||||
const int screen_h = frame_size.Height;
|
||||
|
||||
@ -971,7 +970,7 @@ void Skin::drawRibbonChild(const core::recti &rect, Widget* widget,
|
||||
// automatically guess from position on-screen if tabs go up or down
|
||||
const bool vertical_flip =
|
||||
(unsigned int)rect.UpperLeftCorner.Y <
|
||||
GUIEngine::getDriver()->getCurrentRenderTargetSize().Height/2;
|
||||
irr_driver->getActualScreenSize().Height / 2;
|
||||
params->m_vertical_flip = vertical_flip;
|
||||
|
||||
core::recti rect2 = rect;
|
||||
@ -2254,9 +2253,8 @@ void Skin::drawBGFadeColor()
|
||||
SColor color = SkinConfig::m_colors["dialog_background::neutral"];
|
||||
if (m_dialog_size < 1.0f)
|
||||
color.setAlpha( (unsigned int)(color.getAlpha()*m_dialog_size ));
|
||||
GL32_draw2DRectangle(color,
|
||||
core::recti(position2d< s32 >(0,0),
|
||||
GUIEngine::getDriver()->getCurrentRenderTargetSize()) );
|
||||
GL32_draw2DRectangle(color, core::recti(position2d< s32 >(0,0),
|
||||
irr_driver->getActualScreenSize()));
|
||||
} // drawBGFadeColor
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -80,7 +80,7 @@ RaceGUI::RaceGUI()
|
||||
// special case : when 3 players play, use available 4th space for such things
|
||||
if (race_manager->getNumLocalPlayers() == 3)
|
||||
{
|
||||
m_map_left = UserConfigParams::m_width - m_map_width;
|
||||
m_map_left = irr_driver->getActualScreenSize().Width - m_map_width;
|
||||
}
|
||||
|
||||
m_is_tutorial = (race_manager->getTrackName() == "tutorial");
|
||||
@ -148,10 +148,10 @@ void RaceGUI::renderGlobal(float dt)
|
||||
{
|
||||
static video::SColor black = video::SColor(255,0,0,0);
|
||||
GL32_draw2DRectangle(black,
|
||||
core::rect<s32>(UserConfigParams::m_width/2,
|
||||
UserConfigParams::m_height/2,
|
||||
UserConfigParams::m_width,
|
||||
UserConfigParams::m_height));
|
||||
core::rect<s32>(irr_driver->getActualScreenSize().Width/2,
|
||||
irr_driver->getActualScreenSize().Height/2,
|
||||
irr_driver->getActualScreenSize().Width,
|
||||
irr_driver->getActualScreenSize().Height));
|
||||
}
|
||||
|
||||
World *world = World::getWorld();
|
||||
@ -319,13 +319,13 @@ void RaceGUI::drawGlobalTimer()
|
||||
}
|
||||
}
|
||||
|
||||
core::rect<s32> pos(UserConfigParams::m_width - dist_from_right, 10,
|
||||
UserConfigParams::m_width , 50);
|
||||
core::rect<s32> pos(irr_driver->getActualScreenSize().Width - dist_from_right, 10,
|
||||
irr_driver->getActualScreenSize().Width , 50);
|
||||
|
||||
// special case : when 3 players play, use available 4th space for such things
|
||||
if (race_manager->getNumLocalPlayers() == 3)
|
||||
{
|
||||
pos += core::vector2d<s32>(0, UserConfigParams::m_height/2);
|
||||
pos += core::vector2d<s32>(0, irr_driver->getActualScreenSize().Height/2);
|
||||
}
|
||||
|
||||
gui::ScalableFont* font = (use_digit_font ? GUIEngine::getHighresDigitFont() : GUIEngine::getFont());
|
||||
@ -348,8 +348,8 @@ void RaceGUI::drawGlobalMiniMap()
|
||||
const video::ITexture *old_rtt_mini_map = world->getTrack()->getOldRttMiniMap();
|
||||
const FrameBuffer* new_rtt_mini_map = world->getTrack()->getNewRttMiniMap();
|
||||
|
||||
int upper_y = UserConfigParams::m_height - m_map_bottom - m_map_height;
|
||||
int lower_y = UserConfigParams::m_height - m_map_bottom;
|
||||
int upper_y = irr_driver->getActualScreenSize().Height - m_map_bottom - m_map_height;
|
||||
int lower_y = irr_driver->getActualScreenSize().Height - m_map_bottom;
|
||||
|
||||
core::rect<s32> dest(m_map_left, upper_y,
|
||||
m_map_left + m_map_width, lower_y);
|
||||
@ -723,6 +723,8 @@ void RaceGUI::drawSpeedEnergyRank(const AbstractKart* kart,
|
||||
meter_texture->getOriginalSize());
|
||||
draw2DImage(meter_texture, meter_pos, meter_texture_coords, NULL,
|
||||
NULL, true);
|
||||
// TODO: temporary workaround, shouldn't have to use
|
||||
// draw2DVertexPrimitiveList to render a simple rectangle
|
||||
|
||||
const float speed = kart->getSpeed();
|
||||
|
||||
@ -830,7 +832,7 @@ void RaceGUI::drawLap(const AbstractKart* kart,
|
||||
// move the lap/rank display down a little bit so that it is
|
||||
// displayed under the time.
|
||||
if(viewport.UpperLeftCorner.Y==0 &&
|
||||
viewport.LowerRightCorner.X==UserConfigParams::m_width &&
|
||||
viewport.LowerRightCorner.X==irr_driver->getActualScreenSize().Width &&
|
||||
race_manager->getNumPlayers()!=3)
|
||||
pos.UpperLeftCorner.Y += m_font_height;
|
||||
pos.LowerRightCorner.Y = viewport.LowerRightCorner.Y+20;
|
||||
|
@ -542,24 +542,24 @@ void RaceGUIBase::drawGlobalMusicDescription()
|
||||
thetext_composer += mi->getComposer().c_str();
|
||||
textWidth2 = font->getDimension(thetext_composer.c_str()).Width;
|
||||
}
|
||||
const int max_text_size = (int)(UserConfigParams::m_width*2.0f/3.0f);
|
||||
const int max_text_size = (int)(irr_driver->getActualScreenSize().Width*2.0f/3.0f);
|
||||
if (textWidth > max_text_size) textWidth = max_text_size;
|
||||
if (textWidth2 > max_text_size) textWidth2 = max_text_size;
|
||||
|
||||
const int ICON_SIZE = 64;
|
||||
const int y = UserConfigParams::m_height - 80;
|
||||
const int y = irr_driver->getActualScreenSize().Height - 80;
|
||||
// the 20 is an arbitrary space left between the note icon and the text
|
||||
const int noteX = (UserConfigParams::m_width / 2)
|
||||
const int noteX = (irr_driver->getActualScreenSize().Width / 2)
|
||||
- std::max(textWidth, textWidth2)/2 - ICON_SIZE/2 - 20;
|
||||
const int noteY = y;
|
||||
// the 20 is an arbitrary space left between the note icon and the text
|
||||
const int textXFrom = (UserConfigParams::m_width / 2)
|
||||
const int textXFrom = (irr_driver->getActualScreenSize().Width / 2)
|
||||
- std::max(textWidth, textWidth2)/2 + 20;
|
||||
const int textXTo = (UserConfigParams::m_width / 2)
|
||||
const int textXTo = (irr_driver->getActualScreenSize().Width / 2)
|
||||
+ std::max(textWidth, textWidth2)/2 + 20;
|
||||
|
||||
// ---- Draw "by" text
|
||||
const int text_y = (int)(UserConfigParams::m_height - 80*(resize3)
|
||||
const int text_y = (int)(irr_driver->getActualScreenSize().Height - 80*(resize3)
|
||||
+ 40*(1-resize));
|
||||
|
||||
static const video::SColor white = video::SColor(255, 255, 255, 255);
|
||||
@ -598,10 +598,10 @@ void RaceGUIBase::drawGlobalMusicDescription()
|
||||
void RaceGUIBase::drawGlobalGoal()
|
||||
{
|
||||
static video::SColor color = video::SColor(255, 255, 255, 255);
|
||||
core::rect<s32> pos(UserConfigParams::m_width>>1,
|
||||
UserConfigParams::m_height>>1,
|
||||
UserConfigParams::m_width>>1,
|
||||
UserConfigParams::m_height>>1);
|
||||
core::rect<s32> pos(irr_driver->getActualScreenSize().Width>>1,
|
||||
irr_driver->getActualScreenSize().Height>>1,
|
||||
irr_driver->getActualScreenSize().Width>>1,
|
||||
irr_driver->getActualScreenSize().Height>>1);
|
||||
gui::IGUIFont* font = GUIEngine::getTitleFont();
|
||||
font->draw(m_string_goal.c_str(), pos, color, true, true);
|
||||
}
|
||||
@ -615,10 +615,10 @@ void RaceGUIBase::drawGlobalReadySetGo()
|
||||
case WorldStatus::READY_PHASE:
|
||||
{
|
||||
static video::SColor color = video::SColor(255, 255, 255, 255);
|
||||
core::rect<s32> pos(UserConfigParams::m_width>>1,
|
||||
UserConfigParams::m_height>>1,
|
||||
UserConfigParams::m_width>>1,
|
||||
UserConfigParams::m_height>>1);
|
||||
core::rect<s32> pos(irr_driver->getActualScreenSize().Width>>1,
|
||||
irr_driver->getActualScreenSize().Height>>1,
|
||||
irr_driver->getActualScreenSize().Width>>1,
|
||||
irr_driver->getActualScreenSize().Height>>1);
|
||||
gui::IGUIFont* font = GUIEngine::getTitleFont();
|
||||
font->draw(m_string_ready.c_str(), pos, color, true, true);
|
||||
}
|
||||
@ -626,10 +626,10 @@ void RaceGUIBase::drawGlobalReadySetGo()
|
||||
case WorldStatus::SET_PHASE:
|
||||
{
|
||||
static video::SColor color = video::SColor(255, 255, 255, 255);
|
||||
core::rect<s32> pos(UserConfigParams::m_width>>1,
|
||||
UserConfigParams::m_height>>1,
|
||||
UserConfigParams::m_width>>1,
|
||||
UserConfigParams::m_height>>1);
|
||||
core::rect<s32> pos(irr_driver->getActualScreenSize().Width>>1,
|
||||
irr_driver->getActualScreenSize().Height>>1,
|
||||
irr_driver->getActualScreenSize().Width>>1,
|
||||
irr_driver->getActualScreenSize().Height>>1);
|
||||
gui::IGUIFont* font = GUIEngine::getTitleFont();
|
||||
font->draw(m_string_set.c_str(), pos, color, true, true);
|
||||
}
|
||||
@ -637,10 +637,10 @@ void RaceGUIBase::drawGlobalReadySetGo()
|
||||
case WorldStatus::GO_PHASE:
|
||||
{
|
||||
static video::SColor color = video::SColor(255, 255, 255, 255);
|
||||
core::rect<s32> pos(UserConfigParams::m_width>>1,
|
||||
UserConfigParams::m_height>>1,
|
||||
UserConfigParams::m_width>>1,
|
||||
UserConfigParams::m_height>>1);
|
||||
core::rect<s32> pos(irr_driver->getActualScreenSize().Width>>1,
|
||||
irr_driver->getActualScreenSize().Height>>1,
|
||||
irr_driver->getActualScreenSize().Width>>1,
|
||||
irr_driver->getActualScreenSize().Height>>1);
|
||||
//gui::IGUIFont* font = irr_driver->getRaceFont();
|
||||
gui::IGUIFont* font = GUIEngine::getTitleFont();
|
||||
|
||||
@ -670,20 +670,20 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
|
||||
int x_base = 10;
|
||||
int y_base = 20;
|
||||
unsigned int y_space = UserConfigParams::m_height - bottom_margin - y_base;
|
||||
unsigned int y_space = irr_driver->getActualScreenSize().Height - bottom_margin - y_base;
|
||||
// Special case : when 3 players play, use 4th window to display such stuff
|
||||
if (race_manager->getNumLocalPlayers() == 3)
|
||||
{
|
||||
x_base = UserConfigParams::m_width/2 + x_base;
|
||||
y_base = UserConfigParams::m_height/2 + y_base;
|
||||
y_space = UserConfigParams::m_height - y_base;
|
||||
x_base = irr_driver->getActualScreenSize().Width/2 + x_base;
|
||||
y_base = irr_driver->getActualScreenSize().Height/2 + y_base;
|
||||
y_space = irr_driver->getActualScreenSize().Height - y_base;
|
||||
}
|
||||
|
||||
// -2 because that's the spacing further on
|
||||
int ICON_PLAYER_WIDTH = y_space / race_manager->getNumberOfKarts() - 2;
|
||||
|
||||
int icon_width_max = (int)(50*(UserConfigParams::m_width/800.0f));
|
||||
int icon_width_min = (int)(35*(UserConfigParams::m_height/600.0f));
|
||||
int icon_width_max = (int)(50*(irr_driver->getActualScreenSize().Width/800.0f));
|
||||
int icon_width_min = (int)(35*(irr_driver->getActualScreenSize().Height/600.0f));
|
||||
if (icon_width_min > icon_width_max)
|
||||
{
|
||||
int icon_width_tmp = icon_width_max;
|
||||
@ -696,7 +696,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
if (ICON_PLAYER_WIDTH < icon_width_min) ICON_PLAYER_WIDTH = icon_width_min;
|
||||
|
||||
// TODO: Is this absolute treshold necessary?
|
||||
if(UserConfigParams::m_height<600)
|
||||
if(irr_driver->getActualScreenSize().Height<600)
|
||||
{
|
||||
ICON_PLAYER_WIDTH = 35;
|
||||
}
|
||||
@ -730,9 +730,9 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
const unsigned int kart_amount = world->getNumKarts();
|
||||
|
||||
//where is the limit to hide last icons
|
||||
int y_icons_limit=UserConfigParams::m_height-bottom_margin-ICON_PLAYER_WIDTH;
|
||||
int y_icons_limit=irr_driver->getActualScreenSize().Height-bottom_margin-ICON_PLAYER_WIDTH;
|
||||
if (race_manager->getNumLocalPlayers() == 3)
|
||||
y_icons_limit=UserConfigParams::m_height-ICON_WIDTH;
|
||||
y_icons_limit=irr_driver->getActualScreenSize().Height-ICON_WIDTH;
|
||||
|
||||
world->getKartsDisplayInfo(&m_kart_display_infos);
|
||||
|
||||
|
@ -84,7 +84,7 @@ RaceGUIOverworld::RaceGUIOverworld()
|
||||
m_map_height = (int)(250.0f * scaling);
|
||||
|
||||
m_map_left = 20;
|
||||
m_map_bottom = UserConfigParams::m_height-10;
|
||||
m_map_bottom = irr_driver->getActualScreenSize().Height-10;
|
||||
|
||||
// Minimap is also rendered bigger via OpenGL, so find power-of-two again
|
||||
const int map_texture = 2 << ((int) ceil(1.0 + log(128.0 * scaling)));
|
||||
@ -95,7 +95,7 @@ RaceGUIOverworld::RaceGUIOverworld()
|
||||
// special case : when 3 players play, use available 4th space for such things
|
||||
if (race_manager->getNumLocalPlayers() == 3)
|
||||
{
|
||||
m_map_left = UserConfigParams::m_width - m_map_width;
|
||||
m_map_left = irr_driver->getActualScreenSize().Width - m_map_width;
|
||||
}
|
||||
|
||||
m_speed_meter_icon = material_manager->getMaterial("speedback.png");
|
||||
@ -146,10 +146,10 @@ void RaceGUIOverworld::renderGlobal(float dt)
|
||||
{
|
||||
static video::SColor black = video::SColor(255,0,0,0);
|
||||
GL32_draw2DRectangle(black,
|
||||
core::rect<s32>(UserConfigParams::m_width/2,
|
||||
UserConfigParams::m_height/2,
|
||||
UserConfigParams::m_width,
|
||||
UserConfigParams::m_height));
|
||||
core::rect<s32>(irr_driver->getActualScreenSize().Width/2,
|
||||
irr_driver->getActualScreenSize().Height/2,
|
||||
irr_driver->getActualScreenSize().Width,
|
||||
irr_driver->getActualScreenSize().Height));
|
||||
}
|
||||
|
||||
World *world = World::getWorld();
|
||||
@ -216,14 +216,14 @@ void RaceGUIOverworld::drawTrophyPoints()
|
||||
|
||||
int dist_from_right = 10 + m_trophy_points_width;
|
||||
|
||||
core::rect<s32> pos(UserConfigParams::m_width - dist_from_right, 10,
|
||||
UserConfigParams::m_width , 50);
|
||||
core::rect<s32> pos(irr_driver->getActualScreenSize().Width - dist_from_right, 10,
|
||||
irr_driver->getActualScreenSize().Width , 50);
|
||||
|
||||
gui::ScalableFont* font = GUIEngine::getFont();
|
||||
|
||||
bool vcenter = true;
|
||||
|
||||
const int size = UserConfigParams::m_width/20;
|
||||
const int size = irr_driver->getActualScreenSize().Width/20;
|
||||
core::rect<s32> dest(size, pos.UpperLeftCorner.Y,
|
||||
size*2, pos.UpperLeftCorner.Y + size);
|
||||
core::rect<s32> source(core::position2di(0, 0), m_trophy3->getSize());
|
||||
@ -435,7 +435,7 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
// ---- Draw nearby challenge if any
|
||||
core::rect<s32> pos(15,
|
||||
10,
|
||||
15 + UserConfigParams::m_width/2,
|
||||
15 + irr_driver->getActualScreenSize().Width/2,
|
||||
10 + GUIEngine::getTitleFontHeight());
|
||||
|
||||
m_close_to_a_challenge = false;
|
||||
@ -456,9 +456,9 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
false, true /* vcenter */, NULL);
|
||||
|
||||
core::rect<s32> pos2(0,
|
||||
UserConfigParams::m_height - GUIEngine::getFontHeight()*2,
|
||||
UserConfigParams::m_width,
|
||||
UserConfigParams::m_height);
|
||||
irr_driver->getActualScreenSize().Height - GUIEngine::getFontHeight()*2,
|
||||
irr_driver->getActualScreenSize().Width,
|
||||
irr_driver->getActualScreenSize().Height);
|
||||
GUIEngine::getOutlineFont()->draw(_("Press fire to play the tutorial"), pos2,
|
||||
video::SColor(255,255,150,60),
|
||||
true, true /* vcenter */, NULL);
|
||||
@ -495,7 +495,7 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
|
||||
core::rect<s32> pos(15,
|
||||
20 + GUIEngine::getTitleFontHeight(),
|
||||
15 + UserConfigParams::m_width/2,
|
||||
15 + irr_driver->getActualScreenSize().Width/2,
|
||||
20 + 2*GUIEngine::getTitleFontHeight());
|
||||
|
||||
//just below GP name
|
||||
@ -520,15 +520,15 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
}
|
||||
|
||||
pos.UpperLeftCorner.Y += GUIEngine::getTitleFontHeight();
|
||||
pos.LowerRightCorner.Y = UserConfigParams::m_height;
|
||||
pos.LowerRightCorner.Y = irr_driver->getActualScreenSize().Height;
|
||||
GUIEngine::getFont()->draw(challenge->getChallengeDescription().c_str(),
|
||||
pos, video::SColor(255,255,255,255),
|
||||
false, false /* vcenter */, NULL);
|
||||
|
||||
core::rect<s32> pos2(0,
|
||||
UserConfigParams::m_height - GUIEngine::getFontHeight()*2,
|
||||
UserConfigParams::m_width,
|
||||
UserConfigParams::m_height);
|
||||
irr_driver->getActualScreenSize().Height - GUIEngine::getFontHeight()*2,
|
||||
irr_driver->getActualScreenSize().Width,
|
||||
irr_driver->getActualScreenSize().Height);
|
||||
GUIEngine::getOutlineFont()->draw(_("Press fire to start the challenge"), pos2,
|
||||
video::SColor(255,255,150,60),
|
||||
true, true /* vcenter */, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user