pink_doom.misc package

Submodules

pink_doom.misc.fixed module

Fixed point, 32bit as 16.16.

pink_doom.misc.fixed.fixed_div(a, b)[source]

Divides two fixed point numbers.

pink_doom.misc.fixed.fixed_div2(a, b)[source]

Divide two fixed point numbers.

Used for case when we need to do floating point arithmetic.

pink_doom.misc.fixed.fixed_mul(a, b)[source]

Multiplies two fixed point numbers.

pink_doom.misc.tables module

Lookup tables.

pink_doom.misc.tables.ANGLE_TO_FINE_SHIFT = 19

0x100000000 to 0x2000

pink_doom.misc.tables.fine_sine

Sine lookup.

Guess what, serves as cosine, too. Remarkable thing is, how to use BAMs with this?

pink_doom.misc.tables.fine_tangent

Tangents LUT.

Should work with BAM fairly well (12 of 16bit, effectively, by shifting).

pink_doom.misc.tables.slope_div(num, den)[source]

Perform slope division.

Called by pink_doom.rendering.point_to_angle().

pink_doom.misc.tables.tan_to_angle

ArcTan LUT.

Maps tan(angle) to angle fast.

Module contents

Miscellaneous.