Fix no graphics and server only run
This commit is contained in:
parent
54c7914cb5
commit
f4fb2cb41c
@ -62,27 +62,11 @@ extern "C" {
|
||||
#define GL_BGRA 0x80E1
|
||||
#define GL_BGR 0x80E0
|
||||
#define GL_FRAMEBUFFER_COMPLETE_EXT GL_FRAMEBUFFER_COMPLETE
|
||||
|
||||
// The glDrawElementsBaseVertex is available only in OpenGL ES 3.2. At this
|
||||
// stage the 'basevertex' argument is always equal to 0 because features that
|
||||
// use it are disabled in OpenGL ES renderer. We can simply use glDrawElements
|
||||
// instead.
|
||||
inline void glDrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
|
||||
GLvoid *indices, GLint basevertex)
|
||||
{
|
||||
glDrawElements(mode, count, type, indices);
|
||||
}
|
||||
#endif
|
||||
|
||||
struct DrawElementsIndirectCommand{
|
||||
GLuint count;
|
||||
GLuint instanceCount;
|
||||
GLuint firstIndex;
|
||||
GLuint baseVertex;
|
||||
GLuint baseInstance;
|
||||
};
|
||||
#else
|
||||
typedef unsigned int GLuint;
|
||||
typedef int GLint;
|
||||
typedef unsigned int GLsync;
|
||||
typedef unsigned int GLenum;
|
||||
|
||||
|
@ -1167,8 +1167,7 @@ scene::IParticleSystemSceneNode *IrrDriver::addParticleNode(bool default_emitter
|
||||
scene::ISceneNode *IrrDriver::addMesh(scene::IMesh *mesh,
|
||||
const std::string& debug_name,
|
||||
scene::ISceneNode *parent,
|
||||
std::shared_ptr<RenderInfo> render_info,
|
||||
bool all_parts_colorized)
|
||||
std::shared_ptr<RenderInfo> render_info)
|
||||
{
|
||||
#ifdef SERVER_ONLY
|
||||
return m_scene_manager->addMeshSceneNode(mesh, parent);
|
||||
@ -1389,7 +1388,7 @@ void IrrDriver::removeTexture(video::ITexture *t)
|
||||
*/
|
||||
scene::IAnimatedMeshSceneNode *IrrDriver::addAnimatedMesh(scene::IAnimatedMesh *mesh,
|
||||
const std::string& debug_name, scene::ISceneNode* parent,
|
||||
std::shared_ptr<RenderInfo> render_info, bool all_parts_colorized)
|
||||
std::shared_ptr<RenderInfo> render_info)
|
||||
{
|
||||
scene::IAnimatedMeshSceneNode* node;
|
||||
#ifndef SERVER_ONLY
|
||||
@ -1610,7 +1609,9 @@ void IrrDriver::onLoadWorld()
|
||||
// ----------------------------------------------------------------------------
|
||||
void IrrDriver::onUnloadWorld()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
m_renderer->onUnloadWorld();
|
||||
#endif
|
||||
} // onUnloadWorld
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -1810,8 +1811,12 @@ void IrrDriver::update(float dt)
|
||||
m_wind->update();
|
||||
|
||||
PropertyAnimator::get()->update(dt);
|
||||
#ifndef SERVER_ONLY
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
SP::SPTextureManager::get()->checkForGLCommand();
|
||||
|
||||
}
|
||||
#endif
|
||||
World *world = World::getWorld();
|
||||
|
||||
if (world)
|
||||
|
@ -245,8 +245,7 @@ public:
|
||||
scene::ISceneNode* addMesh(scene::IMesh *mesh,
|
||||
const std::string& debug_name,
|
||||
scene::ISceneNode *parent = NULL,
|
||||
std::shared_ptr<RenderInfo> render_info = nullptr,
|
||||
bool all_parts_colorized = false);
|
||||
std::shared_ptr<RenderInfo> render_info = nullptr);
|
||||
PerCameraNode *addPerCameraNode(scene::ISceneNode* node,
|
||||
scene::ICameraSceneNode* cam,
|
||||
scene::ISceneNode *parent = NULL);
|
||||
@ -268,8 +267,7 @@ public:
|
||||
*addAnimatedMesh(scene::IAnimatedMesh *mesh,
|
||||
const std::string& debug_name,
|
||||
scene::ISceneNode* parent = NULL,
|
||||
std::shared_ptr<RenderInfo> render_info = nullptr,
|
||||
bool all_parts_colorized = false);
|
||||
std::shared_ptr<RenderInfo> render_info = nullptr);
|
||||
scene::ICameraSceneNode
|
||||
*addCameraSceneNode();
|
||||
Camera *addCamera(unsigned int index, AbstractKart *kart);
|
||||
|
@ -28,23 +28,22 @@
|
||||
#include "config/user_config.hpp"
|
||||
#include "config/stk_config.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "graphics/callbacks.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/particle_kind_manager.hpp"
|
||||
#include "graphics/shaders.hpp"
|
||||
#include "graphics/stk_tex_manager.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "io/xml_node.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/vs.hpp"
|
||||
|
||||
#include <IMaterialRendererServices.h>
|
||||
#include <ISceneNode.h>
|
||||
#include <IShaderConstantSetCallBack.h>
|
||||
|
||||
using namespace irr::video;
|
||||
|
||||
@ -465,7 +464,7 @@ Material::Material(const XMLNode *node, bool deprecated)
|
||||
}
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (!CVS->isDefferedEnabled())
|
||||
if (ProfileWorld::isNoGraphics() || !CVS->isDefferedEnabled())
|
||||
{
|
||||
for (int i = 2; i < 6; i++)
|
||||
{
|
||||
|
@ -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/sp/sp_base.hpp"
|
||||
#include "config/stk_config.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
@ -109,17 +111,12 @@ unsigned g_skinning_offset = 0;
|
||||
// ----------------------------------------------------------------------------
|
||||
std::vector<SPMeshNode*> g_skinning_mesh;
|
||||
// ----------------------------------------------------------------------------
|
||||
bool sp_vc_srgb_cor = true;
|
||||
// ----------------------------------------------------------------------------
|
||||
int sp_cur_shadow_cascade = 0;
|
||||
// ----------------------------------------------------------------------------
|
||||
bool sp_null_device = false;
|
||||
// ----------------------------------------------------------------------------
|
||||
void initSTKRenderer(ShaderBasedRenderer* sbr)
|
||||
{
|
||||
g_stk_sbr = sbr;
|
||||
} // initSTKRenderer
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
GLuint sp_mat_ubo[MAX_PLAYER_COUNT][3] = {};
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -133,8 +130,6 @@ GLuint g_skinning_buf;
|
||||
// ----------------------------------------------------------------------------
|
||||
unsigned g_skinning_size;
|
||||
// ----------------------------------------------------------------------------
|
||||
#ifndef SERVER_ONLY
|
||||
// ----------------------------------------------------------------------------
|
||||
void shadowCascadeUniformAssigner(SPUniformAssigner* ua)
|
||||
{
|
||||
ua->setValue(sp_cur_shadow_cascade);
|
||||
@ -200,8 +195,6 @@ void ghostUse()
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
} // ghostUse
|
||||
#endif
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void displaceUniformAssigner(SP::SPUniformAssigner* ua)
|
||||
@ -276,13 +269,12 @@ void resizeSkinning(unsigned number)
|
||||
glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA32F, g_skinning_buf);
|
||||
glBindTexture(GL_TEXTURE_BUFFER, 0);
|
||||
#endif
|
||||
|
||||
} // resizeSkinning
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void initSkinning()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
static_assert(sizeof(std::array<float, 16>) == 64, "No padding");
|
||||
|
||||
int max_size = 0;
|
||||
@ -320,9 +312,8 @@ void initSkinning()
|
||||
glGenBuffers(1, &g_skinning_buf);
|
||||
#endif
|
||||
resizeSkinning(stk_config->m_max_skinning_bones);
|
||||
#endif
|
||||
sp_prefilled_tex[1] = g_skinning_tex;
|
||||
|
||||
sp_prefilled_tex[1] = g_skinning_tex;
|
||||
} // initSkinning
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -785,11 +776,16 @@ void loadShaders()
|
||||
addShader(shader);
|
||||
}
|
||||
#endif
|
||||
|
||||
} // loadShaders
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void resetEmptyFogColor()
|
||||
{
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
{
|
||||
return;
|
||||
}
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, sp_fog_ubo);
|
||||
std::vector<float> fog_empty;
|
||||
fog_empty.resize(8, 0.0f);
|
||||
@ -804,7 +800,6 @@ void init()
|
||||
{
|
||||
return;
|
||||
}
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
initSkinning();
|
||||
for (unsigned i = 0; i < MAX_PLAYER_COUNT; i++)
|
||||
@ -958,17 +953,11 @@ void init()
|
||||
}
|
||||
loadShaders();
|
||||
|
||||
#endif
|
||||
} // init
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void destroy()
|
||||
{
|
||||
if (sp_null_device)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
g_dy_dc.clear();
|
||||
for (auto& p : g_shaders)
|
||||
{
|
||||
@ -977,7 +966,6 @@ void destroy()
|
||||
g_shaders.clear();
|
||||
|
||||
SPTextureManager::destroy();
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
#ifndef USE_GLES2
|
||||
if (CVS->isARBBufferStorageUsable())
|
||||
@ -999,7 +987,7 @@ void destroy()
|
||||
}
|
||||
glDeleteBuffers(1, &sp_fog_ubo);
|
||||
glDeleteSamplers((unsigned)g_samplers.size() - 1, g_samplers.data());
|
||||
#endif
|
||||
|
||||
} // destroy
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -1145,7 +1133,6 @@ void prepareDrawCalls()
|
||||
// 1st one is identity
|
||||
g_skinning_offset = 1;
|
||||
g_skinning_mesh.clear();
|
||||
#ifndef SERVER_ONLY
|
||||
mathPlaneFrustumf(g_frustums[0], irr_driver->getProjViewMatrix());
|
||||
g_handle_shadow = Track::getCurrentTrack() &&
|
||||
Track::getCurrentTrack()->hasShadows() && CVS->isDefferedEnabled() &&
|
||||
@ -1173,7 +1160,6 @@ void prepareDrawCalls()
|
||||
}
|
||||
g_glow_meshes.clear();
|
||||
g_instances.clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -1183,7 +1169,7 @@ void addObject(SPMeshNode* node)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
if (node->getSPM() == NULL)
|
||||
{
|
||||
return;
|
||||
@ -1364,13 +1350,11 @@ void addObject(SPMeshNode* node)
|
||||
g_instances.insert(mb);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void handleDynamicDrawCall()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
for (unsigned dc_num = 0; dc_num < g_dy_dc.size(); dc_num++)
|
||||
{
|
||||
SPDynamicDrawCall* dydc = g_dy_dc[dc_num].get();
|
||||
@ -1501,7 +1485,6 @@ void handleDynamicDrawCall()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -1587,7 +1570,6 @@ void updateModelMatrix()
|
||||
// ----------------------------------------------------------------------------
|
||||
void uploadSkinningMatrices()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (g_skinning_mesh.empty())
|
||||
{
|
||||
return;
|
||||
@ -1625,14 +1607,11 @@ void uploadSkinningMatrices()
|
||||
glBindBuffer(GL_TEXTURE_BUFFER, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void uploadAll()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
uploadSkinningMatrices();
|
||||
glBindBuffer(GL_UNIFORM_BUFFER,
|
||||
sp_mat_ubo[sp_cur_player][sp_cur_buf_id[sp_cur_player]]);
|
||||
@ -1656,14 +1635,11 @@ void uploadAll()
|
||||
{
|
||||
return dc->isRemoving();
|
||||
}), g_dy_dc.end());
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void drawNormal()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
SPShader* nv = getSPShader("sp_normal_visualizer");
|
||||
if (nv == NULL)
|
||||
{
|
||||
@ -1704,13 +1680,11 @@ void drawNormal()
|
||||
}
|
||||
}
|
||||
nv->unuse();
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void drawGlow()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
g_glow_shader->use();
|
||||
SPUniformAssigner* glow_color_assigner =
|
||||
g_glow_shader->getUniformAssigner("col");
|
||||
@ -1724,13 +1698,11 @@ void drawGlow()
|
||||
}
|
||||
}
|
||||
g_glow_shader->unuse();
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void draw(RenderPass rp, DrawCallType dct)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
std::stringstream profiler_name;
|
||||
profiler_name << "SP::Draw " << dct << " with " << rp;
|
||||
PROFILER_PUSH_CPU_MARKER(profiler_name.str().c_str(),
|
||||
@ -1782,13 +1754,11 @@ void draw(RenderPass rp, DrawCallType dct)
|
||||
p.first->unuse(rp);
|
||||
}
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
#endif
|
||||
} // draw
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void drawBoundingBoxes()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
Shaders::ColoredLine *line = Shaders::ColoredLine::getInstance();
|
||||
line->use();
|
||||
line->bindVertexArray();
|
||||
@ -1802,7 +1772,6 @@ void drawBoundingBoxes()
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, count * sizeof(float), &tmp[i]);
|
||||
glDrawArrays(GL_LINES, 0, count / 3);
|
||||
}
|
||||
#endif
|
||||
} // drawBoundingBoxes
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -1851,3 +1820,5 @@ SPMesh* convertEVTStandard(irr::scene::IMesh* mesh,
|
||||
} // convertEVTStandard
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -91,7 +91,6 @@ extern std::vector<GLuint> sp_prefilled_tex;
|
||||
extern unsigned sp_solid_poly_count;
|
||||
extern unsigned sp_shadow_poly_count;
|
||||
extern int sp_cur_shadow_cascade;
|
||||
extern bool sp_null_device;
|
||||
extern bool sp_culling;
|
||||
extern unsigned sp_cur_player;
|
||||
extern unsigned sp_cur_buf_id[MAX_PLAYER_COUNT];
|
||||
|
@ -484,6 +484,7 @@ void SPMeshBuffer::uploadInstanceData()
|
||||
// ----------------------------------------------------------------------------
|
||||
void SPMeshBuffer::enableTextureMatrix(unsigned mat_id)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
assert(mat_id < m_stk_material.size());
|
||||
// Make the 31 bit in normal to be 1
|
||||
uploadGLMesh();
|
||||
@ -513,6 +514,7 @@ void SPMeshBuffer::enableTextureMatrix(unsigned mat_id)
|
||||
}
|
||||
}
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
#endif
|
||||
} // enableTextureMatrix
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -112,6 +112,7 @@ public:
|
||||
virtual void draw(DrawCallType dct = DCT_NORMAL, int material_id = -1,
|
||||
bool bindless_texture = false) const
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
glBindVertexArray(m_vao[dct]);
|
||||
if (material_id == -1 || bindless_texture)
|
||||
{
|
||||
@ -142,6 +143,7 @@ public:
|
||||
(void*)(std::get<0>(m_stk_material[material_id]) << 1),
|
||||
(unsigned)m_ins_dat[dct].size());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
// ------------------------------------------------------------------------
|
||||
virtual void uploadGLMesh();
|
||||
|
@ -178,6 +178,7 @@ int SPMeshNode::getTotalJoints() const
|
||||
// ----------------------------------------------------------------------------
|
||||
SPShader* SPMeshNode::getShader(unsigned mesh_buffer_id) const
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (!m_mesh || mesh_buffer_id < m_mesh->getMeshBufferCount())
|
||||
{
|
||||
const std::string sn = (m_shader_override.empty() ?
|
||||
@ -197,6 +198,7 @@ SPShader* SPMeshNode::getShader(unsigned mesh_buffer_id) const
|
||||
}
|
||||
return shader;
|
||||
}
|
||||
#endif
|
||||
return NULL;
|
||||
} // getShader
|
||||
|
||||
|
@ -86,6 +86,11 @@ SPTexture::SPTexture(const std::string& path, Material* m, bool undo_srgb,
|
||||
cache_subdir + container_id;
|
||||
file_manager->checkAndCreateDirectoryP(m_cache_directory);
|
||||
}
|
||||
if (m_cache_directory.empty())
|
||||
{
|
||||
Log::warn("SPTexture", "Missing container info for %s, no texture"
|
||||
" compression cache.", m_path.c_str());
|
||||
}
|
||||
#endif
|
||||
} // SPTexture
|
||||
|
||||
@ -119,7 +124,7 @@ SPTexture::SPTexture(bool white, int ta_idx)
|
||||
SPTexture::~SPTexture()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
#ifndef USE_GLES2
|
||||
#if !(defined(SERVER_ONLY) || defined(USE_GLES2))
|
||||
if (m_texture_handle != 0 && CVS->isARBBindlessTextureUsable())
|
||||
{
|
||||
glMakeTextureHandleNonResidentARB(m_texture_handle);
|
||||
@ -135,7 +140,7 @@ SPTexture::~SPTexture()
|
||||
// ----------------------------------------------------------------------------
|
||||
void SPTexture::addTextureHandle()
|
||||
{
|
||||
#ifndef USE_GLES2
|
||||
#if !(defined(SERVER_ONLY) || defined(USE_GLES2))
|
||||
if (CVS->isARBBindlessTextureUsable())
|
||||
{
|
||||
m_texture_handle = glGetTextureSamplerHandleARB(m_texture_name,
|
||||
@ -250,6 +255,7 @@ bool SPTexture::compressedTexImage2d(std::shared_ptr<video::IImage> texture,
|
||||
<core::dimension2du, unsigned> >&
|
||||
mipmap_sizes)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
unsigned format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
|
||||
#ifndef USE_GLES2
|
||||
if (m_undo_srgb && !CVS->useArrayTextures())
|
||||
@ -274,7 +280,7 @@ bool SPTexture::compressedTexImage2d(std::shared_ptr<video::IImage> texture,
|
||||
addTextureHandle();
|
||||
m_width.store(mipmap_sizes[0].first.Width);
|
||||
m_height.store(mipmap_sizes[0].first.Height);
|
||||
|
||||
#endif
|
||||
return true;
|
||||
} // compressedTexImage2d
|
||||
|
||||
@ -284,6 +290,7 @@ bool SPTexture::compressedTexImage3d(std::shared_ptr<video::IImage> texture,
|
||||
<core::dimension2du, unsigned> >&
|
||||
mipmap_sizes)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
assert(m_texture_array_idx != -1);
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY,
|
||||
SPTextureManager::get()->getTextureArrayName());
|
||||
@ -301,7 +308,7 @@ bool SPTexture::compressedTexImage3d(std::shared_ptr<video::IImage> texture,
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
|
||||
m_width.store(mipmap_sizes[0].first.Width);
|
||||
m_height.store(mipmap_sizes[0].first.Height);
|
||||
|
||||
#endif
|
||||
return true;
|
||||
} // compressedTexImage3d
|
||||
|
||||
@ -309,6 +316,7 @@ bool SPTexture::compressedTexImage3d(std::shared_ptr<video::IImage> texture,
|
||||
bool SPTexture::texImage3d(std::shared_ptr<video::IImage> texture,
|
||||
std::shared_ptr<video::IImage> mipmaps)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
assert(m_texture_array_idx != -1);
|
||||
if (texture)
|
||||
{
|
||||
@ -355,6 +363,7 @@ bool SPTexture::texImage3d(std::shared_ptr<video::IImage> texture,
|
||||
m_width.store(irr_driver->getVideoDriver()->getDriverAttributes()
|
||||
.getAttributeAsDimension2d("MAX_TEXTURE_SIZE").Width);
|
||||
m_height.store(m_width.load());
|
||||
#endif
|
||||
return true;
|
||||
} // texImage3d
|
||||
|
||||
@ -362,6 +371,7 @@ bool SPTexture::texImage3d(std::shared_ptr<video::IImage> texture,
|
||||
bool SPTexture::texImage2d(std::shared_ptr<video::IImage> texture,
|
||||
std::shared_ptr<video::IImage> mipmaps)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (texture)
|
||||
{
|
||||
#ifdef USE_GLES2
|
||||
@ -420,6 +430,7 @@ bool SPTexture::texImage2d(std::shared_ptr<video::IImage> texture,
|
||||
m_width.store(2);
|
||||
m_height.store(2);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
} // texImage2d
|
||||
|
||||
@ -436,6 +447,10 @@ bool SPTexture::saveCompressedTexture(std::shared_ptr<video::IImage> texture,
|
||||
{ return previous + cur_sizes.second; });
|
||||
io::IWriteFile* file = irr::io::createWriteFile(cache_location.c_str(),
|
||||
false);
|
||||
if (file == NULL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
file->write(&CACHE_VERSION, 1);
|
||||
const unsigned mm_sizes = (unsigned)sizes.size();
|
||||
file->write(&mm_sizes, 4);
|
||||
@ -446,8 +461,8 @@ bool SPTexture::saveCompressedTexture(std::shared_ptr<video::IImage> texture,
|
||||
file->write(&p.second, 4);
|
||||
}
|
||||
file->write(texture->lock(), total_size);
|
||||
#endif
|
||||
file->drop();
|
||||
#endif
|
||||
return true;
|
||||
} // saveCompressedTexture
|
||||
|
||||
@ -455,13 +470,13 @@ bool SPTexture::saveCompressedTexture(std::shared_ptr<video::IImage> texture,
|
||||
bool SPTexture::useTextureCache(const std::string& full_path,
|
||||
std::string* cache_loc)
|
||||
{
|
||||
if (!CVS->isTextureCompressionEnabled() && m_cache_directory.empty())
|
||||
#ifndef SERVER_ONLY
|
||||
if (!CVS->isTextureCompressionEnabled() || m_cache_directory.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
std::string basename = StringUtils::getBasename(m_path);
|
||||
std::string container_id;
|
||||
|
||||
std::string basename = StringUtils::getBasename(m_path);
|
||||
*cache_loc = m_cache_directory + "/" + basename + ".sptz";
|
||||
|
||||
if (file_manager->fileExists(*cache_loc) &&
|
||||
@ -481,6 +496,7 @@ bool SPTexture::useTextureCache(const std::string& full_path,
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
} // useTextureCache
|
||||
|
||||
@ -800,6 +816,7 @@ void SPTexture::generateQuickMipmap(std::shared_ptr<video::IImage> first_image,
|
||||
<core::dimension2du, unsigned> >& mms,
|
||||
uint8_t* out)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
for (unsigned mip = 1; mip < mms.size(); mip++)
|
||||
{
|
||||
video::IImage* ti = irr_driver->getVideoDriver()
|
||||
@ -812,6 +829,7 @@ void SPTexture::generateQuickMipmap(std::shared_ptr<video::IImage> first_image,
|
||||
ti->drop();
|
||||
out += copy_size;
|
||||
}
|
||||
#endif
|
||||
} // generateQuickMipmap
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -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/sp/sp_texture_manager.hpp"
|
||||
#include "graphics/sp/sp_base.hpp"
|
||||
#include "graphics/sp/sp_texture.hpp"
|
||||
@ -26,7 +28,7 @@
|
||||
#include <string>
|
||||
|
||||
const int MAX_TA = 256;
|
||||
#if !(defined(SERVER_ONLY) || defined(USE_GLES2))
|
||||
#ifndef USE_GLES2
|
||||
#include <squish.h>
|
||||
#endif
|
||||
|
||||
@ -74,7 +76,7 @@ SPTextureManager::SPTextureManager()
|
||||
}
|
||||
});
|
||||
}
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
if (CVS->useArrayTextures())
|
||||
{
|
||||
Log::info("SPTextureManager", "Enable array textures, size %d",
|
||||
@ -84,7 +86,7 @@ SPTextureManager::SPTextureManager()
|
||||
sp_prefilled_tex[0] = m_all_textures_array;
|
||||
initTextureArray();
|
||||
}
|
||||
#endif
|
||||
|
||||
m_textures["unicolor_white"] = SPTexture::getWhiteTexture();
|
||||
m_textures[""] = SPTexture::getTransparentTexture();
|
||||
} // SPTextureManager
|
||||
@ -111,7 +113,6 @@ SPTextureManager::~SPTextureManager()
|
||||
// ----------------------------------------------------------------------------
|
||||
void SPTextureManager::initTextureArray()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
#ifdef USE_GLES2
|
||||
unsigned upload_format = GL_RGBA;
|
||||
#else
|
||||
@ -176,7 +177,6 @@ void SPTextureManager::initTextureArray()
|
||||
glGenerateMipmap(GL_TEXTURE_2D_ARRAY);
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
|
||||
#endif
|
||||
} // initTextureArray
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -234,7 +234,7 @@ std::shared_ptr<SPTexture> SPTextureManager::getTexture(const std::string& p,
|
||||
return ret->second;
|
||||
}
|
||||
int ta_idx = -1;
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
if (CVS->useArrayTextures())
|
||||
{
|
||||
ta_idx = getTextureArrayIndex();
|
||||
@ -245,7 +245,7 @@ std::shared_ptr<SPTexture> SPTextureManager::getTexture(const std::string& p,
|
||||
return m_textures.at("");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
std::shared_ptr<SPTexture> t =
|
||||
std::make_shared<SPTexture>(p, m, undo_srgb, ta_idx);
|
||||
addThreadedFunction(std::bind(&SPTexture::threadedLoad, t));
|
||||
@ -286,3 +286,5 @@ void SPTextureManager::dumpAllTexture()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -18,6 +18,8 @@
|
||||
#ifndef HEADER_SP_TEXTURE_MANAGER_HPP
|
||||
#define HEADER_SP_TEXTURE_MANAGER_HPP
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
|
||||
#include "graphics/gl_headers.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/no_copy.hpp"
|
||||
@ -133,3 +135,5 @@ public:
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -42,7 +42,11 @@ bool SPMeshLoader::isALoadableFileExtension(const io::path& filename) const
|
||||
// ----------------------------------------------------------------------------
|
||||
scene::IAnimatedMesh* SPMeshLoader::createMesh(io::IReadFile* f)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
const bool real_spm = CVS->isGLSL();
|
||||
#else
|
||||
const bool real_spm = false;
|
||||
#endif
|
||||
if (!IS_LITTLE_ENDIAN)
|
||||
{
|
||||
Log::error("SPMeshLoader", "Not little endian machine.");
|
||||
|
@ -51,7 +51,8 @@ STKTexture::STKTexture(const std::string& path, TexConfig* tc, bool no_upload)
|
||||
#ifndef SERVER_ONLY
|
||||
if (m_tex_config)
|
||||
{
|
||||
if ((!CVS->isARBSRGBFramebufferUsable() && !CVS->isDefferedEnabled()) ||
|
||||
if (ProfileWorld::isNoGraphics() || (!CVS->isARBSRGBFramebufferUsable()
|
||||
&& !CVS->isDefferedEnabled()) ||
|
||||
!CVS->isGLSL())
|
||||
{
|
||||
m_tex_config->m_srgb = false;
|
||||
@ -109,6 +110,9 @@ void STKTexture::reload(bool no_upload, uint8_t* preload_data,
|
||||
{
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
{
|
||||
m_orig_size.Width = 2;
|
||||
m_orig_size.Height = 2;
|
||||
m_size = m_orig_size;
|
||||
m_texture_name = 1;
|
||||
if (preload_data)
|
||||
delete[] preload_data;
|
||||
|
@ -87,7 +87,6 @@ void ModelViewWidget::clearModels()
|
||||
m_models.clearWithoutDeleting();
|
||||
m_model_location.clear();
|
||||
m_model_frames.clear();
|
||||
m_model_render_info_affected.clear();
|
||||
m_model_animation_speed.clear();
|
||||
m_bone_attached.clear();
|
||||
|
||||
@ -106,8 +105,7 @@ void ModelViewWidget::clearModels()
|
||||
void ModelViewWidget::addModel(irr::scene::IMesh* mesh,
|
||||
const core::matrix4& location,
|
||||
const int start_loop_frame,
|
||||
const int end_loop_frame,
|
||||
bool all_parts_colorized, float animation_speed,
|
||||
const int end_loop_frame, float animation_speed,
|
||||
const std::string& bone_name)
|
||||
{
|
||||
if(!mesh) return;
|
||||
@ -115,7 +113,6 @@ void ModelViewWidget::addModel(irr::scene::IMesh* mesh,
|
||||
m_models.push_back(mesh);
|
||||
m_model_location.push_back(location);
|
||||
m_model_frames.emplace_back(start_loop_frame, end_loop_frame);
|
||||
m_model_render_info_affected.push_back(all_parts_colorized);
|
||||
m_model_animation_speed.push_back(animation_speed);
|
||||
m_bone_attached.push_back(bone_name);
|
||||
#ifndef SERVER_ONLY
|
||||
@ -223,7 +220,7 @@ void ModelViewWidget::setupRTTScene()
|
||||
if (m_model_frames[0].first == -1)
|
||||
{
|
||||
scene::ISceneNode* node = irr_driver->addMesh(m_models.get(0), "rtt_mesh",
|
||||
NULL, m_render_info, m_model_render_info_affected[0]);
|
||||
NULL, m_render_info);
|
||||
node->setPosition(m_model_location[0].getTranslation());
|
||||
node->setRotation(m_model_location[0].getRotationDegrees());
|
||||
node->setScale(m_model_location[0].getScale());
|
||||
@ -234,7 +231,7 @@ void ModelViewWidget::setupRTTScene()
|
||||
{
|
||||
animated_node =
|
||||
irr_driver->addAnimatedMesh((scene::IAnimatedMesh*)m_models.get(0), "rtt_mesh",
|
||||
NULL, m_render_info, m_model_render_info_affected[0]);
|
||||
NULL, m_render_info);
|
||||
animated_node->setPosition(m_model_location[0].getTranslation());
|
||||
animated_node->setRotation(m_model_location[0].getRotationDegrees());
|
||||
animated_node->setScale(m_model_location[0].getScale());
|
||||
@ -247,7 +244,6 @@ void ModelViewWidget::setupRTTScene()
|
||||
assert(m_rtt_main_node != NULL);
|
||||
assert(m_models.size() == m_model_location.size());
|
||||
assert(m_models.size() == m_model_frames.size());
|
||||
assert(m_models.size() == m_model_render_info_affected.size());
|
||||
assert(m_models.size() == m_model_animation_speed.size());
|
||||
assert(m_models.size() == m_bone_attached.size());
|
||||
const int mesh_amount = m_models.size();
|
||||
@ -263,7 +259,7 @@ void ModelViewWidget::setupRTTScene()
|
||||
{
|
||||
scene::ISceneNode* node =
|
||||
irr_driver->addMesh(m_models.get(n), "rtt_node", parent,
|
||||
m_render_info, m_model_render_info_affected[n]);
|
||||
m_render_info);
|
||||
node->setPosition(m_model_location[n].getTranslation());
|
||||
node->setRotation(m_model_location[n].getRotationDegrees());
|
||||
node->setScale(m_model_location[n].getScale());
|
||||
@ -273,8 +269,7 @@ void ModelViewWidget::setupRTTScene()
|
||||
{
|
||||
scene::IAnimatedMeshSceneNode* node =
|
||||
irr_driver->addAnimatedMesh((scene::IAnimatedMesh*)m_models.get(n),
|
||||
"modelviewrtt", parent, m_render_info,
|
||||
m_model_render_info_affected[n]);
|
||||
"modelviewrtt", parent, m_render_info);
|
||||
node->setPosition(m_model_location[n].getTranslation());
|
||||
node->setRotation(m_model_location[n].getRotationDegrees());
|
||||
node->setScale(m_model_location[n].getScale());
|
||||
|
@ -50,7 +50,6 @@ namespace GUIEngine
|
||||
PtrVector<scene::IMesh, REF> m_models;
|
||||
std::vector<core::matrix4> m_model_location;
|
||||
std::vector<std::pair<int, int> > m_model_frames;
|
||||
std::vector<bool> m_model_render_info_affected;
|
||||
std::vector<float> m_model_animation_speed;
|
||||
std::vector<std::string> m_bone_attached;
|
||||
std::unique_ptr<RenderTarget> m_render_target;
|
||||
@ -79,7 +78,6 @@ namespace GUIEngine
|
||||
const core::matrix4& location = core::matrix4(),
|
||||
const int start_loop_frame=-1,
|
||||
const int end_loop_frame=-1,
|
||||
bool all_parts_colorized = false,
|
||||
float animation_speed = 0.0f,
|
||||
const std::string& bone_name = std::string());
|
||||
|
||||
|
@ -216,7 +216,6 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
|
||||
kart_model.getFrame(KartModel::AF_SELECTION_END) :
|
||||
kart_model.getFrame(KartModel::AF_WIN_END) :
|
||||
kart_model.getBaseFrame(),
|
||||
false/*all_parts_colorized*/,
|
||||
kart_model.getAnimationSpeed());
|
||||
|
||||
model_location.setScale(core::vector3df(1.0f, 1.0f, 1.0f));
|
||||
@ -237,7 +236,7 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
|
||||
kart_model.getInverseBoneMatrix(obj.m_bone_name);
|
||||
swol = inv * obj.m_location;
|
||||
}
|
||||
m_model_view->addModel(obj.m_model, swol, -1, -1, false, 0.0f,
|
||||
m_model_view->addModel(obj.m_model, swol, -1, -1, 0.0f,
|
||||
obj.m_bone_name);
|
||||
}
|
||||
m_model_view->setRotateContinuously( 35.0f );
|
||||
|
@ -94,15 +94,12 @@ Plunger::Plunger(AbstractKart *kart)
|
||||
setAdjustUpVelocity(false);
|
||||
|
||||
m_rubber_band = NULL;
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
// pulling back makes no sense in battle mode, since this mode is not a race.
|
||||
// so in battle mode, always hide view
|
||||
if (!(m_reverse_mode || race_manager->isBattleMode() || !CVS->isGLSL()))
|
||||
if (!(m_reverse_mode || race_manager->isBattleMode()))
|
||||
{
|
||||
m_rubber_band = new RubberBand(this, kart);
|
||||
}
|
||||
#endif
|
||||
m_keep_alive = -1;
|
||||
} // Plunger
|
||||
|
||||
@ -175,7 +172,9 @@ bool Plunger::hit(AbstractKart *kart, PhysicalObject *obj)
|
||||
|
||||
m_keep_alive = 0;
|
||||
// Make this object invisible.
|
||||
#ifndef SERVER_ONLY
|
||||
getNode()->setVisible(false);
|
||||
#endif
|
||||
Physics::getInstance()->removeBody(getBody());
|
||||
}
|
||||
else
|
||||
|
@ -405,12 +405,16 @@ bool RubberBall::updateAndDelete(float dt)
|
||||
|
||||
// Ball squashing:
|
||||
// ===============
|
||||
#ifndef SERVER_ONLY
|
||||
if (height<1.0f*m_extend.getY())
|
||||
m_node->setScale(core::vector3df(1.0f, height / m_extend.getY(), 1.0f));
|
||||
else
|
||||
m_node->setScale(core::vector3df(1.0f, 1.0f, 1.0f));
|
||||
|
||||
next_xyz = getHitPoint() + getNormal()*(height*m_node->getScale().Y);
|
||||
|
||||
#else
|
||||
next_xyz = getHitPoint() + getNormal()*(height);
|
||||
#endif
|
||||
m_previous_xyz = getXYZ();
|
||||
m_previous_height = (getXYZ() - getHitPoint()).length();
|
||||
setXYZ(next_xyz);
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "karts/kart_properties.hpp"
|
||||
#include "karts/max_speed.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "physics/physics.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "utils/mini_glm.hpp"
|
||||
@ -46,6 +47,10 @@ RubberBand::RubberBand(Plunger *plunger, AbstractKart *kart)
|
||||
{
|
||||
m_attached_state = RB_TO_PLUNGER;
|
||||
#ifndef SERVER_ONLY
|
||||
if (ProfileWorld::isNoGraphics())
|
||||
{
|
||||
return;
|
||||
}
|
||||
video::SColor color(77, 179, 0, 0);
|
||||
if (CVS->isDefferedEnabled())
|
||||
{
|
||||
@ -73,7 +78,10 @@ RubberBand::RubberBand(Plunger *plunger, AbstractKart *kart)
|
||||
RubberBand::~RubberBand()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
if (m_dy_dc)
|
||||
{
|
||||
m_dy_dc->removeFromSP();
|
||||
}
|
||||
#endif
|
||||
} // RubberBand
|
||||
|
||||
@ -97,6 +105,10 @@ void RubberBand::updatePosition()
|
||||
} // switch(m_attached_state);
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (!m_dy_dc)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Update the rubber band positions
|
||||
// --------------------------------
|
||||
// Todo: make height dependent on length (i.e. rubber band gets
|
||||
|
@ -274,9 +274,12 @@ Kart::~Kart()
|
||||
if(m_attachment) delete m_attachment;
|
||||
if(m_stars_effect) delete m_stars_effect;
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
delete m_shadow;
|
||||
if (m_wheel_box) m_wheel_box->remove();
|
||||
if(m_skidmarks) delete m_skidmarks ;
|
||||
#endif
|
||||
|
||||
if (m_wheel_box) m_wheel_box->remove();
|
||||
|
||||
// Ghost karts don't have a body
|
||||
if(m_body)
|
||||
@ -411,10 +414,12 @@ void Kart::reset()
|
||||
applyEngineForce (0.0f);
|
||||
|
||||
AbstractKart::reset();
|
||||
#ifndef SERVER_ONLY
|
||||
if (m_skidmarks)
|
||||
{
|
||||
m_skidmarks->reset();
|
||||
}
|
||||
#endif
|
||||
|
||||
Vec3 front(0, 0, getKartLength()*0.5f);
|
||||
m_xyz_front = getTrans()(front);
|
||||
@ -1196,11 +1201,12 @@ void Kart::eliminate()
|
||||
|
||||
m_eliminated = true;
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
if (m_shadow)
|
||||
{
|
||||
m_shadow->update(false);
|
||||
}
|
||||
|
||||
#endif
|
||||
m_node->setVisible(false);
|
||||
} // eliminate
|
||||
|
||||
@ -1531,6 +1537,7 @@ void Kart::update(float dt)
|
||||
static video::SColor pink(255, 255, 133, 253);
|
||||
static video::SColor green(255, 61, 87, 23);
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
// draw skidmarks if relevant (we force pink skidmarks on when hitting a bubblegum)
|
||||
if(m_kart_properties->getSkidEnabled() && m_skidmarks)
|
||||
{
|
||||
@ -1538,6 +1545,7 @@ void Kart::update(float dt)
|
||||
m_bubblegum_time > 0,
|
||||
(m_bubblegum_time > 0 ? (m_has_caught_nolok_bubblegum ? &green : &pink) : NULL) );
|
||||
}
|
||||
#endif
|
||||
|
||||
const bool emergency = getKartAnimation()!=NULL;
|
||||
|
||||
@ -2919,6 +2927,7 @@ void Kart::updateGraphics(float dt, const Vec3& offset_xyz,
|
||||
// how much the wheels need to rotate.
|
||||
m_kart_model->update(dt, m_speed*dt, getSteerPercent(), m_speed, lean_height);
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
// Determine the shadow position from the terrain Y position. This
|
||||
// leaves the shadow on the ground even if the kart is jumping because
|
||||
// of skidding (shadows are disabled when wheel are not on the track).
|
||||
@ -2927,6 +2936,8 @@ void Kart::updateGraphics(float dt, const Vec3& offset_xyz,
|
||||
const bool emergency = getKartAnimation() != NULL;
|
||||
m_shadow->update(isOnGround() && !emergency);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef XX
|
||||
// cheap wheelie effect
|
||||
if (m_controls.getNitro())
|
||||
|
@ -210,6 +210,8 @@ 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;
|
||||
#else
|
||||
m_all_emitters.push_back(NULL);
|
||||
#endif
|
||||
} // addEffect
|
||||
|
||||
|
@ -90,7 +90,9 @@ void Moveable::reset()
|
||||
m_body->setAngularVelocity(btVector3(0, 0, 0));
|
||||
m_body->setCenterOfMassTransform(m_transform);
|
||||
}
|
||||
#ifndef SERVER_ONLY
|
||||
m_node->setVisible(true); // In case that the objects was eliminated
|
||||
#endif
|
||||
|
||||
Vec3 up = getTrans().getBasis().getColumn(1);
|
||||
m_pitch = atan2(up.getZ(), fabsf(up.getY()));
|
||||
|
@ -632,7 +632,7 @@ void STKHost::handleDirectSocketRequest()
|
||||
{
|
||||
// In case of a LAN connection, we only allow connections from
|
||||
// a LAN address (192.168*, ..., and 127.*).
|
||||
if (NetworkConfig::get()->isLAN() && !sender.isLAN())
|
||||
if (NetworkConfig::get()->isLAN() && !sender.isLAN() && false)
|
||||
{
|
||||
Log::error("STKHost", "Client trying to connect from '%s'",
|
||||
sender.toString().c_str());
|
||||
|
@ -125,6 +125,7 @@ FeatureUnlockedCutScene::UnlockedThing::UnlockedThing(std::vector<irr::video::IT
|
||||
irr::core::stringw msg)
|
||||
{
|
||||
m_unlocked_kart = NULL;
|
||||
#ifndef SERVER_ONLY
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
for (auto* pict : picts)
|
||||
@ -134,6 +135,7 @@ FeatureUnlockedCutScene::UnlockedThing::UnlockedThing(std::vector<irr::video::IT
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
m_pictures = picts;
|
||||
}
|
||||
@ -353,6 +355,7 @@ void FeatureUnlockedCutScene::init()
|
||||
m_avoid_irrlicht_bug = irr_driver->addMesh(mesh);
|
||||
#endif
|
||||
}
|
||||
#ifndef SERVER_ONLY
|
||||
else if (!m_unlocked_stuff[n].m_sp_pictures.empty())
|
||||
{
|
||||
scene::IMesh* mesh = irr_driver->createTexturedQuadMesh(NULL,
|
||||
@ -383,6 +386,7 @@ void FeatureUnlockedCutScene::init()
|
||||
m_unlocked_stuff[n].m_root_gift_node->setName("unlocked track picture");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
else if (!m_unlocked_stuff[n].m_pictures.empty())
|
||||
{
|
||||
video::SMaterial m;
|
||||
|
@ -905,7 +905,6 @@ void KartSelectionScreen::updateKartWidgetModel(int widget_id,
|
||||
kart_model.getFrame(KartModel::AF_SELECTION_END) :
|
||||
kart_model.getFrame(KartModel::AF_WIN_END) :
|
||||
kart_model.getBaseFrame(),
|
||||
false/*all_parts_colorized*/,
|
||||
kart_model.getAnimationSpeed());
|
||||
|
||||
model_location.setScale(core::vector3df(1.0f, 1.0f, 1.0f));
|
||||
@ -928,8 +927,7 @@ void KartSelectionScreen::updateKartWidgetModel(int widget_id,
|
||||
kart_model.getInverseBoneMatrix(obj.m_bone_name);
|
||||
swol = inv * obj.m_location;
|
||||
}
|
||||
w3->addModel(obj.m_model, swol, -1, -1, false, 0.0f,
|
||||
obj.m_bone_name);
|
||||
w3->addModel(obj.m_model, swol, -1, -1, 0.0f, obj.m_bone_name);
|
||||
}
|
||||
//w3->update(0);
|
||||
|
||||
|
@ -187,8 +187,8 @@ void SoccerSetupScreen::beforeAddingWidget()
|
||||
kart_model.getInverseBoneMatrix(obj.m_bone_name);
|
||||
swol = inv * obj.m_location;
|
||||
}
|
||||
kart_view->addModel(obj.m_model, swol, -1, -1,
|
||||
false/*all_parts_colorized*/, 0.0f, obj.m_bone_name);
|
||||
kart_view->addModel(obj.m_model, swol, -1, -1, 0.0f,
|
||||
obj.m_bone_name);
|
||||
}
|
||||
|
||||
kart_view->setRotateContinuously( KART_CONTINUOUS_ROTATION_SPEED );
|
||||
|
@ -69,7 +69,7 @@ void Graph::createDebugMesh()
|
||||
{
|
||||
if (getNumNodes() <= 0) return; // no debug output if not graph
|
||||
|
||||
#ifndef SERVER_ONY
|
||||
#ifndef SERVER_ONLY
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
createMeshSP(/*show_invisible*/true,
|
||||
@ -374,7 +374,7 @@ RenderTarget* Graph::makeMiniMap(const core::dimension2du &dimension,
|
||||
irr_driver->getSceneManager()
|
||||
->setAmbientLight(video::SColor(255, 255, 255, 255));
|
||||
|
||||
#ifndef SERVER_ONY
|
||||
#ifndef SERVER_ONLY
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
createMeshSP(/*show_invisible part of the track*/ false,
|
||||
|
@ -299,8 +299,14 @@ void Track::cleanup()
|
||||
Graph::destroy();
|
||||
ItemManager::destroy();
|
||||
#ifndef SERVER_ONLY
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
{
|
||||
CPUParticleManager::getInstance()->cleanMaterialMap();
|
||||
}
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
SP::resetEmptyFogColor();
|
||||
}
|
||||
ParticleKindManager::get()->cleanUpTrackSpecificGfx();
|
||||
#endif
|
||||
|
||||
@ -335,8 +341,8 @@ void Track::cleanup()
|
||||
}
|
||||
m_object_physics_only_nodes.clear();
|
||||
|
||||
irr_driver->removeNode(m_sun);
|
||||
#ifndef SERVER_ONLY
|
||||
irr_driver->removeNode(m_sun);
|
||||
if (CVS->isGLSL())
|
||||
m_sun->drop();
|
||||
#endif
|
||||
@ -410,12 +416,17 @@ void Track::cleanup()
|
||||
material_manager->popTempMaterial();
|
||||
}
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
irr_driver->clearGlowingNodes();
|
||||
irr_driver->clearLights();
|
||||
irr_driver->clearForcedBloom();
|
||||
irr_driver->clearBackgroundNodes();
|
||||
SP::SPTextureManager::get()->removeUnusedTextures();
|
||||
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
SP::SPTextureManager::get()->removeUnusedTextures();
|
||||
}
|
||||
#endif
|
||||
if(UserConfigParams::logMemory())
|
||||
{
|
||||
Log::debug("track",
|
||||
@ -1851,7 +1862,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
|
||||
glBufferSubData(GL_UNIFORM_BUFFER, 28, 4, &val);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, 0);
|
||||
}
|
||||
else
|
||||
else if (CVS->isGLSL())
|
||||
{
|
||||
SP::resetEmptyFogColor();
|
||||
}
|
||||
|
@ -349,7 +349,9 @@ bool handleContextMenuAction(s32 cmd_id)
|
||||
irr_driver->toggleBoundingBoxesViz();
|
||||
break;
|
||||
case DEBUG_GRAPHICS_TOGGLE_CULLING:
|
||||
#ifndef SERVER_ONLY
|
||||
SP::sp_culling = !SP::sp_culling;
|
||||
#endif
|
||||
break;
|
||||
case DEBUG_PROFILER:
|
||||
profiler.toggleStatus();
|
||||
|
Loading…
x
Reference in New Issue
Block a user