OpenBF1942-Plus
Refractor 1, rebuilt from scratch
Loading...
Searching...
No Matches
obf Namespace Reference

Classes

struct  Bone
struct  SkinInfluence
struct  SkinRecord
struct  Skin
struct  Animation
struct  Wav
struct  SoundEffect
struct  SoundLayer
struct  SoundPatch
struct  Listener
class  Mixer
struct  ConObject
class  Con
struct  ConquestFlag
struct  Conquest
struct  Material
struct  DamageTable
struct  Image
struct  Crd
struct  Curve
struct  ParticleDef
struct  EmitterDef
struct  EffectDef
struct  Sprite
struct  MeshParticle
class  Effects
struct  GameOptions
struct  GameInput
struct  SoldierView
struct  Ammo
struct  Camera
class  Game
struct  Glyph
struct  Font
struct  HudQuad
struct  MapIcon
struct  HudInfo
struct  Mat4
struct  NavGrid
struct  WheelDef
struct  WingDef
struct  FloatDef
struct  JointDef
struct  WeaponDef
struct  SeatDef
struct  VehicleDef
class  Physics
class  Renderer
struct  RfaEntry
struct  DrawItem
struct  SpawnPoint
struct  SmMaterial
struct  CollisionMesh
struct  SmMesh
class  Sounds
struct  TerrainInfo
struct  Heightmap
struct  TmPart
struct  TmMesh
class  Vfs

Typedefs

using Skeleton = std::vector<Bone>
using JointFn = std::function<Mat4(const std::string& name, int occurrence)>

Functions

Skeleton ske_parse (const std::vector< uint8_t > &d)
Skin skn_parse (const std::vector< uint8_t > &d)
Animation baf_parse (const std::vector< uint8_t > &d)
std::vector< Mat4 > pose (const Skeleton &s, const std::vector< const Animation * > &anims, float frame, bool biped_root)
std::vector< Mat4 > pose (const Skeleton &s, const std::vector< const Animation * > &anims, const std::vector< float > &frames, bool biped_root)
std::vector< int > bone_index (const Skin &skin, const Skeleton &s)
std::vector< int > skin_map (const Skin &skin, const std::vector< float > &v, size_t fpv)
void skin_apply (const Skin &skin, const std::vector< int > &map, const std::vector< int > &to_ske, const std::vector< Mat4 > &world, const std::vector< float > &v, size_t fpv, std::vector< float > &out)
Wav wav_parse (const std::vector< uint8_t > &d)
std::vector< SoundPatch > ssc_patches (const std::string &path, const std::function< std::string(const std::string &)> &read, const std::string &level)
SoundPatch ssc_parse (const std::string &path, const std::function< std::string(const std::string &)> &read, const std::string &level)
std::string lower (std::string s)
static std::string normpath (const std::string &p)
static std::string dirname (const std::string &p)
Conquest conquest_from (const Con &con)
DamageTable damage_table (const std::vector< std::pair< std::string, std::vector< std::string > > > &commands)
static void colour_block (const uint8_t *b, uint8_t out[16][4], bool allow_transparent)
void dxt1_block (const uint8_t *b, uint8_t out[16][4])
static void dxt3_alpha (const uint8_t *a, uint8_t out[16][4])
static void dxt5_alpha (const uint8_t *a, uint8_t out[16][4])
Image dds_decode (const std::vector< uint8_t > &d)
Image tga_decode (const std::vector< uint8_t > &d)
Crd crd_parse (const std::string &s)
Curve curve_parse (const std::string &s)
std::map< std::string, std::string > lexicon_parse (const std::vector< uint8_t > &data, int lang)
Font font_parse (const std::string &text)
float text_width (const Font &f, const std::string &s, float scale)
void hud_text (const Font &f, const std::string &s, float x, float y, float scale, const float rgba[4], std::vector< HudQuad > &out)
std::vector< HudQuad > hud_layout (const Font &f, const HudInfo &in, int w, int h)
Mat4 translate (float x, float y, float z)
Mat4 scale (float x, float y, float z)
Mat4 rotation_ypr (float yaw_deg, float pitch_deg, float roll_deg)
Mat4 perspective (float fovy, float aspect, float zn, float zf)
Mat4 view (float x, float y, float z, float yaw, float pitch)
NavGrid nav_parse (const std::vector< uint8_t > &d, float world_size)
NavGrid nav_coarse (const NavGrid &g, int f)
std::vector< float > nav_path (const NavGrid &g, float ax, float az, float bx, float bz, int max_expand)
WeaponDef weapon_def (const Con &con, const std::string &name)
VehicleDef vehicle_def (const Con &con, const Vfs &vfs, const std::string &name)
std::vector< uint8_t > lzo1x_decompress (const uint8_t *src, size_t n, size_t out_len)
static uint32_t u32 (const std::vector< uint8_t > &b, size_t o)
std::vector< std::pair< std::string, RfaEntry > > rfa_index (const std::string &path)
std::vector< uint8_t > rfa_read (const RfaEntry &e)
void parse_vec3 (const std::string &s, float out[3])
std::vector< DrawItem > build_scene (const Con &con, const Vfs &vfs, std::map< std::string, int > &skipped, const std::function< bool(const std::string &)> &hide, std::vector< SpawnPoint > *spawns)
std::vector< DrawItem > build_object (const Con &con, const Vfs &vfs, const std::string &name, const Mat4 &world, std::map< std::string, int > &skipped, const JointFn &joint, const std::function< bool(const std::string &)> &hide, bool wreck)
SmMesh sm_parse (const std::vector< uint8_t > &d)
CollisionMesh collision_parse (const uint8_t *data, size_t size)
std::vector< uint32_t > sm_triangles (const SmMaterial &m)
std::map< std::string, std::map< std::string, std::string > > rs_parse (const std::string &text)
TerrainInfo parse_terrain_con (const std::string &text)
Heightmap load_heightmap (const std::vector< uint8_t > &raw, float y_scale)
static uint32_t u32_at (const std::vector< uint8_t > &d, size_t o)
TmMesh tm_parse (const std::vector< uint8_t > &d)

Variables

static const char * kObjectFiles []
constexpr uint32_t kTmIndicesPer [3] = {24, 3, 24}

Typedef Documentation

◆ JointFn

using obf::JointFn = std::function<Mat4(const std::string& name, int occurrence)>

◆ Skeleton

using obf::Skeleton = std::vector<Bone>

Function Documentation

◆ baf_parse()

Animation obf::baf_parse ( const std::vector< uint8_t > & d)

◆ bone_index()

std::vector< int > obf::bone_index ( const Skin & skin,
const Skeleton & s )

◆ build_object()

std::vector< DrawItem > obf::build_object ( const Con & con,
const Vfs & vfs,
const std::string & name,
const Mat4 & world,
std::map< std::string, int > & skipped,
const JointFn & joint,
const std::function< bool(const std::string &)> & hide,
bool wreck )

◆ build_scene()

std::vector< DrawItem > obf::build_scene ( const Con & con,
const Vfs & vfs,
std::map< std::string, int > & skipped,
const std::function< bool(const std::string &)> & hide,
std::vector< SpawnPoint > * spawns )

◆ collision_parse()

CollisionMesh obf::collision_parse ( const uint8_t * data,
size_t size )

◆ colour_block()

void obf::colour_block ( const uint8_t * b,
uint8_t out[16][4],
bool allow_transparent )
static

◆ conquest_from()

Conquest obf::conquest_from ( const Con & con)

◆ crd_parse()

Crd obf::crd_parse ( const std::string & s)

◆ curve_parse()

Curve obf::curve_parse ( const std::string & s)

◆ damage_table()

DamageTable obf::damage_table ( const std::vector< std::pair< std::string, std::vector< std::string > > > & commands)

◆ dds_decode()

Image obf::dds_decode ( const std::vector< uint8_t > & d)

◆ dirname()

std::string obf::dirname ( const std::string & p)
static

◆ dxt1_block()

void obf::dxt1_block ( const uint8_t * b,
uint8_t out[16][4] )

◆ dxt3_alpha()

void obf::dxt3_alpha ( const uint8_t * a,
uint8_t out[16][4] )
static

◆ dxt5_alpha()

void obf::dxt5_alpha ( const uint8_t * a,
uint8_t out[16][4] )
static

◆ font_parse()

Font obf::font_parse ( const std::string & text)

◆ hud_layout()

std::vector< HudQuad > obf::hud_layout ( const Font & f,
const HudInfo & in,
int w,
int h )

◆ hud_text()

void obf::hud_text ( const Font & f,
const std::string & s,
float x,
float y,
float scale,
const float rgba[4],
std::vector< HudQuad > & out )

◆ lexicon_parse()

std::map< std::string, std::string > obf::lexicon_parse ( const std::vector< uint8_t > & data,
int lang )

◆ load_heightmap()

Heightmap obf::load_heightmap ( const std::vector< uint8_t > & raw,
float y_scale )

