Further optimisations.
This commit is contained in:
parent
841e287079
commit
fe55947e78
@ -5,7 +5,29 @@ little_endian
|
|||||||
|
|
||||||
if [catch {
|
if [catch {
|
||||||
|
|
||||||
# Type-Value schema
|
# Basic structures - to be reused
|
||||||
|
proc CStrId {{suffix ""}} {
|
||||||
|
if {$suffix != ""} {
|
||||||
|
set suffix " $suffix"
|
||||||
|
}
|
||||||
|
cstr "utf8" "CStrId$suffix"
|
||||||
|
}
|
||||||
|
|
||||||
|
proc bool {} {
|
||||||
|
int8 -hex "bool"
|
||||||
|
}
|
||||||
|
|
||||||
|
proc CAABox2D {} {
|
||||||
|
section "CAABox2D" {
|
||||||
|
set num_records [uint32]
|
||||||
|
sectionvalue "$num_records entries"
|
||||||
|
for { set i 0 } { $i < $num_records } { incr i } {
|
||||||
|
parse_tv
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Type-Value schema - main parser
|
||||||
proc parse_tv {} {
|
proc parse_tv {} {
|
||||||
set type_id [hex 8]
|
set type_id [hex 8]
|
||||||
switch $type_id {
|
switch $type_id {
|
||||||
@ -141,14 +163,14 @@ proc parse_tv {} {
|
|||||||
set num_strings [uint32]
|
set num_strings [uint32]
|
||||||
sectionvalue "$num_strings entries"
|
sectionvalue "$num_strings entries"
|
||||||
for { set i 0 } { $i < $num_strings } { incr i } {
|
for { set i 0 } { $i < $num_strings } { incr i } {
|
||||||
cstr "utf8" "CStrId $i"
|
CStrId $i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
0x2B1A8B33DE7B0C6A {
|
0x2B1A8B33DE7B0C6A {
|
||||||
# bool
|
# bool
|
||||||
int8 -hex "bool"
|
bool
|
||||||
}
|
}
|
||||||
|
|
||||||
0x2F6D2F820BE625FA {
|
0x2F6D2F820BE625FA {
|
||||||
@ -337,13 +359,7 @@ proc parse_tv {} {
|
|||||||
|
|
||||||
0xBDAA54365AE550F4 {
|
0xBDAA54365AE550F4 {
|
||||||
# base::spatial::CAABox2D (MiniMap Area)
|
# base::spatial::CAABox2D (MiniMap Area)
|
||||||
section "CAABox2D" {
|
CAABox2D
|
||||||
set num_records [uint32]
|
|
||||||
sectionvalue "$num_records entries"
|
|
||||||
for { set i 0 } { $i < $num_records } { incr i } {
|
|
||||||
parse_tv
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
0xBF450D514E81EB1B {
|
0xBF450D514E81EB1B {
|
||||||
@ -387,10 +403,7 @@ proc parse_tv {} {
|
|||||||
for { set i 0 } { $i < $num_records } { incr i } {
|
for { set i 0 } { $i < $num_records } { incr i } {
|
||||||
section "CRntSmallDict $i" {
|
section "CRntSmallDict $i" {
|
||||||
sectionvalue [cstr "utf8"]
|
sectionvalue [cstr "utf8"]
|
||||||
set num_props [uint32 "Number of Properties"]
|
CAABox2D
|
||||||
for { set j 0 } { $j < $num_props } { incr j } {
|
|
||||||
parse_tv
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -404,7 +417,7 @@ proc parse_tv {} {
|
|||||||
for { set i 0 } { $i < $num_records } { incr i } {
|
for { set i 0 } { $i < $num_records } { incr i } {
|
||||||
section "CRntSmallDict $i" {
|
section "CRntSmallDict $i" {
|
||||||
sectionvalue [cstr "utf8"]
|
sectionvalue [cstr "utf8"]
|
||||||
int8 -hex "Boolean"
|
bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -544,7 +557,7 @@ proc parse_tv {} {
|
|||||||
|
|
||||||
0xF6EA0DBA9BF734BF {
|
0xF6EA0DBA9BF734BF {
|
||||||
# base::global::CStrId
|
# base::global::CStrId
|
||||||
cstr "utf8" "CStrId"
|
CStrId
|
||||||
}
|
}
|
||||||
|
|
||||||
0xF9304C6C1D1D55FA {
|
0xF9304C6C1D1D55FA {
|
||||||
@ -559,10 +572,6 @@ proc parse_tv {} {
|
|||||||
float "Y"
|
float "Y"
|
||||||
float "Z"
|
float "Z"
|
||||||
}
|
}
|
||||||
###########################################################
|
|
||||||
### TODO
|
|
||||||
###########################################################
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
default {
|
default {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user