From 816b362f12754ea460efd0d1fa69c2b38ac59175 Mon Sep 17 00:00:00 2001 From: meep-eep Date: Sun, 20 Nov 2005 05:56:46 +0000 Subject: [PATCH] Replaced binary resource index files by textual ones. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2003 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/content/androsyn.lst | 16 + sc2/content/androsyn.shp | Bin 348 -> 0 bytes sc2/content/arilou.con | Bin 155 -> 0 bytes sc2/content/arilou.lst | 13 + sc2/content/arilou.shp | Bin 301 -> 0 bytes sc2/content/blackur.con | Bin 156 -> 0 bytes sc2/content/blackurq.lst | 16 + sc2/content/blackurq.shp | Bin 348 -> 0 bytes sc2/content/chenjesu.lst | 16 + sc2/content/chenjesu.shp | Bin 348 -> 0 bytes sc2/content/chmmr.con | Bin 169 -> 0 bytes sc2/content/chmmr.lst | 16 + sc2/content/chmmr.shp | Bin 345 -> 0 bytes sc2/content/comandr.con | Bin 223 -> 0 bytes sc2/content/comm/arilou.lst | 4 + sc2/content/comm/blackur.lst | 4 + sc2/content/comm/chmmr.lst | 5 + sc2/content/comm/comandr.lst | 6 + sc2/content/comm/druuge.lst | 4 + sc2/content/comm/ilwrath.lst | 4 + sc2/content/comm/melnorm.lst | 5 + sc2/content/comm/mycon.lst | 4 + sc2/content/comm/orz.lst | 5 + sc2/content/comm/pkunk.lst | 4 + sc2/content/comm/shofixt.lst | 4 + sc2/content/comm/slyhome.lst | 5 + sc2/content/comm/slyland.lst | 4 + sc2/content/comm/spathi.lst | 7 + sc2/content/comm/supox.lst | 4 + sc2/content/comm/syreen.lst | 5 + sc2/content/comm/talkpet.lst | 5 + sc2/content/comm/thradd.lst | 4 + sc2/content/comm/umgah.lst | 4 + sc2/content/comm/urquan.lst | 4 + sc2/content/comm/utwig.lst | 4 + sc2/content/comm/vux.lst | 5 + sc2/content/comm/yehat.lst | 5 + sc2/content/comm/zoqfot.lst | 4 + sc2/content/druuge.con | Bin 155 -> 0 bytes sc2/content/druuge.lst | 13 + sc2/content/druuge.shp | Bin 301 -> 0 bytes sc2/content/human.lst | 13 + sc2/content/human.shp | Bin 300 -> 0 bytes sc2/content/ilwrath.con | Bin 156 -> 0 bytes sc2/content/ilwrath.lst | 13 + sc2/content/ilwrath.shp | Bin 302 -> 0 bytes sc2/content/lastbat.lst | 12 + sc2/content/lastbat.sc2 | Bin 287 -> 0 bytes sc2/content/melnorm.con | Bin 171 -> 0 bytes sc2/content/melnorme.lst | 16 + sc2/content/melnorme.shp | Bin 348 -> 0 bytes sc2/content/mmrnmhrm.lst | 16 + sc2/content/mmrnmhrm.shp | Bin 348 -> 0 bytes sc2/content/mycon.con | Bin 154 -> 0 bytes sc2/content/mycon.lst | 13 + sc2/content/mycon.shp | Bin 300 -> 0 bytes sc2/content/orz.con | Bin 167 -> 0 bytes sc2/content/orz.lst | 16 + sc2/content/orz.shp | Bin 343 -> 0 bytes sc2/content/pkunk.con | Bin 154 -> 0 bytes sc2/content/pkunk.lst | 13 + sc2/content/pkunk.shp | Bin 300 -> 0 bytes sc2/content/probe.lst | 2 + sc2/content/probe.sc2 | Bin 111 -> 0 bytes sc2/content/shofixt.con | Bin 156 -> 0 bytes sc2/content/shofixti.lst | 20 + sc2/content/shofixti.shp | Bin 432 -> 0 bytes sc2/content/sis.dat | Bin 292 -> 0 bytes sc2/content/sis.lst | 12 + sc2/content/slyhome.con | Bin 171 -> 0 bytes sc2/content/slyland.con | Bin 156 -> 0 bytes sc2/content/slylandr.lst | 10 + sc2/content/slylandr.shp | Bin 258 -> 0 bytes sc2/content/spathi.con | Bin 237 -> 0 bytes sc2/content/spathi.lst | 16 + sc2/content/spathi.shp | Bin 346 -> 0 bytes sc2/content/starcon.lst | 454 +++++++++++++++ sc2/content/supox.con | Bin 154 -> 0 bytes sc2/content/supox.lst | 13 + sc2/content/supox.shp | Bin 300 -> 0 bytes sc2/content/syreen.con | Bin 170 -> 0 bytes sc2/content/syreen.lst | 13 + sc2/content/syreen.shp | Bin 301 -> 0 bytes sc2/content/talkpet.con | Bin 171 -> 0 bytes sc2/content/thradd.con | Bin 155 -> 0 bytes sc2/content/thradd.lst | 16 + sc2/content/thradd.shp | Bin 346 -> 0 bytes sc2/content/umgah.con | Bin 154 -> 0 bytes sc2/content/umgah.lst | 14 + sc2/content/umgah.shp | Bin 315 -> 0 bytes sc2/content/urquan.con | Bin 155 -> 0 bytes sc2/content/urquan.lst | 16 + sc2/content/urquan.shp | Bin 346 -> 0 bytes sc2/content/utwig.con | Bin 154 -> 0 bytes sc2/content/utwig.lst | 13 + sc2/content/utwig.shp | Bin 300 -> 0 bytes sc2/content/vux.con | Bin 167 -> 0 bytes sc2/content/vux.lst | 14 + sc2/content/vux.shp | Bin 313 -> 0 bytes sc2/content/yehat.con | Bin 200 -> 0 bytes sc2/content/yehat.lst | 16 + sc2/content/yehat.shp | Bin 345 -> 0 bytes sc2/content/zoqfot.con | Bin 155 -> 0 bytes sc2/content/zoqfot.lst | 16 + sc2/content/zoqfot.shp | Bin 346 -> 0 bytes sc2/src/sc2code/libs/Makeinfo | 4 +- sc2/src/sc2code/libs/reslib.h | 27 +- sc2/src/sc2code/libs/resource/getres.c | 622 ++++++-------------- sc2/src/sc2code/libs/resource/index.h | 104 ++-- sc2/src/sc2code/libs/resource/resdata.c | 10 +- sc2/src/sc2code/libs/resource/resinit.c | 696 ++++++++++++----------- sc2/src/sc2code/libs/resource/resintrn.h | 55 +- sc2/src/sc2code/setup.c | 2 +- 114 files changed, 1552 insertions(+), 925 deletions(-) create mode 100644 sc2/content/androsyn.lst delete mode 100644 sc2/content/androsyn.shp delete mode 100644 sc2/content/arilou.con create mode 100644 sc2/content/arilou.lst delete mode 100644 sc2/content/arilou.shp delete mode 100644 sc2/content/blackur.con create mode 100644 sc2/content/blackurq.lst delete mode 100644 sc2/content/blackurq.shp create mode 100644 sc2/content/chenjesu.lst delete mode 100644 sc2/content/chenjesu.shp delete mode 100644 sc2/content/chmmr.con create mode 100644 sc2/content/chmmr.lst delete mode 100644 sc2/content/chmmr.shp delete mode 100644 sc2/content/comandr.con create mode 100644 sc2/content/comm/arilou.lst create mode 100644 sc2/content/comm/blackur.lst create mode 100644 sc2/content/comm/chmmr.lst create mode 100644 sc2/content/comm/comandr.lst create mode 100644 sc2/content/comm/druuge.lst create mode 100644 sc2/content/comm/ilwrath.lst create mode 100644 sc2/content/comm/melnorm.lst create mode 100644 sc2/content/comm/mycon.lst create mode 100644 sc2/content/comm/orz.lst create mode 100644 sc2/content/comm/pkunk.lst create mode 100644 sc2/content/comm/shofixt.lst create mode 100644 sc2/content/comm/slyhome.lst create mode 100644 sc2/content/comm/slyland.lst create mode 100644 sc2/content/comm/spathi.lst create mode 100644 sc2/content/comm/supox.lst create mode 100644 sc2/content/comm/syreen.lst create mode 100644 sc2/content/comm/talkpet.lst create mode 100644 sc2/content/comm/thradd.lst create mode 100644 sc2/content/comm/umgah.lst create mode 100644 sc2/content/comm/urquan.lst create mode 100644 sc2/content/comm/utwig.lst create mode 100644 sc2/content/comm/vux.lst create mode 100644 sc2/content/comm/yehat.lst create mode 100644 sc2/content/comm/zoqfot.lst delete mode 100644 sc2/content/druuge.con create mode 100644 sc2/content/druuge.lst delete mode 100644 sc2/content/druuge.shp create mode 100644 sc2/content/human.lst delete mode 100644 sc2/content/human.shp delete mode 100644 sc2/content/ilwrath.con create mode 100644 sc2/content/ilwrath.lst delete mode 100644 sc2/content/ilwrath.shp create mode 100644 sc2/content/lastbat.lst delete mode 100644 sc2/content/lastbat.sc2 delete mode 100644 sc2/content/melnorm.con create mode 100644 sc2/content/melnorme.lst delete mode 100644 sc2/content/melnorme.shp create mode 100644 sc2/content/mmrnmhrm.lst delete mode 100644 sc2/content/mmrnmhrm.shp delete mode 100644 sc2/content/mycon.con create mode 100644 sc2/content/mycon.lst delete mode 100644 sc2/content/mycon.shp delete mode 100644 sc2/content/orz.con create mode 100644 sc2/content/orz.lst delete mode 100644 sc2/content/orz.shp delete mode 100644 sc2/content/pkunk.con create mode 100644 sc2/content/pkunk.lst delete mode 100644 sc2/content/pkunk.shp create mode 100644 sc2/content/probe.lst delete mode 100644 sc2/content/probe.sc2 delete mode 100644 sc2/content/shofixt.con create mode 100644 sc2/content/shofixti.lst delete mode 100644 sc2/content/shofixti.shp delete mode 100644 sc2/content/sis.dat create mode 100644 sc2/content/sis.lst delete mode 100644 sc2/content/slyhome.con delete mode 100644 sc2/content/slyland.con create mode 100644 sc2/content/slylandr.lst delete mode 100644 sc2/content/slylandr.shp delete mode 100644 sc2/content/spathi.con create mode 100644 sc2/content/spathi.lst delete mode 100644 sc2/content/spathi.shp create mode 100644 sc2/content/starcon.lst delete mode 100644 sc2/content/supox.con create mode 100644 sc2/content/supox.lst delete mode 100644 sc2/content/supox.shp delete mode 100644 sc2/content/syreen.con create mode 100644 sc2/content/syreen.lst delete mode 100644 sc2/content/syreen.shp delete mode 100644 sc2/content/talkpet.con delete mode 100644 sc2/content/thradd.con create mode 100644 sc2/content/thradd.lst delete mode 100644 sc2/content/thradd.shp delete mode 100644 sc2/content/umgah.con create mode 100644 sc2/content/umgah.lst delete mode 100644 sc2/content/umgah.shp delete mode 100644 sc2/content/urquan.con create mode 100644 sc2/content/urquan.lst delete mode 100644 sc2/content/urquan.shp delete mode 100644 sc2/content/utwig.con create mode 100644 sc2/content/utwig.lst delete mode 100644 sc2/content/utwig.shp delete mode 100644 sc2/content/vux.con create mode 100644 sc2/content/vux.lst delete mode 100644 sc2/content/vux.shp delete mode 100644 sc2/content/yehat.con create mode 100644 sc2/content/yehat.lst delete mode 100644 sc2/content/yehat.shp delete mode 100644 sc2/content/zoqfot.con create mode 100644 sc2/content/zoqfot.lst delete mode 100644 sc2/content/zoqfot.shp diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 6aff932d6..11af3593d 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.5: +- Replaced the binary resource indexes by textual ones - SvdB - Some subtitle timing fixes (bug #s 771, 780) - Alex - Entering Planetary Orbit wait screen is back (from DOS) - Alex - Gfx engine changes: now always 32bpp internally (facilitates diff --git a/sc2/content/androsyn.lst b/sc2/content/androsyn.lst new file mode 100644 index 000000000..d92e2a719 --- /dev/null +++ b/sc2/content/androsyn.lst @@ -0,0 +1,16 @@ +00200002 androsyn/andicons.ani +00200004 androsyn/andtext.txt +00200008 androsyn/androsyn.cod +00200102 androsyn/andmicon.ani +00400005 androsyn/andsound.snd +00400006 androsyn/andditty.mod +00400202 androsyn/androsyn.big +00400302 androsyn/androsyn.med +00400402 androsyn/androsyn.sml +00400502 androsyn/bubble.big +00400602 androsyn/bubble.med +00400702 androsyn/bubble.sml +00400802 androsyn/blazer.big +00400902 androsyn/blazer.med +00400a02 androsyn/blazer.sml +00400b02 androsyn/andcap.ani diff --git a/sc2/content/androsyn.shp b/sc2/content/androsyn.shp deleted file mode 100644 index ccfee296c73cf6eff188aa1256aa11ee03c78b7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 348 zcmYL^YYu}T5QN7^->)lpivIR0Af`1DFoH>KFVI`tWsx*wnEk@A3&0(~hx8@o*wYRa zCEHS*qXVJHcm>Z72@s?C#L%yT)1CBV+?F+8BVOfMxqjj@!&momC zJS1Ub6+qB6);M801|2AYZ(kms6k^;>c8@>kHa3WJbPvc$%D#o<*b16sD>%ooUcB2e f#UiY+2r))O8!j~@yeuF?li46-06}BM3PCEx8}RG&?JPMy2L2C3$vVEN_mU*K3@zTp#T5? diff --git a/sc2/content/arilou.lst b/sc2/content/arilou.lst new file mode 100644 index 000000000..20c2651ed --- /dev/null +++ b/sc2/content/arilou.lst @@ -0,0 +1,13 @@ +00200002 arilou/ariicons.ani +00200004 arilou/aritext.txt +00200008 arilou/arilou.cod +00200102 arilou/arimicon.ani +00400005 arilou/arisound.snd +00400006 arilou/ariditty.mod +00400202 arilou/arilou.big +00400302 arilou/arilou.med +00400402 arilou/arilou.sml +00400502 arilou/warp.big +00400602 arilou/warp.med +00400702 arilou/warp.sml +00400802 arilou/aricap.ani diff --git a/sc2/content/arilou.shp b/sc2/content/arilou.shp deleted file mode 100644 index 4230269e81fd0bafc8f5ff4d5485b781dc87de36..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 301 zcmX|*VG@EM5QSf8menCVMZdiYf|JY$ID%9C>!{ttmPH$Q?0&Ov-U8eKETj)f;7l)2 zlw8)L&J{?_flsOeElM=xZkP(13h~8}xFVI*RXEYS#syd0uqhAohFm3I?;TtIB zH9%mLcR@PCU=!^S`&UFHC0oksI`jC0wS5lATkHrt2iRQ6Xd=p R_{Hhqa+)?VzOC2kvp;v`M=$^Y diff --git a/sc2/content/blackur.con b/sc2/content/blackur.con deleted file mode 100644 index 024ef06522ed7c7c371a8f49bcc37d9d6d2a0ece..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 156 zcmYL?feC;x3Y4vZg`1aLYRu4HHM;GJgV3wRuP2%%UODp=012k9;W~R diff --git a/sc2/content/blackurq.lst b/sc2/content/blackurq.lst new file mode 100644 index 000000000..56b54812a --- /dev/null +++ b/sc2/content/blackurq.lst @@ -0,0 +1,16 @@ +00200002 blackurq/blaicons.ani +00200004 blackurq/blatext.txt +00200008 blackurq/blackurq.cod +00200102 blackurq/blamicon.ani +00400005 blackurq/blasound.snd +00400006 blackurq/bladitty.mod +00400202 blackurq/blackurq.big +00400302 blackurq/blackurq.med +00400402 blackurq/blackurq.sml +00400502 blackurq/buzbig.ani +00400602 blackurq/buzmed.ani +00400702 blackurq/buzsml.ani +00400802 blackurq/gasbig.ani +00400902 blackurq/gasmed.ani +00400a02 blackurq/gassml.ani +00400b02 blackurq/blacap.ani diff --git a/sc2/content/blackurq.shp b/sc2/content/blackurq.shp deleted file mode 100644 index ead58308667b87f5d9e63c2d9ab996ff9c857b5e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 348 zcmYL^YYu}T5QIn6z8_cc6#ea0P)utoU<)Lzy+Chm7YH?EnfSh7H|7 zUIdx*LsY;wSvX!9Y80r*T?NW%%2=J1#4D--CFz>xTkNo>*GHUi#ymFzZ}0B;Ft;(a zP+>{JRttcjZ?!U9^#P=(1h#uwSSoJ|X-$7!Kz1=8?vVpc+~gfR2Dr&P{$R)v;mXZo eBUo$%i_I_PV+t6!(M}1Y;!@FD`<7bxKm7o`GgUVL diff --git a/sc2/content/chenjesu.lst b/sc2/content/chenjesu.lst new file mode 100644 index 000000000..e54937e09 --- /dev/null +++ b/sc2/content/chenjesu.lst @@ -0,0 +1,16 @@ +00200002 chenjesu/cheicons.ani +00200004 chenjesu/chetext.txt +00200008 chenjesu/chenjesu.cod +00200102 chenjesu/chemicon.ani +00400005 chenjesu/chesound.snd +00400006 chenjesu/cheditty.mod +00400202 chenjesu/chenjesu.big +00400302 chenjesu/chenjesu.med +00400402 chenjesu/chenjesu.sml +00400502 chenjesu/spark.big +00400602 chenjesu/spark.med +00400702 chenjesu/spark.sml +00400802 chenjesu/doggy.big +00400902 chenjesu/doggy.med +00400a02 chenjesu/doggy.sml +00400b02 chenjesu/checap.ani diff --git a/sc2/content/chenjesu.shp b/sc2/content/chenjesu.shp deleted file mode 100644 index 2f22cab1fe22a38b43bc14487258681ef4f87668..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 348 zcmYL^YYu}T5QN89-;XPJivIR0C`4%sn1V@7FVI`t1tbj_X1_4(0&oNHA$>_XcC-UU z8Eh#|(E(p%VR_HdphQjSI#5BUdER6d@rG2QBHz;a9tRxh_8Avku`Jyn^j+A=4r3~z z!;plX;Q)c`jJ8b60LoJWC*BT@*EBikv5gWug>IvA9y&h;~h(%B$#3EQ_eT&eYeBuv25y94O fi4m3!5SbndB4>;LoxQe#qR diff --git a/sc2/content/comandr.con b/sc2/content/comandr.con deleted file mode 100644 index 209db3ac555b74dc59e8dfe1006f2e63e5dd2dc1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmY+6TMoh?5Je9KjX&;z9k>JcLTOC=0FssuH{qJ`V$-0R+?hFd9&iVW^p-3aWpM6W znlb+sjKa#?2NPc8anf1pzGcFh?zzcxqP193$jeGBS#7!v7Hl=FbJ&=5j8^v5ke>q{ VB@akt84&BwO?}lX$2&p)_yMQBE^z<= diff --git a/sc2/content/comm/arilou.lst b/sc2/content/comm/arilou.lst new file mode 100644 index 000000000..64ca0ecc2 --- /dev/null +++ b/sc2/content/comm/arilou.lst @@ -0,0 +1,4 @@ +00200002 comm/arilou/arilou.ani +00200003 comm/arilou/arilou.fon +00200004 comm/arilou/arilou.txt +00200006 comm/arilou/arilou.mod diff --git a/sc2/content/comm/blackur.lst b/sc2/content/comm/blackur.lst new file mode 100644 index 000000000..38a88ae1c --- /dev/null +++ b/sc2/content/comm/blackur.lst @@ -0,0 +1,4 @@ +00200002 comm/blackur/blackur.ani +00200003 comm/blackur/blackur.fon +00200004 comm/blackur/blackur.txt +00200006 comm/blackur/blackur.mod diff --git a/sc2/content/comm/chmmr.lst b/sc2/content/comm/chmmr.lst new file mode 100644 index 000000000..e5218f6e4 --- /dev/null +++ b/sc2/content/comm/chmmr.lst @@ -0,0 +1,5 @@ +00200002 comm/chmmr/chmmr.ani +00200003 comm/chmmr/chmmr.fon +00200004 comm/chmmr/chmmr.txt +00200006 comm/chmmr/chmmr.mod +00200104 comm/chmmr/chmmr.ct diff --git a/sc2/content/comm/comandr.lst b/sc2/content/comm/comandr.lst new file mode 100644 index 000000000..4f44cf015 --- /dev/null +++ b/sc2/content/comm/comandr.lst @@ -0,0 +1,6 @@ +00200002 comm/comandr/comandr.ani +00200003 comm/comandr/comandr.fon +00200004 comm/comandr/comandr.ct +00200006 comm/comandr/comandr.mod +00400104 comm/comandr/comandr.txt +00600204 comm/starbas/starbas.txt diff --git a/sc2/content/comm/druuge.lst b/sc2/content/comm/druuge.lst new file mode 100644 index 000000000..a400d8c61 --- /dev/null +++ b/sc2/content/comm/druuge.lst @@ -0,0 +1,4 @@ +00200002 comm/druuge/druuge.ani +00200003 comm/druuge/druuge.fon +00200004 comm/druuge/druuge.txt +00200006 comm/druuge/druuge.mod diff --git a/sc2/content/comm/ilwrath.lst b/sc2/content/comm/ilwrath.lst new file mode 100644 index 000000000..bea60d559 --- /dev/null +++ b/sc2/content/comm/ilwrath.lst @@ -0,0 +1,4 @@ +00200002 comm/ilwrath/ilwrath.ani +00200003 comm/ilwrath/ilwrath.fon +00200004 comm/ilwrath/ilwrath.txt +00200006 comm/ilwrath/ilwrath.mod diff --git a/sc2/content/comm/melnorm.lst b/sc2/content/comm/melnorm.lst new file mode 100644 index 000000000..25f00f42b --- /dev/null +++ b/sc2/content/comm/melnorm.lst @@ -0,0 +1,5 @@ +00200002 comm/melnorm/melnorm.ani +00200003 comm/melnorm/melnorm.fon +00200004 comm/melnorm/melnorm.txt +00200006 comm/melnorm/melnorm.mod +00200104 comm/melnorm/melnorm.ct diff --git a/sc2/content/comm/mycon.lst b/sc2/content/comm/mycon.lst new file mode 100644 index 000000000..e500cb3dd --- /dev/null +++ b/sc2/content/comm/mycon.lst @@ -0,0 +1,4 @@ +00200002 comm/mycon/mycon.ani +00200003 comm/mycon/mycon.fon +00200004 comm/mycon/mycon.txt +00200006 comm/mycon/mycon.mod diff --git a/sc2/content/comm/orz.lst b/sc2/content/comm/orz.lst new file mode 100644 index 000000000..9d8ab2468 --- /dev/null +++ b/sc2/content/comm/orz.lst @@ -0,0 +1,5 @@ +00200002 comm/orz/orz.ani +00200003 comm/orz/orz.fon +00200004 comm/orz/orz.txt +00200006 comm/orz/orz.mod +00200104 comm/orz/orz.ct diff --git a/sc2/content/comm/pkunk.lst b/sc2/content/comm/pkunk.lst new file mode 100644 index 000000000..0a47ca3cd --- /dev/null +++ b/sc2/content/comm/pkunk.lst @@ -0,0 +1,4 @@ +00200002 comm/pkunk/pkunk.ani +00200003 comm/pkunk/pkunk.fon +00200004 comm/pkunk/pkunk.txt +00200006 comm/pkunk/pkunk.mod diff --git a/sc2/content/comm/shofixt.lst b/sc2/content/comm/shofixt.lst new file mode 100644 index 000000000..20ec471b0 --- /dev/null +++ b/sc2/content/comm/shofixt.lst @@ -0,0 +1,4 @@ +00200002 comm/shofixt/shofixt.ani +00200003 comm/shofixt/shofixt.fon +00200004 comm/shofixt/shofixt.txt +00200006 comm/shofixt/shofixt.mod diff --git a/sc2/content/comm/slyhome.lst b/sc2/content/comm/slyhome.lst new file mode 100644 index 000000000..88fc4c2ea --- /dev/null +++ b/sc2/content/comm/slyhome.lst @@ -0,0 +1,5 @@ +00200002 comm/slyhome/slyhome.ani +00200003 comm/slyhome/slyhome.fon +00200004 comm/slyhome/slyhome.txt +00200006 comm/slyhome/slyhome.mod +00200104 comm/slyhome/slyhome.ct diff --git a/sc2/content/comm/slyland.lst b/sc2/content/comm/slyland.lst new file mode 100644 index 000000000..ded882ddc --- /dev/null +++ b/sc2/content/comm/slyland.lst @@ -0,0 +1,4 @@ +00200002 comm/slyland/slyland.ani +00200003 comm/slyland/slyland.fon +00200004 comm/slyland/slyland.txt +00200006 comm/slyland/slyland.mod diff --git a/sc2/content/comm/spathi.lst b/sc2/content/comm/spathi.lst new file mode 100644 index 000000000..b490c250f --- /dev/null +++ b/sc2/content/comm/spathi.lst @@ -0,0 +1,7 @@ +00200002 comm/spathi/spathi.ani +00200003 comm/spathi/spathi.fon +00200004 comm/spathi/spathi.txt +00400102 comm/spahome/spahome.ani +00400104 comm/spahome/spahome.ct +00400204 comm/spahome/spahome.txt +00600006 comm/spathi/spathi.mod diff --git a/sc2/content/comm/supox.lst b/sc2/content/comm/supox.lst new file mode 100644 index 000000000..b2e416a7f --- /dev/null +++ b/sc2/content/comm/supox.lst @@ -0,0 +1,4 @@ +00200002 comm/supox/supox.ani +00200003 comm/supox/supox.fon +00200004 comm/supox/supox.txt +00200006 comm/supox/supox.mod diff --git a/sc2/content/comm/syreen.lst b/sc2/content/comm/syreen.lst new file mode 100644 index 000000000..88be3d4b7 --- /dev/null +++ b/sc2/content/comm/syreen.lst @@ -0,0 +1,5 @@ +00200002 comm/syreen/syreen.ani +00200003 comm/syreen/syreen.fon +00200004 comm/syreen/syreen.txt +00200006 comm/syreen/syreen.mod +00200104 comm/syreen/syreen.ct diff --git a/sc2/content/comm/talkpet.lst b/sc2/content/comm/talkpet.lst new file mode 100644 index 000000000..5d2ca7af5 --- /dev/null +++ b/sc2/content/comm/talkpet.lst @@ -0,0 +1,5 @@ +00200002 comm/talkpet/talkpet.ani +00200003 comm/talkpet/talkpet.fon +00200004 comm/talkpet/talkpet.txt +00200006 comm/talkpet/talkpet.mod +00200104 comm/talkpet/talkpet.ct diff --git a/sc2/content/comm/thradd.lst b/sc2/content/comm/thradd.lst new file mode 100644 index 000000000..1ed9ac608 --- /dev/null +++ b/sc2/content/comm/thradd.lst @@ -0,0 +1,4 @@ +00200002 comm/thradd/thradd.ani +00200003 comm/thradd/thradd.fon +00200004 comm/thradd/thradd.txt +00200006 comm/thradd/thradd.mod diff --git a/sc2/content/comm/umgah.lst b/sc2/content/comm/umgah.lst new file mode 100644 index 000000000..43ffab919 --- /dev/null +++ b/sc2/content/comm/umgah.lst @@ -0,0 +1,4 @@ +00200002 comm/umgah/umgah.ani +00200003 comm/umgah/umgah.fon +00200004 comm/umgah/umgah.txt +00200006 comm/umgah/umgah.mod diff --git a/sc2/content/comm/urquan.lst b/sc2/content/comm/urquan.lst new file mode 100644 index 000000000..1b7077cf3 --- /dev/null +++ b/sc2/content/comm/urquan.lst @@ -0,0 +1,4 @@ +00200002 comm/urquan/urquan.ani +00200003 comm/urquan/urquan.fon +00200004 comm/urquan/urquan.txt +00200006 comm/urquan/urquan.mod diff --git a/sc2/content/comm/utwig.lst b/sc2/content/comm/utwig.lst new file mode 100644 index 000000000..105a908ee --- /dev/null +++ b/sc2/content/comm/utwig.lst @@ -0,0 +1,4 @@ +00200002 comm/utwig/utwig.ani +00200003 comm/utwig/utwig.fon +00200004 comm/utwig/utwig.txt +00200006 comm/utwig/utwig.mod diff --git a/sc2/content/comm/vux.lst b/sc2/content/comm/vux.lst new file mode 100644 index 000000000..4b9911fd9 --- /dev/null +++ b/sc2/content/comm/vux.lst @@ -0,0 +1,5 @@ +00200002 comm/vux/vux.ani +00200003 comm/vux/vux.fon +00200004 comm/vux/vux.txt +00200006 comm/vux/vux.mod +00200104 comm/vux/vux.ct diff --git a/sc2/content/comm/yehat.lst b/sc2/content/comm/yehat.lst new file mode 100644 index 000000000..002c5a90d --- /dev/null +++ b/sc2/content/comm/yehat.lst @@ -0,0 +1,5 @@ +00200002 comm/yehat/yehat.ani +00200003 comm/yehat/yehat.fon +00200006 comm/yehat/yehat.mod +00400004 comm/yehat/yehat.txt +00600104 comm/rebel/rebel.txt diff --git a/sc2/content/comm/zoqfot.lst b/sc2/content/comm/zoqfot.lst new file mode 100644 index 000000000..573f7ecf9 --- /dev/null +++ b/sc2/content/comm/zoqfot.lst @@ -0,0 +1,4 @@ +00200002 comm/zoqfot/zoqfot.ani +00200003 comm/zoqfot/zoqfot.fon +00200004 comm/zoqfot/zoqfot.txt +00200006 comm/zoqfot/zoqfot.mod diff --git a/sc2/content/druuge.con b/sc2/content/druuge.con deleted file mode 100644 index 70b931f485964d0d173e6abcb7e36f3cf50cf025..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 155 zcmX|&(FuSs3`9>`#4(&ew{QU`D5(`c(t@<$_BD~xgqQFR4p;#k0to|Vxq!9*tD5NQ u*BPt5pxtQ~2#wC^RjJKqHXopGWm3br)(48D?L0G5}lwB+{ECaHJck z>TFBZ76*9P<-;y;LyeBoU8ah*LVU0%Zb&sv4Gy$#al#oFEQ@}mG!6)1n%8m4Mv z8i2v+7)S*tAhbc6-U*3SVq7)4(LFZslb>oqS>nk*0a7WyI47|cyu?-@iE*1&Gt{<+ RVh)BvZ8I*VkB_E&_75!kM;ZVC diff --git a/sc2/content/ilwrath.con b/sc2/content/ilwrath.con deleted file mode 100644 index ef80dd8c449d31cc62057f30c25ba333cc4ee602..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 156 zcmYL?feC;x360_8<2u-Uq3==!X^BZC%_C~BRlCZast-=tEi)` tTdT(eLo6AH`i5>P;d*YDPk2dQVqB_THHNBO3QZi6nux;x^(?t5pxtQ~2GhAXH0IpeZ!!r#JN`by-3T47)EonFY84SV!{{ zs<~`cn=6o-9iLPMderF1-7!@(72=CMaYL%9YjB`>ixbYcVB5^}Tx1*(#<{d3rx#LQ z0|Z8S7o;-`Hc^2%ydokg**NTG9)GYy4#;cl1l-LsfIMttAP?IZf}QAcfRZz0*%SQg PbZ|LMn;75L>-5T~U3?9I{FgBMZ8#C#A_UQNnLH1DEkA7(jJOK#f%V==r3n-OR z(6^im1NkGj6>UR7!>E>(V%6Y;7H3@8>uBrF;EoU$D|>Huh@J9UIadGZHj C(<3SX diff --git a/sc2/content/melnorme.lst b/sc2/content/melnorme.lst new file mode 100644 index 000000000..16eddd6ff --- /dev/null +++ b/sc2/content/melnorme.lst @@ -0,0 +1,16 @@ +00200002 melnorme/melicons.ani +00200004 melnorme/meltext.txt +00200008 melnorme/melnorme.cod +00200102 melnorme/melmicon.ani +00400005 melnorme/melsound.snd +00400006 melnorme/melditty.mod +00400202 melnorme/melnorme.big +00400302 melnorme/melnorme.med +00400402 melnorme/melnorme.sml +00400502 melnorme/pumpbig.ani +00400602 melnorme/pumpmed.ani +00400702 melnorme/pumpsml.ani +00400802 melnorme/confubig.ani +00400902 melnorme/confumed.ani +00400a02 melnorme/confusml.ani +00400b02 melnorme/melcap.ani diff --git a/sc2/content/melnorme.shp b/sc2/content/melnorme.shp deleted file mode 100644 index c84f57a91132e7e08a66cd8a2bdc8108d6f9d0fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 348 zcmYL^YYu`i5QK-9@5dE5g}=E90xAh@i7ko73wUdsZc|A!-TkuDofNnL_)uRe#fCSK z5q)3izo@`}n)u&z1ZVuw9nA92DN^Q^i-o2TmRV~j1d zghXsi3lRFoXj|)EKzWMbx|f5ayiK-U`}+c_3kyPy8h~+9qqoQc58mCf!;cLfhWCw=%8&(+_@&S9$;d diff --git a/sc2/content/mmrnmhrm.lst b/sc2/content/mmrnmhrm.lst new file mode 100644 index 000000000..1d5b20cf9 --- /dev/null +++ b/sc2/content/mmrnmhrm.lst @@ -0,0 +1,16 @@ +00200002 mmrnmhrm/mmricons.ani +00200004 mmrnmhrm/mmrtext.txt +00200008 mmrnmhrm/mmrnmhrm.cod +00200102 mmrnmhrm/mmrmicon.ani +00400005 mmrnmhrm/mmrsound.snd +00400006 mmrnmhrm/mmrditty.mod +00400202 mmrnmhrm/mmrnmhrm.big +00400302 mmrnmhrm/mmrnmhrm.med +00400402 mmrnmhrm/mmrnmhrm.sml +00400502 mmrnmhrm/torp.big +00400602 mmrnmhrm/torp.med +00400702 mmrnmhrm/torp.sml +00400802 mmrnmhrm/ywing.big +00400902 mmrnmhrm/ywing.med +00400a02 mmrnmhrm/ywing.sml +00400b02 mmrnmhrm/mmrcap.ani diff --git a/sc2/content/mmrnmhrm.shp b/sc2/content/mmrnmhrm.shp deleted file mode 100644 index c6619ce532abef300a8691c241a637b95e85fc2e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 348 zcmYL^TMoh?5JhhvzF%ADD*SdUwQVYi15LrGaRctUUWPOVhT&um3;<^UAI6uFW6c#P zN=;L-PZ@}tOh?Q)E+|pau9ON^^Zb%6$V*0v1@nsa4Yt_v^Z`elFij$(mD?!(Hq2XC zZ8BryT7Y00XMJsrf<&4jbgzKGh??GZHT@r?OBbX*atDGN2hdSXfsSelUhbU0`)O=X iPqhTnsg}TtYHZrn1M2xX-aTyVZED(@5Z>b2_@^JKnpaBz diff --git a/sc2/content/mycon.con b/sc2/content/mycon.con deleted file mode 100644 index 8a474459f94f915534e99f9a60ead2dd30f0e147..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 154 zcmXww(G7qw2t-fY7{_n|-NFT&pw=|;gYx5tPG1jeArH6%fEmC>cG6*F1-$=SF~`!n uMUM%Ncrp<49oVuE9m#TikHR1KUQc2_8K1I2SwS?&3`_ z!2$wKQmnnpK#2~B!zUt&QcS9P*Sq%tG|*5A(h_2tfO*nP8hwuKKsmMp=a{q^JwqRR RI4s_>FKyPvxKgm`vwuImM+E=? diff --git a/sc2/content/orz.con b/sc2/content/orz.con deleted file mode 100644 index ed9e03460722aab677cc80b8ccfcbab4aa35b5b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 167 zcmW-Z!41MN5Cq3gf+!;uKnr=M0SW*kq&yr;Q67lq&F($M>sj3$+<=F8iNsYej8jB+ zlgN@3MP_CYBMTR$`$3lJy&XSF+f8Y;-tB8_`S;wn0Lw>XCZx7ECgl8{n2@3rKJo`m Cj2{00 diff --git a/sc2/content/orz.lst b/sc2/content/orz.lst new file mode 100644 index 000000000..7797e36e6 --- /dev/null +++ b/sc2/content/orz.lst @@ -0,0 +1,16 @@ +00200002 orz/orzicons.ani +00200004 orz/orztext.txt +00200008 orz/orz.cod +00200102 orz/orzmicon.ani +00400005 orz/orzsound.snd +00400006 orz/orzditty.mod +00400202 orz/orz.big +00400302 orz/orz.med +00400402 orz/orz.sml +00400502 orz/howbig.ani +00400602 orz/howmed.ani +00400702 orz/howsml.ani +00400802 orz/turbig.ani +00400902 orz/turmed.ani +00400a02 orz/tursml.ani +00400b02 orz/orzcap.ani diff --git a/sc2/content/orz.shp b/sc2/content/orz.shp deleted file mode 100644 index 66ddb961e6617e038316fd32b3a018ab7b4fbd94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 343 zcmYL^Sq_6R3`B>e`*sCR(QmFo32Ko_f=E!e&mNqPO`#4(&ew{QU`sFi}0Bz`EkeN8OQ@p8F?05gD1*_95XZovEBiZv#4 vn;sLK;*~+M-f3IPl^@QC5{07>Ej6$9gn9=Ke72Az3AaE(aq diff --git a/sc2/content/pkunk.lst b/sc2/content/pkunk.lst new file mode 100644 index 000000000..278b26be4 --- /dev/null +++ b/sc2/content/pkunk.lst @@ -0,0 +1,13 @@ +00200002 pkunk/pkuicons.ani +00200004 pkunk/pkutext.txt +00200008 pkunk/pkunk.cod +00200102 pkunk/pkumicon.ani +00400005 pkunk/pkusound.snd +00400006 pkunk/pkuditty.mod +00400202 pkunk/pkunk.big +00400302 pkunk/pkunk.med +00400402 pkunk/pkunk.sml +00400502 pkunk/bugbig.ani +00400602 pkunk/bugmed.ani +00400702 pkunk/bugsml.ani +00400802 pkunk/pkucap.ani diff --git a/sc2/content/pkunk.shp b/sc2/content/pkunk.shp deleted file mode 100644 index 047af6ab0757135e12ab608964526c0c445bd0d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 300 zcmYL@Q4Yc&5JX2>t5pxtQ~2Gh6lhvffhItrUtZOl)Llq5WY~Gx$pCN%kVtQmz?p8K zs`J>YwoHJ{As?OsJ!*86?lM)h72<;2|oEUNe0VjUIi2~H7hV>7@ QC#QoeZQ8{6vR?CNze>_a3IG5A diff --git a/sc2/content/probe.lst b/sc2/content/probe.lst new file mode 100644 index 000000000..995d5ab3a --- /dev/null +++ b/sc2/content/probe.lst @@ -0,0 +1,2 @@ +00200002 probe/promicon.ani +00200008 probe/probe.cod diff --git a/sc2/content/probe.sc2 b/sc2/content/probe.sc2 deleted file mode 100644 index da5abdb859d73668d32e60853e98effaf5c6ed13..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 111 zcmZQz&|_d=a0lW*AZBFX0Fn$0OiWE7Zl|ur7{#J7bhD* dm{wr55O#8Ya()T}1CW!OnVg@On3oBX1pvTD6JG!T diff --git a/sc2/content/shofixt.con b/sc2/content/shofixt.con deleted file mode 100644 index b04257ffa90eb8165f1bd7eebc1a28f3d6fc2d84..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 156 zcmZQz&|_d=2nOO5AZBFX0Fn$0EG%H^KS%@wK{N<3F(@!F12GE_vjH(koEa$k|9^2t uep+Tl2}5#zUUGhJu0D+K2GYg=<0a;0A~#U0v)THxD*v45Gd-1yqAK2 zcK|;ezZ_%Cc?XKIq+v9B{eGNR5B-YHn~GI3ZhXE4Z~C89g*vrtWgk+ Vg3h6E=`Hp7q1MHC^TDQn_y;Z~ZD#-g diff --git a/sc2/content/sis.dat b/sc2/content/sis.dat deleted file mode 100644 index 17b6a5b7a0c8445420bd7825c660ae092fd774ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 292 zcmX|*TMmLS5Jhi66mS!)#I2Y@iPZ3lgE9QOZ@e=EKTc;(dpjB62H-=!Bt^~>aL&q> zmU}%MDD1*P1CHs6HDQ~vI}=AsaY9DB@V!8ZB(HGAwn-EOzbI_)(#081o2M_$6bw*e zGmYZM2o==vVVDeUfMOy;4+VAaMPv3yMI(RF$T6+)GyEYky~iNqJ}ty$SqE;Rqq}u( IUySK~KSr-XZ~y=R diff --git a/sc2/content/sis.lst b/sc2/content/sis.lst new file mode 100644 index 000000000..65c284b8b --- /dev/null +++ b/sc2/content/sis.lst @@ -0,0 +1,12 @@ +00200008 sis_ship/sis.cod +00400002 sis_ship/sisicons.ani +00400005 sis_ship/sissound.snd +00400006 sis_ship/sisditty.mod +00400102 sis_ship/sis.big +00400202 sis_ship/sis.med +00400302 sis_ship/sis.sml +00400402 sis_ship/blasbig.ani +00400502 sis_ship/blasmed.ani +00400602 sis_ship/blassml.ani +00400702 sis_ship/siscap.ani +00600802 sis_ship/sishyper.ani diff --git a/sc2/content/slyhome.con b/sc2/content/slyhome.con deleted file mode 100644 index dfc9141e370c820b970e318c83d51cb7519f7aaa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 171 zcmYMs%?-mK42Izs@}rKC3ECBU%mNu8B8^h1;6phi(-VV)IDEFAPqN_&ESgHoV9@gJN7C*HrR=W@=U;F@`-aWej diff --git a/sc2/content/spathi.con b/sc2/content/spathi.con deleted file mode 100644 index a04c0b55c771fec8d959b9bf56cceab7062eb020..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 237 zcmYL>(G9{d3`8$(srX=sZomeJRid<2`;i!gKbV4*!=;2Y()sf2vw<6cC-tE^oLTAJ zZds~3_hUfdm;!5gf{`?$r%F#Cj^ys__Bdf+e?ZQ!hqrY@2%3V%c>QzzuNr4eya3dR e_i1aeESegaz3ozB`x0XZ1j7N0wVfDsD(Am3S2D!_ diff --git a/sc2/content/spathi.lst b/sc2/content/spathi.lst new file mode 100644 index 000000000..289176c8b --- /dev/null +++ b/sc2/content/spathi.lst @@ -0,0 +1,16 @@ +00200002 spathi/spaicons.ani +00200004 spathi/spatext.txt +00200008 spathi/spathi.cod +00200102 spathi/spamicon.ani +00400005 spathi/spasound.snd +00400006 spathi/spaditty.mod +00400202 spathi/spathi.big +00400302 spathi/spathi.med +00400402 spathi/spathi.sml +00400502 spathi/missile.big +00400602 spathi/missile.med +00400702 spathi/missile.sml +00400802 spathi/discrim.big +00400902 spathi/discrim.med +00400a02 spathi/discrim.sml +00400b02 spathi/spacap.ani diff --git a/sc2/content/spathi.shp b/sc2/content/spathi.shp deleted file mode 100644 index 357bb7b142fa62a89c3d27b1a5e239e5dcacf80b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 346 zcmX|+YYxI75QN7*d_S(xQ~0}AsnF;qg*GlG8vlFkx-4SIF#CmJ7l1Q>x9B4(u$CPt zE48`YCkJA&&=tKviwcdT8>LcCi=tiB!b?$wT6`tv8*H(Y+XozR!aVcTg&TqSHvLMk zBYt4aXaNB-qvy_(f{T`#4(&ew{QU`sFi{rNdy(TeN8OQ@p8F?05gD1*_95XZovEBiZv#4 vn;sLK;*~+M-f3IP{a%t0B??C&T54YH3H1&f_-r9b5^jNnt5pxtQ~2#wT4-7lfhG${{qm~br0znhA;ZqgP6mKGfW&&U6wZ7D zRh`FHwPgZg4*AGbc%Vkd=`K^nTctiYGB>Q6U4s+vTU>C(4ckU(2`gx(c`0_z-Noym zg8>+<4xV~%GdQ6g;4`yz!)NRHBpaTbxMJJ3? zUAZ&{t1z{&JQy@1Z)V-4A5@l{um9;>KqLl<-oKjHdf2dS;R_AN5krUfaqmd!mpVie G<;e{@^CH^- diff --git a/sc2/content/syreen.lst b/sc2/content/syreen.lst new file mode 100644 index 000000000..9b2e373d1 --- /dev/null +++ b/sc2/content/syreen.lst @@ -0,0 +1,13 @@ +00200002 syreen/syricons.ani +00200004 syreen/syrtext.txt +00200008 syreen/syreen.cod +00200102 syreen/syrmicon.ani +00400005 syreen/syrsound.snd +00400006 syreen/syrditty.mod +00400202 syreen/syreen.big +00400302 syreen/syreen.med +00400402 syreen/syreen.sml +00400502 syreen/dagger.big +00400602 syreen/dagger.med +00400702 syreen/dagger.sml +00400802 syreen/syrcap.ani diff --git a/sc2/content/syreen.shp b/sc2/content/syreen.shp deleted file mode 100644 index 3c9b01b3f56c9eb862ad13eed4f66087f097c5b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 301 zcmX|*YYu`i5QIm-2kId>g}=Q@X&Y!_Tf&w^{&`eyg4+kCneKks$?O6T01NBGs&L^S zsGC%_y3G}c%^|&5D?HJlV|SOR=4n-Zab!NR8tzUw^Ss3sH{7vpw9Z;P5RFr5#}r;b zO0NJ0BfTTxOadEehoIj9ffa2rtMAS52Wxc>$Xo0SP+}PLTxw)&Kwi diff --git a/sc2/content/talkpet.con b/sc2/content/talkpet.con deleted file mode 100644 index 82d96ef18b5f4cdfd56bb5821adf140dcd5f3c94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 171 zcmYMs!41P8429tzNTQCB3ECBU%mNu8B8?QaKo34-dt#6fhiB`1k_}H_)f^hbLnjPl zUAZ&{t1z{&%s9=!n@M-+oywB4Y`^dSBlr}33gOkf)XSzVp3rcl*b&m+A(wP`p**<( DUN|EM diff --git a/sc2/content/thradd.con b/sc2/content/thradd.con deleted file mode 100644 index 708255b0079c5cd1fe491e46a400fcc2510ab6e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 155 zcmX|&(FuSs3`9>`#4(&ew{QU`C@Doh(tzZ{?Q0^^gqQFR4p;#k1{nipyFiTJYo7S} t_ZhJu7}1yv&x56{>3OG|K_r!gdHa3$7Jf;oUR_F&+J#wi7u83-_X0}@9wPt% diff --git a/sc2/content/thradd.lst b/sc2/content/thradd.lst new file mode 100644 index 000000000..58c3c0f89 --- /dev/null +++ b/sc2/content/thradd.lst @@ -0,0 +1,16 @@ +00200002 thradd/thricons.ani +00200004 thradd/thrtext.txt +00200008 thradd/thradd.cod +00200102 thradd/thrmicon.ani +00400005 thradd/thrsound.snd +00400006 thradd/thrditty.mod +00400202 thradd/thradd.big +00400302 thradd/thradd.med +00400402 thradd/thradd.sml +00400502 thradd/horbig.ani +00400602 thradd/hormed.ani +00400702 thradd/horsml.ani +00400802 thradd/napbig.ani +00400902 thradd/napmed.ani +00400a02 thradd/napsml.ani +00400b02 thradd/thrcap.ani diff --git a/sc2/content/thradd.shp b/sc2/content/thradd.shp deleted file mode 100644 index 1237cab39644744b8ae2801e223c44d0b46b0b50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 346 zcmYL^YYu}T5QN89-;XPJivIR0D5jbeFhY|y{oiZb0j!1$vtO9q4Zsb+hx$?}cD#Ws z4>o0|=zuShaJ;9ekfUU}43zOTO{=6JZ>SsvearVf4mh&=j0>)qCfAKZN?6+sbE(6M z8JfmOfY3KaTcP^^%F`cQ`*LuUkNH`3-QO2bs*MBU7WDu+Gx~%G0|-8`fMp_r7Q-4N dtTDnGKpX(tJQ-`{IBa>*Cl_fDyn#R??v72E6~QSYtA` uX)(YNPdZ|~V_V8CdpHm^YK|&0{du-0{CCJ9pEV>+nrjdh-D&fk~)R1NN%kB&S7XVMzmz8738z@SV zr8p!7Vw1^#(X4^Ld{NRTvwKqvmy>iNR z0Kq6X`erl&Hqr_~zXAd)t}&`Lt?5^=+UgV#AF`#4(&ew{QU`D3O96O;B2J`OU`e$-Uo6l9{~UW diff --git a/sc2/content/urquan.lst b/sc2/content/urquan.lst new file mode 100644 index 000000000..76bdc3865 --- /dev/null +++ b/sc2/content/urquan.lst @@ -0,0 +1,16 @@ +00200002 urquan/urqicons.ani +00200004 urquan/urqtext.txt +00200008 urquan/urquan.cod +00200102 urquan/urqmicon.ani +00400005 urquan/urqsound.snd +00400006 urquan/urqditty.mod +00400202 urquan/urquan.big +00400302 urquan/urquan.med +00400402 urquan/urquan.sml +00400502 urquan/fusion.big +00400602 urquan/fusion.med +00400702 urquan/fusion.sml +00400802 urquan/fight.big +00400902 urquan/fight.med +00400a02 urquan/fight.sml +00400b02 urquan/urqcap.ani diff --git a/sc2/content/urquan.shp b/sc2/content/urquan.shp deleted file mode 100644 index 40b2c51bae7d93af5696c59f54308ed20778054d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 346 zcmX|+Sq{S>3`8ee_vH#XMZa^E>_IA!)WZeYs-ncn6YH z+MJw12mBDp@;yd@6gjJNp@dK4xQH_54Ofbc`)&$!@jPV diff --git a/sc2/content/utwig.con b/sc2/content/utwig.con deleted file mode 100644 index 77dd1ece4bd87fd62b75e4bbe3485c42af7df584..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 154 zcmXww(FuSs3`9>`#4(&ew{QU`sFg}TlKfP3`Ba vn;sLK;*~+M-f3IwRqlKuN)(PlwETIsC;WHdz`2DaNw@_PlB0$4sO;|rO64A_ diff --git a/sc2/content/utwig.lst b/sc2/content/utwig.lst new file mode 100644 index 000000000..663182393 --- /dev/null +++ b/sc2/content/utwig.lst @@ -0,0 +1,13 @@ +00200002 utwig/utwicons.ani +00200004 utwig/utwtext.txt +00200008 utwig/utwig.cod +00200102 utwig/utwmicon.ani +00400005 utwig/utwsound.snd +00400006 utwig/utwditty.mod +00400202 utwig/utwig.big +00400302 utwig/utwig.med +00400402 utwig/utwig.sml +00400502 utwig/lanbig.ani +00400602 utwig/lanmed.ani +00400702 utwig/lansml.ani +00400802 utwig/utwcap.ani diff --git a/sc2/content/utwig.shp b/sc2/content/utwig.shp deleted file mode 100644 index 9276c18165feb46aa8d38bc56253cbc4dacabf00..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 300 zcmYL@Q4WGI5JX2n6!j3C!f&rqS^`aIOVSec%d2`5oVKWGrn@gYnO)!tV4+@Afg^vQ ztWsIaCRZRfyYyl$a6^Tb?lw`$X;HkfC)ZTPuEv4$1}B_x!MZNtt_S$hk8^Ivl%0F& zq*J_u9_g$XRwpo#z7YCHK%kOsK&LwfZeV)TZvk9lyqSPW*ys=`fDj!&h>i?gD#iQ< R?-r}P&1p)9@H9@vV?Th!M~eUe diff --git a/sc2/content/vux.con b/sc2/content/vux.con deleted file mode 100644 index db8df139c80e18f7bad7c410661fd2fe348c5679..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 167 zcmW-Z!41MN5Cq3gKq-R?NDDk^fC7jkBp!}G2}<{7_a5W*tnLo(z)LJ5G3kZz64Bix zvLr>3xiN^52Un&0L6+(Lcbt^AnbK;V?a$cq@4bBkEFX=TklI#E$bRmakfIbm@&{Q< BA2$F1 diff --git a/sc2/content/vux.lst b/sc2/content/vux.lst new file mode 100644 index 000000000..a3e94fa2f --- /dev/null +++ b/sc2/content/vux.lst @@ -0,0 +1,14 @@ +00200002 vux/vuxicons.ani +00200004 vux/vuxtext.txt +00200008 vux/vux.cod +00200102 vux/vuxmicon.ani +00400005 vux/vuxsound.snd +00400006 vux/vuxditty.mod +00400202 vux/vux.big +00400302 vux/vux.med +00400402 vux/vux.sml +00400502 vux/limpets.big +00400602 vux/limpets.med +00400702 vux/limpets.sml +00400802 vux/slime.ani +00400902 vux/vuxcap.ani diff --git a/sc2/content/vux.shp b/sc2/content/vux.shp deleted file mode 100644 index cdd897776189309d342b52fd8a8e64649d9e7f43..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 313 zcmX|*-44Pa3`W1P&41rvPvNz%f`ce#z!I3wD<6HfT`=U(p0u<87XWYKODOE<2I@w_ zQXkd`a8k+PsBlGtj=DRsnyN~nYRNZ5gO=i!>U(;5#0h6C%WImE9wWo)Q)YA4Mk+yvO>qh) Og>|%XIe&aK{PQ2-2uQC0 diff --git a/sc2/content/yehat.con b/sc2/content/yehat.con deleted file mode 100644 index 8180b1b86bb7b34bf1421a49a0542f2c6ad6957a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 200 zcmY+8Q3{116hudh2;L^#K|5$A{rG%FL3$zjsPDIMn-o9dGR{3CBLX9UmHJZ+dY<$q zTT<%nfZ}L|JDu&#?9y8s$#oKxv! zLaGNpcm*(+!8_`l5wMXm1pNsJ98u#|z3I&>gVk22262cbI|0@ZnMt$AS_aWFh(@E) ilR_`r23E8UNHiWgbThjA9P)3c$fcpmgs@nz;-CJCPg3Ck diff --git a/sc2/content/zoqfot.con b/sc2/content/zoqfot.con deleted file mode 100644 index ce1ee3575d205c580222be1de74df494b5a0368b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 155 zcmX|&(FuSs3`9>`#4(&ew{QU`D3O96X%O-uE?*NVO?V0K;D8mtVURIkwhP4gzv_vv tf1eQxf)S0$@H|*r>nnE_1(6gI=B@eeEi_4~TwQXO(uG;hE~<}u?*n-#A1eR= diff --git a/sc2/content/zoqfot.lst b/sc2/content/zoqfot.lst new file mode 100644 index 000000000..2065e7595 --- /dev/null +++ b/sc2/content/zoqfot.lst @@ -0,0 +1,16 @@ +00200002 zoqfot/zoqicons.ani +00200004 zoqfot/zoqtext.txt +00200008 zoqfot/zoqfot.cod +00200102 zoqfot/zoqmicon.ani +00400005 zoqfot/zoqsound.snd +00400006 zoqfot/zoqditty.mod +00400202 zoqfot/zoqfot.big +00400302 zoqfot/zoqfot.med +00400402 zoqfot/zoqfot.sml +00400502 zoqfot/spitbig.ani +00400602 zoqfot/spitmed.ani +00400702 zoqfot/spitsml.ani +00400802 zoqfot/stibig.ani +00400902 zoqfot/stimed.ani +00400a02 zoqfot/stisml.ani +00400b02 zoqfot/zoqcap.ani diff --git a/sc2/content/zoqfot.shp b/sc2/content/zoqfot.shp deleted file mode 100644 index 8b8f0e49da31ccb90ae18ba49cfa3773f6417fcc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 346 zcmX|+Sq{S>3`8d+>AqYcr|5UClC3RLfmBeb%YUz(+9p(Ju%A451aJcIA$>^-E4qQa zkTT`FSOIP_Ib0QL6sX8u3FS0Zs?JK{1*t$ubxHFzHrUeZJq|cxn%?eyb^+dB$GNo< zF+ppXmKSF cR|0VfP-xeTXcBn$u)Vi2wAUfLjO+PNKdom}i~s-t diff --git a/sc2/src/sc2code/libs/Makeinfo b/sc2/src/sc2code/libs/Makeinfo index d626c6c52..19d8a39d8 100644 --- a/sc2/src/sc2code/libs/Makeinfo +++ b/sc2/src/sc2code/libs/Makeinfo @@ -1,5 +1,5 @@ -uqm_SUBDIRS="decomp file graphics input math memory resource sound strings - task threads time uio video" +uqm_SUBDIRS="decomp file graphics input list math memory resource sound + strings task threads time uio video" #if [ "$DEBUG" = 1 ]; then # uqm_SUBDIRS="$UQM_SUBDIRS debug" #fi diff --git a/sc2/src/sc2code/libs/reslib.h b/sc2/src/sc2code/libs/reslib.h index e6abe1b87..7052620f3 100644 --- a/sc2/src/sc2code/libs/reslib.h +++ b/sc2/src/sc2code/libs/reslib.h @@ -24,8 +24,8 @@ #include "memlib.h" #include "libs/uio.h" + typedef DWORD RESOURCE; -typedef RESOURCE *PRESOURCE; typedef BYTE RES_TYPE; typedef COUNT RES_INSTANCE; @@ -35,10 +35,6 @@ typedef COUNT RES_PACKAGE; #define INSTANCE_BITS 13 #define PACKAGE_BITS 11 -#define MAX_TYPES ((1 << TYPE_BITS) - 1) /* zero is invalid */ -#define MAX_INSTANCES (1 << INSTANCE_BITS) -#define MAX_PACKAGES ((1 << PACKAGE_BITS) - 1) /* zero is invalid */ - #define GET_TYPE(res) \ ((RES_TYPE)(res) & (RES_TYPE)((1 << TYPE_BITS) - 1)) #define GET_INSTANCE(res) \ @@ -51,8 +47,12 @@ typedef COUNT RES_PACKAGE; ((RESOURCE)(i) << TYPE_BITS) | \ ((RESOURCE)(t))) + extern const char *_cur_resfile_name; +typedef MEM_HANDLE (ResourceLoadFun) (uio_Stream *fp, DWORD len); +typedef BOOLEAN (ResourceFreeFun) (MEM_HANDLE handle); + extern uio_Stream *res_OpenResFile (uio_DirHandle *dir, const char *filename, const char *mode); extern int ReadResFile (PVOID lpBuf, COUNT size, COUNT count, uio_Stream *fp); @@ -66,21 +66,20 @@ extern long LengthResFile (uio_Stream *fp); extern BOOLEAN res_CloseResFile (uio_Stream *fp); extern BOOLEAN DeleteResFile (uio_DirHandle *dir, const char *filename); -extern MEM_HANDLE InitResourceSystem (const char *resfile, - COUNT resindex_type, BOOLEAN (*FileErrorFunc) (const char *filename)); -extern BOOLEAN UninitResourceSystem (void); -extern BOOLEAN InstallResTypeVectors (COUNT res_type, - MEM_HANDLE (*load_func) (uio_Stream *fp, DWORD len), - BOOLEAN (*free_func) (MEM_HANDLE handle)); +extern MEM_HANDLE InitResourceSystem (const char *resfile, RES_TYPE resType, + BOOLEAN (*FileErrorFun) (const char *filename)); +extern void UninitResourceSystem (void); +extern BOOLEAN InstallResTypeVectors (RES_TYPE res_type, + ResourceLoadFun *loadFun, ResourceFreeFun *freeFun); extern MEM_HANDLE res_GetResource (RESOURCE res); extern MEM_HANDLE res_DetachResource (RESOURCE res); extern BOOLEAN FreeResource (RESOURCE res); extern COUNT CountResourceTypes (void); extern MEM_HANDLE OpenResourceIndexFile (const char *resfile); -extern MEM_HANDLE OpenResourceIndexInstance (DWORD res); -extern MEM_HANDLE SetResourceIndex (MEM_HANDLE hRH); -extern BOOLEAN CloseResourceIndex (MEM_HANDLE hRH); +extern MEM_HANDLE OpenResourceIndexInstance (RESOURCE res); +extern MEM_HANDLE SetResourceIndex (MEM_HANDLE newIndexHandle); +extern BOOLEAN CloseResourceIndex (MEM_HANDLE newIndexHandle); extern MEM_HANDLE GetResourceData (uio_Stream *fp, DWORD length, MEM_FLAGS mem_flags); diff --git a/sc2/src/sc2code/libs/resource/getres.c b/sc2/src/sc2code/libs/resource/getres.c index 52e5f49c7..931d87879 100644 --- a/sc2/src/sc2code/libs/resource/getres.c +++ b/sc2/src/sc2code/libs/resource/getres.c @@ -16,508 +16,210 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "resintrn.h" -#include "port.h" #include "options.h" +#include "port.h" +#include "resintrn.h" +#include "libs/misc.h" const char *_cur_resfile_name; +// When a file is being loaded, _cur_resfile_name is set to its name. +// At other times, it is NULL. -static BOOLEAN -ValidResource (INDEX_HEADERPTR ResHeaderPtr, RESOURCE res) -{ - if (ResHeaderPtr != NULL_PTR) +static ResourceDesc * +lookupResourceDesc (ResourceIndex *idx, RESOURCE res) { + // Binary search through the resources. + COUNT l, h; + + if (idx->numRes == 0) + return NULL; + + l = 0; + h = idx->numRes; + + while (l + 1 != h) { - RES_PACKAGE res_package; - - res_package = GET_PACKAGE (res); - if (ValidResPackage (ResHeaderPtr, res_package)) - { - RES_TYPE res_type; - - res_type = GET_TYPE (res); - if (ValidResType (ResHeaderPtr, res_type)) - { - COUNT res_instance; - - res_instance = GET_INSTANCE (res); - if (GetInstanceCount (ResHeaderPtr, res_type) > res_instance) - return (TRUE); - } - } - } - - return (FALSE); -} - -static void -dword_convert (PDWORD dword_array, COUNT num_dwords) -{ - PBYTE p = (PBYTE)dword_array; - - do - { - *dword_array++ = MAKE_DWORD ( - MAKE_WORD (p[0], p[1]), - MAKE_WORD (p[2], p[3]) - ); - p += 4; - } while (--num_dwords); -} - -#define PATHLEN 256 - -void -get_resource_filename (INDEX_HEADERPTR ResHeaderPtr, char *pbuf, COUNT - file_index) -{ - UWORD path_offs; - long file_offs; - FILE_INFO file_info; - - file_offs = (long)ResHeaderPtr->file_list_offs + - (long)file_index * FILE_LIST_SIZE; - if (ResHeaderPtr->res_flags & IS_PACKAGED) - memcpy ((PSTR)&file_info, - (PSTR)ResHeaderPtr + (COUNT)file_offs, FILE_LIST_SIZE); - else - { - SeekResFile (ResHeaderPtr->res_fp, file_offs, SEEK_SET); - ReadResFile (&file_info, FILE_LIST_SIZE, 1, ResHeaderPtr->res_fp); - } - - path_offs = MAKE_WORD (file_info.path_offset[0], file_info.path_offset[1]); - if (path_offs != NO_PATH) - { - file_offs = (long)ResHeaderPtr->path_list_offs + path_offs; - if (ResHeaderPtr->res_flags & IS_PACKAGED) - memcpy (pbuf, - (PSTR)ResHeaderPtr + (COUNT)file_offs, PATHLEN); + COUNT m = (l + h) / 2; + if (idx->res[m]->res <= res) + l = m; else - { - SeekResFile (ResHeaderPtr->res_fp, file_offs, SEEK_SET); - ReadResFile (pbuf, PATHLEN, 1, ResHeaderPtr->res_fp); - } - pbuf += strlen (pbuf); - - *pbuf++ = '/'; + h = m; } - { - COUNT i; - char *pstr; - - pstr = file_info.filename; - for (i = 0; i < FILE_NAME_SIZE; ++i) - { - if ((*pbuf++ = *pstr++) == '\0') - { - --pbuf; - if (i == 0) - { -#ifndef PACKAGING - strcpy (pbuf, ResHeaderPtr->index_file_name); -#endif /* PACKAGING */ - return; - } - - break; - } - } - *pbuf++ = '.'; - - pstr = file_info.extension; - for (i = 0; i < EXTENSION_SIZE && (*pbuf++ = *pstr++); ++i) - ; - *pbuf++ = '\0'; - } + if (idx->res[l]->res == res) + return idx->res[l]; + return NULL; } -DWORD -get_packmem_offs (INDEX_HEADERPTR ResHeaderPtr, RES_PACKAGE res_package) -{ - DWORD file_offs; - RES_PACKAGE package; +// Load every resource in a package. +static void +loadPackage (ResourceIndex *idx, RES_PACKAGE pkg) { + COUNT i; - file_offs = ResHeaderPtr->packmem_list_offs; - for (package = 1; package < res_package; ++package) - { - file_offs += (DWORD)PACKMEM_LIST_SIZE - * GET_TYPE (ResHeaderPtr->PackageList[package - 1].packmem_info) - + (DWORD)INSTANCE_LIST_SIZE - * GET_INSTANCE (ResHeaderPtr->PackageList[package - 1].packmem_info); + for (i = 0; i < idx->numRes; i++) { + if (GET_PACKAGE (idx->res[i]->res) != pkg) + continue; + + if (idx->res[i]->handle != NULL_HANDLE) + continue; // Already loaded + + loadResourceDesc (idx, idx->res[i]); } - - return (file_offs); } -//#define DEBUG - MEM_HANDLE -load_package (INDEX_HEADERPTR ResHeaderPtr, RES_PACKAGE res_package) +loadResourceDesc (ResourceIndex *idx, ResourceDesc *desc) { - BOOLEAN DanglingOpen; - MEM_HANDLE hList; - uio_Stream *fp; - COUNT t, num_types, num_instances; - DWORD file_offs, data_len; - RES_HANDLE_LISTPTR ResourceHandleListPtr; - ENCODEPTR TypeEncodePtr; - DATAPTR DataPtr; -#ifdef PACKAGING - extern -#endif /* PACKAGING */ - char file_buf[PATHLEN]; - - num_types = CountPackageTypes (ResHeaderPtr, res_package); - num_instances = CountPackageInstances (ResHeaderPtr, res_package); - - if ((hList = AllocResourceHandleList ( - num_types, num_instances - )) == NULL_HANDLE) + RES_TYPE resType = GET_TYPE (desc->res); + + if (resType >= idx->typeInfo.numTypes || + idx->typeInfo.handlers[resType].loadFun == NULL) { -#ifdef DEBUG - fprintf (stderr, "Unable to allocate resource handle list <%d, %d>\n", - num_types, num_instances); -#endif /* DEBUG */ - return (NULL_HANDLE); + fprintf (stderr, "Warning: Unable to load '%s'; no handler " + "for type %d defined.\n", desc->path, resType); + return NULL_HANDLE; } - LockResourceHandleList (ResHeaderPtr, hList, res_package, - &ResourceHandleListPtr, &TypeEncodePtr, &DataPtr); - ResourceHandleListPtr->flags_and_data_loc = - ResHeaderPtr->PackageList[res_package - 1].flags_and_data_loc; - - DanglingOpen = FALSE; - file_offs = get_packmem_offs (ResHeaderPtr, res_package); - if (!(ResHeaderPtr->res_flags & IS_PACKAGED)) - { - SeekResFile (ResHeaderPtr->res_fp, (long)file_offs, SEEK_SET); - if (ReadResFile ((PSTR)TypeEncodePtr, - (PACKMEM_LIST_SIZE * num_types) - + (INSTANCE_LIST_SIZE * num_instances), - 1, ResHeaderPtr->res_fp) != 1) - { - UnlockResourceHandleList (hList); - FreeResourceHandleList (hList); - - return (NULL_HANDLE); - } - dword_convert (TypeEncodePtr, num_types); - } - else - { - COUNT file_index; - - memcpy (TypeEncodePtr, - (PSTR)((PSTR)ResHeaderPtr + (COUNT)file_offs), - (PACKMEM_LIST_SIZE * num_types) - + (INSTANCE_LIST_SIZE * num_instances)); - dword_convert (TypeEncodePtr, num_types); - - file_index = GET_PACKAGE ( - ResHeaderPtr->PackageList[res_package - 1].packmem_info - ); - get_resource_filename (ResHeaderPtr, file_buf, file_index); - if (!stricmp (ResHeaderPtr->index_file_name, file_buf)) - fp = ResHeaderPtr->res_fp; - else - { - fp = res_OpenResFile (contentDir, file_buf, "rb"); - if (fp) - DanglingOpen = TRUE; - } - - if (fp == NULL) - num_types = 0; - else - { - file_offs = ResourceHandleListPtr->flags_and_data_loc & ~0xFF000000; - if (file_offs) - SeekResFile (fp, (long)file_offs, SEEK_SET); - else if (num_types == 1 && GET_PACKAGE (*TypeEncodePtr) == 1) - { /* if only one thing in this package which is only - * package in its file, let file length be determined - * by the current length of package rather than the - * length at package time. - */ - RES_PACKAGE p; - - for (p = 1; p <= ResHeaderPtr->num_packages; ++p) - { - if (p != res_package - && GET_PACKAGE ( - ResHeaderPtr->PackageList[p - 1].packmem_info) - == file_index) - break; - } - - if (p > ResHeaderPtr->num_packages) - { - data_len = (LengthResFile (fp) + 3) >> 2; - DataPtr[0] = LOBYTE (data_len); - DataPtr[1] = HIBYTE (data_len); - } - } - } - } - - for (t = 0; t < num_types; ++t) - { - RES_TYPE type; - - type = GET_TYPE (*TypeEncodePtr); - num_instances = GET_PACKAGE (*TypeEncodePtr); - while (num_instances--) - { - MEM_HANDLE hData; - - _cur_resfile_name = file_buf; - - hData = NULL_HANDLE; - data_len = MAKE_WORD (DataPtr[0], DataPtr[1]); - if (ResHeaderPtr->res_flags & IS_PACKAGED) - { - if ((data_len <<= 2) == 0) - ; - else if (SeekResFile (fp, (long)file_offs, SEEK_SET)) - ; - else - { - hData = DoLoad (ResHeaderPtr, type, fp, data_len); - if (hData && IsIndexType (ResHeaderPtr, type)) - DanglingOpen = FALSE; -#ifdef DEBUG - if (hData == 0) - fprintf (stderr, "fp = 0x%08lx(%d), type = %u, " - "file_offs = %lu, len = %lu\n", - (unsigned long) fp, - DanglingOpen, type, file_offs, data_len); -#endif /* DEBUG */ - } - file_offs += data_len; - } - else - { - get_resource_filename (ResHeaderPtr, file_buf, (COUNT)data_len); - - fp = res_OpenResFile (contentDir, file_buf, "rb"); - if (fp == NULL) - { -#if 1 // def DEBUG - // HACK: added the 'if' here as not to scare people - // with the warning for this workaround. - // It will go with the new resource system. - // (together with the rest of this file) - if (strcmp(file_buf, "ignored.key") != 0) { - fprintf (stderr, "Can't open '%s'\n", file_buf); - } -#endif /* DEBUG */ - } - else - { - data_len = LengthResFile (fp); -#ifndef PACKAGING - fprintf (stderr, "\t'%s' -- %lu bytes\n", file_buf, - data_len); -#endif /* PACKAGING */ - if (data_len == 0) - hData = NULL_HANDLE; - else - hData = DoLoad (ResHeaderPtr, type, fp, data_len); - if (hData == 0 || !IsIndexType (ResHeaderPtr, type)) - res_CloseResFile (fp); - } - } -#ifdef DEBUG - if (hData == 0) - fprintf (stderr, "Can't create data for '%s' <%lu>\n", - file_buf, data_len); -#endif /* DEBUG */ - - DataPtr[0] = LOBYTE (hData); - DataPtr[1] = HIBYTE (hData); - DataPtr += 2; - - if (hData) - ++ResourceHandleListPtr->num_valid_handles; - - _cur_resfile_name = 0; - } - ++TypeEncodePtr; - } - - if (DanglingOpen) - res_CloseResFile (fp); - - num_instances = ResourceHandleListPtr->num_valid_handles; - UnlockResourceHandleList (hList); - - if (num_instances == 0) - { -#ifdef DEBUG - fprintf (stderr, "Nothing in package!\n"); -#endif /* DEBUG */ - FreeResourceHandleList (hList); - hList = NULL_HANDLE; - } - - return (hList); + desc->handle = loadResource (desc->path, + idx->typeInfo.handlers[resType].loadFun); + return desc->handle; } +MEM_HANDLE +loadResource(const char *path, ResourceLoadFun *loadFun) +{ + uio_Stream *stream; + long dataLen; + MEM_HANDLE handle; + + stream = res_OpenResFile (contentDir, path, "rb"); + if (stream == NULL) + { + fprintf (stderr, "Warning: Can't open '%s'\n", path); + return NULL_HANDLE; + } + + dataLen = LengthResFile (stream); +//#ifdef DEBUG +#if 1 + fprintf (stderr, "\t'%s' -- %lu bytes\n", path, dataLen); +#endif + + if (dataLen == 0) + { + fprintf (stderr, "Warning: Trying to load empty file '%s'.\n", path); + goto err; + } + + _cur_resfile_name = path; + handle = (*loadFun) (stream, dataLen); + _cur_resfile_name = NULL; + res_CloseResFile (stream); + + return handle; + +err: + res_CloseResFile (stream); + return NULL_HANDLE; +} + +// Get a resource by its resource ID. +// For historical reasons, if the resource is not already loaded, +// the *entire* package will be (pre-)loaded. +// NB. It may be better to add an extra flag to res_GetResource() to +// indicate whether you really want this, or add a separate function +// for preloading the entire package. MEM_HANDLE res_GetResource (RESOURCE res) { - MEM_HANDLE hData, hList; - RES_PACKAGE res_package; - RES_TYPE res_type; - RES_INSTANCE res_instance; - RES_HANDLE_LISTPTR ResourceHandleListPtr; - ENCODEPTR TypeEncodePtr; - DATAPTR DataPtr; - INDEX_HEADERPTR ResHeaderPtr; - UWORD hi; + ResourceIndex *resourceIndex; + ResourceDesc *desc; + + resourceIndex = _get_current_index_header (); - ResHeaderPtr = _get_current_index_header (); - if (!ValidResource (ResHeaderPtr, res)) + desc = lookupResourceDesc (resourceIndex, res); + if (desc == NULL) { -#ifdef DEBUG - if (res) - fprintf (stderr, "0x%08lx is not a valid resource!\n", res); -#endif /* DEBUG */ - return (NULL_HANDLE); + fprintf (stderr, "Trying to get undefined resource %08lx\n", + (DWORD) res); + return NULL_HANDLE; } - res_package = GET_PACKAGE (res); + if (desc->handle != NULL_HANDLE) + return desc->handle; - hi = HIWORD (ResHeaderPtr->PackageList[res_package - 1].flags_and_data_loc); - if (HIBYTE (hi) == 0) - // Package is loaded. - hList = (MEM_HANDLE)LOWORD ( - ResHeaderPtr->PackageList[res_package - 1].flags_and_data_loc); - else - { - // Package is not loaded. Load now. - hList = load_package (ResHeaderPtr, res_package); - if (hList == NULL_HANDLE) - { -#ifdef DEBUG - fprintf (stderr, "Unable to load package %u\n", res_package); -#endif /* DEBUG */ - return (NULL_HANDLE); - } + // Load the entire package, for historical reasons. + loadPackage (resourceIndex, GET_PACKAGE (res)); - ResHeaderPtr->PackageList[res_package - 1].flags_and_data_loc = - MAKE_DWORD (hList, 0); - } - - res_type = GET_TYPE (res); - res_instance = GET_INSTANCE (res); - - LockResourceHandleList (ResHeaderPtr, hList, res_package, - &ResourceHandleListPtr, &TypeEncodePtr, &DataPtr); - - while (GET_TYPE (*TypeEncodePtr) != res_type) - { - DataPtr += (GET_PACKAGE (*TypeEncodePtr) << 1); - ++TypeEncodePtr; - } - DataPtr += (res_instance - GET_INSTANCE (*TypeEncodePtr)) << 1; - hData = MAKE_WORD (DataPtr[0], DataPtr[1]); - UnlockResourceHandleList (hList); - -#ifdef DEBUG - if (hData == 0) - fprintf (stderr, "No data for res 0x%08lx\n", res); -#endif /* DEBUG */ - return (hData); + return desc->handle; + // May still be NULL_HANDLE, if the load failed. } -static MEM_HANDLE -get_res_handle (RESOURCE res, BOOLEAN DoDetach) +// NB: this function appears to be never called! +void +res_FreeResource (RESOURCE res) { - MEM_HANDLE hData = NULL_HANDLE; - RES_PACKAGE res_package; - RES_TYPE res_type; - RES_INSTANCE res_instance; - INDEX_HEADERPTR ResHeaderPtr; - UWORD hi; + ResourceDesc *desc; + ResourceFreeFun *freeFun; - ResHeaderPtr = _get_current_index_header (); - if (!ValidResource (ResHeaderPtr, res)) - return (hData); - - res_package = GET_PACKAGE (res); - res_type = GET_TYPE (res); - res_instance = GET_INSTANCE (res); - - hi = HIWORD (ResHeaderPtr->PackageList[res_package - 1].flags_and_data_loc); - if (HIBYTE (hi) == 0) + desc = lookupResourceDesc (_get_current_index_header(), res); + if (desc == NULL) { - MEM_HANDLE hList; - COUNT num_instances; - RES_HANDLE_LISTPTR ResourceHandleListPtr; - ENCODEPTR TypeEncodePtr; - DATAPTR DataPtr; - DWORD flags_and_data_loc; - - hList = LOWORD (ResHeaderPtr->PackageList[res_package - 1].flags_and_data_loc); - LockResourceHandleList (ResHeaderPtr, hList, res_package, - &ResourceHandleListPtr, &TypeEncodePtr, &DataPtr); - - while (GET_TYPE (*TypeEncodePtr) != res_type) - { - DataPtr += (GET_PACKAGE (*TypeEncodePtr) << 1); - ++TypeEncodePtr; - } - DataPtr += (res_instance - GET_INSTANCE (*TypeEncodePtr)) << 1; - hData = MAKE_WORD (DataPtr[0], DataPtr[1]); - if (hData && DoDetach) - { - DataPtr[0] = DataPtr[1] = 0; - --ResourceHandleListPtr->num_valid_handles; - - flags_and_data_loc = ResourceHandleListPtr->flags_and_data_loc; - } - num_instances = ResourceHandleListPtr->num_valid_handles; - UnlockResourceHandleList (hList); - - if (num_instances == 0) - { - FreeResourceHandleList (hList); - - ResHeaderPtr->PackageList[res_package - 1].flags_and_data_loc = - flags_and_data_loc; - } +#ifdef DEBUG + fprintf (stderr, "Warning: trying to free an unrecognised " + "resource.\n"); +#endif + return; + } + + if (desc->handle == NULL_HANDLE) + { +#ifdef DEBUG + fprintf (stderr, "Warning: trying to free not loaded " + "resource.\n"); +#endif + return; } - return (hData); -} - -BOOLEAN -FreeResource (RESOURCE res) -{ - MEM_HANDLE hData; - - hData = get_res_handle (res, FALSE); - if (hData) - { - RES_TYPE res_type; - INDEX_HEADERPTR ResHeaderPtr; - - res_type = GET_TYPE (res); - ResHeaderPtr = _get_current_index_header (); - if (DoFree (ResHeaderPtr, res_type, hData) - && get_res_handle (res, TRUE)) - return (TRUE); - } - - return (FALSE); + ResourceIndex *idx = _get_current_index_header (); + freeFun = idx->typeInfo.handlers[GET_TYPE (res)].freeFun; + (*freeFun) (desc->handle); + desc->handle = NULL_HANDLE; } +// By calling this function the caller will be responsible of unloading +// the resource. If res_GetResource() get called again for this +// resource, a NEW copy will be loaded, regardless of whether a detached +// copy still exists. MEM_HANDLE res_DetachResource (RESOURCE res) { - return (get_res_handle (res, TRUE)); + ResourceDesc *desc; + MEM_HANDLE result; + + desc = lookupResourceDesc (_get_current_index_header(), res); + if (desc == NULL) + { +#ifdef DEBUG + fprintf (stderr, "Warning: trying to detach from an unrecognised " + "resource.\n"); +#endif + return NULL_HANDLE; + } + + if (desc->handle == NULL_HANDLE) + { +#ifdef DEBUG + fprintf (stderr, "Warning: trying to detach from a not loaded " + "resource.\n"); +#endif + return NULL_HANDLE; + } + + result = desc->handle; + desc->handle = NULL_HANDLE; + + return result; } + diff --git a/sc2/src/sc2code/libs/resource/index.h b/sc2/src/sc2code/libs/resource/index.h index 4939e8e47..06a72fdcc 100644 --- a/sc2/src/sc2code/libs/resource/index.h +++ b/sc2/src/sc2code/libs/resource/index.h @@ -23,95 +23,55 @@ typedef struct { - MEM_HANDLE (*load_func) (uio_Stream *fp, DWORD len); - BOOLEAN (*free_func) (MEM_HANDLE handle); -} RES_VECTORS; + RESOURCE res; + char *path; + MEM_HANDLE handle; + //COUNT ref; +} ResourceDesc; typedef struct { - RES_INSTANCE instance_count; - RES_VECTORS func_vectors; -} TYPE_DESC; -typedef TYPE_DESC *PTYPE_DESC; + ResourceLoadFun *loadFun; + ResourceFreeFun *freeFun; +} ResourceHandlers; typedef struct { - RESOURCE packmem_info; - DWORD flags_and_data_loc; - /* data_loc doubles as 3 byte offset into package file or 2 byte - * MEM_HANDLE to package member array with the offset stored in - * the MEM_HANDLE (cuts down on use of near memory). +} ResourceType; + +typedef struct +{ + RES_TYPE numTypes; + /* Number of types in the handlers array (whether NULL or not). + * == the highest stored vector number + 1. */ -} PACKAGE_DESC; -typedef PACKAGE_DESC *PPACKAGE_DESC; - -typedef BYTE RES_FLAGS; -#define IS_PACKAGED ((RES_FLAGS)(1 << 0)) + ResourceHandlers *handlers; +} ResourceTypeInfo; typedef struct { - uio_Stream *res_fp; + ResourceDesc **res; + ResourceTypeInfo typeInfo; + size_t numRes; +} ResourceIndex; - DWORD packmem_list_offs; - DWORD path_list_offs; - DWORD file_list_offs; - RES_PACKAGE num_packages; - RES_TYPE num_types; - RES_FLAGS res_flags; +void +forAllResourceIndices( + void (*callback) (ResourceIndex *idx, void *extra), void *extra); - union - { - DWORD header_len; - struct - { - PPACKAGE_DESC package_list; - PTYPE_DESC type_list; - } lists; - } index_info; - -#ifndef PACKAGING - char index_file_name[36]; - DWORD data_offs; - MEM_HANDLE hPredHeader, hSuccHeader; -#endif /* PACKAGING */ -} INDEX_HEADER; -typedef INDEX_HEADER *PINDEX_HEADER; - -typedef PINDEX_HEADER INDEX_HEADERPTR; - -void forAllResourceIndices( - void (*callback)(INDEX_HEADERPTR ResHeaderPtr, void *extra), - void *extra); - -#define PackageList index_info.lists.package_list -#define TypeList index_info.lists.type_list #define INDEX_HEADER_PRIORITY DEFAULT_MEM_PRIORITY -#define AllocResourceHeader(s) \ - mem_allocate ((s), MEM_ZEROINIT | MEM_PRIMARY, \ - INDEX_HEADER_PRIORITY, MEM_SIMPLE) -#define LockResourceHeader (INDEX_HEADERPTR)mem_lock -#define UnlockResourceHeader mem_unlock -#define FreeResourceHeader mem_release -typedef struct -{ - BYTE path_offset[2]; - char filename[8]; - char extension[3]; -} FILE_INFO; +static inline ResourceIndex * +lockResourceIndex (MEM_HANDLE h) { + return (ResourceIndex *) mem_lock (h); +} +static inline void +unlockResourceIndex (MEM_HANDLE h) { + mem_unlock (h); +} -#define FILE_NAME_SIZE 8 -#define EXTENSION_SIZE 3 -#define NO_PATH 0xFFFF - -#define FILE_LIST_SIZE \ - ((sizeof (BYTE) * 2) + FILE_NAME_SIZE + EXTENSION_SIZE) -#define PACKMEM_LIST_SIZE \ - (sizeof (DWORD)) -#define INSTANCE_LIST_SIZE \ - (sizeof (BYTE) * 2) #endif /* _INDEX_H */ diff --git a/sc2/src/sc2code/libs/resource/resdata.c b/sc2/src/sc2code/libs/resource/resdata.c index 79cff72ff..48db3df1d 100644 --- a/sc2/src/sc2code/libs/resource/resdata.c +++ b/sc2/src/sc2code/libs/resource/resdata.c @@ -18,17 +18,17 @@ #include "resintrn.h" -static INDEX_HEADERPTR CurResHeaderPtr; +static ResourceIndex *curResourceIndex; void -_set_current_index_header (INDEX_HEADERPTR ResHeaderPtr) +_set_current_index_header (ResourceIndex *newResourceIndex) { - CurResHeaderPtr = ResHeaderPtr; + curResourceIndex = newResourceIndex; } -INDEX_HEADERPTR +ResourceIndex * _get_current_index_header (void) { - return (CurResHeaderPtr); + return curResourceIndex; } diff --git a/sc2/src/sc2code/libs/resource/resinit.c b/sc2/src/sc2code/libs/resource/resinit.c index d4f38fd5f..0b0c2b621 100644 --- a/sc2/src/sc2code/libs/resource/resinit.c +++ b/sc2/src/sc2code/libs/resource/resinit.c @@ -17,277 +17,347 @@ */ #include "resintrn.h" +#include "misc.h" #include "options.h" +#include "types.h" +#include "libs/list.h" +#include +#include + + +static bool copyResTypeHandlers (ResourceIndex *dest, + const ResourceIndex *src); +static bool setResTypeHandlers (ResourceIndex *idx, RES_TYPE resType, + const ResourceHandlers *handlers); +static MEM_HANDLE allocResourceIndex(void); +static void freeResourceIndex (MEM_HANDLE h); + + +static List_List *indexList; -static MEM_HANDLE hIndexList; -// Add a package index to the global list of package indices. static void -_add_index_list (MEM_HANDLE hRH) +initIndexList (void) { -#ifndef PACKAGING - INDEX_HEADERPTR ResHeaderPtr; - - ResHeaderPtr = LockResourceHeader (hRH); - strncpy (ResHeaderPtr->index_file_name, _cur_resfile_name, - sizeof (ResHeaderPtr->index_file_name) - 1); - ResHeaderPtr->hPredHeader = 0; - ResHeaderPtr->hSuccHeader = hIndexList; - if (ResHeaderPtr->hSuccHeader) - { - INDEX_HEADERPTR SuccResHeaderPtr; - - SuccResHeaderPtr = LockResourceHeader (hIndexList); - SuccResHeaderPtr->hPredHeader = hRH; - UnlockResourceHeader (hIndexList); - } - UnlockResourceHeader (hRH); -#endif /* PACKAGING */ - - hIndexList = hRH; + indexList = List_newList (); } -// Remove a package index from the global list of package indices. static void -_sub_index_list (MEM_HANDLE hRH) +uninitIndexList (void) { -#ifdef PACKAGING - hIndexList = 0; -#else /* !PACKAGING */ - INDEX_HEADERPTR ResHeaderPtr; - MEM_HANDLE hPred, hSucc; - - ResHeaderPtr = LockResourceHeader (hRH); - - hPred = ResHeaderPtr->hPredHeader; - hSucc = ResHeaderPtr->hSuccHeader; - if (hRH == hIndexList) - hIndexList = hSucc; - - if (hPred) - { - INDEX_HEADERPTR PredResHeaderPtr; - - PredResHeaderPtr = LockResourceHeader (hPred); - PredResHeaderPtr->hSuccHeader = hSucc; - UnlockResourceHeader (hPred); - } - if (hSucc) - { - INDEX_HEADERPTR SuccResHeaderPtr; - - SuccResHeaderPtr = LockResourceHeader (hSucc); - SuccResHeaderPtr->hPredHeader = hPred; - UnlockResourceHeader (hSucc); - } - - UnlockResourceHeader (hRH); -#endif /* PACKAGING */ + List_deleteList (indexList); + indexList = NULL; } -MEM_HANDLE -_GetResFileData (uio_Stream *res_fp, DWORD flen) -{ - UWORD lo_word, hi_word; - DWORD res_offs; - DWORD remainder = 0; - // Initialisation is to keep the compiler quiet. - MEM_SIZE HeaderSize; - INDEX_HEADER h; - INDEX_HEADERPTR ResHeaderPtr; - MEM_HANDLE hRH; - char buf[32]; +void +forAllResourceIndices( + void (*callback) (ResourceIndex *idx, void *extra), + void *extra) { + List_Link *link; - res_offs = TellResFile (res_fp); - - ReadResFile (buf, 1, 22, res_fp); - - h.res_fp = res_fp; - h.res_flags = MAKE_WORD (buf[0], buf[1]) ? IS_PACKAGED : 0; - - lo_word = MAKE_WORD (buf[2], buf[3]); - hi_word = MAKE_WORD (buf[4], buf[5]); - h.packmem_list_offs = MAKE_DWORD (lo_word, hi_word); - - lo_word = MAKE_WORD (buf[6], buf[7]); - hi_word = MAKE_WORD (buf[8], buf[9]); - h.path_list_offs = MAKE_DWORD (lo_word, hi_word); - - lo_word = MAKE_WORD (buf[10], buf[11]); - hi_word = MAKE_WORD (buf[12], buf[13]); - h.file_list_offs = MAKE_DWORD (lo_word, hi_word); - - h.num_packages = (RES_PACKAGE)MAKE_WORD (buf[14], buf[15]); - h.num_types = (RES_TYPE)MAKE_WORD (buf[16], buf[17]); - - lo_word = MAKE_WORD (buf[18], buf[19]); - hi_word = MAKE_WORD (buf[20], buf[21]); - h.index_info.header_len = MAKE_DWORD (lo_word, hi_word); - - HeaderSize = (MEM_SIZE)(sizeof (INDEX_HEADER) - + (sizeof (PACKAGE_DESC) * h.num_packages) - + (sizeof (TYPE_DESC) * h.num_types)); - if (h.res_flags & IS_PACKAGED) + for (link = indexList->first; link != NULL; link = link->next) { - DWORD offs; + ResourceIndex *idx = (ResourceIndex *) link->entry; + (*callback) (idx, extra); + } +} - remainder = h.index_info.header_len - h.packmem_list_offs; - offs = HeaderSize - h.packmem_list_offs; - HeaderSize += remainder; - h.packmem_list_offs += offs; - h.file_list_offs += offs; - h.path_list_offs += offs; + +#if 0 +static ResourceDesc * +lookupResourceIndex (const char *path) +{ + List_Link *link; + + for (link = indexList->first; link != NULL; link = link->next) + { + ResourceDesc *desc = (ResourceDesc *) link->entry; + + if (strcmp (desc->path, path) == 0) + return link->entry; } -#ifndef PACKAGING - { - MEM_HANDLE hNextRH; + return NULL; +} +#endif - h.data_offs = res_offs; - for (hRH = hIndexList; hRH != 0; hRH = hNextRH) +static ResourceDesc * +newResourceDesc (RESOURCE res, char *path) +{ + ResourceDesc *result; + + result = HMalloc (sizeof (ResourceDesc)); + if (result == NULL) + return NULL; + + result->res = res; + result->path = path; + result->handle = NULL_HANDLE; + //result->ref = 0; + return result; +} + +static MEM_HANDLE +loadResourceIndex (uio_Stream *stream, const char *fileName) { + size_t lineNum; + ResourceDesc **descs = NULL; + COUNT numRes; + int numDescsAlloced = 0; + MEM_HANDLE indexHandle = NULL_HANDLE; + ResourceIndex *ndx = NULL; +#ifdef DEBUG + RESOURCE lastResource = 0x00000000; +#endif + + // This loop parses lines of the format " ". + // Resnum is in hex. '#' can be used to add comments. + lineNum = 0; + numRes = 0; + for (;;) + { + char lineBuf[PATH_MAX + 80]; + char *ptr; + char *endResPtr; + char *endPtr; + char *path; + char *newPath; + RESOURCE res; + ResourceDesc *desc; + + if (uio_fgets (lineBuf, sizeof lineBuf, stream) == NULL) { - ResHeaderPtr = LockResourceHeader (hRH); - if (h.data_offs == ResHeaderPtr->data_offs - && strncmp (ResHeaderPtr->index_file_name, - _cur_resfile_name, - sizeof (ResHeaderPtr->index_file_name) - 1) == 0) - return (hRH); /* DON'T UNLOCK IT */ - - hNextRH = ResHeaderPtr->hSuccHeader; - UnlockResourceHeader (hRH); + if (uio_ferror (stream)) + goto err; + else + break; // EOF } - } -#endif /* PACKAGING */ - if ((hRH = AllocResourceHeader (HeaderSize)) - && (ResHeaderPtr = LockResourceHeader (hRH))) - { - *ResHeaderPtr = h; + lineNum++; + // Skip comments. + ptr = strchr (lineBuf, '#'); + if (ptr != NULL) + *ptr = '\0'; + + // Omit leading whitespace. + ptr = lineBuf; + while (isspace (*ptr)) + ptr++; + + // Omit trailing whitespace. + endPtr = ptr + strlen(ptr); + while (endPtr != ptr && isspace (endPtr[-1])) { - RES_PACKAGE p; + endPtr--; + *endPtr = '\0'; + } - ResHeaderPtr->PackageList = (PPACKAGE_DESC)&ResHeaderPtr[1]; - for (p = 0; p < ResHeaderPtr->num_packages; ++p) + // If the line is empty (apart from comments and whitespace) + // go to the next one. + if (*ptr == 0) + continue; + + // Find the separator between the resource number and the path. + endResPtr = ptr; + do { + endResPtr++; + } while (*endResPtr != '\0' && !isspace (*endResPtr)); + + // Skip the separator + path = endResPtr; + while (isspace (*path)) + path++; + + if (*path == 0) + { + // No path present after the line number. + fprintf (stderr, "Resource index '%s': Invalid line %d.\n", + fileName, lineNum); + continue; + } + + // Parse the resource number. + { + *endResPtr = '\0'; + res = strtoul (ptr, &endResPtr, 16); + if (*endResPtr != '\0') { - ReadResFile (buf, 1, 8, res_fp); - - lo_word = MAKE_WORD (buf[0], buf[1]); - hi_word = MAKE_WORD (buf[2], buf[3]); - ResHeaderPtr->PackageList[p].packmem_info = - (RESOURCE)MAKE_DWORD (lo_word, hi_word); - - lo_word = MAKE_WORD (buf[4], buf[5]); - hi_word = MAKE_WORD (buf[6], buf[7]); - ResHeaderPtr->PackageList[p].flags_and_data_loc = - MAKE_DWORD (lo_word, hi_word) + res_offs; + // Invalid characters in the resource number. + fprintf (stderr, "Resource index '%s': Invalid line %d.\n", + fileName, lineNum); + continue; } } +#ifdef DEBUG + // We need the list to be sorted, as we binary search through it. + if (res <= lastResource) { - RES_TYPE t; - INDEX_HEADERPTR CurResHeaderPtr; + fprintf (stderr, "Fatal: resource index '%s' is not sorted " + "on the resource number, or contains a double entry. " + "Problem encountered on line %d.\n", fileName, lineNum); + abort (); + } + lastResource = res; +#endif - CurResHeaderPtr = _get_current_index_header (); - - ResHeaderPtr->TypeList = - (PTYPE_DESC)&ResHeaderPtr->PackageList[ResHeaderPtr->num_packages]; - for (t = 0; t < ResHeaderPtr->num_types; ++t) - { - ReadResFile (buf, 1, 2, res_fp); - - ResHeaderPtr->TypeList[t].instance_count = - MAKE_WORD (buf[0], buf[1]); - if (CurResHeaderPtr) - ResHeaderPtr->TypeList[t].func_vectors = - CurResHeaderPtr->TypeList[t].func_vectors; - } +#define DESC_NUM_INCREMENT 80 + if (numDescsAlloced <= numRes) + { + // Need to enlarge the array of resource descs. + ResourceDesc **newDescs = HRealloc (descs, + sizeof (ResourceDesc *) * + (numDescsAlloced + DESC_NUM_INCREMENT)); + if (newDescs == NULL) + goto err; // Original descs is untouched. + descs = newDescs; + numDescsAlloced += DESC_NUM_INCREMENT; } - if (h.res_flags & IS_PACKAGED) - ReadResFile (&ResHeaderPtr->TypeList[ResHeaderPtr->num_types], - 1, (COUNT)remainder, res_fp); + // Can't use strdup; it doesn't use HMalloc. + newPath = HMalloc (endPtr - path + 1); + if (newPath == NULL) + goto err; + strcpy (newPath, path); - _add_index_list (hRH); + desc = newResourceDesc (res, newPath); + if (desc == NULL) + goto err; - return (hRH); /* DON'T UNLOCK IT */ + descs[numRes] = desc; + numRes++; } - FreeResourceHeader (hRH); - (void) flen; /* Satisfy compiler (unused parameter) */ - return (NULL_HANDLE); + { + ResourceDesc **newDescs = HRealloc (descs, + sizeof (ResourceDesc *) * numRes); + if (newDescs == NULL && numRes != 0) + goto err; // Original descs is untouched. + descs = newDescs; + } + +#ifdef DEBUG + if (numRes == 0) + fprintf (stderr, "Warning: Resource index '%s' contains no valid " + "entries.\n", fileName); +#endif + + indexHandle = allocResourceIndex (); + if (indexHandle == NULL_HANDLE) + goto err; + + ndx = lockResourceIndex (indexHandle); + ndx->res = descs; + ndx->numRes = numRes; + ndx->typeInfo.numTypes = 0; + ndx->typeInfo.handlers = NULL; + List_add (indexList, (void *) ndx); + unlockResourceIndex (indexHandle); + + return indexHandle; + +err: + if (indexHandle != NULL_HANDLE) + freeResourceIndex (indexHandle); + HFree (descs); + return NULL_HANDLE; } +// Get the data associated with a resource of type RES_INDEX +// (In other words, a ResourceIndex) MEM_HANDLE -InitResourceSystem (const char *resfile, COUNT resindex_type, BOOLEAN - (*FileErrorFunc) (const char *filename)) +_GetResFileData (uio_Stream *res_fp, DWORD fileLength) { - MEM_HANDLE h; + MEM_HANDLE handle; + ResourceIndex *ndx; + ResourceIndex *parentNdx; - h = OpenResourceIndexFile (resfile); - if (h) - { - SetResourceIndex (h); +#if 0 + ResourceDesc *desc; - InstallResTypeVectors (resindex_type, - _GetResFileData, FreeResourceHeader); - } + desc = lookupResourceIndex (_cur_resfile_name); + assert(desc != NULL); - (void) FileErrorFunc; /* Satisfy compiler (unused parameter) */ - return (h); + if (desc->handle != NULL_HANDLE) + return desc->handle; +#endif + + handle = loadResourceIndex (res_fp, _cur_resfile_name); + if (handle == NULL_HANDLE) + return NULL_HANDLE; + + ndx = lockResourceIndex (handle); + parentNdx = _get_current_index_header (); + if (parentNdx != NULL) + copyResTypeHandlers (ndx, parentNdx); + + unlockResourceIndex (handle); + + (void) fileLength; + return handle; } BOOLEAN +_ReleaseResFileData (MEM_HANDLE handle) +{ + ResourceIndex *ndx; + + ndx = lockResourceIndex (handle); + if (ndx->typeInfo.handlers != NULL) + HFree (ndx->typeInfo.handlers); + unlockResourceIndex (handle); + mem_release (handle); + return TRUE; +} + +MEM_HANDLE +InitResourceSystem (const char *resfile, RES_TYPE resType, BOOLEAN + (*FileErrorFun) (const char *filename)) +{ + MEM_HANDLE handle; + ResourceIndex *ndx; + + initIndexList (); + + ResourceHandlers handlers; + + handlers.loadFun = _GetResFileData; + handlers.freeFun = _ReleaseResFileData; + + SetResourceIndex (NULL_HANDLE); + handle = loadResource (resfile, handlers.loadFun); + if (handle == NULL_HANDLE) + return NULL_HANDLE; + + ndx = lockResourceIndex (handle); + setResTypeHandlers (ndx, resType, &handlers); + unlockResourceIndex (handle); + + SetResourceIndex (handle); + + (void) FileErrorFun; + return handle; +} + +void UninitResourceSystem (void) { - if (hIndexList) +#if 0 + List_Link *link; + + for (link = indexList->first; link != NULL; link = link->next) { - do - CloseResourceIndex (hIndexList); - while (hIndexList); - - return (TRUE); + ResourceIndex *ndx = (ResourceIndex *) link->entry; + } - - return (FALSE); +#endif + uninitIndexList (); + + SetResourceIndex (NULL_HANDLE); } MEM_HANDLE -OpenResourceIndexFile (const char *resfile) -{ - uio_Stream *res_fp; - char fullname[256]; - - strcpy (fullname, resfile); - res_fp = res_OpenResFile (contentDir, fullname, "rb"); - if (res_fp == 0) - { - sprintf (fullname, "%s.pkg", resfile); - res_fp = res_OpenResFile (contentDir, fullname, "rb"); - if (res_fp == 0) - { - sprintf (fullname, "%s.ndx", resfile); - res_fp = res_OpenResFile (contentDir, fullname, "rb"); - } - } - - if (res_fp) - { - MEM_HANDLE hRH; - - _cur_resfile_name = fullname; - - hRH = _GetResFileData (res_fp, LengthResFile (res_fp)); - /* DO NOT res_CloseResFile!!! */ - - return (hRH); - } - - return (0); -} - -MEM_HANDLE -OpenResourceIndexInstance (DWORD res) +OpenResourceIndexInstance (RESOURCE res) { MEM_HANDLE hRH; @@ -298,135 +368,119 @@ OpenResourceIndexInstance (DWORD res) return (hRH); } +// Sets the current global resource index. +// This is the index res_GetResource() calls will use. MEM_HANDLE -SetResourceIndex (MEM_HANDLE hRH) +SetResourceIndex (MEM_HANDLE newIndexHandle) { - MEM_HANDLE hOldRH; - static MEM_HANDLE hCurResHeader; + static MEM_HANDLE currentIndexHandle; + // NB: currentIndexHandle is locked. + MEM_HANDLE oldIndexHandle; + + if (currentIndexHandle != NULL_HANDLE) + unlockResourceIndex (currentIndexHandle); - if ((hOldRH = hCurResHeader) != hRH) - { - INDEX_HEADERPTR ResHeaderPtr; + oldIndexHandle = currentIndexHandle; + currentIndexHandle = newIndexHandle; - ResHeaderPtr = LockResourceHeader (hRH); - UnlockResourceHeader (hRH); - _set_current_index_header (ResHeaderPtr); - hCurResHeader = hRH; - } + if (currentIndexHandle != NULL_HANDLE) { + ResourceIndex *ndx; - return (hOldRH); + ndx = lockResourceIndex (currentIndexHandle); + _set_current_index_header (ndx); + } else + _set_current_index_header (NULL); + + return oldIndexHandle; } BOOLEAN -CloseResourceIndex (MEM_HANDLE hRH) +CloseResourceIndex (MEM_HANDLE handle) { - if (UnlockResourceHeader (hRH)) - { - uio_Stream *res_fp; - INDEX_HEADERPTR ResHeaderPtr; + ResourceIndex *ndx; + + unlockResourceIndex (handle); - ResHeaderPtr = LockResourceHeader (hRH); -#ifdef DEBUG - { - COUNT i; + ndx = lockResourceIndex (handle); + if (ndx == _get_current_index_header ()) + SetResourceIndex (NULL_HANDLE); - for (i = 0; i < ResHeaderPtr->num_packages; ++i) - { - UWORD hi; + List_remove ((void *) indexList, ndx); + + unlockResourceIndex (handle); - hi = HIWORD (ResHeaderPtr->PackageList[i].flags_and_data_loc); - if (HIBYTE (hi) == 0) - { - MEM_HANDLE hList; - RES_HANDLE_LISTPTR ResourceHandleListPtr; - ENCODEPTR TypeEncodePtr; - DATAPTR DataPtr; + _ReleaseResFileData (handle); - hList = (MEM_HANDLE)LOWORD ( - ResHeaderPtr->PackageList[i].flags_and_data_loc); - LockResourceHandleList (ResHeaderPtr, hList, i + 1, - &ResourceHandleListPtr, &TypeEncodePtr, &DataPtr); - fprintf (stderr, "Package %u has %u instances left\n", - i + 1, ResourceHandleListPtr->num_valid_handles); - UnlockResourceHandleList (hList); - } - } - } -#endif /* DEBUG */ - - _sub_index_list (hRH); - res_fp = ResHeaderPtr->res_fp; - if (ResHeaderPtr == _get_current_index_header ()) - SetResourceIndex (hIndexList); - UnlockResourceHeader (hRH); - FreeResourceHeader (hRH); - - if (res_fp) - { - MEM_HANDLE hNextRH; - - for (hRH = hIndexList; hRH && res_fp; hRH = hNextRH) - { - ResHeaderPtr = LockResourceHeader (hRH); - if (res_fp == ResHeaderPtr->res_fp) - res_fp = 0; - hNextRH = ResHeaderPtr->hSuccHeader; - UnlockResourceHeader (hRH); - } - - if (res_fp) - res_CloseResFile (res_fp); - } - - return (TRUE); - } - - return (FALSE); + return TRUE; } BOOLEAN -InstallResTypeVectors (COUNT res_type, - MEM_HANDLE (*load_func) (uio_Stream *fp, DWORD len), - BOOLEAN (*free_func) (MEM_HANDLE handle)) +InstallResTypeVectors (RES_TYPE resType, ResourceLoadFun *loadFun, + ResourceFreeFun *freeFun) { - INDEX_HEADERPTR ResHeaderPtr; + ResourceHandlers handlers; + handlers.loadFun = loadFun; + handlers.freeFun = freeFun; - ResHeaderPtr = _get_current_index_header (); - if (ValidResType (ResHeaderPtr, res_type)) - { - ResHeaderPtr->TypeList[res_type - 1].func_vectors.load_func = load_func; - ResHeaderPtr->TypeList[res_type - 1].func_vectors.free_func = free_func; + setResTypeHandlers(_get_current_index_header (), resType, &handlers); + return TRUE; +} - return (TRUE); +static bool +setResTypeHandlers (ResourceIndex *idx, RES_TYPE resType, + const ResourceHandlers *handlers) +{ + if (resType >= idx->typeInfo.numTypes) { + // Have to enlarge the handler array. + ResourceHandlers *newHandlers = HRealloc (idx->typeInfo.handlers, + (resType + 1) * sizeof (ResourceHandlers)); + if (newHandlers == NULL) + return false; // idx->typeInfo.handlers is untouched + + // Clear the space for new entries. No need to init the last one; + // it's going to be used immediately. + memset (&newHandlers[idx->typeInfo.numTypes], 0, + (resType - idx->typeInfo.numTypes /* + 1 - 1 */) + * sizeof (ResourceHandlers)); + + idx->typeInfo.handlers = newHandlers; + idx->typeInfo.numTypes = resType + 1; } - return (FALSE); + idx->typeInfo.handlers[resType] = *handlers; + return true; } -COUNT -CountResourceTypes (void) +static bool +copyResTypeHandlers (ResourceIndex *dest, const ResourceIndex *src) { - INDEX_HEADERPTR ResHeaderPtr; + assert (src != dest); - ResHeaderPtr = _get_current_index_header (); - return ((COUNT)ResHeaderPtr->num_types); -} + if (dest->typeInfo.handlers != NULL) + HFree (dest->typeInfo.handlers); -void -forAllResourceIndices( - void (*callback) (INDEX_HEADERPTR ResHeaderPtr, void *extra), - void *extra) { - MEM_HANDLE hRH; - MEM_HANDLE hNextRH; - INDEX_HEADERPTR ResHeaderPtr; + dest->typeInfo.handlers = HMalloc (src->typeInfo.numTypes * + sizeof (ResourceHandlers)); + if (dest->typeInfo.handlers == NULL) + return false; + + memcpy (dest->typeInfo.handlers, src->typeInfo.handlers, + src->typeInfo.numTypes * sizeof (ResourceHandlers)); + dest->typeInfo.numTypes = src->typeInfo.numTypes; + + return true; +} - for (hRH = hIndexList; hRH != 0; hRH = hNextRH) - { - ResHeaderPtr = LockResourceHeader (hRH); - hNextRH = ResHeaderPtr->hSuccHeader; - (*callback) (ResHeaderPtr, extra); - UnlockResourceHeader (hRH); - } + +static MEM_HANDLE +allocResourceIndex (void) { + return mem_allocate (sizeof (ResourceIndex), MEM_PRIMARY, + INDEX_HEADER_PRIORITY, MEM_SIMPLE); +} + +static void +freeResourceIndex (MEM_HANDLE h) { + mem_release (h); } diff --git a/sc2/src/sc2code/libs/resource/resintrn.h b/sc2/src/sc2code/libs/resource/resintrn.h index e9ab5572e..455e47bdd 100644 --- a/sc2/src/sc2code/libs/resource/resintrn.h +++ b/sc2/src/sc2code/libs/resource/resintrn.h @@ -20,59 +20,14 @@ #define _RESINTRN_H #include -#include "reslib.h" +#include "libs/reslib.h" #include "index.h" -typedef struct -{ - DWORD flags_and_data_loc; - COUNT num_valid_handles; -} RES_HANDLE_LIST; -typedef RES_HANDLE_LIST *PRES_HANDLE_LIST; -typedef PRES_HANDLE_LIST RES_HANDLE_LISTPTR; +MEM_HANDLE loadResourceDesc (ResourceIndex *idx, ResourceDesc *desc); +MEM_HANDLE loadResource(const char *path, ResourceLoadFun *loadFun); -typedef PDWORD ENCODEPTR; -typedef PBYTE DATAPTR; - -#define RES_HANDLE_LIST_PRIORITY DEFAULT_MEM_PRIORITY - -#define AllocResourceHandleList(nt,ni) \ - mem_allocate ((MEM_SIZE)(sizeof (RES_HANDLE_LIST) \ - + (PACKMEM_LIST_SIZE * (nt)) \ - + (INSTANCE_LIST_SIZE * (ni))), MEM_ZEROINIT | MEM_PRIMARY, \ - RES_HANDLE_LIST_PRIORITY, MEM_SIMPLE) -#define LockResourceHandleList(pRH,h,p,rp,tp,dp) \ -do \ -{ \ - *(rp) = (RES_HANDLE_LISTPTR)mem_lock ((MEM_HANDLE)h); \ - *(tp) = (ENCODEPTR)&(*(rp))[1]; \ - *(dp) = (DATAPTR)&(*(tp))[CountPackageTypes (pRH,p)]; \ -} while (0) -#define UnlockResourceHandleList(h) mem_unlock((MEM_HANDLE)h) -#define FreeResourceHandleList(h) mem_release((MEM_HANDLE)h) - -#define DoLoad(pRH, t,fp,len) (*(pRH)->TypeList[t-1].func_vectors.load_func)(fp,len) -#define DoFree(pRH, t,h) (*(pRH)->TypeList[t-1].func_vectors.free_func)(h) - -extern MEM_HANDLE _GetResFileData (uio_Stream *res_fp, DWORD flen); -#define IsIndexType(pRH, t) ((pRH)->TypeList[t-1].func_vectors.load_func \ - ==_GetResFileData) - -#define LastResPackage(pRH) ((pRH)->num_packages) -#define LastResType(pRH) ((pRH)->num_types) -#define GetInstanceCount(pRH,t) \ - ((pRH)->TypeList[(t)-1].instance_count) - -#define ValidResPackage(pRH,p) ((p)<=LastResPackage(pRH)) -#define ValidResType(pRH,t) ((t)!=0&&(t)<=LastResType(pRH)) - -#define CountPackageTypes(pRH,p) \ - (COUNT)GET_TYPE ((pRH)->PackageList[(p)-1].packmem_info) -#define CountPackageInstances(pRH,p) \ - (COUNT)GET_INSTANCE ((pRH)->PackageList[(p)-1].packmem_info) - -extern void _set_current_index_header (INDEX_HEADERPTR ResHeaderPtr); -extern INDEX_HEADERPTR _get_current_index_header (void); +void _set_current_index_header (ResourceIndex *newResourceIndex); +ResourceIndex *_get_current_index_header (void); #endif /* _RESINTRN_H */ diff --git a/sc2/src/sc2code/setup.c b/sc2/src/sc2code/setup.c index 1a78f2374..837141f8e 100644 --- a/sc2/src/sc2code/setup.c +++ b/sc2/src/sc2code/setup.c @@ -105,7 +105,7 @@ LoadKernel (int argc, char *argv[]) SetContextFGFrame (Screen); SetFrameHot (Screen, MAKE_HOT_SPOT (0, 0)); - hResIndex = InitResourceSystem ("starcon", RES_INDEX, NULL); + hResIndex = InitResourceSystem ("starcon.lst", RES_INDEX, NULL); if (hResIndex == 0) return FALSE; INIT_INSTANCES ();