~ubuntu-branches/debian/jessie/scummvm/jessie

« back to all changes in this revision

Viewing changes to engines/draci/draci.cpp

  • Committer: Package Import Robot
  • Author(s): Moritz Muehlenhoff
  • Date: 2011-11-05 10:29:43 UTC
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: package-import@ubuntu.com-20111105102943-zfm3dhlvy5b01u7v
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * along with this program; if not, write to the Free Software
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
20
 *
21
 
 * $URL$
22
 
 * $Id$
23
 
 *
24
21
 */
25
22
 
26
23
#include "common/scummsys.h"
30
27
#include "common/events.h"
31
28
#include "common/file.h"
32
29
#include "common/keyboard.h"
33
 
#include "common/EventRecorder.h"
34
30
 
35
31
#include "engines/util.h"
36
32
 
74
70
const uint kDubbingFrequency = 22050;
75
71
 
76
72
DraciEngine::DraciEngine(OSystem *syst, const ADGameDescription *gameDesc)
77
 
 : Engine(syst) {
 
73
 : Engine(syst), _rnd("draci") {
 
74
 
78
75
        // Put your engine in a sane state, but do nothing big yet;
79
76
        // in particular, do not load data from files; rather, if you
80
77
        // need to do such things, do them from init().
95
92
        DebugMan.addDebugChannel(kDraciWalkingDebugLevel, "walking", "Walking debug info");
96
93
 
97
94
        _console = new DraciConsole(this);
98
 
 
99
 
        // Don't forget to register your random source
100
 
        g_eventRec.registerRandomSource(_rnd, "draci");
101
95
}
102
96
 
103
97
bool DraciEngine::hasFeature(EngineFeature f) const {
445
439
        _music->syncVolume();
446
440
}
447
441
 
448
 
const char *DraciEngine::getSavegameFile(int saveGameIdx) {
449
 
        static char buffer[20];
450
 
        sprintf(buffer, "draci.s%02d", saveGameIdx);
451
 
        return buffer;
 
442
Common::String DraciEngine::getSavegameFile(int saveGameIdx) {
 
443
        return Common::String::format("draci.s%02d", saveGameIdx);
452
444
}
453
445
 
454
446
Common::Error DraciEngine::loadGameState(int slot) {
469
461
                (_game->getLoopSubstatus() == kOuterLoop);
470
462
}
471
463
 
472
 
Common::Error DraciEngine::saveGameState(int slot, const char *desc) {
 
464
Common::Error DraciEngine::saveGameState(int slot, const Common::String &desc) {
473
465
        return saveSavegameData(slot, desc, *this);
474
466
}
475
467