◆ lower()

std::string obf::lower ( std::string s)

◆ lzo1x_decompress()

std::vector< uint8_t > obf::lzo1x_decompress ( const uint8_t * src,
size_t n,
size_t out_len )

◆ nav_coarse()

NavGrid obf::nav_coarse ( const NavGrid & g,
int f )

◆ nav_parse()

NavGrid obf::nav_parse ( const std::vector< uint8_t > & d,
float world_size )

◆ nav_path()

std::vector< float > obf::nav_path ( const NavGrid & g,
float ax,
float az,
float bx,
float bz,
int max_expand )

◆ normpath()

std::string obf::normpath ( const std::string & p)
static

◆ parse_terrain_con()

TerrainInfo obf::parse_terrain_con ( const std::string & text)

◆ parse_vec3()

void obf::parse_vec3 ( const std::string & s,
float out[3] )

◆ perspective()

Mat4 obf::perspective ( float fovy,
float aspect,
float zn,
float zf )
inline

◆ pose() [1/2]

std::vector< Mat4 > obf::pose ( const Skeleton & s,
const std::vector< const Animation * > & anims,
const std::vector< float > & frames,
bool biped_root )

◆ pose() [2/2]

std::vector< Mat4 > obf::pose ( const Skeleton & s,
const std::vector< const Animation * > & anims,
float frame,
bool biped_root )

◆ rfa_index()

std::vector< std::pair< std::string, RfaEntry > > obf::rfa_index ( const std::string & path)

◆ rfa_read()

std::vector< uint8_t > obf::rfa_read ( const RfaEntry & e)

◆ rotation_ypr()

Mat4 obf::rotation_ypr ( float yaw_deg,
float pitch_deg,
float roll_deg )
inline

◆ rs_parse()

std::map< std::string, std::map< std::string, std::string > > obf::rs_parse ( const std::string & text)

◆ scale()

Mat4 obf::scale ( float x,
float y,
float z )
inline

◆ ske_parse()

Skeleton obf::ske_parse ( const std::vector< uint8_t > & d)

◆ skin_apply()

void obf::skin_apply ( const Skin & skin,
const std::vector< int > & map,
const std::vector< int > & to_ske,
const std::vector< Mat4 > & world,
const std::vector< float > & v,
size_t fpv,
std::vector< float > & out )

◆ skin_map()

std::vector< int > obf::skin_map ( const Skin & skin,
const std::vector< float > & v,
size_t fpv )

◆ skn_parse()

Skin obf::skn_parse ( const std::vector< uint8_t > & d)

◆ sm_parse()

SmMesh obf::sm_parse ( const std::vector< uint8_t > & d)

◆ sm_triangles()

std::vector< uint32_t > obf::sm_triangles ( const SmMaterial & m)

◆ ssc_parse()

SoundPatch obf::ssc_parse ( const std::string & path,
const std::function< std::string(const std::string &)> & read,
const std::string & level )

◆ ssc_patches()

std::vector< SoundPatch > obf::ssc_patches ( const std::string & path,
const std::function< std::string(const std::string &)> & read,
const std::string & level )

◆ text_width()

float obf::text_width ( const Font & f,
const std::string & s,
float scale )

◆ tga_decode()

Image obf::tga_decode ( const std::vector< uint8_t > & d)

◆ tm_parse()

TmMesh obf::tm_parse ( const std::vector< uint8_t > & d)

◆ translate()

Mat4 obf::translate ( float x,
float y,
float z )
inline

◆ u32()

uint32_t obf::u32 ( const std::vector< uint8_t > & b,
size_t o )
static

◆ u32_at()

uint32_t obf::u32_at ( const std::vector< uint8_t > & d,
size_t o )
static

◆ vehicle_def()

VehicleDef obf::vehicle_def ( const Con & con,
const Vfs & vfs,
const std::string & name )

◆ view()

Mat4 obf::view ( float x,
float y,
float z,
float yaw,
float pitch )
inline

◆ wav_parse()

Wav obf::wav_parse ( const std::vector< uint8_t > & d)

◆ weapon_def()

WeaponDef obf::weapon_def ( const Con & con,
const std::string & name )

Variable Documentation

◆ kObjectFiles

const char* obf::kObjectFiles[]
static
Initial value:
= {"geometries.con", "network.con", "physics.con", "weapons.con",
"effects.con", "objects.con", "object.con"}

◆ kTmIndicesPer

uint32_t obf::kTmIndicesPer[3] = {24, 3, 24}
constexpr