summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-06-09 18:42:24 -0700
committerPixel <pixel@nobis-crew.org>2009-06-09 18:42:24 -0700
commit07c79ea1a1b015c8c8f5ea4bb4b8b5c2aaf6f4b9 (patch)
treebe8dcacf3c17c7536b0f923c42135dd82ce6d11d /lib
parent2f6b22ede60a89cced23d499cd77413b9301a16d (diff)
Adding dvdmode to the dirtree object.
Diffstat (limited to 'lib')
-rw-r--r--lib/isobuilder.cpp12
-rw-r--r--lib/luacd.cpp9
2 files changed, 15 insertions, 6 deletions
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;