mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-02 17:03:13 +00:00
DREAMWEB: implemented openfile
This commit is contained in:
parent
1494cdb295
commit
9a1575b9d5
@ -133,6 +133,15 @@ Common::Error DreamWebEngine::run() {
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
void DreamWebEngine::openFile(const Common::String &name) {
|
||||
if (_file.isOpen()) {
|
||||
_file.close();
|
||||
}
|
||||
if (!_file.open(name))
|
||||
error("cannot open file %s", name.c_str());
|
||||
}
|
||||
|
||||
|
||||
} // End of namespace DreamWeb
|
||||
|
||||
|
||||
@ -194,9 +203,11 @@ void openfile(Context &context) {
|
||||
uint16 name_ptr = context.dx;
|
||||
Common::String name;
|
||||
uint8 c;
|
||||
while((c = context.data.byte(name_ptr++)) != 0)
|
||||
while((c = context.cs.byte(name_ptr++)) != 0)
|
||||
name += (char)c;
|
||||
debug(1, "opening file: %s", name.c_str());
|
||||
context.cs.word(kHandle) = 1; //only one handle
|
||||
context.flags._c = false;
|
||||
}
|
||||
|
||||
void createfile(Context &context) {
|
||||
|
@ -26,10 +26,11 @@
|
||||
#ifndef DREAMWEB_H
|
||||
#define DREAMWEB_H
|
||||
|
||||
#include "common/scummsys.h"
|
||||
#include "common/error.h"
|
||||
#include "common/file.h"
|
||||
#include "common/random.h"
|
||||
#include "common/rect.h"
|
||||
#include "common/error.h"
|
||||
#include "common/scummsys.h"
|
||||
|
||||
#include "engines/engine.h"
|
||||
#include "dreamweb/console.h"
|
||||
@ -76,10 +77,14 @@ public:
|
||||
//dreamgen public api:
|
||||
uint8 randomNumber() { return _rnd.getRandomNumber(255); }
|
||||
|
||||
void openFile(const Common::String &name);
|
||||
|
||||
private:
|
||||
const DreamWebGameDescription *_gameDescription;
|
||||
Common::RandomSource _rnd;
|
||||
Common::Point _mouse;
|
||||
|
||||
Common::File _file;
|
||||
};
|
||||
|
||||
} // End of namespace DreamWeb
|
||||
|
Loading…
x
Reference in New Issue
Block a user