mirror of
https://github.com/zeldaret/ss
synced 2026-06-22 16:42:53 -04:00
9c3c480b24
* g3d_calcvtx GetData seems to have changed -> dwarf says r is a local and using ofs_to_ptr didnt work * g3d_light and g3d_fog sdata2 splits and func ordering * g3d_scnproc * g3d_init * g3d_scnmdl * g3d_scnmdlsmpl * g3d_scnroot * g3d_scnobj * g3d_res* progress * g3d_resmdl OK * g3d_restev OK * g3d_resmat OK * g3d_resvtx and g3d_restex OK * g3d_resnode OK * g3d_resanm OK * g3d_resanmchr Progress * the rest of g3d_res* OK * g3d_anmvis OK * g3d_anmclr OK * Some Splitting * more OK, Inline Issue in g3d_anmtexsrt * g3d_obj, g3d_anmobj, g3d_gpu, g3d_tmem, g3d_cpu OK * g3d_state OK * g3d/dcc OK * Include fixup * More Fixups * g3d_camera OK * g3d_draw OK * g3d_calcworld OK * g3d_calcworld actually OK * g3d_workmem, g3d_dcc OK * g3d_calcview OK * g3d_anmtexsrt OK with DONT_INLINE * g3d_transform OK (Feels Cheaty) * g3d_resanmchr OK * g3d_draw1mat1shp Close * g3d_draw1mat1shp OK (Thanks Lago!). Ran symbol applying script
96 lines
2.6 KiB
C++
96 lines
2.6 KiB
C++
#ifndef NW4R_G3D_DCC_H
|
|
#define NW4R_G3D_DCC_H
|
|
#include <nw4r/types_nw4r.h>
|
|
|
|
#include "nw4r/g3d/res/g3d_resanmtexsrt.h"
|
|
#include "nw4r/g3d/res/g3d_resnode.h"
|
|
|
|
namespace nw4r {
|
|
namespace g3d {
|
|
|
|
void CalcTexMtx(math::MTX34 *pMtx, bool set, const TexSrt &rSrt, TexSrt::Flag flag);
|
|
void CalcTexMtx(math::MTX34 *pMtx, bool set, const TexSrt &rSrt, TexSrt::Flag flag, TexSrt::TexMatrixMode mode);
|
|
|
|
namespace detail {
|
|
|
|
class WorldMtxAttr {
|
|
public:
|
|
enum Attr {
|
|
ATTR_BILLBOARD_MASK = (1 << 8) - 1,
|
|
|
|
ATTR_T_IGNORE = (1 << 27),
|
|
ATTR_S_UNIFORM = (1 << 28),
|
|
ATTR_ALL_S_UNIFORM = (1 << 29),
|
|
ATTR_S_ONE = (1 << 30),
|
|
ATTR_ALL_S_ONE = (1 << 31),
|
|
};
|
|
|
|
public:
|
|
static ResNodeData::Billboard GetBillboard(u32 attr) {
|
|
return static_cast<ResNodeData::Billboard>(attr & ATTR_BILLBOARD_MASK);
|
|
}
|
|
static u32 SetBillboard(u32 attr, ResNodeData::Billboard billboard) {
|
|
return (attr & ~ATTR_BILLBOARD_MASK) | billboard;
|
|
}
|
|
|
|
static bool IsIgnoreTrans(u32 attr) {
|
|
return (attr & ATTR_T_IGNORE) ? true : false;
|
|
}
|
|
static u32 AnmIgnoreTrans(u32 attr) {
|
|
return attr | ATTR_T_IGNORE;
|
|
}
|
|
static u32 AnmNotIgnoreTrans(u32 attr) {
|
|
return attr & ~ATTR_T_IGNORE;
|
|
}
|
|
|
|
static bool IsScaleUniform(u32 attr) {
|
|
return (attr & ATTR_S_UNIFORM) ? true : false;
|
|
}
|
|
static u32 AnmScaleUniform(u32 attr) {
|
|
return attr | ATTR_S_UNIFORM;
|
|
}
|
|
static u32 AnmNotScaleUniform(u32 attr) {
|
|
return attr & ~(ATTR_S_UNIFORM | ATTR_ALL_S_UNIFORM | ATTR_S_ONE | ATTR_ALL_S_ONE);
|
|
}
|
|
|
|
static bool IsAllScaleUniform(u32 attr) {
|
|
return (attr & ATTR_ALL_S_UNIFORM) ? true : false;
|
|
}
|
|
static u32 AnmAllScaleUniform(u32 attr) {
|
|
return attr | ATTR_ALL_S_UNIFORM;
|
|
}
|
|
static u32 AnmNotAllScaleUniform(u32 attr) {
|
|
return attr & ~(ATTR_ALL_S_UNIFORM | ATTR_ALL_S_ONE);
|
|
}
|
|
|
|
static bool IsScaleOne(u32 attr) {
|
|
return (attr & ATTR_S_ONE) ? true : false;
|
|
}
|
|
static u32 AnmScaleOne(u32 attr) {
|
|
return attr | ATTR_S_ONE;
|
|
}
|
|
static u32 AnmNotScaleOne(u32 attr) {
|
|
return attr & ~(ATTR_S_ONE | ATTR_ALL_S_ONE);
|
|
}
|
|
|
|
static bool IsAllScaleOne(u32 attr) {
|
|
return (attr & ATTR_ALL_S_ONE) ? true : false;
|
|
}
|
|
static u32 AnmAllScaleOne(u32 attr) {
|
|
return attr | ATTR_ALL_S_ONE;
|
|
}
|
|
static u32 AnmNotAllScaleOne(u32 attr) {
|
|
return attr & ~ATTR_ALL_S_ONE;
|
|
}
|
|
|
|
static u32 GetRootMtxAttr() {
|
|
return ATTR_S_UNIFORM | ATTR_ALL_S_UNIFORM | ATTR_S_ONE | ATTR_ALL_S_ONE;
|
|
}
|
|
};
|
|
|
|
} // namespace detail
|
|
} // namespace g3d
|
|
} // namespace nw4r
|
|
|
|
#endif
|