Skip to content

Commit

Permalink
Merge pull request #1843 from Legend-of-Dragoon-Modding/main.lmb-part…
Browse files Browse the repository at this point in the history
…icles

Added OpenGL rendering for LMB poly particles
  • Loading branch information
LordMonoxide authored Dec 12, 2024
2 parents a491d3b + 1d85c42 commit 7118643
Show file tree
Hide file tree
Showing 2 changed files with 295 additions and 202 deletions.
54 changes: 1 addition & 53 deletions src/main/java/legend/game/combat/SEffe.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import legend.game.combat.deff.DeffPart;
import legend.game.combat.deff.LmbTransforms14;
import legend.game.combat.deff.LmbType0;
import legend.game.combat.deff.LmbType1;
import legend.game.combat.deff.LmbType2;
import legend.game.combat.effects.AdditionOverlaysEffect44;
import legend.game.combat.effects.AttachmentHost;
import legend.game.combat.effects.BillboardSpriteEffect0c;
Expand Down Expand Up @@ -4350,63 +4348,13 @@ public static FlowControl scriptAllocateLmbAnimation(final RunningScript<? exten
final ScriptState<EffectManagerData6c<EffectManagerParams.AnimType>> state = allocateEffectManager(
"LMB animation",
script.scriptState_04,
new LmbAnimationEffect5c(),
new LmbAnimationEffect5c(lmbFlags),
new EffectManagerParams.AnimType()
);

final EffectManagerData6c<EffectManagerParams.AnimType> manager = state.innerStruct_00;
manager.flags_04 = 0;

final DeffPart.LmbType lmbType;
if((lmbFlags & 0xf_ff00) == 0xf_ff00) {
lmbType = deffManager_800c693c.lmbs_390[lmbFlags & 0xff];
} else {
//LAB_80117f58
lmbType = (DeffPart.LmbType)deffManager_800c693c.getDeffPart(lmbFlags);
}

//LAB_80117f68
final LmbAnimationEffect5c effect = (LmbAnimationEffect5c)manager.effect_44;
effect.lmbType_00 = lmbType.type_04;
effect.previousTick_04 = 0;
effect.lmb_0c = lmbType.lmb_08;
effect.lmbTransforms_10 = null;
effect.totalSubFrames_38 = 1;
effect.subTickStep_3c = 0x1000;
effect.deffTmdFlags_48 = -1;
effect.deffSpriteFlags_50 = -1;

//LAB_80117fc4
for(int i = 0; i < 8; i++) {
effect.deffFlags_14[i] = 0;
}

final int type = effect.lmbType_00 & 0x7;
if(type == 0) {
//LAB_80118004
final LmbType0 lmb = (LmbType0)effect.lmb_0c;
effect.keyframeCount_08 = lmb.partAnimations_08[0].keyframeCount_04;
} else if(type == 1) {
//LAB_80118018
final LmbType1 lmb = (LmbType1)effect.lmb_0c;
effect.keyframeCount_08 = lmb.keyframeCount_0a;
effect.lmbTransforms_10 = new LmbTransforms14[lmb.objectCount_04];

for(int i = 0; i < lmb.objectCount_04; i++) {
effect.lmbTransforms_10[i] = new LmbTransforms14().set(lmb.transforms_10[i]);
}
} else if(type == 2) {
//LAB_80118068
final LmbType2 lmb = (LmbType2)effect.lmb_0c;
effect.keyframeCount_08 = lmb.keyframeCount_0a;
effect.lmbTransforms_10 = new LmbTransforms14[lmb.objectCount_04 * 2];

for(int i = 0; i < lmb.objectCount_04; i++) {
effect.lmbTransforms_10[i] = new LmbTransforms14().set(lmb.initialTransforms_10[i]);
effect.lmbTransforms_10[i + lmb.objectCount_04] = new LmbTransforms14().set(lmb.initialTransforms_10[i]);
}
}

//LAB_801180e0
//LAB_801180e8
manager.params_10.ticks_24 = -1;
Expand Down
Loading

0 comments on commit 7118643

Please sign in to comment.