aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ethyl.py4
-rw-r--r--testrlyt.py32
-rw-r--r--write-brlyt.py12
3 files changed, 43 insertions, 5 deletions
diff --git a/ethyl.py b/ethyl.py
index 2f6458e..e968d69 100644
--- a/ethyl.py
+++ b/ethyl.py
@@ -26,8 +26,8 @@ formats = {
u8 unk4 // 54
u8 pad[3] = [0, 0, 0]// 55
u32 name_offs // 58
- u32 unk6 // 5c
- u32 unk7 // 60
+ u32 color1 // 5c
+ u32 color2 // 60 (--> dc)
float font_size_x // 64
float font_size_y // 68
float char_space // 6c
diff --git a/testrlyt.py b/testrlyt.py
index 32c53c5..9619263 100644
--- a/testrlyt.py
+++ b/testrlyt.py
@@ -13,6 +13,7 @@
('fnl1', {
'files': [
{'unk': 0, 'name': 'wbf1.brfna'},
+ {'unk': 0, 'name': 'wbf2.brfna'},
]
}),
('mat1', {
@@ -46,19 +47,44 @@
'x': 0,
'y': 50,
'xmag': 1,
- 'ymag': 2,
+ 'ymag': 1,
'z': 0,
'~text.material': 'textmat',
'~text.text': 'Some Text',
'~text.font_idx': 0,
'~text.unk4': 0,
- '~text.unk6': 0xffffffff,
- '~text.unk7': 0xffffffff,
+ '~text.color1': 0xffffffff,
+ '~text.color2': 0xffffffff,
'~text.font_size_x': 32.0,
'~text.font_size_y': 38.0,
'~text.char_space': -1.0,
'~text.line_space': -1.0,
}),
+ [('txt1', {
+ 'alpha': 0xff,
+ 'alpha_2': 0x0,
+ 'angle': 0,
+ 'flags_1': 1,
+ 'flags_2': 0,
+ 'height': 38,
+ 'name': 'textbox%d' % i,
+ 'width': 400,
+ 'x': -250,
+ 'y': -50 + 5*i,
+ 'xmag': 1,
+ 'ymag': 1,
+ 'z': 0,
+ '~text.material': 'textmat',
+ '~text.text': 'benzin (and built-in fonts) ftw!',
+ '~text.font_idx': 1,
+ '~text.unk4': 0,
+ '~text.color1': 0xff + 0x01080800*i,
+ '~text.color2': 0xff + 0x08080100*i,
+ '~text.font_size_x': 32.0,
+ '~text.font_size_y': 38.0,
+ '~text.char_space': -1.0,
+ '~text.line_space': -1.0,
+ }) for i in xrange(2, 30)],
('pic1', {
'alpha': 0xff,
'alpha_2': 0x0,
diff --git a/write-brlyt.py b/write-brlyt.py
index a424e11..79b47be 100644
--- a/write-brlyt.py
+++ b/write-brlyt.py
@@ -5,6 +5,18 @@ f = open(sys.argv[1], 'r')
chunks = eval(f.read())
f.close()
+# ugly hack
+def flatten(chunks):
+ a = []
+ for c in chunks:
+ if type(c) == list:
+ a += flatten(c)
+ else:
+ a.append(c)
+ return a
+chunks = flatten(chunks)
+
+
rlyt = 'RLYT\xfe\xff\x00\x08\x00\x00\x00\x00' # size later
rlyt += struct.pack('>hh', 0x10, len(chunks))