Fixed linking problems - will probably not run ;)

This commit is contained in:
hiker
2016-04-18 00:29:59 +10:00
parent 61a3d10e10
commit 73182863df
42 changed files with 359 additions and 97 deletions

View File

@@ -264,6 +264,9 @@ const std::string& getOSVersion()
*/
void reportHardwareStats()
{
#ifdef SERVER_ONLY
return;
#else
if(!UserConfigParams::m_hw_report_enable)
return;
@@ -393,7 +396,7 @@ void reportHardwareStats()
request->setURL((std::string)UserConfigParams::m_server_hw_report+"/upload/v1/");
//request->setURL("http://127.0.0.1:8000/upload/v1/");
request->queue();
#endif // !SERVER_ONLY
} // reportHardwareStats
} // namespace HardwareStats

View File

@@ -527,6 +527,7 @@ void FontWithFace::render(const core::stringw& text,
FontSettings* font_settings,
FontCharCollector* char_collector)
{
#ifndef SERVER_ONLY
const bool black_border = font_settings ?
font_settings->useBlackBorder() : false;
const bool rtl = font_settings ? font_settings->isRTL() : false;
@@ -778,4 +779,5 @@ void FontWithFace::render(const core::stringw& text,
}
}
}
#endif
} // render

View File

@@ -41,9 +41,11 @@ Explosion::Explosion(const Vec3& coord, const char* explosion_sound, const char
m_remaining_time = burst_time;
m_emission_frames = 0;
#ifndef SERVER_ONLY
ParticleKindManager* pkm = ParticleKindManager::get();
ParticleKind* particles = pkm->getParticles(particle_file);
m_emitter = new ParticleEmitter(particles, coord, NULL);
#endif
} // Explosion
//-----------------------------------------------------------------------------

View File

@@ -15,6 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef SERVER_ONLY
#include "graphics/fixed_pipeline_renderer.hpp"
#include "config/user_config.hpp"
#include "graphics/camera.hpp"
@@ -112,3 +113,4 @@ std::unique_ptr<RenderTarget> FixedPipelineRenderer::createRenderTarget(const ir
{
return std::unique_ptr<RenderTarget>(new GL1RenderTarget(dimension, name));
}
#endif

View File

@@ -18,6 +18,7 @@
#ifndef HEADER_FIXED_PIPELINE_RENDERER_HPP
#define HEADER_FIXED_PIPELINE_RENDERER_HPP
#ifndef SERVER_ONLY
#include "graphics/abstract_renderer.hpp"
#include <map>
@@ -37,4 +38,5 @@ public:
const std::string &name);
};
#endif // !SERVER_ONLY
#endif //HEADER_FIXED_PIPELINE_RENDERER_HPP

View File

@@ -139,8 +139,9 @@ IrrDriver::IrrDriver()
IrrDriver::~IrrDriver()
{
assert(m_device != NULL);
#ifndef SERVER_ONLY
cleanUnicolorTextures();
#endif
m_device->drop();
m_device = NULL;
m_modes.clear();
@@ -160,7 +161,9 @@ IrrDriver::~IrrDriver()
*/
void IrrDriver::reset()
{
#ifndef SERVER_ONLY
m_renderer->resetPostProcessing();
#endif
} // reset
void IrrDriver::setPhase(STKRenderingPass p)
@@ -191,11 +194,13 @@ GPUTimer &IrrDriver::getGPUTimer(unsigned i)
#ifndef SERVER_ONLY
std::unique_ptr<RenderTarget> IrrDriver::createRenderTarget(const irr::core::dimension2du &dimension,
const std::string &name)
{
return m_renderer->createRenderTarget(dimension, name);
}
#endif
// ----------------------------------------------------------------------------
@@ -207,6 +212,7 @@ If window is the root window, returns window.
*/
Window get_toplevel_parent(Display* display, Window window)
{
#ifndef SERVER_ONLY
Window parent;
Window root;
Window * children;
@@ -229,6 +235,9 @@ Window get_toplevel_parent(Display* display, Window window)
window = parent;
}
}
#else
return NULL;
#endif
}
#endif
@@ -239,8 +248,9 @@ Window get_toplevel_parent(Display* display, Window window)
*/
void IrrDriver::updateConfigIfRelevant()
{
if (!UserConfigParams::m_fullscreen &&
UserConfigParams::m_remember_window_location)
#ifndef SERVER_ONLY
if (!UserConfigParams::m_fullscreen &&
UserConfigParams::m_remember_window_location)
{
#ifdef WIN32
const video::SExposedVideoData& videoData = m_device->getVideoDriver()
@@ -292,6 +302,8 @@ void IrrDriver::updateConfigIfRelevant()
}
#endif
}
#endif // !SERVER_ONLY
} // updateConfigIfRelevant
// ----------------------------------------------------------------------------
@@ -501,6 +513,7 @@ void IrrDriver::initDevice()
{
Log::fatal("irr_driver", "Couldn't initialise irrlicht device. Quitting.\n");
}
#ifndef SERVER_ONLY
CVS->init();
@@ -519,12 +532,14 @@ void IrrDriver::initDevice()
params.ForceLegacyDevice = true;
recreate_device = true;
}
#endif
// This is the ugly hack for intel driver on linux, which doesn't
// use sRGB-capable visual, even if we request it. This causes
// the screen to be darker than expected. It affects mesa 10.6 and newer.
// Though we are able to force to use the proper format on mesa side by
// setting WithAlphaChannel parameter.
#ifndef SERVER_ONLY
else if (CVS->needsSRGBCapableVisualWorkaround())
{
Log::warn("irr_driver", "Created visual is not sRGB-capable. "
@@ -550,13 +565,13 @@ void IrrDriver::initDevice()
CVS->init();
}
#endif
m_scene_manager = m_device->getSceneManager();
m_gui_env = m_device->getGUIEnvironment();
m_video_driver = m_device->getVideoDriver();
m_actual_screen_size = m_video_driver->getCurrentRenderTargetSize();
#ifndef SERVER_ONLY
if(CVS->isGLSL())
m_renderer = new ShaderBasedRenderer();
@@ -581,6 +596,7 @@ void IrrDriver::initDevice()
m_video_driver->beginScene(/*backBuffer clear*/true, /* Z */ false);
m_video_driver->endScene();
#ifndef SERVER_ONLY
if (CVS->isGLSL())
{
Log::info("irr_driver", "GLSL supported.");
@@ -593,7 +609,6 @@ void IrrDriver::initDevice()
UserConfigParams::m_gi = false;
}*/
#ifndef SERVER_ONLY
// m_glsl might be reset in rtt if an error occurs.
if (CVS->isGLSL())
@@ -614,7 +629,7 @@ void IrrDriver::initDevice()
// Only change video driver settings if we are showing graphics
if (!ProfileWorld::isNoGraphics())
{
#if defined(__linux__) && !defined(ANDROID)
#if defined(__linux__) && !defined(ANDROID) && !defined(SERVER_ONLY)
// Set class hints on Linux, used by Window Managers.
const video::SExposedVideoData& videoData = m_video_driver
->getExposedVideoData();
@@ -664,10 +679,12 @@ void IrrDriver::initDevice()
material2D.AntiAliasing=video::EAAM_FULL_BASIC;
//m_video_driver->enableMaterial2D();
#ifndef SERVER_ONLY
// set cursor visible by default (what's the default is not too clearly documented,
// so let's decide ourselves...)
m_device->getCursorControl()->setVisible(true);
m_pointer_shown = true;
#endif
} // initDevice
// ----------------------------------------------------------------------------
@@ -691,6 +708,7 @@ void IrrDriver::cleanSunInterposer()
// ----------------------------------------------------------------------------
void IrrDriver::createSunInterposer()
{
#ifndef SERVER_ONLY
scene::IMesh * sphere = m_scene_manager->getGeometryCreator()
->createSphereMesh(1, 16, 16);
for (unsigned i = 0; i < sphere->getMeshBufferCount(); ++i)
@@ -698,16 +716,12 @@ void IrrDriver::createSunInterposer()
scene::IMeshBuffer *mb = sphere->getMeshBuffer(i);
if (!mb)
continue;
#ifndef SERVER_ONLY
mb->getMaterial().setTexture(0,
mb->getMaterial().setTexture(0,
getUnicolorTexture(video::SColor(255, 255, 255, 255)));
mb->getMaterial().setTexture(1,
getUnicolorTexture(video::SColor(0, 0, 0, 0)));
mb->getMaterial().setTexture(7,
getUnicolorTexture(video::SColor(0, 0, 0, 0)));
#endif
}
m_sun_interposer = new STKMeshSceneNode(sphere,
m_scene_manager->getRootSceneNode(),
@@ -720,11 +734,10 @@ void IrrDriver::createSunInterposer()
m_sun_interposer->getMaterial(0).Lighting = false;
m_sun_interposer->getMaterial(0).ColorMask = video::ECP_NONE;
m_sun_interposer->getMaterial(0).ZWriteEnable = false;
#ifndef SERVER_ONLY
m_sun_interposer->getMaterial(0).MaterialType = Shaders::getShader(ES_OBJECTPASS);
#endif
sphere->drop();
#endif
}
//-----------------------------------------------------------------------------
@@ -779,6 +792,7 @@ core::position2di IrrDriver::getMouseLocation()
*/
bool IrrDriver::moveWindow(int x, int y)
{
#ifndef SERVER_ONLY
#ifdef WIN32
const video::SExposedVideoData& videoData =
m_video_driver->getExposedVideoData();
@@ -817,6 +831,7 @@ bool IrrDriver::moveWindow(int x, int y)
// TODO: Actually handle possible failure
XMoveWindow(display, videoData.OpenGLLinux.X11Window, x, y);
#endif
#endif
return true;
}
@@ -1152,13 +1167,11 @@ scene::IMeshSceneNode *IrrDriver::addSphere(float radius,
m.EmissiveColor = color;
m.BackfaceCulling = false;
m.MaterialType = video::EMT_SOLID;
#ifndef SERVER_ONLY
//m.setTexture(0, getUnicolorTexture(video::SColor(128, 255, 105, 180)));
m.setTexture(0, getUnicolorTexture(color));
m.setTexture(1, getUnicolorTexture(video::SColor(0, 0, 0, 0)));
m.setTexture(7, getUnicolorTexture(video::SColor(0, 0, 0, 0)));
#endif
if (CVS->isGLSL())
{
@@ -1168,6 +1181,7 @@ scene::IMeshSceneNode *IrrDriver::addSphere(float radius,
NULL, -1, "sphere");
return node;
}
#endif
scene::IMeshSceneNode *node = m_scene_manager->addMeshSceneNode(mesh);
return node;
@@ -1193,6 +1207,9 @@ scene::IMeshSceneNode *IrrDriver::addMesh(scene::IMesh *mesh,
bool all_parts_colorized,
int frame_for_mesh)
{
#ifdef SERVER_ONLY
return m_scene_manager->addMeshSceneNode(mesh, parent);
#else
if (!CVS->isGLSL())
return m_scene_manager->addMeshSceneNode(mesh, parent);
@@ -1211,6 +1228,7 @@ scene::IMeshSceneNode *IrrDriver::addMesh(scene::IMesh *mesh,
node->drop();
return node;
#endif
} // addMesh
// ----------------------------------------------------------------------------
@@ -1234,6 +1252,7 @@ scene::ISceneNode *IrrDriver::addBillboard(const core::dimension2d< f32 > size,
bool alphaTesting)
{
scene::IBillboardSceneNode* node;
#ifndef SERVER_ONLY
if (CVS->isGLSL())
{
if (!parent)
@@ -1244,13 +1263,14 @@ scene::ISceneNode *IrrDriver::addBillboard(const core::dimension2d< f32 > size,
node->drop();
}
else
#endif
node = m_scene_manager->addBillboardSceneNode(parent, size);
assert(node->getMaterialCount() > 0);
node->setMaterialTexture(0, texture);
if(alphaTesting)
node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
return node;
} // addMesh
} // addBillboard
// ----------------------------------------------------------------------------
/** Creates a quad mesh with a given material.
@@ -1392,13 +1412,16 @@ scene::IAnimatedMeshSceneNode *IrrDriver::addAnimatedMesh(scene::IAnimatedMesh *
const std::string& debug_name, scene::ISceneNode* parent,
RenderInfo* render_info, bool all_parts_colorized)
{
#ifndef SERVER_ONLY
if (!CVS->isGLSL())
{
#endif
return m_scene_manager->addAnimatedMeshSceneNode(mesh, parent, -1,
core::vector3df(0, 0, 0),
core::vector3df(0, 0, 0),
core::vector3df(1, 1, 1),
/*addIfMeshIsZero*/true);
#ifndef SERVER_ONLY
}
if (!parent)
@@ -1409,6 +1432,7 @@ scene::IAnimatedMeshSceneNode *IrrDriver::addAnimatedMesh(scene::IAnimatedMesh *
core::vector3df(1, 1, 1), render_info, all_parts_colorized);
node->drop();
return node;
#endif
} // addAnimatedMesh
// ----------------------------------------------------------------------------
@@ -1449,19 +1473,24 @@ scene::ISceneNode *IrrDriver::addSkyDome(video::ITexture *texture,
scene::ISceneNode *IrrDriver::addSkyBox(const std::vector<video::ITexture*> &texture,
const std::vector<video::ITexture*> &spherical_harmonics_textures)
{
#ifndef SERVER_ONLY
assert(texture.size() == 6);
m_renderer->addSkyBox(texture, spherical_harmonics_textures);
#endif
return m_scene_manager->addSkyBoxSceneNode(texture[0], texture[1],
texture[2], texture[3],
texture[4], texture[5]);
} // addSkyBox
// ----------------------------------------------------------------------------
void IrrDriver::suppressSkyBox()
{
#ifndef SERVER_ONLY
m_renderer->removeSkyBox();;
}
#endif
} // suppressSkyBox
// ----------------------------------------------------------------------------
/** Adds a camera to the scene.
@@ -1813,12 +1842,15 @@ video::ITexture* IrrDriver::applyMask(video::ITexture* texture,
void IrrDriver::onLoadWorld()
{
m_renderer->onLoadWorld();
}
// ----------------------------------------------------------------------------
} // onLoadWorld
// ----------------------------------------------------------------------------
void IrrDriver::onUnloadWorld()
{
m_renderer->onUnloadWorld();
}
} // onUnloadWorld
// ----------------------------------------------------------------------------
/** Sets the ambient light.
* \param light The colour of the light to set.
@@ -1827,10 +1859,13 @@ void IrrDriver::onUnloadWorld()
*/
void IrrDriver::setAmbientLight(const video::SColorf &light, bool force_SH_computation)
{
#ifndef SERVER_ONLY
m_scene_manager->setAmbientLight(light);
m_renderer->setAmbientLight(light, force_SH_computation);
#endif
} // setAmbientLight
// ----------------------------------------------------------------------------
video::SColorf IrrDriver::getAmbientLight() const
{
return m_scene_manager->getAmbientLight();
@@ -1841,6 +1876,7 @@ video::SColorf IrrDriver::getAmbientLight() const
*/
void IrrDriver::displayFPS()
{
#ifndef SERVER_ONLY
gui::IGUIFont* font = GUIEngine::getSmallFont();
core::rect<s32> position;
@@ -1911,6 +1947,7 @@ void IrrDriver::displayFPS()
static video::SColor fpsColor = video::SColor(255, 0, 0, 0);
font->draw( fps_string.c_str(), position, fpsColor, false );
#endif
} // updateFPS
// ----------------------------------------------------------------------------
@@ -2009,6 +2046,7 @@ void IrrDriver::update(float dt)
if (world)
{
#ifndef SERVER_ONLY
m_renderer->render(dt);
GUIEngine::Screen* current_screen = GUIEngine::getCurrentScreen();
@@ -2025,6 +2063,7 @@ void IrrDriver::update(float dt)
debug_drawer->beginNextFrame();
}
}
#endif
}
else
{
@@ -2094,8 +2133,12 @@ bool IrrDriver::OnEvent(const irr::SEvent &event)
// ----------------------------------------------------------------------------
bool IrrDriver::supportsSplatting()
{
#ifndef SERVER_ONLY
return CVS->isGLSL();
}
#else
return false;
#endif
} // supportsSplatting
// ----------------------------------------------------------------------------

