ScummVM API documentation
Fixed-point fractions

Description

API for fixed-point fractions.

Typedefs

typedef int32 frac_t
 

Enumerations

enum  {
  FRAC_BITS = 16, FRAC_LO_MASK = ((1L << FRAC_BITS) - 1), FRAC_HI_MASK = ((1L << FRAC_BITS) - 1) << FRAC_BITS, FRAC_ONE = (1L << FRAC_BITS),
  FRAC_HALF = (1L << (FRAC_BITS-1))
}
 

Functions

frac_t doubleToFrac (double value)
 
double fracToDouble (frac_t value)
 
frac_t intToFrac (int16 value)
 
int16 fracToInt (frac_t value)
 

Typedef Documentation

◆ frac_t

typedef int32 frac_t

Fixed-point fractions, used by the sound rate converter and other code.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The precision of the fractional (fixed-point) type that is defined below. Normally, you should never need to modify this value.