SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
MiiFaceRecipe.cpp
1#include "Game/NPC/MiiFaceRecipe.hpp"
2#include <RVLFaceLib.h>
3
4MiiFaceRecipe::MiiFaceRecipe(RFLDataSource dataSource, int index, RFLResolution resolution, u32 expressionFlags) {
5 mDataSource = dataSource;
6 mMiddleDB = 0;
7 mIndex = index;
8 mResolution = resolution;
9 mExpressionFlag = expressionFlags;
10}
11
12void MiiFaceRecipe::setDatabase(RFLMiddleDB *pDb) {
13 mMiddleDB = pDb;
14}
15
16bool MiiFaceRecipe::hasExpression(RFLExpression expr) const {
17 return (mExpressionFlag & (1 << expr)) != 0;
18}
19
20u32 MiiFaceRecipe::getModelBufferSize() const {
21 return RFLGetModelBufferSize(mResolution, mExpressionFlag);
22}
23
24void MiiFaceRecipe::initFaceModel(RFLCharModel *pModel, void *pData) const {
25 RFLInitCharModel(pModel, mDataSource, mMiddleDB, mIndex, pData, mResolution, mExpressionFlag);
26}
27
28RFLErrcode MiiFaceRecipe::makeIcon(void *pData, int width, int height, _GXColor color) const {
29 RFLIconSetting settings;
30 settings.width = width;
31 settings.height = height;
32 settings.bgType = RFLIconBG_Direct;
33 settings.bgColor.r = color.r;
34 settings.bgColor.g = color.g;
35 settings.bgColor.b = color.b;
36 settings.bgColor.a = color.a;
37 settings.drawXluOnly = false;
38 return RFLMakeIcon(pData, mDataSource, mMiddleDB, mIndex, RFLExp_Normal, &settings);
39}
40
41RFLErrcode MiiFaceRecipe::makeIconWithFavoriteColor(void *pData, int width, int height) const {
42 RFLIconSetting settings;
43 settings.width = width;
44 settings.height = height;
45 settings.bgType = RFLIconBG_Favorite;
46 settings.drawXluOnly = false;
47 return RFLMakeIcon(pData, mDataSource, mMiddleDB, mIndex, RFLExp_Normal, &settings);
48}