View File

@@ -297,8 +297,10 @@ public:
void unsetTextureErrorMessage();
class GPUTimer &getGPUTimer(unsigned);
#ifndef SERVER_ONLY
std::unique_ptr<RenderTarget> createRenderTarget(const irr::core::dimension2du &dimension,
const std::string &name);
#endif
// ------------------------------------------------------------------------
/** Convenience function that loads a texture with default parameters

View File

@@ -287,5 +287,8 @@ void LODNode::add(int level, scene::ISceneNode* node, bool reparent)
node->drop();
node->updateAbsolutePosition();
#ifndef SERVER_ONLY
irr_driver->applyObjectPassShader(node);
#endif
}

View File

@@ -1014,6 +1014,7 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
void Material::adjustForFog(scene::ISceneNode* parent, video::SMaterial *m,
bool use_fog) const
{
#ifndef SERVER_ONLY
if (CVS->isGLSL())
{
// to disable fog in the new pipeline, we slightly abuse the steps :
@@ -1037,6 +1038,7 @@ void Material::adjustForFog(scene::ISceneNode* parent, video::SMaterial *m,
if (parent != NULL)
parent->setMaterialFlag(video::EMF_FOG_ENABLE, m_fog && use_fog);
}
#endif
} // adjustForFog
//-----------------------------------------------------------------------------
@@ -1044,7 +1046,9 @@ void Material::adjustForFog(scene::ISceneNode* parent, video::SMaterial *m,
/** Callback from LOD nodes to create some effects */
void Material::onMadeVisible(scene::IMeshBuffer* who)
{
#ifndef SERVER_ONLY
if (!CVS->isGLSL()) return;
#endif
}
//-----------------------------------------------------------------------------
@@ -1052,14 +1056,18 @@ void Material::onMadeVisible(scene::IMeshBuffer* who)
/** Callback from LOD nodes to create some effects */
void Material::onHidden(scene::IMeshBuffer* who)
{
#ifndef SERVER_ONLY
if (!CVS->isGLSL()) return;
#endif
}
//-----------------------------------------------------------------------------
void Material::isInitiallyHidden(scene::IMeshBuffer* who)
{
#ifndef SERVER_ONLY
if (!CVS->isGLSL()) return;
#endif
}
//-----------------------------------------------------------------------------

View File

@@ -147,7 +147,7 @@ Referee::Referee()
m_scene_node->setScale(m_st_scale.toIrrVector());
m_scene_node->setFrameLoop(m_st_first_start_frame,
m_st_last_start_frame);
#ifndef SERVER_ONLY
irr_driver->applyObjectPassShader(m_scene_node);
if (CVS->isGLSL() && CVS->isDefferedEnabled())
@@ -156,6 +156,7 @@ Referee::Referee()
0.7f /* r */, 0.0 /* g */, 0.0f /* b */, false /* sun */, m_scene_node);
}
else
#endif
{
m_light = NULL;
}
@@ -184,7 +185,9 @@ Referee::Referee(const AbstractKart &kart)
m_scene_node->setFrameLoop(m_st_first_rescue_frame,
m_st_last_rescue_frame);
#ifndef SERVER_ONLY
irr_driver->applyObjectPassShader(m_scene_node);
#endif
} // Referee
// ----------------------------------------------------------------------------

View File

