mrcrowbar.lib.games.lomax module

class mrcrowbar.lib.games.lomax.ANIM(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

four_bit = <Bits: offset=0x7, bits=0b10000000>
frames = <BlockField: 0x00007f0c83471470>
num_frames = <UInt16_LE: offset=0x4>
property palette
palette_id = <UInt8: offset=0x6>
unk1 = <UInt16_LE: offset=0x0>
unk2 = <UInt16_LE: offset=0x2>
unk4 = <Bits: offset=0x7, bits=0b1111111>
unk5 = <UInt32_LE: offset=0x8>
class mrcrowbar.lib.games.lomax.AnimFrame(*args, **kwargs)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

height = <UInt16_LE: offset=0x2>
raw_data = <Bytes: offset=0x8, length=<Ref: size (rw)>, transform=<mrcrowbar.lib.games.lomax.FourBit object>>
property size
unk1 = <UInt16_LE: offset=0x4>
unk2 = <UInt16_LE: offset=0x6>
width = <UInt16_LE: offset=0x0>
class mrcrowbar.lib.games.lomax.Colour15(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Colour

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

property b_8

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

b_raw = <Bits16: offset=0x0, bits=0b11111>
property g_8

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

g_raw = <Bits16: offset=0x0, bits=0b1111100000>
property r_8

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

r_raw = <Bits16: offset=0x0, bits=0b111110000000000>
class mrcrowbar.lib.games.lomax.FourBit(enable=True)[source]

Bases: Transform

export_data(buffer, parent=None)[source]

Perform a transform on a byte string.

buffer

Source byte string.

parent

Parent object of the source (to provide context for Refs).

import_data(buffer, parent=None)[source]

Perform a reverse-transform on a byte string.

buffer

Source byte string.

parent

Parent object of the source (to provide context for Refs).

class mrcrowbar.lib.games.lomax.HEAD(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

palettes = <BlockField: 0x00007f0c83472270>
unk1 = <UInt32_BE: offset=0x0>
unk2 = <UInt32_BE: offset=0x4>
unk3 = <Bytes: offset=0x1408, length=80>
unk4 = <Bytes: offset=0x1458, length=32>
class mrcrowbar.lib.games.lomax.Palette(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

colours = <BlockField: 0x00007f0c834717f0>
class mrcrowbar.lib.games.lomax.World(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

BLOCK_MAP = {b'ANIM': <class 'mrcrowbar.lib.games.lomax.ANIM'>, b'HEAD': <class 'mrcrowbar.lib.games.lomax.HEAD'>}
chunks = <ChunkField: 0x00007f0c832a5150>