Move no graphics setting to guiengine which is a better place
This commit is contained in:
parent
0912ca041b
commit
88bbdbdc92
@ -25,7 +25,6 @@
|
||||
#include "font/regular_face.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/skin.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
@ -47,7 +46,7 @@ FontManager::FontManager()
|
||||
m_ft_library = NULL;
|
||||
m_digit_face = NULL;
|
||||
m_shaping_dpi = 128;
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
checkFTError(FT_Init_FreeType(&m_ft_library), "loading freetype library");
|
||||
@ -64,7 +63,7 @@ FontManager::~FontManager()
|
||||
m_fonts.clear();
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
for (unsigned int i = 0; i < m_faces.size(); i++)
|
||||
@ -84,7 +83,7 @@ std::vector<FT_Face>
|
||||
FontManager::loadTTF(const std::vector<std::string>& ttf_list)
|
||||
{
|
||||
std::vector <FT_Face> ret;
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return ret;
|
||||
|
||||
for (const std::string& font : ttf_list)
|
||||
@ -547,7 +546,7 @@ void FontManager::initGlyphLayouts(const core::stringw& text,
|
||||
std::vector<irr::gui::GlyphLayout>& gls,
|
||||
std::vector<std::u32string>* line_data)
|
||||
{
|
||||
if (ProfileWorld::isNoGraphics() || text.empty())
|
||||
if (GUIEngine::isNoGraphics() || text.empty())
|
||||
return;
|
||||
|
||||
if (line_data != NULL)
|
||||
@ -643,7 +642,7 @@ void FontManager::loadFonts()
|
||||
GUIEngine::getSkin()->getNormalTTF());
|
||||
std::vector<FT_Face> bold_ttf = normal_ttf;
|
||||
FT_Face color_emoji = NULL;
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
assert(!normal_ttf.empty());
|
||||
color_emoji = loadColorEmoji();
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "graphics/stk_tex_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/skin.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
#include "utils/utf8.h"
|
||||
|
||||
@ -84,7 +83,7 @@ void FontWithFace::init()
|
||||
{
|
||||
setDPI();
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
{
|
||||
reset();
|
||||
return;
|
||||
@ -140,7 +139,7 @@ void FontWithFace::reset()
|
||||
void FontWithFace::loadGlyphInfo(wchar_t c)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
unsigned int font_number = 0;
|
||||
@ -156,7 +155,7 @@ void FontWithFace::loadGlyphInfo(wchar_t c)
|
||||
void FontWithFace::createNewGlyphPage()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
uint8_t* data = new uint8_t[getGlyphPageSize() * getGlyphPageSize() *
|
||||
@ -187,7 +186,7 @@ void FontWithFace::createNewGlyphPage()
|
||||
void FontWithFace::insertGlyph(unsigned font_number, unsigned glyph_index)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
assert(glyph_index > 0);
|
||||
@ -250,7 +249,7 @@ void FontWithFace::insertGlyph(unsigned font_number, unsigned glyph_index)
|
||||
}
|
||||
|
||||
const unsigned int cur_tex = m_spritebank->getTextureCount() - 1;
|
||||
if (bits->buffer != NULL && !ProfileWorld::isNoGraphics())
|
||||
if (bits->buffer != NULL && !GUIEngine::isNoGraphics())
|
||||
{
|
||||
video::ITexture* tex = m_spritebank->getTexture(cur_tex);
|
||||
glBindTexture(GL_TEXTURE_2D, tex->getOpenGLTextureName());
|
||||
@ -526,7 +525,7 @@ core::dimension2d<u32> FontWithFace::getDimension(const core::stringw& text,
|
||||
#ifdef SERVER_ONLY
|
||||
return core::dimension2d<u32>(1, 1);
|
||||
#else
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return core::dimension2d<u32>(1, 1);
|
||||
|
||||
const float scale = font_settings ? font_settings->getScale() : 1.0f;
|
||||
@ -597,7 +596,7 @@ void FontWithFace::render(const std::vector<gui::GlyphLayout>& gl,
|
||||
FontCharCollector* char_collector)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics() || gl.empty())
|
||||
if (GUIEngine::isNoGraphics() || gl.empty())
|
||||
return;
|
||||
|
||||
const bool black_border = font_settings ?
|
||||
@ -1015,7 +1014,7 @@ void FontWithFace::drawText(const core::stringw& text,
|
||||
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (text.empty() || ProfileWorld::isNoGraphics())
|
||||
if (text.empty() || GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
if (disableTextShaping())
|
||||
@ -1044,7 +1043,7 @@ void FontWithFace::drawTextQuick(const core::stringw& text,
|
||||
FontCharCollector* char_collector)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (text.empty() || ProfileWorld::isNoGraphics())
|
||||
if (text.empty() || GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
render(text2GlyphsWithoutShaping(text), position, color, hcenter,
|
||||
|
@ -19,11 +19,11 @@
|
||||
#include "graphics/central_settings.hpp"
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "graphics/sp/sp_base.hpp"
|
||||
#include "graphics/gl_headers.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/graphics_restrictions.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
|
||||
bool CentralVideoSettings::m_supports_sp = true;
|
||||
|
||||
@ -60,7 +60,7 @@ void CentralVideoSettings::init()
|
||||
m_need_vertex_id_workaround = false;
|
||||
|
||||
// Call to glGetIntegerv should not be made if --no-graphics is used
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &m_gl_major_version);
|
||||
glGetIntegerv(GL_MINOR_VERSION, &m_gl_minor_version);
|
||||
@ -75,10 +75,10 @@ void CentralVideoSettings::init()
|
||||
#else
|
||||
m_glsl = m_gl_major_version >= 3 && !UserConfigParams::m_force_legacy_device;
|
||||
#endif
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
initGL();
|
||||
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
std::string driver((char*)(glGetString(GL_VERSION)));
|
||||
std::string card((char*)(glGetString(GL_RENDERER)));
|
||||
|
@ -62,7 +62,6 @@
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "karts/kart_properties_manager.hpp"
|
||||
#include "main_loop.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "network/network_config.hpp"
|
||||
#include "network/stk_host.hpp"
|
||||
@ -364,7 +363,7 @@ void IrrDriver::initDevice()
|
||||
SIrrlichtCreationParameters params;
|
||||
|
||||
// If --no-graphics option was used, the null device can still be used.
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
// This code is only executed once. No need to reload the video
|
||||
// modes every time the resolution changes.
|
||||
@ -548,7 +547,7 @@ void IrrDriver::initDevice()
|
||||
// pipeline doesn't work for them. For example some radeon drivers
|
||||
// support only GLSL 1.3 and it causes STK to crash. We should force to use
|
||||
// fixed pipeline in this case.
|
||||
if (!ProfileWorld::isNoGraphics() &&
|
||||
if (!GUIEngine::isNoGraphics() &&
|
||||
(GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_FORCE_LEGACY_DEVICE) ||
|
||||
(CVS->isGLSL() && !CentralVideoSettings::m_supports_sp)))
|
||||
{
|
||||
@ -561,7 +560,7 @@ void IrrDriver::initDevice()
|
||||
#endif
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (!ProfileWorld::isNoGraphics() && recreate_device)
|
||||
if (!GUIEngine::isNoGraphics() && recreate_device)
|
||||
{
|
||||
m_device->closeDevice();
|
||||
m_device->clearSystemMessages();
|
||||
@ -698,7 +697,7 @@ void IrrDriver::initDevice()
|
||||
#endif
|
||||
|
||||
// Only change video driver settings if we are showing graphics
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
m_device->setWindowClass("SuperTuxKart");
|
||||
m_device->setWindowCaption(L"SuperTuxKart");
|
||||
@ -742,12 +741,12 @@ void IrrDriver::initDevice()
|
||||
#ifndef SERVER_ONLY
|
||||
// set cursor visible by default (what's the default is not too clearly documented,
|
||||
// so let's decide ourselves...)
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
m_device->getCursorControl()->setVisible(true);
|
||||
#endif
|
||||
m_pointer_shown = true;
|
||||
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
m_device->registerGetMovedHeightFunction([]
|
||||
@ -844,7 +843,7 @@ void IrrDriver::getOpenGLData(std::string *vendor, std::string *renderer,
|
||||
std::string *version)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
*vendor = (char*)glGetString(GL_VENDOR );
|
||||
@ -857,7 +856,7 @@ void IrrDriver::getOpenGLData(std::string *vendor, std::string *renderer,
|
||||
void IrrDriver::showPointer()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
if (!m_pointer_shown)
|
||||
@ -872,7 +871,7 @@ void IrrDriver::showPointer()
|
||||
void IrrDriver::hidePointer()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
// always visible in artist debug mode, to be able to use the context menu
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "graphics/stk_tex_manager.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "io/xml_node.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "graphics/sp/sp_texture_manager.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "io/xml_node.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
|
@ -42,8 +42,8 @@
|
||||
#include "graphics/sp/sp_texture.hpp"
|
||||
#include "graphics/sp/sp_texture_manager.hpp"
|
||||
#include "graphics/sp/sp_uniform_assigner.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/helpers.hpp"
|
||||
#include "utils/profiler.hpp"
|
||||
@ -411,7 +411,7 @@ void loadShaders()
|
||||
// ----------------------------------------------------------------------------
|
||||
void resetEmptyFogColor()
|
||||
{
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -425,7 +425,7 @@ void resetEmptyFogColor()
|
||||
// ----------------------------------------------------------------------------
|
||||
void init()
|
||||
{
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "graphics/stk_tex_manager.hpp"
|
||||
#include "graphics/material.hpp"
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
|
||||
@ -40,7 +40,7 @@ STKTexture::STKTexture(const std::string& path, TexConfig* tc, bool no_upload)
|
||||
#ifndef SERVER_ONLY
|
||||
if (m_tex_config)
|
||||
{
|
||||
if (ProfileWorld::isNoGraphics() ||
|
||||
if (GUIEngine::isNoGraphics() ||
|
||||
(!CVS->isDeferredEnabled()) || !CVS->isGLSL())
|
||||
{
|
||||
m_tex_config->m_srgb = false;
|
||||
@ -78,7 +78,7 @@ STKTexture::STKTexture(video::IImage* img, const std::string& name)
|
||||
STKTexture::~STKTexture()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (m_texture_name != 0 && !ProfileWorld::isNoGraphics())
|
||||
if (m_texture_name != 0 && !GUIEngine::isNoGraphics())
|
||||
{
|
||||
glDeleteTextures(1, &m_texture_name);
|
||||
}
|
||||
@ -92,7 +92,7 @@ STKTexture::~STKTexture()
|
||||
void STKTexture::reload(bool no_upload, uint8_t* preload_data,
|
||||
video::IImage* preload_img)
|
||||
{
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
{
|
||||
m_orig_size.Width = 2;
|
||||
m_orig_size.Height = 2;
|
||||
|
@ -755,6 +755,7 @@ namespace GUIEngine
|
||||
|
||||
std::vector<MenuMessage> gui_messages;
|
||||
|
||||
bool g_is_no_graphics;
|
||||
// ------------------------------------------------------------------------
|
||||
void showMessage(const core::stringw& message, const float time)
|
||||
{
|
||||
@ -1051,6 +1052,7 @@ namespace GUIEngine
|
||||
#ifdef ANDROID
|
||||
m_gui_functions.clear();
|
||||
#endif
|
||||
g_is_no_graphics = false;
|
||||
} // resetGlobalVariables
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@ -1459,7 +1461,7 @@ namespace GUIEngine
|
||||
// This will avoid no response in windows, also allow showing loading
|
||||
// icon in apple device, because apple device only update render
|
||||
// buffer if you poll the mainloop
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
g_device->setEventReceiver(NULL);
|
||||
g_device->run();
|
||||
@ -1549,4 +1551,19 @@ namespace GUIEngine
|
||||
|
||||
return screen->getWidget(id);
|
||||
} // getWidget
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
// -----------------------------------------------------------------------
|
||||
void disableGraphics()
|
||||
{
|
||||
g_is_no_graphics = true;
|
||||
} // disableGraphics
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
bool isNoGraphics()
|
||||
{
|
||||
return g_is_no_graphics;
|
||||
} // isNoGraphics
|
||||
#endif
|
||||
|
||||
} // namespace GUIEngine
|
||||
|
@ -261,6 +261,14 @@ namespace GUIEngine
|
||||
* \brief Add gui-related function before rendering GUI (from other thread)
|
||||
*/
|
||||
void addGUIFunctionBeforeRendering(std::function<void()> func);
|
||||
|
||||
#ifdef SERVER_ONLY
|
||||
inline void disableGraphics() {}
|
||||
constexpr bool isNoGraphics() { return true; }
|
||||
#else
|
||||
void disableGraphics();
|
||||
bool isNoGraphics();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/scalable_font.hpp"
|
||||
#include "guiengine/skin.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "utils/synchronised.hpp"
|
||||
|
||||
#include "GlyphLayout.h"
|
||||
@ -381,7 +380,7 @@ void updatePosition()
|
||||
void add(MessageType mt, const irr::core::stringw &message)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
Message *m = new TextMessage(mt, message);
|
||||
privateAdd(m);
|
||||
@ -397,7 +396,7 @@ void add(MessageType mt, const irr::core::stringw &message)
|
||||
void addStatic(MessageType mt, const irr::core::stringw &message)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
delete g_static_message;
|
||||
g_static_message = NULL;
|
||||
@ -415,7 +414,7 @@ void addStatic(MessageType mt, const irr::core::stringw &message)
|
||||
void update(float dt)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
if (!g_container)
|
||||
@ -456,7 +455,7 @@ void update(float dt)
|
||||
void showProgressBar(int progress, const core::stringw& msg)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
g_progress_bar_msg.setProgress(progress, msg);
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "guiengine/widgets/model_view_widget.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/render_target.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
|
||||
#include <IAnimatedMesh.h>
|
||||
#include <IAnimatedMeshSceneNode.h>
|
||||
@ -56,7 +55,7 @@ m_rtt_size(rtt_size)
|
||||
// so that the base class doesn't complain there is no icon defined
|
||||
m_properties[PROP_ICON]="gui/icons/main_help.png";
|
||||
|
||||
m_rtt_unsupported = ProfileWorld::isNoGraphics();
|
||||
m_rtt_unsupported = GUIEngine::isNoGraphics();
|
||||
} // ModelViewWidget
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "karts/controller/controller.hpp"
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "modes/demo_world.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "network/network_config.hpp"
|
||||
#include "network/protocols/client_lobby.hpp"
|
||||
|
@ -22,8 +22,8 @@
|
||||
#include "graphics/material.hpp"
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "graphics/sp/sp_base.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
|
||||
AttachmentManager *attachment_manager = 0;
|
||||
|
||||
@ -99,7 +99,7 @@ void AttachmentManager::loadModels()
|
||||
/* full_path */ true,
|
||||
/*make_permanent */ true);
|
||||
}
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
mesh->freeMeshVertexBuffer();
|
||||
} // for
|
||||
} // reInit
|
||||
|
@ -23,17 +23,20 @@
|
||||
|
||||
#include <irrlicht.h>
|
||||
|
||||
#include "config/stk_config.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/sp/sp_base.hpp"
|
||||
#include "graphics/material.hpp"
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "io/xml_node.hpp"
|
||||
#include "items/bowling.hpp"
|
||||
#include "items/cake.hpp"
|
||||
#include "items/plunger.hpp"
|
||||
#include "items/rubber_ball.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
|
||||
@ -150,7 +153,7 @@ void PowerupManager::loadPowerupsModels()
|
||||
|
||||
delete root;
|
||||
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
{
|
||||
for (unsigned i = POWERUP_FIRST; i <= POWERUP_LAST; i++)
|
||||
{
|
||||
|
@ -23,12 +23,13 @@
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "graphics/sp/sp_dynamic_draw_call.hpp"
|
||||
#include "graphics/sp/sp_shader_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "items/plunger.hpp"
|
||||
#include "items/projectile_manager.hpp"
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "karts/kart_properties.hpp"
|
||||
#include "karts/max_speed.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "physics/physics.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "utils/mini_glm.hpp"
|
||||
@ -48,7 +49,7 @@ RubberBand::RubberBand(Plunger *plunger, AbstractKart *kart)
|
||||
m_hit_kart = NULL;
|
||||
m_attached_state = RB_TO_PLUNGER;
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics() || !CVS->isGLSL())
|
||||
if (GUIEngine::isNoGraphics() || !CVS->isGLSL())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -65,7 +65,6 @@
|
||||
#include "modes/capture_the_flag.hpp"
|
||||
#include "modes/linear_world.hpp"
|
||||
#include "modes/overworld.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/soccer_world.hpp"
|
||||
#include "network/compress_network_body.hpp"
|
||||
#include "network/network_config.hpp"
|
||||
@ -2996,13 +2995,13 @@ void Kart::loadData(RaceManager::KartType type, bool is_animated_model)
|
||||
#ifndef SERVER_ONLY
|
||||
m_skidmarks = nullptr;
|
||||
m_shadow = nullptr;
|
||||
if (!ProfileWorld::isNoGraphics() &&
|
||||
if (!GUIEngine::isNoGraphics() &&
|
||||
m_kart_properties->getSkidEnabled() && CVS->isGLSL())
|
||||
{
|
||||
m_skidmarks.reset(new SkidMarks(*this));
|
||||
}
|
||||
|
||||
if (!ProfileWorld::isNoGraphics() &&
|
||||
if (!GUIEngine::isNoGraphics() &&
|
||||
CVS->isGLSL() && !CVS->isShadowEnabled() && m_kart_properties
|
||||
->getShadowMaterial()->getSamplerPath(0) != "unicolor_white")
|
||||
{
|
||||
@ -3370,7 +3369,7 @@ btQuaternion Kart::getVisualRotation() const
|
||||
void Kart::setOnScreenText(const core::stringw& text)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
BoldFace* bold_face = font_manager->getFont<BoldFace>();
|
||||
|
@ -35,12 +35,12 @@
|
||||
#include "graphics/sp/sp_mesh.hpp"
|
||||
#include "graphics/sp/sp_mesh_buffer.hpp"
|
||||
#include "graphics/sp/sp_mesh_node.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "io/xml_node.hpp"
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "karts/ghost_kart.hpp"
|
||||
#include "karts/kart_properties.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "physics/btKart.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
@ -629,7 +629,7 @@ bool KartModel::loadModels(const KartProperties &kart_properties)
|
||||
m_kart_lowest_point = kart_min.getY();
|
||||
initInverseBoneMatrices();
|
||||
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
m_mesh->freeMeshVertexBuffer();
|
||||
|
||||
// Load the speed weighted object models. We need to do that now because it can affect the dimensions of the kart
|
||||
@ -675,7 +675,7 @@ bool KartModel::loadModels(const KartProperties &kart_properties)
|
||||
obj.m_location.transformVect(transformed_max, obj_max.toIrrVector());
|
||||
kart_min.min(transformed_min);
|
||||
kart_max.max(transformed_max);
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
mesh->freeMeshVertexBuffer();
|
||||
}
|
||||
|
||||
@ -689,7 +689,7 @@ bool KartModel::loadModels(const KartProperties &kart_properties)
|
||||
#endif
|
||||
obj.getModel()->grab();
|
||||
irr_driver->grabAllTextures(obj.getModel());
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
obj.getModel()->freeMeshVertexBuffer();
|
||||
}
|
||||
|
||||
@ -739,7 +739,7 @@ bool KartModel::loadModels(const KartProperties &kart_properties)
|
||||
// the destructor will only free the textures if a master
|
||||
// copy is freed.
|
||||
irr_driver->grabAllTextures(m_wheel_model[i]);
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
m_wheel_model[i]->freeMeshVertexBuffer();
|
||||
} // for i<4
|
||||
|
||||
|
27
src/main.cpp
27
src/main.cpp
@ -216,7 +216,6 @@
|
||||
#include "karts/kart_properties_manager.hpp"
|
||||
#include "modes/cutscene_world.hpp"
|
||||
#include "modes/demo_world.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "network/protocols/connect_to_server.hpp"
|
||||
#include "network/protocols/client_lobby.hpp"
|
||||
#include "network/protocols/server_lobby.hpp"
|
||||
@ -1686,7 +1685,7 @@ int handleCmdLine(bool has_server_config, bool has_parent_process)
|
||||
|
||||
CommandLine::reportInvalidParameters();
|
||||
|
||||
if (ProfileWorld::isProfileMode() || ProfileWorld::isNoGraphics())
|
||||
if (ProfileWorld::isProfileMode() || GUIEngine::isNoGraphics())
|
||||
{
|
||||
UserConfigParams::m_sfx = false; // Disable sound effects
|
||||
UserConfigParams::m_music = false;// and music when profiling
|
||||
@ -1785,7 +1784,7 @@ void initRest()
|
||||
// separate thread running in network HTTP.
|
||||
#ifndef SERVER_ONLY
|
||||
addons_manager = NULL;
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
// Need to load shader after downloading assets as it reads prefilled
|
||||
// textures
|
||||
@ -1803,7 +1802,7 @@ void initRest()
|
||||
PlayerManager::create();
|
||||
Online::RequestManager::get()->startNetworkThread();
|
||||
#ifndef SERVER_ONLY
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
NewsManager::get(); // this will create the news manager
|
||||
#endif
|
||||
|
||||
@ -1885,7 +1884,7 @@ void askForInternetPermission()
|
||||
bool need_to_start_news_manager =
|
||||
UserConfigParams::m_internet_status !=
|
||||
Online::RequestManager::IPERM_ALLOWED &&
|
||||
!ProfileWorld::isNoGraphics();
|
||||
!GUIEngine::isNoGraphics();
|
||||
UserConfigParams::m_internet_status =
|
||||
Online::RequestManager::IPERM_ALLOWED;
|
||||
if (need_to_start_news_manager)
|
||||
@ -1993,7 +1992,7 @@ int main(int argc, char *argv[])
|
||||
#ifndef SERVER_ONLY
|
||||
if(CommandLine::has("--no-graphics") || CommandLine::has("-l"))
|
||||
#endif
|
||||
ProfileWorld::disableGraphics();
|
||||
GUIEngine::disableGraphics();
|
||||
|
||||
// Init the minimum managers so that user config exists, then
|
||||
// handle all command line options that do not need (or must
|
||||
@ -2021,7 +2020,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (no_graphics)
|
||||
{
|
||||
ProfileWorld::disableGraphics();
|
||||
GUIEngine::disableGraphics();
|
||||
UserConfigParams::m_enable_sound = false;
|
||||
}
|
||||
ServerConfig::loadServerConfig(server_config);
|
||||
@ -2034,7 +2033,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (no_graphics)
|
||||
{
|
||||
ProfileWorld::disableGraphics();
|
||||
GUIEngine::disableGraphics();
|
||||
UserConfigParams::m_enable_sound = false;
|
||||
}
|
||||
NetworkConfig::get()->setIsServer(true);
|
||||
@ -2049,7 +2048,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (no_graphics)
|
||||
{
|
||||
ProfileWorld::disableGraphics();
|
||||
GUIEngine::disableGraphics();
|
||||
UserConfigParams::m_enable_sound = false;
|
||||
}
|
||||
NetworkConfig::get()->setIsServer(true);
|
||||
@ -2058,7 +2057,7 @@ int main(int argc, char *argv[])
|
||||
ServerConfig::m_validating_player = false;
|
||||
}
|
||||
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
profiler.init();
|
||||
// Create the story mode timer with empty setting first, it will
|
||||
// be reset later after story mode status and player manager is loaded
|
||||
@ -2140,7 +2139,7 @@ int main(int argc, char *argv[])
|
||||
exit(0);
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
addons_manager->checkInstalledAddons();
|
||||
|
||||
@ -2173,7 +2172,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
// Some Android devices have only 320x240 and height >= 480 is bare
|
||||
// minimum to make the GUI working as expected.
|
||||
@ -2302,7 +2301,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
// If an important news message exists it is shown in a popup dialog.
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
const core::stringw important_message =
|
||||
NewsManager::get()->getImportantMessage();
|
||||
@ -2483,7 +2482,7 @@ static void cleanSuperTuxKart()
|
||||
// the OS takes all threads down.
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
if (UserConfigParams::m_internet_status == Online::RequestManager::
|
||||
IPERM_ALLOWED && NewsManager::isRunning() &&
|
||||
|
@ -35,8 +35,8 @@
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/screen_keyboard.hpp"
|
||||
#include "input/input_manager.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "network/network_config.hpp"
|
||||
#include "network/network_timer_synchronizer.hpp"
|
||||
#include "network/protocols/game_protocol.hpp"
|
||||
@ -158,7 +158,7 @@ float MainLoop::getLimitedDt()
|
||||
float dt = 0;
|
||||
|
||||
// In profile mode without graphics, run with a fixed dt of 1/60
|
||||
if ((ProfileWorld::isProfileMode() && ProfileWorld::isNoGraphics()) ||
|
||||
if ((ProfileWorld::isProfileMode() && GUIEngine::isNoGraphics()) ||
|
||||
UserConfigParams::m_arena_ai_stats)
|
||||
{
|
||||
return 1.0f/60.0f;
|
||||
@ -176,7 +176,7 @@ float MainLoop::getLimitedDt()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (UserConfigParams::m_artist_debug_mode &&
|
||||
!ProfileWorld::isNoGraphics())
|
||||
!GUIEngine::isNoGraphics())
|
||||
{
|
||||
core::stringw err = L"System clock running backwards in"
|
||||
" networking game.";
|
||||
@ -435,7 +435,7 @@ void MainLoop::run()
|
||||
|
||||
if (!m_request_abort)
|
||||
{
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
SFXManager::get()->quickSound("anvil");
|
||||
if (!STKHost::get()->getErrorMessage().empty())
|
||||
@ -474,7 +474,7 @@ void MainLoop::run()
|
||||
|
||||
if (exist_host == true)
|
||||
{
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
StateManager::get()->resetAndSetStack(
|
||||
NetworkConfig::get()->getResetScreens().data());
|
||||
@ -495,7 +495,7 @@ void MainLoop::run()
|
||||
if (!m_abort)
|
||||
{
|
||||
float frame_duration = num_steps * dt;
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
PROFILER_PUSH_CPU_MARKER("Update race", 0, 255, 255);
|
||||
if (World::getWorld())
|
||||
@ -610,7 +610,7 @@ void MainLoop::run()
|
||||
|
||||
// Handle controller the last to avoid slow PC sending actions too
|
||||
// late
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
// User aborted (e.g. closed window)
|
||||
bool abort = !irr_driver->getDevice()->run();
|
||||
@ -662,7 +662,7 @@ void MainLoop::renderGUI(int phase, int loop_index, int loop_size)
|
||||
#else
|
||||
if ((NetworkConfig::get()->isNetworking() &&
|
||||
NetworkConfig::get()->isServer()) ||
|
||||
ProfileWorld::isNoGraphics())
|
||||
GUIEngine::isNoGraphics())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -34,7 +34,6 @@
|
||||
ProfileWorld::ProfileType ProfileWorld::m_profile_mode=PROFILE_NONE;
|
||||
int ProfileWorld::m_num_laps = 0;
|
||||
float ProfileWorld::m_time = 0.0f;
|
||||
bool ProfileWorld::m_no_graphics = false;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** The constructor sets the number of (local) players to 0, since only AI
|
||||
@ -206,7 +205,7 @@ void ProfileWorld::enterRaceOverState()
|
||||
m_frame_count, runtime, (float)m_frame_count/runtime);
|
||||
|
||||
// Print geometry statistics if we're not in no-graphics mode
|
||||
if(!m_no_graphics)
|
||||
if(!GUIEngine::isNoGraphics())
|
||||
{
|
||||
Log::verbose("profile", "Average # drawn nodes %f k",
|
||||
(float)m_num_triangles/m_frame_count);
|
||||
|
@ -36,10 +36,6 @@ private:
|
||||
/** If profiling is done, and if so, which mode. */
|
||||
static ProfileType m_profile_mode;
|
||||
|
||||
/** If no graphics should be displayed. Useful for batch testing
|
||||
* of AI changes etc. */
|
||||
static bool m_no_graphics;
|
||||
|
||||
/** In time based profiling only: time to run. */
|
||||
static float m_time;
|
||||
|
||||
@ -91,12 +87,6 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns true if profile mode was selected. */
|
||||
static bool isProfileMode() {return m_profile_mode!=PROFILE_NONE; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Switches off graphics. */
|
||||
static void disableGraphics() { m_no_graphics = true; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns true if no graphics should be displayed. */
|
||||
static bool isNoGraphics() {return m_no_graphics; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -52,7 +52,6 @@
|
||||
#include "karts/kart_rewinder.hpp"
|
||||
#include "main_loop.hpp"
|
||||
#include "modes/overworld.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "network/protocols/client_lobby.hpp"
|
||||
#include "network/network_config.hpp"
|
||||
#include "network/rewind_manager.hpp"
|
||||
@ -266,7 +265,7 @@ void World::init()
|
||||
{
|
||||
auto cl = LobbyProtocol::get<ClientLobby>();
|
||||
if ( (NetworkConfig::get()->isServer() &&
|
||||
!ProfileWorld::isNoGraphics() ) ||
|
||||
!GUIEngine::isNoGraphics() ) ||
|
||||
race_manager->isWatchingReplay() ||
|
||||
(cl && cl->isSpectator()))
|
||||
{
|
||||
@ -416,7 +415,7 @@ void World::reset(bool restart)
|
||||
|
||||
void World::createRaceGUI()
|
||||
{
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
m_race_gui = new RaceGUI();
|
||||
}
|
||||
|
||||
@ -728,7 +727,7 @@ void World::terminateRace()
|
||||
assert(m_saved_race_gui==NULL);
|
||||
m_saved_race_gui = m_race_gui;
|
||||
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
RaceResultGUI* results = RaceResultGUI::getInstance();
|
||||
m_race_gui = results;
|
||||
|
@ -24,9 +24,10 @@
|
||||
#include "config/stk_config.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "network/network_config.hpp"
|
||||
#include "network/protocols/client_lobby.hpp"
|
||||
#include "network/rewind_manager.hpp"
|
||||
@ -378,7 +379,7 @@ void WorldStatus::updateTime(int ticks)
|
||||
music_manager->startMusic();
|
||||
}
|
||||
// no graphics mode goes race phase now
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
{
|
||||
m_race_ticks = -1;
|
||||
m_phase = RACE_PHASE;
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include "modes/follow_the_leader.hpp"
|
||||
#include "modes/free_for_all.hpp"
|
||||
#include "modes/overworld.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/standard_race.hpp"
|
||||
#include "modes/tutorial_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
|
@ -29,9 +29,8 @@
|
||||
#include "input/input_device.hpp"
|
||||
#include "input/input_manager.hpp"
|
||||
#include "main_loop.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
||||
using namespace GUIEngine;
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "karts/cannon_animation.hpp"
|
||||
#include "karts/skidding.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
|
||||
/** Constructor for a check cannon.
|
||||
@ -65,7 +64,7 @@ CheckCannon::CheckCannon(const XMLNode &node, unsigned int index)
|
||||
for(unsigned int i=0; i<p.size(); i++)
|
||||
m_show_curve->addPoint(p[i]);
|
||||
}
|
||||
if (UserConfigParams::m_check_debug && !ProfileWorld::isNoGraphics())
|
||||
if (UserConfigParams::m_check_debug && !GUIEngine::isNoGraphics())
|
||||
{
|
||||
m_debug_target_dy_dc = std::make_shared<SP::SPDynamicDrawCall>
|
||||
(scene::EPT_TRIANGLE_STRIP,
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "io/xml_node.hpp"
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "modes/linear_world.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "network/network_string.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
@ -75,7 +74,7 @@ CheckLine::CheckLine(const XMLNode &node, unsigned int index)
|
||||
m_min_height = std::min(m_left_point.getY(), m_right_point.getY());
|
||||
}
|
||||
m_line.setLine(p1, p2);
|
||||
if(UserConfigParams::m_check_debug && !ProfileWorld::isNoGraphics())
|
||||
if(UserConfigParams::m_check_debug && !GUIEngine::isNoGraphics())
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
m_debug_dy_dc = std::make_shared<SP::SPDynamicDrawCall>
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "graphics/sp/sp_mesh.hpp"
|
||||
#include "graphics/sp/sp_mesh_buffer.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "tracks/arena_node_3d.hpp"
|
||||
#include "tracks/drive_node_2d.hpp"
|
||||
@ -395,7 +395,7 @@ RenderTarget* Graph::makeMiniMap(const core::dimension2du &dimension,
|
||||
bool invert_x_z)
|
||||
{
|
||||
// Skip minimap when profiling
|
||||
if (ProfileWorld::isNoGraphics()) return NULL;
|
||||
if (GUIEngine::isNoGraphics()) return NULL;
|
||||
|
||||
const video::SColor oldClearColor = irr_driver->getClearColor();
|
||||
irr_driver->setClearbackBufferColor(video::SColor(0, 255, 255, 255));
|
||||
|
@ -59,7 +59,6 @@
|
||||
#include "main_loop.hpp"
|
||||
#include "modes/linear_world.hpp"
|
||||
#include "modes/easter_egg_hunt.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "network/network_config.hpp"
|
||||
#include "network/protocols/server_lobby.hpp"
|
||||
#include "physics/physical_object.hpp"
|
||||
@ -318,7 +317,7 @@ void Track::cleanup()
|
||||
#ifndef SERVER_ONLY
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
if (!GUIEngine::isNoGraphics())
|
||||
{
|
||||
CPUParticleManager::getInstance()->cleanMaterialMap();
|
||||
}
|
||||
@ -1154,7 +1153,7 @@ void Track::convertTrackToBullet(scene::ISceneNode *node)
|
||||
void Track::loadMinimap()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
//Create the minimap resizing it as necessary.
|
||||
@ -1222,7 +1221,7 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
#ifdef SERVER_ONLY
|
||||
if (false)
|
||||
#else
|
||||
if (m_version < 7 && !CVS->isGLSL() && !ProfileWorld::isNoGraphics())
|
||||
if (m_version < 7 && !CVS->isGLSL() && !GUIEngine::isNoGraphics())
|
||||
#endif
|
||||
{
|
||||
// The mesh as returned does not have all mesh buffers with the same
|
||||
@ -1482,7 +1481,7 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
}
|
||||
|
||||
// Free the tangent (track mesh) after converting to physics
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
tangent_mesh->freeMeshVertexBuffer();
|
||||
|
||||
if (m_track_mesh == NULL)
|
||||
@ -1501,7 +1500,7 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
// ----------------------------------------------------------------------------
|
||||
void Track::freeCachedMeshVertexBuffer()
|
||||
{
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
{
|
||||
for (unsigned i = 0; i < m_all_cached_meshes.size(); i++)
|
||||
m_all_cached_meshes[i]->freeMeshVertexBuffer();
|
||||
@ -1969,7 +1968,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
|
||||
main_loop->renderGUI(3500);
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (!ProfileWorld::isNoGraphics() && CVS->isGLSL() && m_use_fog)
|
||||
if (!GUIEngine::isNoGraphics() && CVS->isGLSL() && m_use_fog)
|
||||
{
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, SP::sp_fog_ubo);
|
||||
glBufferSubData(GL_UNIFORM_BUFFER, 0, 4, &m_fog_start);
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include "input/input_manager.hpp"
|
||||
#include "items/item_manager.hpp"
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "scriptengine/script_engine.hpp"
|
||||
#include "states_screens/dialogs/tutorial_message_dialog.hpp"
|
||||
@ -822,7 +821,7 @@ TrackObjectPresentationBillboard::TrackObjectPresentationBillboard(
|
||||
// ----------------------------------------------------------------------------
|
||||
void TrackObjectPresentationBillboard::updateGraphics(float dt)
|
||||
{
|
||||
if (ProfileWorld::isNoGraphics()) return;
|
||||
if (GUIEngine::isNoGraphics()) return;
|
||||
#ifndef SERVER_ONLY
|
||||
if (m_fade_out_when_close)
|
||||
{
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/progress_bar_android.hpp"
|
||||
|
||||
@ -49,7 +48,7 @@ ProgressBarAndroid::~ProgressBarAndroid()
|
||||
bool ProgressBarAndroid::compileShaders()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return false;
|
||||
|
||||
const GLchar* vsh =
|
||||
@ -127,7 +126,7 @@ bool ProgressBarAndroid::compileShaders()
|
||||
void ProgressBarAndroid::deleteShaders()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
glDeleteShader(m_vertex_shader);
|
||||
@ -139,7 +138,7 @@ void ProgressBarAndroid::deleteShaders()
|
||||
void ProgressBarAndroid::init()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
SIrrlichtCreationParameters params;
|
||||
@ -185,7 +184,7 @@ void ProgressBarAndroid::init()
|
||||
void ProgressBarAndroid::close()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
glDisableVertexAttribArray(m_position);
|
||||
@ -210,7 +209,7 @@ void ProgressBarAndroid::close()
|
||||
void ProgressBarAndroid::draw(float value)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
if (GUIEngine::isNoGraphics())
|
||||
return;
|
||||
|
||||
if (!m_initialized || m_close_event_received)
|
||||
|
Loading…
x
Reference in New Issue
Block a user