@@ -131,12 +131,14 @@ void SkidMarks::update(float dt, bool force_skid_marks,
if (!is_skidding) // end skid marking
{
m_skid_marking = false;
#ifndef SERVER_ONLY
// The vertices and indices will not change anymore
// (till these skid mark quads are deleted)
m_left[m_current]->setHardwareMappingHint(scene::EHM_STATIC);
m_right[m_current]->setHardwareMappingHint(scene::EHM_STATIC);
if (STKMeshSceneNode* stkm = dynamic_cast<STKMeshSceneNode*>(m_nodes[m_current]))
stkm->setReloadEachFrame(false);
#endif
return;
}
@@ -192,11 +194,13 @@ void SkidMarks::update(float dt, bool force_skid_marks,
custom_color);
new_mesh->addMeshBuffer(smq_right);
scene::IMeshSceneNode *new_node = irr_driver->addMesh(new_mesh, "skidmark");
#ifndef SERVER_ONLY
if (STKMeshSceneNode* stkm = dynamic_cast<STKMeshSceneNode*>(new_node))
stkm->setReloadEachFrame(true);
#ifdef DEBUG
std::string debug_name = m_kart.getIdent()+" (skid-mark)";
new_node->setName(debug_name.c_str());
#endif
#endif
// We don't keep a reference to the mesh here, so we have to decrement

View File

@@ -51,10 +51,12 @@ SlipStream::SlipStream(AbstractKart* kart) : MovingTexture(0, 0), m_kart(kart)
scene::IMeshBuffer* buffer = m_mesh->getMeshBuffer(0);
material->setMaterialProperties(&buffer->getMaterial(), buffer);
#ifndef SERVER_ONLY
STKMeshSceneNode* stk_node = dynamic_cast<STKMeshSceneNode*>(m_node);
if (stk_node != NULL)
stk_node->setReloadEachFrame(true);
m_mesh->drop();
#endif
#ifdef DEBUG
std::string debug_name = m_kart->getIdent()+" (slip-stream)";
@@ -233,7 +235,9 @@ void SlipStream::createMesh(Material* material)
} // for j<num_circles-1
material->setMaterialProperties(&buffer->getMaterial(), buffer);
#ifndef SERVER_ONLY
if (!CVS->isGLSL())
#endif
{
buffer->Material.setFlag(video::EMF_BACK_FACE_CULLING, false);
buffer->Material.setFlag(video::EMF_COLOR_MATERIAL, true);

View File

@@ -174,6 +174,7 @@ void STKModifiedSpriteBank::draw2DSprite(u32 index,
const core::rect<s32>* clip, const video::SColor& color,
u32 starttime, u32 currenttime, bool loop, bool center)
{
#ifndef SERVER_ONLY
assert( m_magic_number == 0xCAFEC001 );
if (index >= Sprites.size() || Sprites[index].Frames.empty() )
return;
@@ -221,7 +222,7 @@ void STKModifiedSpriteBank::draw2DSprite(u32 index,
*/
draw2DImage(tex, dest, r /* source rect */, clip,
NULL /* colors */, true);
#endif
} // draw2DSprite
// ----------------------------------------------------------------------------

View File

@@ -1123,6 +1123,7 @@ namespace GUIEngine
void render(float elapsed_time)
{
#ifndef SERVER_ONLY
GUIEngine::dt = elapsed_time;
// Not yet initialized, or already cleaned up
@@ -1247,7 +1248,7 @@ namespace GUIEngine
DemoWorld::resetIdleTime();
}
#endif
} // render
// -----------------------------------------------------------------------

View File

@@ -93,6 +93,8 @@ void ScalableFont::draw(const core::stringw& text,
const video::SColor& color, bool hcenter, bool vcenter,
const core::rect<s32>* clip, bool ignoreRTL)
{
#ifndef SERVER_ONLY
bool previousRTL = m_font_settings->isRTL();
if (ignoreRTL)
m_font_settings->setRTL(false);
@@ -102,7 +104,7 @@ void ScalableFont::draw(const core::stringw& text,
if (ignoreRTL)
m_font_settings->setRTL(previousRTL);
#endif
} // draw
// ----------------------------------------------------------------------------

View File

@@ -326,7 +326,7 @@ Skin::~Skin()
// ----------------------------------------------------------------------------
void Skin::drawBgImage()
{
#ifndef SERVER_ONLY
// ---- background image
// on one end, making these static is not too clean.
// on another end, these variables are really only used locally,
@@ -370,6 +370,7 @@ void Skin::drawBgImage()
/* no clipping */0, /*color*/ 0,
/*alpha*/false);
irr_driver->getVideoDriver()->enableMaterial2D(false);
#endif
} // drawBgImage
// ----------------------------------------------------------------------------
@@ -401,6 +402,7 @@ void Skin::drawBoxFromStretchableTexture(SkinWidgetContainer* w,
bool deactivated,
const core::recti* clipRect)
{
#ifndef SERVER_ONLY
// check if widget moved. if so, recalculate coords
if (w->m_skin_x != dest.UpperLeftCorner.X ||
w->m_skin_y != dest.UpperLeftCorner.Y ||
@@ -701,7 +703,7 @@ X##_yflip.LowerRightCorner.Y = w->m_skin_dest_y + \
{
delete[] colorptr;
}
#endif
} // drawBoxFromStretchableTexture
// ----------------------------------------------------------------------------
@@ -844,6 +846,7 @@ void Skin::drawProgress(Widget* w, const core::recti &rect,
void Skin::drawRatingBar(Widget *w, const core::recti &rect,
const bool pressed, const bool focused)
{
#ifndef SERVER_ONLY
RatingBarWidget *ratingBar = (RatingBarWidget*)w;
const ITexture *texture = SkinConfig::m_render_params["rating::neutral"].getImage();
@@ -897,7 +900,7 @@ void Skin::drawRatingBar(Widget *w, const core::recti &rect,
(w->m_deactivated || ID_DEBUG) ? colors : 0,
true /* alpha */);
}
#endif
} // drawRatingBar
// ----------------------------------------------------------------------------
@@ -921,6 +924,7 @@ void Skin::drawRibbon(const core::recti &rect, Widget* widget,
void Skin::drawRibbonChild(const core::recti &rect, Widget* widget,
const bool pressed, bool focused)
{
#ifndef SERVER_ONLY
// for now, when this kind of widget is disabled, just hide it. we can
// change that behaviour if we ever need to...
//if (widget->m_deactivated) return;
@@ -1220,6 +1224,7 @@ void Skin::drawRibbonChild(const core::recti &rect, Widget* widget,
m_tooltips.push_back(widget);
}
}
#endif
} // drawRibbonChild
// ----------------------------------------------------------------------------
@@ -1435,6 +1440,7 @@ void Skin::drawSpinnerChild(const core::recti &rect, Widget* widget,
void Skin::drawIconButton(const core::recti &rect, Widget* widget,
const bool pressed, bool focused)
{
#ifndef SERVER_ONLY
RibbonWidget* parentRibbon = dynamic_cast<RibbonWidget*>(widget->m_event_handler);
IGUIElement* focusedElem = NULL;
if (GUIEngine::getFocusForPlayer(PLAYER_ID_GAME_MASTER) != NULL)
@@ -1543,6 +1549,7 @@ void Skin::drawIconButton(const core::recti &rect, Widget* widget,
{
irr_driver->getVideoDriver()->enableMaterial2D();
}
#endif
} // drawIconButton
// ----------------------------------------------------------------------------
@@ -1662,6 +1669,7 @@ void Skin::drawListSelection(const core::recti &rect, Widget* widget,
void Skin::drawListHeader(const irr::core::rect< irr::s32 > &rect,
Widget* widget)
{
#ifndef SERVER_ONLY
bool isSelected =
(((ListWidget*)widget->m_event_handler)->m_selected_column == widget &&
((ListWidget*)widget->m_event_handler)->m_sort_default == false);
@@ -1689,7 +1697,7 @@ void Skin::drawListHeader(const irr::core::rect< irr::s32 > &rect,
draw2DImage(img, destRect, srcRect,
NULL, NULL, /* alpha */true);
}
#endif
} // drawListHeader
// ----------------------------------------------------------------------------
@@ -1698,6 +1706,7 @@ void Skin::drawListHeader(const irr::core::rect< irr::s32 > &rect,
*/
void Skin::renderSections(PtrVector<Widget>* within_vector)
{
#ifndef SERVER_ONLY
if (within_vector == NULL) within_vector = &getCurrentScreen()->m_widgets;
const unsigned short widgets_amount = within_vector->size();
@@ -1770,12 +1779,13 @@ void Skin::renderSections(PtrVector<Widget>* within_vector)
}
}
} // next
#endif // !SERVER_ONLY
} // renderSections
// ----------------------------------------------------------------------------
void Skin::drawScrollbarBackground(const irr::core::rect< irr::s32 > &rect)
{
#ifndef SERVER_ONLY
// leave square space at both ends for up/down buttons (yeah, irrlicht
// doesn't handle that)
core::recti rect2 = rect;
@@ -1789,12 +1799,13 @@ void Skin::drawScrollbarBackground(const irr::core::rect< irr::s32 > &rect)
p.m_source_area_center,
0 /* no clipping */, 0,
true /* alpha */);
#endif
} // drawScrollbarBackground
// ----------------------------------------------------------------------------
void Skin::drawScrollbarThumb(const irr::core::rect< irr::s32 > &rect)
{
#ifndef SERVER_ONLY
BoxRenderParams& p =
SkinConfig::m_render_params["scrollbar_thumb::neutral"];
@@ -1802,7 +1813,7 @@ void Skin::drawScrollbarThumb(const irr::core::rect< irr::s32 > &rect)
p.m_source_area_center,
0 /* no clipping */, 0,
true /* alpha */);
#endif
} // drawScrollbarThumb
// ----------------------------------------------------------------------------
@@ -2018,6 +2029,7 @@ void Skin::process3DPane(IGUIElement *element, const core::recti &rect,
void doDrawBadge(ITexture* texture, const core::recti& rect,
float max_icon_size, bool badge_at_left)
{
#ifndef SERVER_ONLY
// In case of a problem
if(!texture) return;
@@ -2043,6 +2055,7 @@ void doDrawBadge(ITexture* texture, const core::recti& rect,
draw2DImage(texture, rect2, source_area,
0 /* no clipping */, 0,
true /* alpha */);
#endif
} // doDrawBadge
// ----------------------------------------------------------------------------
@@ -2141,6 +2154,7 @@ void Skin::draw3DSunkenPane (IGUIElement *element, video::SColor bgcolor,
bool flat, bool fillBackGround,
const core::recti &rect, const core::recti *clip)
{
#ifndef SERVER_ONLY
const int id = element->getID();
Widget* widget = GUIEngine::getWidget(id);
@@ -2259,18 +2273,21 @@ void Skin::draw3DSunkenPane (IGUIElement *element, video::SColor bgcolor,
return;
}
#endif
} // draw3DSunkenPane
// -----------------------------------------------------------------------------
void Skin::drawBGFadeColor()
{
#ifndef SERVER_ONLY
// fade out background
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),
irr_driver->getActualScreenSize()));
#endif
} // drawBGFadeColor
// -----------------------------------------------------------------------------
@@ -2318,8 +2335,10 @@ core::recti Skin::draw3DWindowBackground(IGUIElement *element,
void Skin::draw3DMenuPane (IGUIElement *element, const core::recti &rect,
const core::recti *clip)
{
#ifndef SERVER_ONLY
SColor color = SColor(150, 96, 74, 196);
GL32_draw2DRectangle(color, rect);
#endif
} // draw3DMenuPane
// -----------------------------------------------------------------------------
@@ -2378,7 +2397,9 @@ void Skin::draw2DImage(const video::ITexture* texture, const core::rect<s32>& de
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
const video::SColor* const colors, bool useAlphaChannelOfTexture)
{
#ifndef SERVER_ONLY
::draw2DImage(texture, destRect, sourceRect, clipRect, colors, useAlphaChannelOfTexture);
#endif
}
// -----------------------------------------------------------------------------

View File

@@ -882,6 +882,7 @@ core::position2di CGUIEditBox::calculateICPos()
//! draws the element and its children
void CGUIEditBox::draw()
{
#ifndef SERVER_ONLY
if (!IsVisible)
return;
@@ -1083,6 +1084,7 @@ void CGUIEditBox::draw()
// draw children
IGUIElement::draw();
#endif
}

View File

@@ -52,13 +52,17 @@ IconButtonWidget(IconButtonWidget::SCALE_MODE_KEEP_TEXTURE_ASPECT_RATIO, false,
m_properties[PROP_ICON]="gui/main_help.png";
m_rtt_unsupported = false;
}
} // ModelViewWidget
// -----------------------------------------------------------------------------
ModelViewWidget::~ModelViewWidget()
{
GUIEngine::needsUpdate.remove(this);
#ifndef SERVER_ONLY
delete m_render_info;
}
#endif
} // ~ModelViewWidget
// -----------------------------------------------------------------------------
void ModelViewWidget::add()
{
@@ -92,7 +96,7 @@ void ModelViewWidget::clearModels()
m_rtt_main_node = NULL;
m_camera = NULL;
m_light = NULL;
}
} // clearModels
// -----------------------------------------------------------------------------
@@ -107,10 +111,11 @@ void ModelViewWidget::addModel(irr::scene::IMesh* mesh, const Vec3& location,
m_model_scale.push_back(scale);
m_model_frames.push_back(frame);
m_model_render_info_affected.push_back(all_parts_colorized);
#ifndef SERVER_ONLY
if (!CVS->isGLSL())
m_render_target = NULL;
}
#endif
} // addModel
// -----------------------------------------------------------------------------
void ModelViewWidget::update(float delta)
@@ -161,7 +166,10 @@ void ModelViewWidget::update(float delta)
// stop rotating when target reached
if (fabsf(m_angle - m_rotation_target) < 2.0f) m_rotation_mode = ROTATE_OFF;
}
#ifdef SERVER_ONLY
return;
#else
if (m_render_target == NULL)
{
std::string name = "model view ";
@@ -181,10 +189,13 @@ void ModelViewWidget::update(float delta)
m_render_target->renderToTexture(m_camera, GUIEngine::getLatestDt());
m_rtt_main_node->setVisible(false);
}
#endif
} // update
// ----------------------------------------------------------------------------
void ModelViewWidget::setupRTTScene()
{
#ifndef SERVER_ONLY
irr_driver->suppressSkyBox();
if (m_rtt_main_node != NULL) m_rtt_main_node->remove();
@@ -297,42 +308,57 @@ void ModelViewWidget::setupRTTScene()
m_camera->setFOV(DEGREE_TO_RAD*50.0f);
m_camera->updateAbsolutePosition();
}
#endif
} // setupRTTScene
// ----------------------------------------------------------------------------
void ModelViewWidget::setRotateOff()
{
m_rotation_mode = ROTATE_OFF;
}
} // setRotateOff
// ----------------------------------------------------------------------------
void ModelViewWidget::setRotateContinuously(float speed)
{
m_rotation_mode = ROTATE_CONTINUOUSLY;
m_rotation_speed = speed;
}
} // setRotateContinuously
// ----------------------------------------------------------------------------
void ModelViewWidget::setRotateTo(float targetAngle, float speed)
{
m_rotation_mode = ROTATE_TO;
m_rotation_speed = speed;
m_rotation_target = targetAngle;
}
} // setRotateTo
// ----------------------------------------------------------------------------
bool ModelViewWidget::isRotating()
{
return m_rotation_mode != ROTATE_OFF ? true : false;
}
} // isRotating
// ----------------------------------------------------------------------------
void ModelViewWidget::elementRemoved()
{
#ifndef SERVER_ONLY
m_render_target = NULL;
IconButtonWidget::elementRemoved();
}
#endif
} // elementRemoved
// ----------------------------------------------------------------------------
void ModelViewWidget::clearRttProvider()
{
m_render_target = NULL;
}
} // clearRttProvider
// ----------------------------------------------------------------------------
void ModelViewWidget::drawRTTScene(const irr::core::rect<s32>& dest_rect) const
{
#ifndef SERVER_ONLY
if(m_render_target != NULL)
m_render_target->draw2DImage(dest_rect, NULL, video::SColor(255, 255, 255, 255), true);
}
#endif
} // drawRTTScene

