Get rid of unnecessary length calls.
This commit is contained in:
parent
161544e612
commit
0f160e9663
@ -182,7 +182,7 @@ class Shape:
|
|||||||
|
|
||||||
if mode != 4:
|
if mode != 4:
|
||||||
raise Exception("Unexpected mode in GE2D structure!")
|
raise Exception("Unexpected mode in GE2D structure!")
|
||||||
if (flags & 0x2) and len(labels) == 0:
|
if (flags & 0x2) and not labels:
|
||||||
raise Exception("GE2D structure has a texture, but no region labels present!")
|
raise Exception("GE2D structure has a texture, but no region labels present!")
|
||||||
if (flags & 0x2) and (tex1 == 0xFF):
|
if (flags & 0x2) and (tex1 == 0xFF):
|
||||||
raise Exception("GE2D structure requests a texture, but no texture pointer present!")
|
raise Exception("GE2D structure requests a texture, but no texture pointer present!")
|
||||||
|
@ -23,7 +23,7 @@ def pad(data: bytes, length: int) -> bytes:
|
|||||||
|
|
||||||
|
|
||||||
def descramble_text(text: bytes, obfuscated: bool) -> str:
|
def descramble_text(text: bytes, obfuscated: bool) -> str:
|
||||||
if len(text):
|
if text:
|
||||||
if obfuscated and (text[0] - 0x20) > 0x7F:
|
if obfuscated and (text[0] - 0x20) > 0x7F:
|
||||||
# Gotta do a weird demangling where we swap the
|
# Gotta do a weird demangling where we swap the
|
||||||
# top bit.
|
# top bit.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user