Fixed some crashes
This commit is contained in:
parent
b5e4275f87
commit
ecc5aaf869
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "config/user_config.hpp"
|
#include "config/user_config.hpp"
|
||||||
#include "graphics/irr_driver.hpp"
|
#include "graphics/irr_driver.hpp"
|
||||||
|
#include "modes/profile_world.hpp"
|
||||||
#include "utils/log.hpp"
|
#include "utils/log.hpp"
|
||||||
#include "utils/progress_bar_android.hpp"
|
#include "utils/progress_bar_android.hpp"
|
||||||
|
|
||||||
@ -48,6 +49,9 @@ ProgressBarAndroid::~ProgressBarAndroid()
|
|||||||
bool ProgressBarAndroid::compileShaders()
|
bool ProgressBarAndroid::compileShaders()
|
||||||
{
|
{
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
|
if (ProfileWorld::isNoGraphics())
|
||||||
|
return false;
|
||||||
|
|
||||||
const GLchar* vsh =
|
const GLchar* vsh =
|
||||||
"precision mediump float;"
|
"precision mediump float;"
|
||||||
"attribute vec2 position;"
|
"attribute vec2 position;"
|
||||||
@ -123,6 +127,9 @@ bool ProgressBarAndroid::compileShaders()
|
|||||||
void ProgressBarAndroid::deleteShaders()
|
void ProgressBarAndroid::deleteShaders()
|
||||||
{
|
{
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
|
if (ProfileWorld::isNoGraphics())
|
||||||
|
return;
|
||||||
|
|
||||||
glDeleteShader(m_vertex_shader);
|
glDeleteShader(m_vertex_shader);
|
||||||
glDeleteShader(m_fragment_shader);
|
glDeleteShader(m_fragment_shader);
|
||||||
glDeleteProgram(m_program);
|
glDeleteProgram(m_program);
|
||||||
@ -132,6 +139,9 @@ void ProgressBarAndroid::deleteShaders()
|
|||||||
void ProgressBarAndroid::init()
|
void ProgressBarAndroid::init()
|
||||||
{
|
{
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
|
if (ProfileWorld::isNoGraphics())
|
||||||
|
return;
|
||||||
|
|
||||||
SIrrlichtCreationParameters params;
|
SIrrlichtCreationParameters params;
|
||||||
params.DriverType = video::EDT_OGLES2;
|
params.DriverType = video::EDT_OGLES2;
|
||||||
params.Bits = 32;
|
params.Bits = 32;
|
||||||
@ -175,6 +185,9 @@ void ProgressBarAndroid::init()
|
|||||||
void ProgressBarAndroid::close()
|
void ProgressBarAndroid::close()
|
||||||
{
|
{
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
|
if (ProfileWorld::isNoGraphics())
|
||||||
|
return;
|
||||||
|
|
||||||
glDisableVertexAttribArray(m_position);
|
glDisableVertexAttribArray(m_position);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
glUseProgram(0);
|
glUseProgram(0);
|
||||||
@ -197,6 +210,9 @@ void ProgressBarAndroid::close()
|
|||||||
void ProgressBarAndroid::draw(float value)
|
void ProgressBarAndroid::draw(float value)
|
||||||
{
|
{
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
|
if (ProfileWorld::isNoGraphics())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!m_initialized || m_close_event_received)
|
if (!m_initialized || m_close_event_received)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ bool SeparateProcess::createChildProcess(const std::string& exe,
|
|||||||
argv.push_back(const_cast<char*>(parent_pid.c_str()));
|
argv.push_back(const_cast<char*>(parent_pid.c_str()));
|
||||||
|
|
||||||
Log::info("SeparateProcess", "Starting main()");
|
Log::info("SeparateProcess", "Starting main()");
|
||||||
std::thread child_process(main_proc, argv.size(), &argv[0]);
|
m_child_thread = std::thread(main_proc, argv.size(), &argv[0]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user