Compile SERVER_ONLY (by #ifdef'ing out all graphics related code).
Does not link yet!!
This commit is contained in:
parent
8d9bb9c30f
commit
ddcddf4a0a
@ -335,8 +335,10 @@ void reportHardwareStats()
|
||||
if(nr_procs>0)
|
||||
json.add("cpu_numprocs", nr_procs);
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
json.add("GL_EXTENSIONS", getGLExtensions());
|
||||
getGLLimits(&json);
|
||||
#endif
|
||||
json.finish();
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -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/2dutils.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
@ -779,3 +780,6 @@ void GL32_draw2DRectangle(video::SColor color, const core::rect<s32>& position,
|
||||
|
||||
glGetError();
|
||||
} // GL32_draw2DRectangle
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -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/central_settings.hpp"
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
@ -442,3 +443,5 @@ bool CentralVideoSettings::isDefferedEnabled() const
|
||||
{
|
||||
return UserConfigParams::m_dynamic_lights && !GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_ADVANCED_PIPELINE);
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -18,6 +18,8 @@
|
||||
#ifndef GL_HEADER_HPP
|
||||
#define GL_HEADER_HPP
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
#define GLEW_STATIC
|
||||
|
||||
extern "C" {
|
||||
@ -79,5 +81,12 @@ struct DrawElementsIndirectCommand{
|
||||
GLuint baseVertex;
|
||||
GLuint baseInstance;
|
||||
};
|
||||
#else
|
||||
typedef unsigned int GLuint;
|
||||
typedef unsigned int GLsync;
|
||||
typedef unsigned int GLenum;
|
||||
|
||||
#endif // server only
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/glwrap.hpp"
|
||||
|
||||
#include "config/hardware_stats.hpp"
|
||||
@ -758,3 +760,6 @@ else \
|
||||
|
||||
#endif // ifdef XX
|
||||
} // getGLLimits
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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
|
||||
|
||||
#ifndef GLWRAP_HEADER_H
|
||||
#define GLWRAP_HEADER_H
|
||||
|
||||
@ -152,3 +154,6 @@ const std::string getGLExtensions();
|
||||
void getGLLimits(HardwareStats::Json *json);
|
||||
|
||||
#endif
|
||||
|
||||
#endif // supertuxkart
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/gpu_particles.hpp"
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
@ -633,3 +635,5 @@ void ParticleSystemProxy::render() {
|
||||
draw();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SERVER_ONLY
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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
|
||||
|
||||
#ifndef HEADER_GPU_PARTICLES_HPP
|
||||
#define HEADER_GPU_PARTICLES_HPP
|
||||
|
||||
@ -109,3 +111,5 @@ public:
|
||||
};
|
||||
|
||||
#endif // GPUPARTICLES_H
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -96,8 +96,9 @@ using namespace irr;
|
||||
/** singleton */
|
||||
IrrDriver *irr_driver = NULL;
|
||||
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
GPUTimer m_perf_query[Q_LAST];
|
||||
#endif
|
||||
|
||||
const int MIN_SUPPORTED_HEIGHT = 768;
|
||||
const int MIN_SUPPORTED_WIDTH = 1024;
|
||||
@ -144,10 +145,12 @@ IrrDriver::~IrrDriver()
|
||||
m_device = NULL;
|
||||
m_modes.clear();
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
Shaders::destroy();
|
||||
}
|
||||
#endif
|
||||
delete m_wind;
|
||||
delete m_renderer;
|
||||
} // ~IrrDriver
|
||||
@ -179,11 +182,12 @@ core::array<video::IRenderTarget> &IrrDriver::getMainSetup()
|
||||
{
|
||||
return m_mrt;
|
||||
}
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
GPUTimer &IrrDriver::getGPUTimer(unsigned i)
|
||||
{
|
||||
return m_perf_query[i];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -587,6 +591,8 @@ void IrrDriver::initDevice()
|
||||
UserConfigParams::m_gi = false;
|
||||
}*/
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
// m_glsl might be reset in rtt if an error occurs.
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
@ -601,6 +607,7 @@ void IrrDriver::initDevice()
|
||||
Log::warn("irr_driver", "Using the fixed pipeline (old GPU, or "
|
||||
"shaders disabled in options)");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Only change video driver settings if we are showing graphics
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
@ -689,12 +696,16 @@ void IrrDriver::createSunInterposer()
|
||||
scene::IMeshBuffer *mb = sphere->getMeshBuffer(i);
|
||||
if (!mb)
|
||||
continue;
|
||||
mb->getMaterial().setTexture(0,
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
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(),
|
||||
@ -707,7 +718,9 @@ 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();
|
||||
}
|
||||
@ -716,9 +729,11 @@ void IrrDriver::createSunInterposer()
|
||||
void IrrDriver::getOpenGLData(std::string *vendor, std::string *renderer,
|
||||
std::string *version)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
*vendor = (char*)glGetString(GL_VENDOR );
|
||||
*renderer = (char*)glGetString(GL_RENDERER);
|
||||
*version = (char*)glGetString(GL_VERSION );
|
||||
#endif
|
||||
} // getOpenGLData
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -829,6 +844,7 @@ void IrrDriver::changeResolution(const int w, const int h,
|
||||
|
||||
void IrrDriver::applyResolutionSettings()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
// show black before resolution switch so we don't see OpenGL's buffer
|
||||
// garbage during switch
|
||||
m_video_driver->beginScene(true, true, video::SColor(255,100,101,140));
|
||||
@ -918,6 +934,7 @@ void IrrDriver::applyResolutionSettings()
|
||||
// above) - this happens dynamically when the tracks are loaded.
|
||||
GUIEngine::reshowCurrentScreen();
|
||||
MessageQueue::updatePosition();
|
||||
#endif // !SERVER_ONLY
|
||||
} // applyResolutionSettings
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -1133,10 +1150,13 @@ 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())
|
||||
{
|
||||
@ -2076,6 +2096,8 @@ bool IrrDriver::supportsSplatting()
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
void IrrDriver::applyObjectPassShader(scene::ISceneNode * const node, bool rimlit)
|
||||
{
|
||||
if (!CVS->isGLSL())
|
||||
@ -2153,6 +2175,8 @@ void IrrDriver::applyObjectPassShader()
|
||||
applyObjectPassShader(m_scene_manager->getRootSceneNode());
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos,
|
||||
@ -2160,6 +2184,7 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos,
|
||||
float r, float g, float b,
|
||||
bool sun, scene::ISceneNode* parent)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
if (parent == NULL) parent = m_scene_manager->getRootSceneNode();
|
||||
@ -2194,6 +2219,9 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos,
|
||||
->addLightSceneNode(m_scene_manager->getRootSceneNode(),
|
||||
pos, video::SColorf(1.0f, r, g, b));
|
||||
}
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
} // addLight
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -716,6 +716,7 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
|
||||
m_texname.c_str());
|
||||
}
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
ITexture *tex;
|
||||
@ -865,7 +866,7 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
|
||||
}
|
||||
m->setTexture(1, glossytex);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (m_shader_type == SHADERTYPE_SOLID_UNLIT)
|
||||
{
|
||||
|
@ -145,6 +145,7 @@ Material* MaterialManager::getDefaultMaterial(video::E_MATERIAL_TYPE shader_type
|
||||
// Try to find a cleaner way
|
||||
// If graphics are disabled, shaders should not be accessed (getShader
|
||||
// asserts that shaders are initialised).
|
||||
#ifndef SERVER_ONLY
|
||||
if(!ProfileWorld::isNoGraphics() && CVS->isGLSL() &&
|
||||
shader_type == Shaders::getShader(ShaderType::ES_OBJECT_UNLIT))
|
||||
default_material->setShaderType(Material::SHADERTYPE_SOLID_UNLIT);
|
||||
@ -156,7 +157,7 @@ Material* MaterialManager::getDefaultMaterial(video::E_MATERIAL_TYPE shader_type
|
||||
// default_material->setShaderType(Material::SHADERTYPE_ALPHA_BLEND);
|
||||
else
|
||||
default_material->setShaderType(Material::SHADERTYPE_SOLID);
|
||||
|
||||
#endif
|
||||
m_default_materials[shader_type] = default_material;
|
||||
return default_material;
|
||||
}
|
||||
|
@ -328,6 +328,7 @@ void recalculateTangents(scene::IMesh* mesh, bool recalculate_normals, bool smoo
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
bool MeshTools::isNormalMap(scene::IMeshBuffer* mb)
|
||||
{
|
||||
if (!CVS->isGLSL())
|
||||
@ -335,6 +336,7 @@ bool MeshTools::isNormalMap(scene::IMeshBuffer* mb)
|
||||
return (mb->getMaterial().MaterialType == Shaders::getShader(ES_NORMAL_MAP) &&
|
||||
mb->getVertexType() != video::EVT_TANGENTS);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Copied from irrlicht
|
||||
scene::IMesh* MeshTools::createMeshWithTangents(scene::IMesh* mesh,
|
||||
|
@ -16,6 +16,8 @@
|
||||
// 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/particle_emitter.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
@ -763,3 +765,5 @@ void ParticleEmitter::resizeBox(float size)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/post_processing.hpp"
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
@ -1596,3 +1598,5 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode,
|
||||
|
||||
return out_fbo;
|
||||
} // render
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/rtts.hpp"
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
@ -317,3 +319,5 @@ RTT::~RTT()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -16,6 +16,8 @@
|
||||
// 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/shader.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
@ -362,3 +364,5 @@ GLuint ShaderBase::createVAO()
|
||||
} // createVAO
|
||||
|
||||
// ============================================================================
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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
|
||||
|
||||
#ifndef HEADER_SHADER_HPP
|
||||
#define HEADER_SHADER_HPP
|
||||
|
||||
@ -382,3 +384,6 @@ public:
|
||||
// ============================================================================
|
||||
|
||||
#endif
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
/**
|
||||
\page shaders_overview Shaders Overview
|
||||
|
||||
@ -397,3 +399,5 @@ Shaders::ColoredLine::ColoredLine()
|
||||
glBindVertexArray(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
} // Shaders::ColoredLine
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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
|
||||
|
||||
#ifndef HEADER_SHADERS_HPP
|
||||
#define HEADER_SHADERS_HPP
|
||||
|
||||
@ -164,3 +166,5 @@ public:
|
||||
}; // class Shaders
|
||||
|
||||
#endif
|
||||
|
||||
#endif // SHADER_ONLY
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/shadow_matrices.hpp"
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
@ -523,3 +525,5 @@ void ShadowMatrices::renderShadowsDebug(const FrameBuffer &shadow_framebuffer,
|
||||
renderWireFrameFrustrum(m_shadows_cam[3], 3);
|
||||
glViewport(0, 0, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/shared_gpu_objects.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
|
||||
@ -213,3 +215,6 @@ void SharedGPUObjects::reset()
|
||||
{
|
||||
m_has_been_initialised = false;
|
||||
} // reset
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
// 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/show_curve.hpp"
|
||||
|
||||
#include "graphics/irr_driver.hpp"
|
||||
@ -200,3 +202,6 @@ void ShowCurve::setPosition(const Vec3 &xyz)
|
||||
m_scene_node->setPosition(xyz.toIrrVector());
|
||||
} // setPosition
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -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/skybox.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
@ -375,4 +376,5 @@ void Skybox::render(const scene::ICameraSceneNode *camera) const
|
||||
glBindVertexArray(0);
|
||||
} // renderSkybox
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -99,8 +99,10 @@ SlipStream::SlipStream(AbstractKart* kart) : MovingTexture(0, 0), m_kart(kart)
|
||||
}
|
||||
video::SMaterial &mat = buffer->getMaterial();
|
||||
// Meshes need a texture, otherwise stk crashes.
|
||||
#ifndef SERVER_ONLY
|
||||
video::ITexture *red_texture = getUnicolorTexture(red);
|
||||
mat.setTexture(0, red_texture);
|
||||
#endif
|
||||
|
||||
buffer->recalculateBoundingBox();
|
||||
m_mesh->setBoundingBox(buffer->getBoundingBox());
|
||||
|
@ -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/irr_driver.hpp"
|
||||
#include "graphics/spherical_harmonics.hpp"
|
||||
@ -528,3 +529,5 @@ void SphericalHarmonics::unprojectSH(size_t width, size_t height,
|
||||
}
|
||||
} // unprojectSH
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/stk_animated_mesh.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
@ -281,3 +283,6 @@ void STKAnimatedMesh::render()
|
||||
updateNoGL();
|
||||
updateGL();
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/stk_billboard.hpp"
|
||||
|
||||
#include "graphics/irr_driver.hpp"
|
||||
@ -118,3 +120,6 @@ void STKBillboard::render()
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
glBindVertexArray(0);
|
||||
} // render
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/stk_mesh.hpp"
|
||||
|
||||
#include "graphics/callbacks.hpp"
|
||||
@ -442,3 +444,6 @@ void initTexturesTransparent(GLMesh &mesh)
|
||||
}
|
||||
#endif
|
||||
} // initTexturesTransparent
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/stk_mesh_scene_node.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
@ -580,3 +582,6 @@ void STKMeshSceneNode::render()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -73,8 +73,10 @@ public:
|
||||
scene::IMeshBuffer* mb = Mesh->getMeshBuffer(i);
|
||||
if (!mb)
|
||||
continue;
|
||||
#ifndef SERVER_ONLY
|
||||
if (isDisplacement)
|
||||
mb->getMaterial().MaterialType = Shaders::getShader(ES_DISPLACE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
virtual bool glow() const { return isGlow; }
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/stk_scene_manager.hpp"
|
||||
#include <SViewFrustum.h>
|
||||
#include <vector>
|
||||
@ -61,3 +63,5 @@ bool isCulledPrecise(const scene::ICameraSceneNode *cam, const scene::ISceneNode
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -19,6 +19,8 @@
|
||||
// Not really a scene manager yet but hold algorithm that
|
||||
// rework scene manager output
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
#ifndef HEADER_STKSCENEMANAGER_HPP
|
||||
#define HEADER_STKSCENEMANAGER_HPP
|
||||
|
||||
@ -31,3 +33,5 @@ void addEdge(const irr::core::vector3df &P0, const irr::core::vector3df &P1);
|
||||
bool isCulledPrecise(const irr::scene::ICameraSceneNode *cam, const irr::scene::ISceneNode *node);
|
||||
|
||||
#endif
|
||||
|
||||
#endif // supertuxkart
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/stk_text_billboard.hpp"
|
||||
#include "graphics/shaders.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
@ -190,3 +192,6 @@ void STKTextBillboard::collectChar(video::ITexture* texture,
|
||||
{
|
||||
m_chars.push_back(STKTextBillboardChar(texture, destRect, sourceRect, colors));
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/texture_manager.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
@ -258,3 +260,6 @@ video::ITexture* getUnicolorTexture(const video::SColor &c)
|
||||
return tex;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
// 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/texture_shader.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
|
||||
@ -366,3 +368,6 @@ GLuint TextureShaderBase::createSemiTrilinearSampler()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef SHADER_ONLY
|
||||
|
||||
#ifndef HEADER_TEXTURE_SHADER_HPP
|
||||
#define HEADER_TEXTURE_SHADER_HPP
|
||||
|
||||
@ -254,3 +256,5 @@ public:
|
||||
}; // class TextureShader
|
||||
|
||||
#endif
|
||||
|
||||
#endif // SHADER_ONLY
|
||||
|
@ -15,6 +15,8 @@
|
||||
// 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/vao_manager.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
@ -343,3 +345,5 @@ std::pair<unsigned, unsigned> VAOManager::getBase(scene::IMeshBuffer *mb, Render
|
||||
assert(It != mappedBaseIndex[tp].end());
|
||||
return std::pair<unsigned, unsigned>(vtx, It->second);
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
@ -16,6 +16,8 @@
|
||||
// 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/water.hpp"
|
||||
|
||||
#include "graphics/callbacks.hpp"
|
||||
@ -89,3 +91,6 @@ void WaterNode::OnRegisterSceneNode()
|
||||
ISceneNode::OnRegisterSceneNode();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !SERVER_ONLY
|
||||
|
||||
|
@ -664,7 +664,9 @@ namespace GUIEngine
|
||||
#include "font/regular_face.hpp"
|
||||
#include "input/input_manager.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#ifndef SERVER_ONLY
|
||||
#include "graphics/2dutils.hpp"
|
||||
#endif
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "guiengine/event_handler.hpp"
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
|
@ -1958,7 +1958,9 @@ void Skin::process3DPane(IGUIElement *element, const core::recti &rect,
|
||||
else if (type == WTYPE_MODEL_VIEW)
|
||||
{
|
||||
ModelViewWidget* mvw = dynamic_cast<ModelViewWidget*>(widget);
|
||||
#ifndef SERVER_ONLY
|
||||
mvw->drawRTTScene(rect);
|
||||
#endif
|
||||
}
|
||||
else if (type == WTYPE_ICON_BUTTON)
|
||||
{
|
||||
|
@ -68,12 +68,14 @@ RubberBand::RubberBand(Plunger *plunger, AbstractKart *kart)
|
||||
verts[i].Color = color;
|
||||
}
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
// Color
|
||||
mb->getMaterial().setTexture(0, getUnicolorTexture(video::SColor(255, 255, 255, 255)));
|
||||
// Gloss
|
||||
mb->getMaterial().setTexture(1, getUnicolorTexture(video::SColor(0, 0, 0, 0)));
|
||||
// Colorization mask
|
||||
mb->getMaterial().setTexture(7, getUnicolorTexture(video::SColor(0, 0, 0, 0)));
|
||||
#endif
|
||||
updatePosition();
|
||||
m_node = irr_driver->addMesh(m_mesh, "rubberband");
|
||||
irr_driver->applyObjectPassShader(m_node);
|
||||
|
@ -249,10 +249,12 @@ void KartProperties::load(const std::string &filename, const std::string &node)
|
||||
else
|
||||
m_minimap_icon = NULL;
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (m_minimap_icon == NULL)
|
||||
{
|
||||
m_minimap_icon = getUnicolorTexture(m_color);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Only load the model if the .kart file has the appropriate version,
|
||||
// otherwise warnings are printed.
|
||||
|
@ -27,6 +27,9 @@ using namespace irr;
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/camera.hpp"
|
||||
#include "graphics/2dutils.hpp"
|
||||
#ifndef SERVER_ONLY
|
||||
#include "graphics/glwrap.hpp"
|
||||
#endif
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
@ -370,6 +373,7 @@ void RaceGUI::drawGlobalTimer()
|
||||
*/
|
||||
void RaceGUI::drawGlobalMiniMap()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
World *world = World::getWorld();
|
||||
// draw a map when arena has a navigation mesh.
|
||||
if ((world->getTrack()->isArena() || world->getTrack()->isSoccer()) &&
|
||||
@ -428,7 +432,7 @@ void RaceGUI::drawGlobalMiniMap()
|
||||
lower_y -(int)(draw_at.getY()-(m_minimap_player_size/2.5f)));
|
||||
draw2DImage(icon, position, source, NULL, NULL, true);
|
||||
}
|
||||
|
||||
#endif
|
||||
} // drawGlobalMiniMap
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -25,6 +25,9 @@
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/camera.hpp"
|
||||
#include "graphics/2dutils.hpp"
|
||||
#ifndef SERVER_ONLY
|
||||
#include "graphics/glwrap.hpp"
|
||||
#endif
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
@ -294,6 +297,7 @@ void RaceGUIOverworld::drawTrophyPoints()
|
||||
*/
|
||||
void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
World *world = World::getWorld();
|
||||
// arenas currently don't have a map.
|
||||
if(world->getTrack()->isArena() || world->getTrack()->isSoccer()) return;
|
||||
@ -534,7 +538,7 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
true, true /* vcenter */, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SERVER_ONLY
|
||||
} // drawGlobalMiniMap
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -72,6 +72,7 @@ CheckLine::CheckLine(const XMLNode &node, unsigned int index)
|
||||
m_line.setLine(p1, p2);
|
||||
if(UserConfigParams::m_check_debug)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
video::SMaterial material;
|
||||
material.setFlag(video::EMF_BACK_FACE_CULLING, false);
|
||||
material.setFlag(video::EMF_LIGHTING, false);
|
||||
@ -109,6 +110,7 @@ CheckLine::CheckLine(const XMLNode &node, unsigned int index)
|
||||
//mesh->setBoundingBox(buffer->getBoundingBox());
|
||||
m_debug_node = irr_driver->addMesh(mesh, "checkdebug");
|
||||
mesh->drop();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -150,7 +152,9 @@ void CheckLine::changeDebugColor(bool is_active)
|
||||
{
|
||||
vertices[i].Color = color;
|
||||
}
|
||||
#ifndef SERVER_ONLY
|
||||
buffer->getMaterial().setTexture(0, getUnicolorTexture(color));
|
||||
#endif
|
||||
|
||||
} // changeDebugColor
|
||||
|
||||
|
@ -280,11 +280,13 @@ void Track::cleanup()
|
||||
{
|
||||
Graph::destroy();
|
||||
ItemManager::destroy();
|
||||
#ifndef SERVER_ONLY
|
||||
VAOManager::kill();
|
||||
|
||||
ParticleKindManager::get()->cleanUpTrackSpecificGfx();
|
||||
// Clear reminder of transformed textures
|
||||
resetTextureTable();
|
||||
#endif
|
||||
|
||||
// Clear reminder of the link between textures and file names.
|
||||
irr_driver->clearTexturesFileName();
|
||||
|
||||
@ -787,12 +789,16 @@ void Track::createPhysicsModel(unsigned int main_track_count)
|
||||
}
|
||||
|
||||
// Color
|
||||
#ifndef SERVER_ONLY
|
||||
mb->getMaterial().setTexture(0, getUnicolorTexture(video::SColor(255, 255, 105, 180)));
|
||||
#endif
|
||||
irr_driver->grabAllTextures(mesh);
|
||||
// Gloss
|
||||
#ifndef SERVER_ONLY
|
||||
mb->getMaterial().setTexture(1, getUnicolorTexture(video::SColor(0, 0, 0, 0)));
|
||||
// Colorization mask
|
||||
mb->getMaterial().setTexture(7, getUnicolorTexture(video::SColor(0, 0, 0, 0)));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
irr_driver->removeNode(m_static_physics_only_nodes[i]);
|
||||
@ -1029,6 +1035,7 @@ void Track::convertTrackToBullet(scene::ISceneNode *node)
|
||||
|
||||
void Track::loadMinimap()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
//Check whether the hardware can do nonsquare or
|
||||
// non power-of-two textures
|
||||
video::IVideoDriver* const video_driver = irr_driver->getVideoDriver();
|
||||
@ -1055,6 +1062,7 @@ void Track::loadMinimap()
|
||||
m_minimap_y_scale = float(m_mini_map_size.Height) / float(mini_map_texture_size.Height);
|
||||
else
|
||||
m_minimap_y_scale = 0;
|
||||
#endif
|
||||
} // loadMinimap
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -234,8 +234,10 @@ bool handleContextMenuAction(s32 cmd_id)
|
||||
switch(cmd_id)
|
||||
{
|
||||
case DEBUG_GRAPHICS_RELOAD_SHADERS:
|
||||
Log::info("Debug", "Reloading shaders...");
|
||||
#ifndef SERVER_ONLY
|
||||
Log::info("Debug", "Reloading shaders...");
|
||||
ShaderBase::updateShaders();
|
||||
#endif
|
||||
break;
|
||||
case DEBUG_GRAPHICS_RESET:
|
||||
if (physics)
|
||||
|
@ -17,11 +17,13 @@
|
||||
|
||||
#include "profiler.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/2dutils.hpp"
|
||||
#include "guiengine/event_handler.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "guiengine/scalable_font.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "utils/vs.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
@ -372,7 +374,9 @@ void Profiler::draw()
|
||||
unsigned int gpu_timers[Q_LAST];
|
||||
for (unsigned i = 0; i < Q_LAST; i++)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
gpu_timers[i] = irr_driver->getGPUTimer(i).elapsedTimeus();
|
||||
#endif
|
||||
total += gpu_timers[i];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user