Final preparation for the replacement of integer-based resources.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2918 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2008-02-06 10:08:57 +00:00
parent d0bd867fe7
commit 58b9361927
7 changed files with 284 additions and 13 deletions
+1
View File
@@ -1,6 +1,7 @@
1 0 8 ship.lastbat.code
2 0 2 ship.lastbat.graphics.lastbat.large
2 0 5 ship.lastbat.sounds
2 0 6 ship.lastbat.ditty
2 1 2 ship.lastbat.graphics.lastbat.medium
2 2 2 ship.lastbat.graphics.lastbat.small
2 3 2 ship.lastbat.graphics.sen.large
-5
View File
@@ -93,7 +93,6 @@ comm.spathi.graphics = GFXRES:comm/spathi/spathi.ani
comm.spathi.music = MUSICRES:comm/spathi/spathi.mod
comm.spathi.resources = RES_INDEX:comm/spathi.ls2
comm.starbase.dialogue = STRTAB:comm/starbas/starbas.txt
comm.starbase.music = MUSICRES:comm/starbas/starbas.ogg
comm.supox.colortable = STRTAB:comm/supox/supox.ct
comm.supox.dialogue = STRTAB:comm/supox/supox.txt
comm.supox.font = FONTRES:comm/supox/supox.fon
@@ -136,7 +135,6 @@ comm.utwig.font = FONTRES:comm/utwig/utwig.fon
comm.utwig.graphics = GFXRES:comm/utwig/utwig.ani
comm.utwig.music = MUSICRES:comm/utwig/utwig.mod
comm.utwig.resources = RES_INDEX:comm/utwig.ls2
comm.utwigult.music = MUSICRES:comm/utwig/utwigult.ogg
comm.vux.colortable = STRTAB:comm/vux/vux.ct
comm.vux.dialogue = STRTAB:comm/vux/vux.txt
comm.vux.font = FONTRES:comm/vux/vux.fon
@@ -149,7 +147,6 @@ comm.yehat.font = FONTRES:comm/yehat/yehat.fon
comm.yehat.graphics = GFXRES:comm/yehat/yehat.ani
comm.yehat.music = MUSICRES:comm/yehat/yehat.mod
comm.yehat.rebel.dialogue = STRTAB:comm/rebel/rebel.txt
comm.yehat.rebel.music = MUSICRES:comm/rebel/rebel.ogg
comm.yehat.resources = RES_INDEX:comm/yehat.ls2
comm.zoqfotpik.colortable = STRTAB:comm/zoqfot/zoqfot.ct
comm.zoqfotpik.dialogue = STRTAB:comm/zoqfot/zoqfot.txt
@@ -258,8 +255,6 @@ graphics.utwbomb = GFXRES:ipanims/utwbomb.ani
music.arispace = MUSICRES:lbm/arispace.mod
music.battle = MUSICRES:lbm/battle.mod
music.hyper = MUSICRES:lbm/hyper.mod
music.mainmenu = MUSICRES:lbm/mainmenu.ogg
music.meleemenu = MUSICRES:melee/melemenu.ogg
music.orbit1 = MUSICRES:ipanims/orbit.mod
music.orbit2 = MUSICRES:ipanims/orbit.mod
music.orbit3 = MUSICRES:ipanims/orbit.mod
+1 -2
View File
@@ -1,3 +1,2 @@
#define JOYSTICK_KEYS 0x00200001L
// This is a dead resource file.
+1 -1
View File
@@ -1,3 +1,3 @@
#define SAMATRA_VICTORY_SONG 0x00400005L
#define SAMATRA_VICTORY_SONG 0x00400006L
typedef RESOURCE MUSICRES_INSTANCE;
+1 -1
View File
@@ -1,3 +1,3 @@
#define SAMATRA_SHIP_SOUNDS 0x00400004L
// Dead file
-4
View File
@@ -1,10 +1,6 @@
#ifndef _ISTRTAB_H
#define _ISTRTAB_H
#define ARILOU_RACE_STRINGS 0x00200004L
#define ARILOU_SHIP_SOUNDS 0x00400104L
#define ARILOU_VICTORY_SONG 0x00600204L
typedef RESOURCE STRTAB_INSTANCE;
#endif /* _ISTRTAB_H */
+280
View File
@@ -0,0 +1,280 @@
#!/usr/bin/python
import scan_defines as scan
# 72-5-4 for colortable.str_cts_ -- 0x09000504L -- OOLITE_COLOR_TAB. Goes up through
# 202-87-2 for PLANET00_BIG_MASK_PMAP_ANIM. Goes up through 58.
# MAROON and CRIMSON seem swapped!
planettypes = ['oolite',
'yttric',
'quasidegenerate',
'lanthanide',
'treasure',
'urea',
'metal',
'radioactive',
'opalescent',
'cyanic',
'acid',
'alkali',
'halide',
'green',
'copper',
'carbide',
'ultramarine',
'noble',
'azure',
'chondrite',
'purple',
'superdense',
'pellucid',
'dust',
'crimson',
'cimmerian',
'infrared',
'selenic',
'auric',
'fluorescent',
'ultraviolet',
'plutonic',
'rainbow',
'shattered',
'sapphire',
'organic',
'xenolithic',
'redux',
'primordial',
'emerald',
'chlorine',
'magnetic',
'water',
'telluric',
'hydrocarbon',
'iodine',
'vinylogous',
'ruby',
'magma',
'maroon',
'bluegas', # PLANET50 # (As per colorcodes)
'cyangas',
'greengas',
'greygas',
'orangegas',
'purplegas',
'redgas',
'violetgas',
'yellowgas']
headersymbols = {'quasidegenerate': 'quasi_degenerate',
'superdense': 'super_dense',
'bluegas': 'blu_gas',
'cyangas': 'cya_gas',
'greengas': 'grn_gas',
'greygas': 'gry_gas',
'orangegas': 'ora_gas',
'purplegas': 'pur_gas',
'redgas': 'red_gas',
'violetgas': 'vio_gas',
'yellowgas': 'yel_gas' }
xlattabs = ['oolite',
'yttric',
'quasidegenerate',
'yttric',
'quasidegenerate',
'urea',
'metal',
'yttric',
'opalescent',
'quasidegenerate',
'yttric',
'yttric',
'yttric',
'urea',
'quasidegenerate',
'opalescent',
'urea',
'yttric',
'urea',
'chondrite',
'urea',
'quasidegenerate',
'opalescent',
'yttric',
'urea',
'quasidegenerate',
'opalescent',
'urea',
'quasidegenerate',
'opalescent',
'yttric',
'yttric',
'rainbow',
'shattered',
'sapphire',
'quasidegenerate',
'opalescent',
'redux',
'yttric',
'sapphire',
'chlorine',
'opalescent',
'chlorine',
'yttric',
'quasidegenerate',
'urea',
'opalescent',
'sapphire',
'quasidegenerate',
'urea',
'gas',
'gas',
'gas',
'gas',
'gas',
'gas',
'gas',
'gas',
'gas']
colorcodes = ['blu', 'cya', 'grn', 'gry', 'ora', 'pur', 'red', 'vio', 'yel']
# androsyn -> androsynth
# blackurq -> kohrah
# human -> earthling
# slylandr -> slylandro
# thradd -> thraddash
# zoqfot -> zoqfotpik
shiptypes = ['arilou',
'chmmr',
'earthling',
'orz',
'pkunk',
'shofixti',
'spathi',
'supox',
'thraddash',
'utwig',
'vux',
'yehat',
'melnorme',
'druuge',
'ilwrath',
'mycon',
'slylandro',
'umgah',
'urquan',
'zoqfotpik',
'syreen',
'kohrah',
'androsynth',
'chenjesu',
'mmrnmhrm']
#blackur -> kohrah
#comandr -> commander
#melnorm -> melnorme
#shofixt -> shofixti
#slyland -> slylandro
#starbas -> starbase
#talkpet -> talkingpet
#thradd -> thraddash
#zoqfot -> zoqfotpik
convtypes = ['arilou',
'chmmr',
'commander',
'orz',
'pkunk',
'shofixti',
'spathi',
'supox',
'thraddash',
'utwig',
'vux',
'yehat',
'melnorme',
'druuge',
'ilwrath',
'mycon',
'slylandro',
'umgah',
'urquan',
'zoqfotpik',
'syreen',
'kohrah',
'talkingpet',
'slyhome']
def write_planet_gfx():
vals = scan.collect_data()
planetanibase = vals.index([x for x in vals if x[0] == 'PLANET00_BIG_MASK_PMAP_ANIM'][0])
(pkg, inst, typ) = scan.res_decode_str(vals[planetanibase][1])
resmap = []
for planettype in planettypes:
for size in ['large', 'medium', 'small']:
print "%3d %3d %3d planet.%s.%s" % (pkg, inst, typ, planettype, size)
resmap.append(("planet.%s.%s" % (planettype, size), vals[planetanibase][3]))
planetanibase += 1
inst += 1
pkg += 1
print
print "---"
print
for (key, val) in resmap:
print "%s = GFXRES:%s" % (key, val)
def write_planet_str():
vals = scan.collect_data()
planetctbase = [x for x in vals if x[0] == 'OOLITE_COLOR_TAB'][0]
(basepkg, ctinst, typ) = scan.res_decode_str(planetctbase[1])
xltinst = ctinst + 1
reslist = []
deflist = []
rmplist = []
pkg = basepkg
for (planettype, xltindex) in zip(planettypes, xlattabs):
ctres = "planet.%s.colortable" % planettype
xltres = "planet.%s.translatetable" % planettype
defname = planettype
if planettype in headersymbols:
defname = headersymbols[defname]
defname = defname.upper()
ctdef = "%s_COLOR_TAB" % defname
xltdef = "%s_XLAT_TAB" % defname
if xltindex in headersymbols:
oldxltdef = "%s_XLAT_TAB" % headersymbols[xltindex].upper()
else:
oldxltdef = "%s_XLAT_TAB" % xltindex.upper()
ctmatch = [x for x in vals if x[0] == ctdef]
xltmatch = [x for x in vals if x[0] == oldxltdef]
if len(ctmatch) != 1:
raise ValueError, "Couldn't find unique %s" % ctdef
if len(xltmatch) != 1:
raise ValueError, "Couldn't find unique %s" % oldxltdef
ctfile = ctmatch[0][3]
xltfile = xltmatch[0][3]
reslist.append("%3d %3d %3d %s" % (pkg, ctinst, typ, ctres))
reslist.append("%3d %3d %3d %s" % (pkg, xltinst, typ, xltres))
deflist.append("#define %s %s" % (ctdef, scan.res_encode_str(pkg, ctinst, typ)))
deflist.append("#define %s %s" % (xltdef, scan.res_encode_str(pkg, xltinst, typ)))
rmplist.append("%s = STRTAB:%s" % (ctres, ctfile))
rmplist.append("%s = STRTAB:%s" % (xltres, xltfile))
pkg += 1
for l in reslist:
print l
print
print "---"
print
for l in deflist:
print l
print
print "---"
print
for l in rmplist:
print l
if __name__ == '__main__':
write_planet_str()