PrpPack does not work for MOUL files

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

PrpPack does not work for MOUL files

Postby diafero » Sat Jul 04, 2009 2:11 am

I just tried to use PrpPack to extract a MOUL prp file ("Ercana_District_Canyon.prp") and it did not work: After running for about a minute, the application canceled with the following error:

terminate called after throwing an instance of 'hsFileWriteException'
what(): Error writing to file
Aborted
(that message should really say which file it tried to open)

The only file which got created in Ercana_Canyon_PRP is called "[0001].po" and has a size of about 330MiB, MUCH bigger than the prp file (which is about 4,5MiB). Extracting a TPOTS file works great. The same MOUL file can without problems be opened in PageEditor.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: PrpPack does not work for MOUL files

Postby diafero » Sat Jul 04, 2009 2:26 am

Ok, I got it working :)
Here is the patch:

Code: Select all
From a2848d921c8476230e7b8319911ca5f0bfa8d2ce Mon Sep 17 00:00:00 2001
From: diafero <diafero@arcor.de>
Date: Sat, 4 Jul 2009 11:25:23 +0200
Subject: [PATCH] fix reading MOUL files in PrpPack

---
 Tools/src/PrpPack.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Tools/src/PrpPack.cpp b/Tools/src/PrpPack.cpp
index b48fd20..be0187a 100644
--- a/Tools/src/PrpPack.cpp
+++ b/Tools/src/PrpPack.cpp
@@ -157,7 +157,7 @@ int main(int argc, char** argv) {
       #endif
         for (i=0; i<tCount; i++) {
             short type = S->readShort();
-            if (S->getVer() == pvEoa || S->getVer() == pvHex) {
+            if (S->getVer() >= pvLive) {
                 S->readInt();
                 unsigned char b = S->readByte();
                 if (b != 0)
--
1.6.0.4


That really makes me wonder why you duplicate some code between here and the resource manager...
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: PrpPack does not work for MOUL files

Postby Zrax » Sun Jul 05, 2009 1:38 am

Thanks, I must have forgotten this one when I added MOUL support and changed the way Plasma versions are defined (I recognize that change between those two tests and >= pvLive :P)... In any case, I applied your patch, and it's on SVN and the Windows build now. Thanks!

Regarding the ResManager thing: The way that PrpPack works, it can't use the ResManager directly. It's the only tool that directly manipulates PRP objects WITHOUT trying to parse them, and using the ResManager would cause those objects to be parsed. Granted, PrpPack was also written before hsKeyedObjectStub was introduced, so it might be possible to rewrite it better now. However, since it works fine already (plus your patch), and since prpmod is probably better for individual object manipulation, I don't know that I'll ever end up rewriting it unless I get really bored someday ;).
User avatar
Zrax
 
Posts: 206
Joined: Fri Sep 28, 2007 5:19 pm
Location: Waist-deep in a conecano

Re: PrpPack does not work for MOUL files

Postby diafero » Sun Jul 05, 2009 2:26 am

Thanks for applying.

Yeah, being too lazy for a re-write which does not bring anything but reducing the amount of code... I know that :lol:
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany


Return to Plasma Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron