summaryrefslogtreecommitdiff
path: root/libs/JSystem/src/JParticle/JPAExTexShape.cpp
blob: bb9510050ef255b6b5f6badbfc17ee992de3b7f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "JSystem/JSystem.h" // IWYU pragma: keep

#include "JSystem/JParticle/JPAExTexShape.h"
#include "JSystem/JParticle/JPAResourceManager.h"
#include "JSystem/JParticle/JPAEmitter.h"
#include <gx.h>

void JPALoadExTex(JPAEmitterWorkData* work) {
    JPAExTexShape* ets = work->mpRes->getEts();

    GXTexCoordID secTexCoordID = GX_TEXCOORD1;
    if (ets->isUseIndirect()) {
        GXSetTexCoordGen(secTexCoordID, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
        work->mpResMgr->load(work->mpRes->getTexIdx(ets->getIndTexIdx()), GX_TEXMAP2);
        secTexCoordID = GX_TEXCOORD2;
    }

    if (ets->isUseSecTex()) {
        GXSetTexCoordGen(secTexCoordID, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
        work->mpResMgr->load(work->mpRes->getTexIdx(ets->getSecTexIdx()), GX_TEXMAP3);
    }
}

JPAExTexShape::JPAExTexShape(u8 const* data) {
    mpData = (const JPAExTexShapeData*)data;
}