View File

@@ -182,7 +182,7 @@ void Attachment::set(AttachmentType type, float time,
}
}
m_node->setVisible(true);
#ifndef SERVER_ONLY
irr_driver->applyObjectPassShader(m_node);
// Save event about the new attachment
@@ -193,6 +193,7 @@ void Attachment::set(AttachmentType type, float time,
saveState(buffer);
rwm->addEvent(this, buffer);
}
#endif
} // set
// -----------------------------------------------------------------------------

View File

@@ -76,6 +76,7 @@ Flyable::Flyable(AbstractKart *kart, PowerupManager::PowerupType type,
m_max_lifespan = -1;
// Add the graphical model
#ifndef SERVER_ONLY
setNode(irr_driver->addMesh(m_st_model[type], StringUtils::insertValues("flyable_%i", (int)type)));
irr_driver->applyObjectPassShader(getNode());
#ifdef DEBUG
@@ -83,7 +84,7 @@ Flyable::Flyable(AbstractKart *kart, PowerupManager::PowerupType type,
debug_name += type;
getNode()->setName(debug_name.c_str());
#endif
#endif
} // Flyable
// ----------------------------------------------------------------------------

View File

@@ -185,6 +185,7 @@ void Item::switchTo(ItemType type, scene::IMesh *mesh, scene::IMesh *lowmesh)
scene::ISceneNode* node = m_node->getAllNodes()[0];
((scene::IMeshSceneNode*)node)->setMesh(mesh);
#ifndef SERVER_ONLY
if (lowmesh != NULL)
{
node = m_node->getAllNodes()[1];
@@ -195,6 +196,7 @@ void Item::switchTo(ItemType type, scene::IMesh *mesh, scene::IMesh *lowmesh)
irr_driver->applyObjectPassShader(m_node->getAllNodes()[0]);
World::getWorld()->getTrack()->adjustForFog(m_node);
#endif
} // switchTo
//-----------------------------------------------------------------------------

View File

@@ -78,6 +78,7 @@ RubberBand::RubberBand(Plunger *plunger, AbstractKart *kart)
#endif
updatePosition();
m_node = irr_driver->addMesh(m_mesh, "rubberband");
#ifndef SERVER_ONLY
irr_driver->applyObjectPassShader(m_node);
if (STKMeshSceneNode *stkm = dynamic_cast<STKMeshSceneNode *>(m_node))
stkm->setReloadEachFrame(true);
@@ -85,6 +86,7 @@ RubberBand::RubberBand(Plunger *plunger, AbstractKart *kart)
std::string debug_name = m_owner->getIdent()+" (rubber-band)";
m_node->setName(debug_name.c_str());
#endif
#endif
} // RubberBand

View File

@@ -263,8 +263,11 @@ void LocalPlayerController::handleZipper(bool play_sound)
m_wee_sound->play();
}
#ifndef SERVER_ONLY
// Apply the motion blur according to the speed of the kart
irr_driver->giveBoost(m_camera_index);
#endif
} // handleZipper
//-----------------------------------------------------------------------------

View File

@@ -336,9 +336,10 @@ void Kart::reset()
m_kart_gfx->reset();
m_skidding->reset();
#ifndef SERVER_ONLY
if (m_collision_particles)
m_collision_particles->setCreationRateAbsolute(0.0f);
#endif
m_race_position = m_initial_position;
m_finished_race = false;
@@ -2054,6 +2055,7 @@ void Kart::crashed(const Material *m, const Vec3 &normal)
if(m && m->getCollisionReaction() != Material::NORMAL &&
!getKartAnimation())
{
#ifndef SERVER_ONLY
std::string particles = m->getCrashResetParticles();
if (particles.size() > 0)
{
@@ -2079,7 +2081,7 @@ void Kart::crashed(const Material *m, const Vec3 &normal)
"crash-reset properties\n", particles.c_str());
}
}
#endif
if (m->getCollisionReaction() == Material::RESCUE)
{
new RescueAnimation(this);
@@ -2539,6 +2541,7 @@ void Kart::loadData(RaceManager::KartType type, bool is_animated_model)
// Attach Particle System
Track *track = World::getWorld()->getTrack();
#ifndef SERVER_ONLY
if (type == RaceManager::KT_PLAYER &&
UserConfigParams::m_weather_effects &&
track->getSkyParticles() != NULL)
@@ -2555,6 +2558,7 @@ void Kart::loadData(RaceManager::KartType type, bool is_animated_model)
// of the heightmap being calculated and kept in memory
m_sky_particles_emitter->addHeightMapAffector(track);
}
#endif
Vec3 position(0, getKartHeight()*0.35f, -getKartLength()*0.35f);
@@ -2567,12 +2571,13 @@ void Kart::loadData(RaceManager::KartType type, bool is_animated_model)
track_manager->getTrack(race_manager->getTrackName())
->isFogEnabled() );
}
#ifndef SERVER_ONLY
if (!CVS->supportsShadows())
{
m_shadow = new Shadow(m_kart_properties.get(), m_node,
-m_kart_model->getLowestPoint());
}
#endif
World::getWorld()->kartAdded(this, m_node);
} // loadData
@@ -2882,6 +2887,7 @@ btQuaternion Kart::getVisualRotation() const
*/
void Kart::setOnScreenText(const wchar_t *text)
{
#ifndef SERVER_ONLY
BoldFace* bold_face = font_manager->getFont<BoldFace>();
core::dimension2d<u32> textsize = bold_face->getDimension(text);
@@ -2914,6 +2920,7 @@ void Kart::setOnScreenText(const wchar_t *text)
// No need to store the reference to the billboard scene node:
// It has one reference to the parent, and will get deleted
// when the parent is deleted.
#endif
} // setOnScreenText
// ------------------------------------------------------------------------

