X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FInterpreter.cpp;h=ecbb076224e225bad82cd92017c4db9d5caa33fc;hb=0e7b9eca67383e45e04aa419cb783c92722f7801;hp=fc428cd8365e998ea37128ef23adf2ede9dbb716;hpb=8c8061a4f8b88410d6d93c039afe6affc4b69cf2;p=l2e.git diff --git a/src/loader/Interpreter.cpp b/src/loader/Interpreter.cpp index fc428cd..ecbb076 100644 --- a/src/loader/Interpreter.cpp +++ b/src/loader/Interpreter.cpp @@ -332,6 +332,7 @@ void Interpreter::ReadObject(int typeId, int id, char *object, const PropertyLis int arraySize(i->second->GetLiteral().ArraySize()); size_t memberSize = fd.IsReferenced() ? sizeof(char *) : fieldType.Size(); Array array; + array.typeId = fd.TypeId(); array.size = arraySize * memberSize; array.data = alloc.Alloc(array.size); array.ref = fd.IsReferenced(); @@ -905,6 +906,17 @@ SDL_Surface *Interpreter::GetImage(const string &path) { } } +const string &Interpreter::FindImage(SDL_Surface *img) const { + for (std::map::const_iterator + i(imageCache.begin()), end(imageCache.end()); + i != end; ++i) { + if (i->second == img) { + return i->first; + } + } + throw Error("unable to locate image"); +} + bool Interpreter::CanLink(const Value &v) const { return v.IsLiteral() || source.IsDefined(v.GetIdentifier());