aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/tools/classes.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2009-02-15 11:39:07 +0000
committerEugene Sandulenko2009-02-15 11:39:07 +0000
commite241843bec22600ab4ef98e7a085e82aac73fc93 (patch)
tree61a793884d3462e1feb80e80f202d8816d0c8ec4 /engines/sci/tools/classes.cpp
parente9f742806362a84ffdb176a7414318dd2ab4df89 (diff)
downloadscummvm-rg350-e241843bec22600ab4ef98e7a085e82aac73fc93.tar.gz
scummvm-rg350-e241843bec22600ab4ef98e7a085e82aac73fc93.tar.bz2
scummvm-rg350-e241843bec22600ab4ef98e7a085e82aac73fc93.zip
- Remove some unneeded files
- Mass rename .c to .cpp svn-id: r38227
Diffstat (limited to 'engines/sci/tools/classes.cpp')
-rw-r--r--engines/sci/tools/classes.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/engines/sci/tools/classes.cpp b/engines/sci/tools/classes.cpp
new file mode 100644
index 0000000000..cdb8c93f9f
--- /dev/null
+++ b/engines/sci/tools/classes.cpp
@@ -0,0 +1,54 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <engine.h>
+#include <vocabulary.h>
+
+int main(int argc, char** argv)
+{
+ int res;
+ int sizes[1000];
+ int altsizes[1000];
+ int count, *classes;
+ loadResources(SCI_VERSION_AUTODETECT, 1);
+
+ for(res=0; res<1000; res++)
+ {
+ resource_t* r;
+ int i=0;
+
+ sizes[res]=-1;
+
+ if((r=findResource(sci_script, res))==0) continue;
+ sizes[res]=0;
+ altsizes[res]=0;
+ i+=2;
+ i=getInt16(r->data+i);
+
+ while(i<r->length-2)
+ {
+ switch(getInt16(r->data+i))
+ {
+ case 1:
+ case 6: sizes[res]++;
+ break;
+ default: altsizes[res]++;
+ }
+ i+=getInt16(r->data+i+2);
+ }
+ fflush(stdout);
+ }
+
+ for(res=0; res<1000; res++) if(sizes[res]!=-1) printf("%03d %d\n", res, sizes[res]);
+ printf("\n");
+
+ classes=vocabulary_get_classes(&count);
+ for(res=0; res<count; res++)
+ {
+ printf("%03d %d (%d)\n", classes[res],
+ sizes[classes[res]]--, altsizes[classes[res]]);
+ }
+
+ freeResources();
+ return 0;
+}