mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
Some set objects (eg, 'al') do not have ZBuffers.
This commit is contained in:
parent
7fe43e09c2
commit
c6e192d37b
10
scene.cpp
10
scene.cpp
@ -130,8 +130,14 @@ void Scene::Setup::load(TextSplitter &ts) {
|
||||
|
||||
ts.scanString(" background %256s", 1, buf);
|
||||
bkgnd_bm_ = ResourceLoader::instance()->loadBitmap(buf);
|
||||
ts.scanString(" zbuffer %256s", 1, buf);
|
||||
bkgnd_zbm_ = ResourceLoader::instance()->loadBitmap(buf);
|
||||
|
||||
// ZBuffer is optional
|
||||
if (!ts.checkString("zbuffer")) {
|
||||
bkgnd_zbm_ = NULL;
|
||||
} else {
|
||||
ts.scanString(" zbuffer %256s", 1, buf);
|
||||
bkgnd_zbm_ = ResourceLoader::instance()->loadBitmap(buf);
|
||||
}
|
||||
|
||||
ts.scanString(" position %f %f %f", 3, &pos_.x(), &pos_.y(), &pos_.z());
|
||||
ts.scanString(" interest %f %f %f", 3, &interest_.x(), &interest_.y(),
|
||||
|
@ -50,6 +50,13 @@ TextSplitter::TextSplitter(const char *data, int len) {
|
||||
processLine();
|
||||
}
|
||||
|
||||
bool TextSplitter::checkString(const char *needle) {
|
||||
if (std::strstr(currentLine(), needle))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void TextSplitter::expectString(const char *expected) {
|
||||
if (eof())
|
||||
error("Expected `%s', got EOF\n", expected);
|
||||
|
@ -38,6 +38,9 @@ public:
|
||||
const char *currentLine() const { return curr_line_; }
|
||||
bool eof() const { return curr_line_ == NULL; }
|
||||
|
||||
// Check if the current line contains 'needle'
|
||||
bool TextSplitter::checkString(const char *needle);
|
||||
|
||||
// Expect a certain fixed string; bail out with an error if not
|
||||
// found. Advance to the next line.
|
||||
void expectString(const char *expected);
|
||||
|
Loading…
Reference in New Issue
Block a user