View File

@@ -80,12 +80,14 @@ KartGFX::KartGFX(const AbstractKart *kart)
m_skidding_light_2->setName( ("skidding emitter 2 (" + m_kart->getIdent()
+ ")").c_str() );
#ifndef SERVER_ONLY
if (CVS->isGLSL())
{
m_nitro_light->grab();
m_skidding_light_1->grab();
m_skidding_light_2->grab();
}
#endif
// Create particle effects
Vec3 rear_left(kart->getWheelGraphicsPosition(3).getX(), 0.05f,
@@ -128,13 +130,15 @@ KartGFX::~KartGFX()
if(m_all_emitters[i])
delete m_all_emitters[i];
} // for i < KGFX_COUNT
#ifndef SERVER_ONLY
if (CVS->isGLSL())
{
m_nitro_light->drop();
m_skidding_light_1->drop();
m_skidding_light_2->drop();
}
#endif
} // ~KartGFX
@@ -148,6 +152,7 @@ KartGFX::~KartGFX()
void KartGFX::addEffect(KartGFXType type, const std::string &file_name,
const Vec3 &position, bool important)
{
#ifndef SERVER_ONLY
if (!UserConfigParams::m_graphical_effects &&
(!important || m_kart->getType() == RaceManager::KT_AI ||
m_kart->getType() == RaceManager::KT_SPARE_TIRE))
@@ -193,6 +198,7 @@ void KartGFX::addEffect(KartGFXType type, const std::string &file_name,
m_skid_kind1 = kind;
else if (type==KGFX_SKID2L || type==KGFX_SKID2R)
m_skid_kind2 = kind;
#endif
} // addEffect
// ----------------------------------------------------------------------------
@@ -201,6 +207,7 @@ void KartGFX::addEffect(KartGFXType type, const std::string &file_name,
void KartGFX::reset()
{
m_wheel_toggle = 1;
#ifndef SERVER_ONLY
for(unsigned int i=0; i<m_all_emitters.size(); i++)
{
if(m_all_emitters[i])
@@ -209,6 +216,7 @@ void KartGFX::reset()
m_all_emitters[i]->clearParticles();
}
}
#endif
} // reset
// ----------------------------------------------------------------------------
@@ -221,6 +229,7 @@ void KartGFX::setSkidLevel(const unsigned int level)
assert(level >= 1);
assert(level <= 2);
const ParticleKind *pk = level==1 ? m_skid_kind1 : m_skid_kind2;
#ifndef SERVER_ONLY
if(m_all_emitters[KGFX_SKID1L])
m_all_emitters[KGFX_SKID1L]->setParticleType(pk);
if(m_all_emitters[KGFX_SKID1R])
@@ -229,6 +238,7 @@ void KartGFX::setSkidLevel(const unsigned int level)
// set to indicate that the bonus is now available.
setCreationRateRelative(KartGFX::KGFX_SKIDL, 0.0f);
setCreationRateRelative(KartGFX::KGFX_SKIDR, 0.0f);
#endif
} // setSkidLevel
// ----------------------------------------------------------------------------
@@ -239,10 +249,12 @@ void KartGFX::setSkidLevel(const unsigned int level)
*/
void KartGFX::setParticleKind(const KartGFXType type, const ParticleKind *pk)
{
#ifndef SERVER_ONLY
ParticleEmitter *pe = m_all_emitters[KGFX_TERRAIN];
if(!pe) return;
pe->setParticleType(pk);
#endif
} // setParticleKind
// ----------------------------------------------------------------------------
@@ -252,9 +264,11 @@ void KartGFX::setParticleKind(const KartGFXType type, const ParticleKind *pk)
*/
void KartGFX::setXYZ(const KartGFXType type, const Vec3 &xyz)
{
#ifndef SERVER_ONLY
ParticleEmitter *pe = m_all_emitters[KGFX_TERRAIN];
if(!pe) return;
pe->setPosition(xyz);
#endif
} // setXYZ
// ----------------------------------------------------------------------------
@@ -265,8 +279,10 @@ void KartGFX::setXYZ(const KartGFXType type, const Vec3 &xyz)
*/
void KartGFX::setCreationRateAbsolute(KartGFXType type, float f)
{
#ifndef SERVER_ONLY
if(m_all_emitters[type])
m_all_emitters[type]->setCreationRateAbsolute(f);
#endif
} // setCreationRateAbsolute
// ----------------------------------------------------------------------------
@@ -279,6 +295,7 @@ void KartGFX::setCreationRateAbsolute(KartGFXType type, float f)
*/
void KartGFX::setCreationRateRelative(KartGFXType type, float f)
{
#ifndef SERVER_ONLY
if(m_all_emitters[type])
{
if(f<0)
@@ -286,6 +303,7 @@ void KartGFX::setCreationRateRelative(KartGFXType type, float f)
else
m_all_emitters[type]->setCreationRateRelative(f);
}
#endif
} // setCreationRateRelative
// ----------------------------------------------------------------------------
@@ -298,8 +316,10 @@ void KartGFX::setCreationRateRelative(KartGFXType type, float f)
*/
void KartGFX::resizeBox(KartGFXType type, float new_size)
{
#ifndef SERVER_ONLY
if(m_all_emitters[type])
m_all_emitters[type]->resizeBox(std::max(0.25f, new_size));
#endif
} // resizeBox
// ----------------------------------------------------------------------------
@@ -311,6 +331,7 @@ void KartGFX::resizeBox(KartGFXType type, float new_size)
*/
void KartGFX::updateTerrain(const ParticleKind *pk)
{
#ifndef SERVER_ONLY
ParticleEmitter *pe = m_all_emitters[KGFX_TERRAIN];
if(!pe) return;
@@ -343,6 +364,7 @@ void KartGFX::updateTerrain(const ParticleKind *pk)
// m_skidding can be > 2, and speed > maxSpeed (if powerups are used).
if(rate>1.0f) rate = 1.0f;
pe->setCreationRateRelative(rate);
#endif
} // updateTerrain
// ----------------------------------------------------------------------------
@@ -367,6 +389,7 @@ void KartGFX::update(float dt)
*/
void KartGFX::updateNitroGraphics(float nitro_frac)
{
#ifndef SERVER_ONLY
// Upate particle effects (creation rate, and emitter size
// depending on speed)
// --------------------------------------------------------
@@ -386,7 +409,7 @@ void KartGFX::updateNitroGraphics(float nitro_frac)
setCreationRateAbsolute(KartGFX::KGFX_NITROSMOKE2, 0);
m_nitro_light->setVisible(false);
}
#endif
} // updateGraphics
// ----------------------------------------------------------------------------
@@ -404,6 +427,7 @@ void KartGFX::updateSkidLight(unsigned int level)
void KartGFX::getGFXStatus(int* nitro, bool* zipper,
int* skidding, bool* red_skidding) const
{
#ifndef SERVER_ONLY
int n = 0;
bool z = false;
int s = 0;
@@ -429,13 +453,14 @@ void KartGFX::getGFXStatus(int* nitro, bool* zipper,
*zipper = z;
*skidding = s;
*red_skidding = r;
#endif
} // getGFXStatus
// ----------------------------------------------------------------------------
void KartGFX::setGFXFromReplay(int nitro, bool zipper,
int skidding, bool red_skidding)
{
#ifndef SERVER_ONLY
if (nitro > 0)
{
setCreationRateAbsolute(KartGFX::KGFX_NITRO1, (float)nitro);
@@ -489,6 +514,7 @@ void KartGFX::setGFXFromReplay(int nitro, bool zipper,
m_skidding_light_1->setVisible(false);
m_skidding_light_2->setVisible(false);
}
#endif
} // setGFXFromReplay
// ----------------------------------------------------------------------------

View File

@@ -357,6 +357,7 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
irr_driver->getSceneManager()->getRootSceneNode(),
irr_driver->getSceneManager() );
#ifndef SERVER_ONLY
node = irr_driver->addAnimatedMesh(m_mesh, "kartmesh",
NULL/*parent*/, getRenderInfo());
@@ -365,7 +366,7 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
node->setAutomaticCulling(scene::EAC_OFF);
else
node->setAutomaticCulling(scene::EAC_FRUSTUM_BOX);
#endif
if (always_animated)
{
// give a huge LOD distance for the player's kart. the reason is that it should
@@ -409,7 +410,7 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
if(!m_speed_weighted_objects[i].m_node) continue;
m_speed_weighted_objects[i].m_node->setParent(lod_node);
}
#ifndef SERVER_ONLY
// Enable rim lighting for the kart
irr_driver->applyObjectPassShader(lod_node, true);
std::vector<scene::ISceneNode*> &lodnodes = lod_node->getAllNodes();
@@ -418,6 +419,7 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
{
irr_driver->applyObjectPassShader(lodnodes[i], true);
}
#endif
}
else
{
@@ -428,12 +430,13 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
: 0;
scene::IMesh* main_frame = m_mesh;
#ifndef SERVER_ONLY
if (!CVS->isGLSL())
{
main_frame = m_mesh->getMesh(straight_frame);
main_frame->setHardwareMappingHint(scene::EHM_STATIC);
}
#endif
std::string debug_name;
#ifdef DEBUG
@@ -510,12 +513,13 @@ bool KartModel::loadModels(const KartProperties &kart_properties)
return false;
}
#ifndef SERVER_ONLY
scene::ISkinnedMesh* sm = dynamic_cast<scene::ISkinnedMesh*>(m_mesh);
if (sm)
{
MeshTools::createSkinnedMeshWithTangents(sm, &MeshTools::isNormalMap);
}
#endif
m_mesh->grab();
irr_driver->grabAllTextures(m_mesh);
@@ -564,7 +568,7 @@ bool KartModel::loadModels(const KartProperties &kart_properties)
// Grab all textures. This is done for the master only, so
// the destructor will only free the textures if a master
// copy is freed.
#ifndef SERVER_ONLY
scene::ISkinnedMesh* sm =
dynamic_cast<scene::ISkinnedMesh*>(obj.m_model);
if (sm)
@@ -573,7 +577,7 @@ bool KartModel::loadModels(const KartProperties &kart_properties)
&MeshTools::isNormalMap);
}
irr_driver->grabAllTextures(obj.m_model);
#endif
// Update min/max
Vec3 obj_min, obj_max;
MeshTools::minMax3D(obj.m_model, &obj_min, &obj_max);
@@ -614,8 +618,10 @@ bool KartModel::loadModels(const KartProperties &kart_properties)
std::string full_wheel =
kart_properties.getKartDir()+m_wheel_filename[i];
m_wheel_model[i] = irr_driver->getMesh(full_wheel);
#ifndef SERVER_ONLY
m_wheel_model[i] = MeshTools::createMeshWithTangents(m_wheel_model[i],
&MeshTools::isNormalMap);
&MeshTools::isNormalMap);
#endif
// Grab all textures. This is done for the master only, so
// the destructor will only free the textures if a master
// copy is freed.

