cleanup and small fixes
svn-id: r25738
This commit is contained in:
parent
1bd5f9932b
commit
5886d3ed7f
6 changed files with 26 additions and 96 deletions
|
@ -28,40 +28,12 @@
|
|||
namespace Parallaction {
|
||||
|
||||
char _tokens[20][40];
|
||||
/*
|
||||
static char *_src = NULL;
|
||||
|
||||
|
||||
|
||||
void parseInit(char *s) {
|
||||
_src = s;
|
||||
}
|
||||
|
||||
char *parseNextLine(char *s, uint16 count) {
|
||||
|
||||
uint16 _si;
|
||||
char v2 = 0;
|
||||
for ( _si = 0; _si<count; _si++) {
|
||||
|
||||
v2 = *_src++;
|
||||
if (v2 == 0xA || v2 == -1) break;
|
||||
if (v2 != -1 && _si < count) s[_si] = v2;
|
||||
}
|
||||
|
||||
if (_si == 0 && v2 == -1)
|
||||
return 0;
|
||||
|
||||
s[_si] = 0xA;
|
||||
s[_si+1] = '\0';
|
||||
|
||||
return s;
|
||||
}
|
||||
*/
|
||||
LocScript::LocScript(const char* s) : _src(s) {
|
||||
Script::Script(const char* s) : _src(s) {
|
||||
|
||||
}
|
||||
|
||||
char *LocScript::readLine(char *buf, size_t bufSize) {
|
||||
char *Script::readLine(char *buf, size_t bufSize) {
|
||||
|
||||
uint16 _si;
|
||||
char v2 = 0;
|
||||
|
@ -82,24 +54,24 @@ char *LocScript::readLine(char *buf, size_t bufSize) {
|
|||
|
||||
}
|
||||
|
||||
uint32 LocScript::read(void *dataPtr, uint32 dataSize) {
|
||||
error("binary read not supported on LocScript streams");
|
||||
uint32 Script::read(void *dataPtr, uint32 dataSize) {
|
||||
error("binary read not supported on Script streams");
|
||||
}
|
||||
|
||||
bool LocScript::eos() const {
|
||||
error("EoS not supported on LocScript streams");
|
||||
bool Script::eos() const {
|
||||
error("EoS not supported on Script streams");
|
||||
}
|
||||
|
||||
uint32 LocScript::pos() const {
|
||||
error("position not supported on LocScript streams");
|
||||
uint32 Script::pos() const {
|
||||
error("position not supported on Script streams");
|
||||
}
|
||||
|
||||
uint32 LocScript::size() const {
|
||||
error("can't get size of LocScript streams");
|
||||
uint32 Script::size() const {
|
||||
error("can't get size of Script streams");
|
||||
}
|
||||
|
||||
void LocScript::seek(int32 offset, int whence) {
|
||||
error("seek not supported on LocScript streams");
|
||||
void Script::seek(int32 offset, int whence) {
|
||||
error("seek not supported on Script streams");
|
||||
}
|
||||
|
||||
// looks for next token in a string
|
||||
|
@ -199,49 +171,5 @@ uint16 fillBuffers(Common::SeekableReadStream &stream, bool errorOnEOF) {
|
|||
|
||||
return fillTokens(line);
|
||||
}
|
||||
/*
|
||||
//
|
||||
// FIXME
|
||||
// this function does the same Job as fillBuffers, except that
|
||||
// it gets input from a SeekableStream instead of a memory buffer
|
||||
//
|
||||
uint16 tableFillBuffers(Common::SeekableReadStream &stream) {
|
||||
|
||||
clearTokens();
|
||||
|
||||
char buf[200];
|
||||
char *line = NULL;
|
||||
do {
|
||||
line = stream.readLine(buf, 200);
|
||||
if (line == NULL) {
|
||||
return 0;
|
||||
}
|
||||
line = Common::ltrim(line);
|
||||
} while (strlen(line) == 0 || line[0] == '#');
|
||||
|
||||
return fillTokens(line);
|
||||
}
|
||||
|
||||
|
||||
// FIXME
|
||||
// this function does the same Job as fillBuffers, except that
|
||||
// it gets input from an ArchivedFile instead of a memory buffer
|
||||
//
|
||||
uint16 scriptFillBuffers(ArchivedFile *file) {
|
||||
|
||||
clearTokens();
|
||||
|
||||
char buf[200];
|
||||
char *line = NULL;
|
||||
do {
|
||||
line = readArchivedFileText(buf, 200, file);
|
||||
if (line == NULL) {
|
||||
return 0;
|
||||
}
|
||||
line = Common::ltrim(line);
|
||||
} while (strlen(line) == 0 || line[0] == '#');
|
||||
|
||||
return fillTokens(line);
|
||||
}
|
||||
*/
|
||||
} // namespace Parallaction
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue