summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-06-04 21:48:47 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-06-04 21:48:47 +0000
commita353543dd4da3c489a84f6f17125fdd0e1be2349 (patch)
tree5e447a0f9a3fd50f58a48f39bbb77d392d78af36 /src/game.cpp
parentab072dddb231895ba7b6762eda9fa70af961b0fb (diff)
downloadmana-a353543dd4da3c489a84f6f17125fdd0e1be2349.tar.gz
mana-a353543dd4da3c489a84f6f17125fdd0e1be2349.tar.bz2
mana-a353543dd4da3c489a84f6f17125fdd0e1be2349.tar.xz
mana-a353543dd4da3c489a84f6f17125fdd0e1be2349.zip
Merged 0.0 changes from revision 3234 to 3317 to trunk.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp
index ba4e2b9d..1afc530b 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -41,6 +41,7 @@
#include "localplayer.h"
#include "log.h"
#include "npc.h"
+#include "particle.h"
#include "gui/buy.h"
#include "gui/buysell.h"
@@ -121,6 +122,8 @@ BeingManager *beingManager = NULL;
FloorItemManager *floorItemManager = NULL;
ChannelManager *channelManager = NULL;
+Particle *particleEngine = NULL;
+
const int MAX_TIME = 10000;
/**
@@ -242,6 +245,9 @@ Game::Game():
floorItemManager = new FloorItemManager();
channelManager = new ChannelManager();
+ particleEngine = new Particle(NULL);
+ particleEngine->setupEngine();
+
// Initialize timers
tick_time = 0;
mLogicCounterId = SDL_AddTimer(10, nextTick, NULL); //Logic counter
@@ -286,6 +292,7 @@ Game::~Game()
delete floorItemManager;
delete channelManager;
delete joystick;
+ delete particleEngine;
beingManager = NULL;
floorItemManager = NULL;
@@ -308,7 +315,9 @@ bool saveScreenshot(SDL_Surface *screenshot)
screenshotCount++;
filename.str("");
#if (defined __USE_UNIX98 || defined __FreeBSD__ || defined __APPLE__)
- filename << PHYSFS_getUserDir() << "/";
+ filename << PHYSFS_getUserDir() << ".tmw/";
+#elif defined __APPLE__
+ filename << PHYSFS_getUserDir() << "Desktop/";
#endif
filename << "TMW_Screenshot_" << screenshotCount << ".png";
testExists.open(filename.str().c_str(), std::ios::in);
@@ -316,7 +325,18 @@ bool saveScreenshot(SDL_Surface *screenshot)
testExists.close();
} while (!found);
- return ImageWriter::writePNG(screenshot, filename.str());
+ if (ImageWriter::writePNG(screenshot, filename.str()))
+ {
+ std::stringstream chatlogentry;
+ chatlogentry << "Screenshot saved to " << filename.str().c_str();
+ chatWindow->chatLog(chatlogentry.str(), BY_SERVER);
+ return true;
+ }
+ else
+ {
+ chatWindow->chatLog("Saving screenshot failed!", BY_SERVER);
+ return false;
+ }
}
void Game::optionChanged(const std::string &name)