View File

@@ -1613,6 +1613,7 @@ int main(int argc, char *argv[] )
}
Log::warn("OpenGL", "Driver is too old!");
}
#ifndef SERVER_ONLY
else if (!CVS->isGLSL())
{
if (UserConfigParams::m_old_driver_popup)
@@ -1631,7 +1632,7 @@ int main(int argc, char *argv[] )
}
Log::warn("OpenGL", "OpenGL version is too old!");
}
#endif
// Note that on the very first run of STK internet status is set to
// "not asked", so the report will only be sent in the next run.
if(UserConfigParams::m_internet_status==Online::RequestManager::IPERM_ALLOWED)

View File

@@ -320,6 +320,7 @@ void SoccerWorld::countdownReachedZero()
//-----------------------------------------------------------------------------
void SoccerWorld::initKartList()
{
#ifndef SERVER_ONLY
const unsigned int kart_amount = (unsigned int)m_karts.size();
//Loading the indicator textures
@@ -340,13 +341,14 @@ void SoccerWorld::initKartList()
float arrow_pos_height = km->getHeight() + 0.5f;
SoccerTeam team = getKartTeam(i);
arrow_node = irr_driver->addBillboard(core::dimension2d<irr::f32>(0.3f,
0.3f), team == SOCCER_TEAM_BLUE ? blue : red, m_karts[i]
->getNode(), true);
arrow_node = irr_driver->addBillboard(
core::dimension2d<irr::f32>(0.3f,0.3f),
team == SOCCER_TEAM_BLUE ? blue : red,
m_karts[i]->getNode(), true);
arrow_node->setPosition(core::vector3df(0, arrow_pos_height, 0));
}
#endif
} // initKartList
//-----------------------------------------------------------------------------

View File

@@ -224,8 +224,10 @@ void World::init()
// Load other custom models if needed
loadCustomModels();
#ifndef SERVER_ONLY
// Now that all models are loaded, apply the overrides
irr_driver->applyObjectPassShader();
#endif
// Must be called after all karts are created
m_race_gui->init();

View File

@@ -94,7 +94,7 @@ namespace Scripting
core::dimension2d<u32> textsize = digit_face->getDimension(wtext.c_str());
core::vector3df xyz(location->getX(), location->getY(), location->getZ());
#ifndef SERVER_ONLY
if (CVS->isGLSL())
{
STKTextBillboard* tb = new STKTextBillboard(wtext.c_str(), digit_face,
@@ -123,6 +123,7 @@ namespace Scripting
GUIEngine::getSkin()->getColor("font::top"));
World::getWorld()->getTrack()->addNode(sn);
}
#endif
}
/** Exits the race to the main menu */

View File

@@ -40,6 +40,7 @@ CutsceneGUI::~CutsceneGUI()
void CutsceneGUI::renderGlobal(float dt)
{
#ifndef SERVER_ONLY
core::dimension2d<u32> screen_size = irr_driver->getActualScreenSize();
if (m_fade_level > 0.0f)
@@ -67,5 +68,6 @@ void CutsceneGUI::renderGlobal(float dt)
video::SColor(255,255,255,255), true, true, NULL);
}
}
#endif
}

View File

@@ -52,6 +52,7 @@ CustomVideoSettingsDialog::~CustomVideoSettingsDialog()
void CustomVideoSettingsDialog::beforeAddingWidgets()
{
#ifndef SERVER_ONLY
getWidget<CheckBoxWidget>("anim_gfx")->setState(UserConfigParams::m_graphical_effects);
getWidget<CheckBoxWidget>("weather_gfx")->setState(UserConfigParams::m_weather_effects);
getWidget<CheckBoxWidget>("dof")->setState(UserConfigParams::m_dof);
@@ -115,12 +116,14 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
shadows->setActive(false);
getWidget<CheckBoxWidget>("global_illumination")->setActive(false);
}
#endif
}
// -----------------------------------------------------------------------------
GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::string& eventSource)
{
#ifndef SERVER_ONLY
if (eventSource == "close")
{
bool advanced_pipeline = getWidget<CheckBoxWidget>("dynamiclight")->getState();
@@ -219,7 +222,7 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
{
updateActivation();
}
#endif
return GUIEngine::EVENT_LET;
} // processEvent
@@ -227,6 +230,7 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
void CustomVideoSettingsDialog::updateActivation()
{
#ifndef SERVER_ONLY
bool light = getWidget<CheckBoxWidget>("dynamiclight")->getState();
getWidget<CheckBoxWidget>("motionblur")->setActive(light);
getWidget<CheckBoxWidget>("dof")->setActive(light);
@@ -244,5 +248,6 @@ void CustomVideoSettingsDialog::updateActivation()
getWidget<SpinnerWidget>("shadows")->setActive(false);
getWidget<CheckBoxWidget>("global_illumination")->setActive(false);
}
#endif
} // updateActivation

View File

@@ -92,7 +92,7 @@ RaceGUI::RaceGUI()
else if (UserConfigParams::m_multitouch_enabled)
{
m_map_left = irr_driver->getActualScreenSize().Width - m_map_width;
m_map_bottom = irr_driver->getActualScreenSize().Height * 0.55f;
m_map_bottom = int(irr_driver->getActualScreenSize().Height * 0.55f);
}
m_is_tutorial = (race_manager->getTrackName() == "tutorial");
@@ -168,6 +168,7 @@ void RaceGUI::reset()
*/
void RaceGUI::renderGlobal(float dt)
{
#ifndef SERVER_ONLY
RaceGUIBase::renderGlobal(dt);
cleanupMessages(dt);
@@ -216,6 +217,7 @@ void RaceGUI::renderGlobal(float dt)
if (!m_is_tutorial) drawGlobalPlayerIcons(m_map_height);
if(world->getTrack()->isSoccer()) drawScores();
#endif
} // renderGlobal
//-----------------------------------------------------------------------------
@@ -263,6 +265,7 @@ void RaceGUI::renderPlayerView(const Camera *camera, float dt)
*/
void RaceGUI::drawScores()
{
#ifndef SERVER_ONLY
SoccerWorld* sw = dynamic_cast<SoccerWorld*>(World::getWorld());
int offset_y = 5;
int offset_x = 5;
@@ -304,6 +307,7 @@ void RaceGUI::drawScores()
NULL,NULL,true);
offset_x += position.LowerRightCorner.X + 30;
}
#endif
} // drawScores
//-----------------------------------------------------------------------------
@@ -448,6 +452,7 @@ void RaceGUI::drawEnergyMeter(int x, int y, const AbstractKart *kart,
const core::recti &viewport,
const core::vector2df &scaling)
{
#ifndef SERVER_ONLY
float min_ratio = std::min(scaling.X, scaling.Y);
const int GAUGEWIDTH = 78;
int gauge_width = (int)(GAUGEWIDTH*min_ratio);
@@ -642,7 +647,7 @@ void RaceGUI::drawEnergyMeter(int x, int y, const AbstractKart *kart,
index, count-2, video::EVT_STANDARD, scene::EPT_TRIANGLE_FAN);
}
#endif
} // drawEnergyMeter
//-----------------------------------------------------------------------------
@@ -742,6 +747,7 @@ void RaceGUI::drawSpeedEnergyRank(const AbstractKart* kart,
const core::vector2df &scaling,
float dt)
{
#ifndef SERVER_ONLY
float min_ratio = std::min(scaling.X, scaling.Y);
const int SPEEDWIDTH = 128;
int meter_width = (int)(SPEEDWIDTH*min_ratio);
@@ -848,7 +854,7 @@ void RaceGUI::drawSpeedEnergyRank(const AbstractKart* kart,
irr_driver->getVideoDriver()->setMaterial(m);
draw2DVertexPrimitiveList(m_speed_bar_icon->getTexture(), vertices, count,
index, count-2, video::EVT_STANDARD, scene::EPT_TRIANGLE_FAN);
#endif
} // drawSpeedEnergyRank
//-----------------------------------------------------------------------------
@@ -916,26 +922,26 @@ void RaceGUI::initMultitouchSteering()
const float small_ratio = 0.6f;
device->addButton(BUTTON_STEERING,
0.5f * margin, h - 0.5f * margin - btn2_size,
btn2_size, btn2_size);
int(0.5f * margin), int(h - 0.5f * margin - btn2_size),
int(btn2_size), int(btn2_size));
device->addButton(BUTTON_ESCAPE,
top_margin, small_ratio * margin,
small_ratio * btn_size, small_ratio * btn_size);
top_margin, int(small_ratio * margin),
int(small_ratio * btn_size), int(small_ratio * btn_size));
device->addButton(BUTTON_RESCUE,
top_margin + small_ratio * col_size, small_ratio * margin,
small_ratio * btn_size, small_ratio * btn_size);
int(top_margin + small_ratio * col_size), int(small_ratio * margin),
int(small_ratio * btn_size), int(small_ratio * btn_size));
device->addButton(BUTTON_NITRO,
w - 1 * col_size, h - 2 * col_size,
btn_size, btn_size);
int(btn_size), int(btn_size));
device->addButton(BUTTON_SKIDDING,
w - 1 * col_size, h - 1 * col_size,
btn_size, btn_size);
int(btn_size), int(btn_size));
device->addButton(BUTTON_FIRE,
w - 2 * col_size, h - 2 * col_size,
btn_size, btn_size);
int(btn_size), int(btn_size));
device->addButton(BUTTON_LOOK_BACKWARDS,
w - 2 * col_size, h - 1 * col_size,
btn_size, btn_size);
int(btn_size), int(btn_size));
} // initMultitouchSteering
@@ -949,6 +955,7 @@ void RaceGUI::drawMultitouchSteering(const AbstractKart* kart,
const core::recti &viewport,
const core::vector2df &scaling)
{
#ifndef SERVER_ONLY
MultitouchDevice* device = input_manager->getDeviceManager()->
getMultitouchDevice();
@@ -1046,4 +1053,5 @@ void RaceGUI::drawMultitouchSteering(const AbstractKart* kart,
}
}
}
#endif
} // drawMultitouchSteering

