NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
g3d_dcc.h
1#ifndef NW4R_G3D_DCC_H
2#define NW4R_G3D_DCC_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/g3d/res/g3d_resanmtexsrt.h>
6#include <nw4r/g3d/res/g3d_resnode.h>
7
8#include <nw4r/math.h>
9
10namespace nw4r {
11namespace g3d {
12
13void CalcTexMtx(math::MTX34* pMtx, bool set, const TexSrt& rSrt,
14 TexSrt::Flag flag, TexSrtTypedef::TexMatrixMode mode);
15
16namespace detail {
17
19public:
20 enum Attr {
21 ATTR_BILLBOARD_MASK = (1 << 8) - 1,
22
23 ATTR_T_IGNORE = (1 << 27),
24 ATTR_S_UNIFORM = (1 << 28),
25 ATTR_ALL_S_UNIFORM = (1 << 29),
26 ATTR_S_ONE = (1 << 30),
27 ATTR_ALL_S_ONE = (1 << 31),
28 };
29
30public:
31 static ResNodeData::Billboard GetBillboard(ulong attr) {
32 return static_cast<ResNodeData::Billboard>(attr & ATTR_BILLBOARD_MASK);
33 }
34 static ulong SetBillboard(ulong attr, ResNodeData::Billboard billboard) {
35 return (attr & ~ATTR_BILLBOARD_MASK) | billboard;
36 }
37
38 static bool IsIgnoreTrans(ulong attr) {
39 return (attr & ATTR_T_IGNORE) ? true : false;
40 }
41 static ulong AnmIgnoreTrans(ulong attr) {
42 return attr | ATTR_T_IGNORE;
43 }
44 static ulong AnmNotIgnoreTrans(ulong attr) {
45 return attr & ~ATTR_T_IGNORE;
46 }
47
48 static bool IsScaleUniform(ulong attr) {
49 return (attr & ATTR_S_UNIFORM) ? true : false;
50 }
51 static ulong AnmScaleUniform(ulong attr) {
52 return attr | ATTR_S_UNIFORM;
53 }
54 static ulong AnmNotScaleUniform(ulong attr) {
55 return attr & ~(ATTR_S_UNIFORM | ATTR_ALL_S_UNIFORM | ATTR_S_ONE |
56 ATTR_ALL_S_ONE);
57 }
58
59 static bool IsAllScaleUniform(ulong attr) {
60 return (attr & ATTR_ALL_S_UNIFORM) ? true : false;
61 }
62 static ulong AnmAllScaleUniform(ulong attr) {
63 return attr | ATTR_ALL_S_UNIFORM;
64 }
65 static ulong AnmNotAllScaleUniform(ulong attr) {
66 return attr & ~(ATTR_ALL_S_UNIFORM | ATTR_ALL_S_ONE);
67 }
68
69 static bool IsScaleOne(ulong attr) {
70 return (attr & ATTR_S_ONE) ? true : false;
71 }
72 static ulong AnmScaleOne(ulong attr) {
73 return attr | ATTR_S_ONE;
74 }
75 static ulong AnmNotScaleOne(ulong attr) {
76 return attr & ~(ATTR_S_ONE | ATTR_ALL_S_ONE);
77 }
78
79 static bool IsAllScaleOne(ulong attr) {
80 return (attr & ATTR_ALL_S_ONE) ? true : false;
81 }
82 static ulong AnmAllScaleOne(ulong attr) {
83 return attr | ATTR_ALL_S_ONE;
84 }
85 static ulong AnmNotAllScaleOne(ulong attr) {
86 return attr & ~ATTR_ALL_S_ONE;
87 }
88
89 static ulong GetRootMtxAttr() {
90 return ATTR_S_UNIFORM | ATTR_ALL_S_UNIFORM | ATTR_S_ONE |
91 ATTR_ALL_S_ONE;
92 }
93};
94
95} // namespace detail
96} // namespace g3d
97} // namespace nw4r
98
99#endif
3D graphics drawing library.
Definition g3d_3dsmax.h:10