mirror of
https://github.com/glest/glest-source.git
synced 2025-08-17 13:50:43 +02:00
bugfixes to correct segfault
This commit is contained in:
@@ -26,7 +26,7 @@ using namespace Shared::Platform;
|
|||||||
namespace Glest{ namespace Game{
|
namespace Glest{ namespace Game{
|
||||||
|
|
||||||
const string mailString= "contact_game@glest.org";
|
const string mailString= "contact_game@glest.org";
|
||||||
const string glestVersionString= "v3.3.5-beta7.2";
|
const string glestVersionString= "v3.3.5-beta7.3";
|
||||||
|
|
||||||
string getCrashDumpFileName(){
|
string getCrashDumpFileName(){
|
||||||
return "glest" + glestVersionString + ".dmp";
|
return "glest" + glestVersionString + ".dmp";
|
||||||
|
@@ -48,7 +48,6 @@ Game::Game(Program *program, const GameSettings *gameSettings):
|
|||||||
{
|
{
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
sdlEventsThread = NULL;
|
|
||||||
originalDisplayMsgCallback = NULL;
|
originalDisplayMsgCallback = NULL;
|
||||||
thisGamePtr = this;
|
thisGamePtr = this;
|
||||||
|
|
||||||
@@ -80,10 +79,6 @@ Game::Game(Program *program, const GameSettings *gameSettings):
|
|||||||
Game::~Game(){
|
Game::~Game(){
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
BaseThread::shutdownAndWait(sdlEventsThread);
|
|
||||||
delete sdlEventsThread;
|
|
||||||
sdlEventsThread = NULL;
|
|
||||||
|
|
||||||
Logger &logger= Logger::getInstance();
|
Logger &logger= Logger::getInstance();
|
||||||
Renderer &renderer= Renderer::getInstance();
|
Renderer &renderer= Renderer::getInstance();
|
||||||
|
|
||||||
@@ -130,9 +125,6 @@ void Game::load(){
|
|||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] gameSettings = [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->gameSettings.toString().c_str());
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] gameSettings = [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->gameSettings.toString().c_str());
|
||||||
|
|
||||||
sdlEventsThread = new PumpSDLEventsTaskThread();
|
|
||||||
sdlEventsThread->start();
|
|
||||||
|
|
||||||
Logger &logger= Logger::getInstance();
|
Logger &logger= Logger::getInstance();
|
||||||
string mapName= gameSettings.getMap();
|
string mapName= gameSettings.getMap();
|
||||||
string tilesetName= gameSettings.getTileset();
|
string tilesetName= gameSettings.getTileset();
|
||||||
@@ -440,12 +432,6 @@ void Game::init()
|
|||||||
|
|
||||||
logger.add("Launching game");
|
logger.add("Launching game");
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n\n\n=-=-=-=-=-=-=-=-=-=-= STARTING GAME =-=-=-=-=-=-=-=-=-=-=\n\n",__FILE__,__FUNCTION__,__LINE__);
|
|
||||||
|
|
||||||
BaseThread::shutdownAndWait(sdlEventsThread);
|
|
||||||
delete sdlEventsThread;
|
|
||||||
sdlEventsThread = NULL;
|
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1210,7 +1196,8 @@ void Game::render2d(){
|
|||||||
SurfaceCell *sc= map->getSurfaceCell(mapPos.x, mapPos.y);
|
SurfaceCell *sc= map->getSurfaceCell(mapPos.x, mapPos.y);
|
||||||
Object *o= sc->getObject();
|
Object *o= sc->getObject();
|
||||||
bool isExplored = (sc->isExplored(thisTeamIndex) && o!=NULL);
|
bool isExplored = (sc->isExplored(thisTeamIndex) && o!=NULL);
|
||||||
bool isVisible = (sc->isVisible(thisTeamIndex) && o!=NULL);
|
//bool isVisible = (sc->isVisible(thisTeamIndex) && o!=NULL);
|
||||||
|
bool isVisible = true;
|
||||||
if(isExplored == true && isVisible == true) {
|
if(isExplored == true && isVisible == true) {
|
||||||
visibleObjectCount++;
|
visibleObjectCount++;
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
#include "chat_manager.h"
|
#include "chat_manager.h"
|
||||||
#include "script_manager.h"
|
#include "script_manager.h"
|
||||||
#include "game_settings.h"
|
#include "game_settings.h"
|
||||||
#include "simple_threads.h"
|
//#include "simple_threads.h"
|
||||||
#include "network_interface.h"
|
#include "network_interface.h"
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
@@ -84,8 +84,6 @@ private:
|
|||||||
time_t lastRenderLog2d;
|
time_t lastRenderLog2d;
|
||||||
DisplayMessageFunction originalDisplayMsgCallback;
|
DisplayMessageFunction originalDisplayMsgCallback;
|
||||||
|
|
||||||
PumpSDLEventsTaskThread *sdlEventsThread;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Game(Program *program, const GameSettings *gameSettings);
|
Game(Program *program, const GameSettings *gameSettings);
|
||||||
~Game();
|
~Game();
|
||||||
|
@@ -1304,7 +1304,9 @@ void Renderer::renderObjects(const int renderFps, const int worldFrameCount) {
|
|||||||
SurfaceCell *sc= map->getSurfaceCell(mapPos.x, mapPos.y);
|
SurfaceCell *sc= map->getSurfaceCell(mapPos.x, mapPos.y);
|
||||||
Object *o= sc->getObject();
|
Object *o= sc->getObject();
|
||||||
bool isExplored = (sc->isExplored(thisTeamIndex) && o!=NULL);
|
bool isExplored = (sc->isExplored(thisTeamIndex) && o!=NULL);
|
||||||
bool isVisible = (sc->isVisible(thisTeamIndex) && o!=NULL);
|
//bool isVisible = (sc->isVisible(thisTeamIndex) && o!=NULL);
|
||||||
|
bool isVisible = true;
|
||||||
|
|
||||||
if(isExplored == true && isVisible == true) {
|
if(isExplored == true && isVisible == true) {
|
||||||
/*
|
/*
|
||||||
if(renderFps >= 0 && renderFps < MIN_RENDER_FPS_ALLOWED) {
|
if(renderFps >= 0 && renderFps < MIN_RENDER_FPS_ALLOWED) {
|
||||||
@@ -2826,7 +2828,8 @@ void Renderer::renderObjectsFast() {
|
|||||||
SurfaceCell *sc= map->getSurfaceCell(mapPos);
|
SurfaceCell *sc= map->getSurfaceCell(mapPos);
|
||||||
Object *o= sc->getObject();
|
Object *o= sc->getObject();
|
||||||
bool isExplored = (sc->isExplored(thisTeamIndex) && o!=NULL);
|
bool isExplored = (sc->isExplored(thisTeamIndex) && o!=NULL);
|
||||||
bool isVisible = (sc->isVisible(thisTeamIndex) && o!=NULL);
|
//bool isVisible = (sc->isVisible(thisTeamIndex) && o!=NULL);
|
||||||
|
bool isVisible = true;
|
||||||
|
|
||||||
if(isExplored == true && isVisible == true) {
|
if(isExplored == true && isVisible == true) {
|
||||||
const Model *objModel= sc->getObject()->getModel();
|
const Model *objModel= sc->getObject()->getModel();
|
||||||
|
@@ -71,13 +71,6 @@ public:
|
|||||||
bool getTaskSignalled();
|
bool getTaskSignalled();
|
||||||
};
|
};
|
||||||
|
|
||||||
class PumpSDLEventsTaskThread : public BaseThread
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
PumpSDLEventsTaskThread();
|
|
||||||
virtual void execute();
|
|
||||||
};
|
|
||||||
|
|
||||||
}}//end namespace
|
}}//end namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -155,37 +155,4 @@ bool SimpleTaskThread::getTaskSignalled() {
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
PumpSDLEventsTaskThread::PumpSDLEventsTaskThread() : BaseThread() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void PumpSDLEventsTaskThread::execute() {
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
|
||||||
|
|
||||||
setRunningStatus(true);
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"SDL_PumpEvents thread is running\n");
|
|
||||||
|
|
||||||
try {
|
|
||||||
for(;getQuitStatus() == false;) {
|
|
||||||
SDL_PumpEvents();
|
|
||||||
sleep(25);
|
|
||||||
}
|
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch(const exception &ex) {
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] error [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
|
|
||||||
setRunningStatus(false);
|
|
||||||
}
|
|
||||||
catch(...) {
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] unknown error\n",__FILE__,__FUNCTION__,__LINE__);
|
|
||||||
setRunningStatus(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
setRunningStatus(false);
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"SDL_PumpEvents thread is exiting\n");
|
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
|
||||||
}
|
|
||||||
|
|
||||||
}}//end namespace
|
}}//end namespace
|
||||||
|
Reference in New Issue
Block a user