diff options
author | Pixel <pixel@nobis-crew.org> | 2009-06-09 18:42:24 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-06-09 18:42:24 -0700 |
commit | 07c79ea1a1b015c8c8f5ea4bb4b8b5c2aaf6f4b9 (patch) | |
tree | be8dcacf3c17c7536b0f923c42135dd82ce6d11d | |
parent | 2f6b22ede60a89cced23d499cd77413b9301a16d (diff) |
Adding dvdmode to the dirtree object.
-rw-r--r-- | includes/isobuilder.h | 2 | ||||
-rw-r--r-- | lib/isobuilder.cpp | 12 | ||||
-rw-r--r-- | lib/luacd.cpp | 9 |
3 files changed, 17 insertions, 6 deletions
diff --git a/includes/isobuilder.h b/includes/isobuilder.h index 16a3a4d..88ab91a 100644 --- a/includes/isobuilder.h +++ b/includes/isobuilder.h @@ -63,12 +63,14 @@ class isobuilder : public Base { DirTree * Child(); DirTree * Brother(); DirTree * Find(const String &); + void setdvdmode(); private: int buildpath_r(int * n, Byte * data, int size, int current_level, int level_to_dump, bool bigendian) throw (GeneralException); int maxlevel(int current_level = 1); DirTree * father, * child, * brother; bool dir; int node; + bool dvdmode; }; isobuilder(Handle * w, int mode = MODE2_FORM1); ~isobuilder(); diff --git a/lib/isobuilder.cpp b/lib/isobuilder.cpp index 9bec34c..d3d9e1b 100644 --- a/lib/isobuilder.cpp +++ b/lib/isobuilder.cpp @@ -88,6 +88,8 @@ isobuilder::DirTree::DirTree(isobuilder::DirTree * _father, bool _dir) : mode(-1 if (!father) return; + + dvdmode = father->dvdmode; creation = father->creation; @@ -99,6 +101,10 @@ isobuilder::DirTree::DirTree(isobuilder::DirTree * _father, bool _dir) : mode(-1 } } +isobuilder::DirTree::setdvdmode() { + dvdmode = true; +} + isobuilder::DirTree::~DirTree() { while (child) { delete child; @@ -266,10 +272,6 @@ int isobuilder::DirTree::buildentry(Byte * buffer, int spaceleft, bool put_xa) { memset(pbuf, 0, 256); - if (name == "BM2.ELF") { - printm(M_INFO, "GRON"); - } - if (name == ".") { N = 1; pbuf[0] = 0; @@ -279,7 +281,7 @@ int isobuilder::DirTree::buildentry(Byte * buffer, int spaceleft, bool put_xa) { } else { strcpy(pbuf, name.to_charp()); N = name.strlen(); - if (!dir) { + if ((!dir) && !dvdmode) { N += 2; strcat(pbuf, ";1"); } diff --git a/lib/luacd.cpp b/lib/luacd.cpp index 881f5ae..6855b9a 100644 --- a/lib/luacd.cpp +++ b/lib/luacd.cpp @@ -1126,6 +1126,7 @@ enum DirTree_methods_t { DIRTREE_FROMDIR, DIRTREE_SETBASICSXA, DIRTREE_FIND, + DIRTREE_SETDVDMODE, }; enum DirTree_functions_t { @@ -1136,8 +1137,9 @@ struct lua_functypes_t DirTree_methods[] = { { DIRTREE_INDEX, "index", 1, 1, { BLUA_STRING } }, { DIRTREE_NEWINDEX, "newindex", 2, 2, { BLUA_STRING, BLUA_ANY } }, { DIRTREE_FROMDIR, "fromdir", 1, 1, { BLUA_OBJECT } }, - { DIRTREE_SETBASICSXA, "setbasicsxa", 0, 0, 0 }, + { DIRTREE_SETBASICSXA, "setbasicsxa", 0, 0, { } }, { DIRTREE_FIND, "find", 1, 1, { BLUA_STRING } }, + { DIRTREE_SETDVDMODE, "setdvdmode", 0, 0, { } }, { -1, 0, 0, 0, 0 } }; @@ -1153,6 +1155,7 @@ class sLua_DirTree : public Base { DECLARE_METHOD(DirTree, DIRTREE_FROMDIR); DECLARE_METHOD(DirTree, DIRTREE_SETBASICSXA); DECLARE_METHOD(DirTree, DIRTREE_FIND); + DECLARE_METHOD(DirTree, DIRTREE_SETDVDMODE); DECLARE_FUNCTION(DirTree, DIRTREE_NEWDIRTREE); private: @@ -1169,6 +1172,7 @@ void LuaDirTree::pushmembers(Lua * L) { PUSH_METHOD(DirTree, DIRTREE_FROMDIR); PUSH_METHOD(DirTree, DIRTREE_SETBASICSXA); PUSH_METHOD(DirTree, DIRTREE_FIND); + PUSH_METHOD(DirTree, DIRTREE_SETDVDMODE); } void LuaDirTree::pushstatics(Lua * L) throw (GeneralException) { @@ -1204,6 +1208,9 @@ int sLua_DirTree::DirTree_proceed(Lua * L, int n, DirTree * dir, int caller) { L->push(); } break; + case DIRTREE_SETDVDMODE: + dir->setdvdmode(); + break; case DIRTREE_INDEX: key = L->tostring(2); r = 1; |