View File

@@ -305,6 +305,7 @@ void RaceGUIBase::drawPowerupIcons(const AbstractKart* kart,
const core::recti &viewport,
const core::vector2df &scaling)
{
#ifndef SERVER_ONLY
// If player doesn't have any powerups or has completed race, do nothing.
const Powerup* powerup = kart->getPowerup();
if (powerup->getType() == PowerupManager::POWERUP_NOTHING
@@ -354,6 +355,7 @@ void RaceGUIBase::drawPowerupIcons(const AbstractKart* kart,
pos, video::SColor(255, 255, 255, 255));
font->setScale(1.0f);
}
#endif
} // drawPowerupIcons
// ----------------------------------------------------------------------------
@@ -454,6 +456,7 @@ void RaceGUIBase::addMessage(const core::stringw &msg,
*/
void RaceGUIBase::drawGlobalMusicDescription()
{
#ifndef SERVER_ONLY
// show no music description when it's off
if (!UserConfigParams::m_music) return;
@@ -550,6 +553,7 @@ void RaceGUIBase::drawGlobalMusicDescription()
draw2DImage(t, dest, source,
NULL, NULL, true);
#endif
} // drawGlobalMusicDescription
//-----------------------------------------------------------------------------
@@ -621,6 +625,7 @@ void RaceGUIBase::drawGlobalReadySetGo()
*/
void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
{
#ifndef SERVER_ONLY
// For now, don't draw player icons when in soccer mode
const RaceManager::MinorRaceModeType minor_mode = race_manager->getMinorMode();
if(minor_mode == RaceManager::MINOR_MODE_SOCCER)
@@ -934,6 +939,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
}
} //next position
#endif
} // drawGlobalPlayerIcons
// ----------------------------------------------------------------------------
@@ -943,6 +949,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
*/
void RaceGUIBase::drawPlungerInFace(const Camera *camera, float dt)
{
#ifndef SERVER_ONLY
const AbstractKart *kart = camera->getKart();
if (kart->getBlockedByPlungerTime()<=0)
{
@@ -1029,4 +1036,5 @@ void RaceGUIBase::drawPlungerInFace(const Camera *camera, float dt)
&viewport /* clip */,
NULL /* color */,
true /* alpha */ );
#endif // !SERVER_ONLY
} // drawPlungerInFace

View File

@@ -140,6 +140,7 @@ RaceGUIOverworld::~RaceGUIOverworld()
*/
void RaceGUIOverworld::renderGlobal(float dt)
{
#ifndef SERVER_ONLY
RaceGUIBase::renderGlobal(dt);
cleanupMessages(dt);
@@ -176,6 +177,7 @@ void RaceGUIOverworld::renderGlobal(float dt)
//irr_driver->getVideoDriver()->enableMaterial2D();
m_is_first_render_call = false;
#endif
} // renderGlobal
//-----------------------------------------------------------------------------
@@ -211,6 +213,7 @@ void RaceGUIOverworld::renderPlayerView(const Camera *camera, float dt)
*/
void RaceGUIOverworld::drawTrophyPoints()
{
#ifndef SERVER_ONLY
PlayerProfile *player = PlayerManager::getCurrentPlayer();
const int points = player->getPoints();
std::string s = StringUtils::toString(points);
@@ -289,7 +292,7 @@ void RaceGUIOverworld::drawTrophyPoints()
font->draw(sw.c_str(), pos, time_color, false, vcenter, NULL, true /* ignore RTL */);
font->disableShadow();
#endif
} // drawTrophyPoints
//-----------------------------------------------------------------------------
@@ -554,6 +557,7 @@ void RaceGUIOverworld::drawEnergyMeter(int x, int y, const AbstractKart *kart,
const core::recti &viewport,
const core::vector2df &scaling)
{
#ifndef SERVER_ONLY
float state = (float)(kart->getEnergy())
/ kart->getKartProperties()->getNitroMax();
if (state < 0.0f) state = 0.0f;
@@ -607,7 +611,7 @@ void RaceGUIOverworld::drawEnergyMeter(int x, int y, const AbstractKart *kart,
&clip, NULL /* colors */, true /* alpha */);
}
#endif
} // drawEnergyMeter
//-----------------------------------------------------------------------------

View File

@@ -659,6 +659,7 @@ void RaceResultGUI::backToLobby()
*/
void RaceResultGUI::renderGlobal(float dt)
{
#ifndef SERVER_ONLY
bool isSoccerWorld = race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER;
m_timer += dt;
@@ -830,6 +831,7 @@ void RaceResultGUI::backToLobby()
{
displayPostRaceInfo();
}
#endif
} // renderGlobal
//-----------------------------------------------------------------------------
@@ -838,6 +840,7 @@ void RaceResultGUI::backToLobby()
*/
void RaceResultGUI::determineGPLayout()
{
#ifndef SERVER_ONLY
unsigned int num_karts = race_manager->getNumberOfKarts();
std::vector<int> old_rank(num_karts, 0);
for (unsigned int kart_id = 0; kart_id < num_karts; kart_id++)
@@ -900,6 +903,7 @@ void RaceResultGUI::backToLobby()
int p = race_manager->getKartScore(i);
ri->m_new_overall_points = p;
} // i < num_karts
#endif
} // determineGPLayout
//-----------------------------------------------------------------------------
@@ -933,6 +937,7 @@ void RaceResultGUI::backToLobby()
void RaceResultGUI::displayOneEntry(unsigned int x, unsigned int y,
unsigned int n, bool display_points)
{
#ifndef SERVER_ONLY
RowInfo *ri = &(m_all_row_infos[n]);
video::SColor color = ri->m_is_player_kart
? video::SColor(255, 255, 0, 0)
@@ -1003,12 +1008,13 @@ void RaceResultGUI::backToLobby()
m_font->draw(point_inc_string, dest_rect, color, false, false, NULL,
true /* ignoreRTL */);
}
#endif
} // displayOneEntry
//-----------------------------------------------------------------------------
void RaceResultGUI::displaySoccerResults()
{
#ifndef SERVER_ONLY
//Draw win text
core::stringw result_text;
static video::SColor color = video::SColor(255, 255, 255, 255);
@@ -1177,6 +1183,7 @@ void RaceResultGUI::backToLobby()
draw2DImage(scorer_icon, dest_rect, source_rect,
NULL, NULL, true);
}
#endif
}
//-----------------------------------------------------------------------------
@@ -1324,6 +1331,7 @@ void RaceResultGUI::backToLobby()
// ----------------------------------------------------------------------------
void RaceResultGUI::displayPostRaceInfo()
{
#ifndef SERVER_ONLY
// This happens in demo world
if (!World::getWorld())
return;
@@ -1441,8 +1449,9 @@ void RaceResultGUI::backToLobby()
GUIEngine::getFont()->draw(best_lap_string,
core::recti(x, current_y, 0, 0), white_color, false, false,
nullptr, true);
}
}
} // if mode has laps
} // if not soccer mode
#endif
}
// ----------------------------------------------------------------------------

View File

@@ -42,6 +42,7 @@ CheckCannon::CheckCannon(const XMLNode &node, unsigned int index)
m_curve = new Ipo(*(node.getNode("curve")),
/*fps*/25,
/*reverse*/race_manager->getReverseTrack());
#ifndef SERVER_ONLY
#ifdef DEBUG
if(UserConfigParams::m_track_debug)
{
@@ -50,7 +51,8 @@ CheckCannon::CheckCannon(const XMLNode &node, unsigned int index)
for(unsigned int i=0; i<p.size(); i++)
m_show_curve->addPoint(p[i]);
}
#endif
#endif // DEBUG
#endif // SERVER_ONLY
} // CheckCannon
// ----------------------------------------------------------------------------
@@ -60,10 +62,12 @@ CheckCannon::CheckCannon(const XMLNode &node, unsigned int index)
CheckCannon::~CheckCannon()
{
delete m_curve;
#ifndef SERVER_ONLY
#ifdef DEBUG
if(UserConfigParams::m_track_debug)
delete m_show_curve;
#endif
#endif
} // ~CheckCannon
// ----------------------------------------------------------------------------

View File

@@ -101,6 +101,7 @@ void Graph::cleanupDebugMesh()
void Graph::createMesh(bool show_invisible, bool enable_transparency,
const video::SColor *track_color)
{
#ifndef SERVER_ONLY
// The debug track will not be lighted or culled.
video::SMaterial m;
m.BackfaceCulling = false;
@@ -229,6 +230,7 @@ void Graph::createMesh(bool show_invisible, bool enable_transparency,
delete[] ind;
delete[] new_v;
#endif
} // createMesh
// -----------------------------------------------------------------------------
@@ -245,9 +247,9 @@ RenderTarget* Graph::makeMiniMap(const core::dimension2du &dimension,
World::getWorld()
->setClearbackBufferColor(video::SColor(0, 255, 255, 255));
World::getWorld()->forceFogDisabled(true);
#ifndef SERVER_ONLY
m_render_target = irr_driver->createRenderTarget(dimension, name);
#endif
irr_driver->getSceneManager()
->setAmbientLight(video::SColor(255, 255, 255, 255));

View File

@@ -58,6 +58,7 @@ void ModelDefinitionLoader::addModelDefinition(const XMLNode* xml)
LODNode* ModelDefinitionLoader::instanciateAsLOD(const XMLNode* node, scene::ISceneNode* parent, RenderInfo* ri)
{
#ifndef SERVER_ONLY
scene::ISceneManager* sm = irr_driver->getSceneManager();
std::string groupname = "";
@@ -138,6 +139,9 @@ LODNode* ModelDefinitionLoader::instanciateAsLOD(const XMLNode* node, scene::ISc
Log::warn("ModelDefinitionLoader", "LOD group '%s' is empty", groupname.c_str());
return NULL;
}
#else
return NULL;
#endif
}
// ----------------------------------------------------------------------------

View File

@@ -322,16 +322,20 @@ void Track::cleanup()
m_object_physics_only_nodes.clear();
irr_driver->removeNode(m_sun);
#ifndef SERVER_ONLY
if (CVS->isGLSL())
m_sun->drop();
#endif
delete m_track_mesh;
m_track_mesh = NULL;
delete m_gfx_effect_mesh;
m_gfx_effect_mesh = NULL;
#ifndef SERVER_ONLY
if (CVS->isGLSL())
irr_driver->cleanSunInterposer();
#endif
// The m_all_cached_mesh contains each mesh loaded from a file, which
@@ -1130,10 +1134,13 @@ bool Track::loadMainTrack(const XMLNode &root)
scene::CBatchingMesh *merged_mesh = new scene::CBatchingMesh();
merged_mesh->addMesh(mesh);
merged_mesh->finalize();
#ifndef SERVER_ONLY
scene::IMesh* tangent_mesh = MeshTools::createMeshWithTangents(merged_mesh, &MeshTools::isNormalMap);
adjustForFog(tangent_mesh, NULL);
#else
scene::IMesh* tangent_mesh = merged_mesh;
#endif
// The merged mesh is grabbed by the octtree, so we don't need
// to keep a reference to it.
@@ -1251,8 +1258,9 @@ bool Track::loadMainTrack(const XMLNode &root)
full_path.c_str());
continue;
}
#ifndef SERVER_ONLY
a_mesh = MeshTools::createMeshWithTangents(a_mesh, &MeshTools::isNormalMap);
#endif
// The meshes loaded here are in irrlicht's mesh cache. So we
// have to keep track of them in order to properly remove them
@@ -1761,7 +1769,8 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
// It's important to execute this BEFORE the code that creates the skycube,
// otherwise the skycube node could be modified to have fog enabled, which
// we don't want
if (m_use_fog && Camera::getDefaultCameraType()!=Camera::CM_TYPE_DEBUG &&
#ifndef SERVER_ONLY
if (m_use_fog && Camera::getDefaultCameraType()!=Camera::CM_TYPE_DEBUG &&
!CVS->isGLSL())
{
/* NOTE: if LINEAR type, density does not matter, if EXP or EXP2, start
@@ -1771,6 +1780,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
m_fog_start, m_fog_end,
1.0f);
}
#endif
// Enable for for all track nodes if fog is used
const unsigned int count = (int)m_all_nodes.size();
@@ -1838,6 +1848,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
const video::SColorf tmpf(m_sun_diffuse_color);
m_sun = irr_driver->addLight(m_sun_position, 0., 0., tmpf.r, tmpf.g, tmpf.b, true);
#ifndef SERVER_ONLY
if (!CVS->isGLSL())
{
scene::ILightSceneNode *sun = (scene::ILightSceneNode *) m_sun;
@@ -1860,6 +1871,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
irr_driver->createSunInterposer();
m_sun->grab();
}
#endif
createPhysicsModel(main_track_count);

View File

@@ -363,6 +363,7 @@ TrackObjectPresentationMesh::TrackObjectPresentationMesh(
throw std::runtime_error("Model '" + model_name + "' cannot be found");
}
#ifndef SERVER_ONLY
if (!animated)
{
m_mesh = MeshTools::createMeshWithTangents(m_mesh,
@@ -378,6 +379,7 @@ TrackObjectPresentationMesh::TrackObjectPresentationMesh(
&MeshTools::isNormalMap);
}
}
#endif
init(&xml_node, parent, enabled);
} // TrackObjectPresentationMesh
@@ -416,6 +418,7 @@ TrackObjectPresentationMesh::TrackObjectPresentationMesh(
m_model_file = model_file;
file_manager->pushTextureSearchPath(StringUtils::getPath(model_file));
#ifndef SERVER_ONLY
if (file_manager->fileExists(model_file))
{
if (animated)
@@ -435,6 +438,7 @@ TrackObjectPresentationMesh::TrackObjectPresentationMesh(
irr_driver->getMesh(model_file), &MeshTools::isNormalMap);
}
}
#endif
if (!m_mesh)
{
@@ -534,9 +538,11 @@ void TrackObjectPresentationMesh::init(const XMLNode* xml_node,
m_node = irr_driver->addMesh(m_mesh, m_model_file, parent, m_render_info);
#ifndef SERVER_ONLY
STKMeshSceneNode* stkmesh = dynamic_cast<STKMeshSceneNode*>(m_node);
if (displacing && stkmesh != NULL)
stkmesh->setIsDisplacement(displacing);
#endif
m_frame_start = 0;
m_frame_end = 0;
@@ -857,7 +863,6 @@ TrackObjectPresentationParticles::TrackObjectPresentationParticles(
{
m_emitter = NULL;
m_lod_emitter_node = NULL;
std::string path;
xml_node.get("kind", &path);
@@ -871,6 +876,7 @@ TrackObjectPresentationParticles::TrackObjectPresentationParticles(
m_delayed_stop = false;
m_delayed_stop_time = 0.0;
#ifndef SERVER_ONLY
try
{
ParticleKind* kind = ParticleKindManager::get()->getParticles(path);
@@ -907,6 +913,7 @@ TrackObjectPresentationParticles::TrackObjectPresentationParticles(
Log::warn ("Track", "Could not load particles '%s'; cause :\n %s",
path.c_str(), e.what());
}
#endif
} // TrackObjectPresentationParticles
// ----------------------------------------------------------------------------
@@ -945,20 +952,24 @@ void TrackObjectPresentationParticles::update(float dt)
// ----------------------------------------------------------------------------
void TrackObjectPresentationParticles::triggerParticles()
{
#ifndef SERVER_ONLY
if (m_emitter != NULL)
{
m_emitter->setCreationRateAbsolute(1.0f);
m_emitter->setParticleType(m_emitter->getParticlesInfo());
}
#endif
} // triggerParticles
// ----------------------------------------------------------------------------
void TrackObjectPresentationParticles::stop()
{
#ifndef SERVER_ONLY
if (m_emitter != NULL)
{
m_emitter->setCreationRateAbsolute(0.0f);
m_emitter->clearParticles();
}
#endif
}
// ----------------------------------------------------------------------------
void TrackObjectPresentationParticles::stopIn(double delay)
@@ -969,12 +980,15 @@ void TrackObjectPresentationParticles::stopIn(double delay)
// ----------------------------------------------------------------------------
void TrackObjectPresentationParticles::setRate(float rate)
{
#ifndef SERVER_ONLY
if (m_emitter != NULL)
{
m_emitter->setCreationRateAbsolute(rate);
m_emitter->setParticleType(m_emitter->getParticlesInfo());
}
}
#endif
} // setRate
// ----------------------------------------------------------------------------
TrackObjectPresentationLight::TrackObjectPresentationLight(
const XMLNode& xml_node,
@@ -990,7 +1004,7 @@ TrackObjectPresentationLight::TrackObjectPresentationLight(
m_distance = 20.f * m_energy;
xml_node.get("distance", &m_distance);
#ifndef SERVER_ONLY
if (CVS->isGLSL())
{
m_node = irr_driver->addLight(m_init_xyz, m_energy, m_distance,
@@ -998,6 +1012,7 @@ TrackObjectPresentationLight::TrackObjectPresentationLight(
parent);
}
else
#endif
{
m_node = NULL; // lights require shaders to work
}

View File

@@ -268,6 +268,7 @@ void Profiler::synchronizeFrame()
/// Draw the markers
void Profiler::draw()
{
#ifndef SERVER_ONLY
PROFILER_PUSH_CPU_MARKER("ProfilerDraw", 0xFF, 0xFF, 0x00);
video::IVideoDriver* driver = irr_driver->getVideoDriver();
std::stack<Marker> hovered_markers;
@@ -470,6 +471,7 @@ void Profiler::draw()
}
PROFILER_POP_CPU_MARKER();
#endif
}
//-----------------------------------------------------------------------------
@@ -510,6 +512,7 @@ void Profiler::onClick(const core::vector2di& mouse_pos)
/// Helper to draw a white background
void Profiler::drawBackground()
{
#ifndef SERVER_ONLY
video::IVideoDriver* driver = irr_driver->getVideoDriver();
const core::dimension2d<u32>& screen_size = driver->getScreenSize();
@@ -520,4 +523,5 @@ void Profiler::drawBackground()
video::SColor color(0x88, 0xFF, 0xFF, 0xFF);
GL32_draw2DRectangle(color, background_rect);
#endif
}