Skip to content

Commit

Permalink
Fix the GpuParticles magnification
Browse files Browse the repository at this point in the history
  • Loading branch information
ueshita committed Apr 24, 2024
1 parent 47065b8 commit b9124fb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Dev/Cpp/Effekseer/Effekseer/Parameter/GpuParticlesParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@ GpuParticles::ParamSet LoadGpuParticlesParameter(uint8_t*& pos, int32_t version,

paramSet.Scale.Type = (ScaleType)Read<uint8_t>(pos);

auto ReadScale4 = [](uint8_t*& pos, float magnification)
auto ReadScale4 = [](uint8_t*& pos)
{
float s0 = Read<float>(pos) * magnification;
float s1 = Read<float>(pos) * magnification;
float s0 = Read<float>(pos);
float s1 = Read<float>(pos);
float3 xyz0 = Read<float3>(pos);
float3 xyz1 = Read<float3>(pos);
return std::array<float4, 2>{ float4(xyz0.x, xyz0.y, xyz0.z, s0), float4(xyz1.x, xyz1.y, xyz1.z, s1) };
};
switch (paramSet.Scale.Type)
{
case ScaleType::Fixed:
paramSet.Scale.Fixed.Scale = ReadScale4(pos, magnification);
paramSet.Scale.Fixed.Scale = ReadScale4(pos);
break;
case ScaleType::Easing:
paramSet.Scale.Easing.Start = ReadScale4(pos, magnification);
paramSet.Scale.Easing.End = ReadScale4(pos, magnification);
paramSet.Scale.Easing.Start = ReadScale4(pos);
paramSet.Scale.Easing.End = ReadScale4(pos);
paramSet.Scale.Easing.Speed = Read<float3>(pos);
break;
default:
Expand All @@ -126,7 +126,7 @@ GpuParticles::ParamSet LoadGpuParticlesParameter(uint8_t*& pos, int32_t version,

paramSet.RenderShape.Type = (RenderShapeT)Read<uint8_t>(pos);
paramSet.RenderShape.Data = Read<uint32_t>(pos);
paramSet.RenderShape.Size = Read<float>(pos);
paramSet.RenderShape.Size = Read<float>(pos) * magnification;

paramSet.RenderColor.ColorInherit = (BindType)Read<uint8_t>(pos);
paramSet.RenderColor.ColorAllType = (ColorParamType)Read<uint8_t>(pos);
Expand Down

0 comments on commit b9124fb

Please sign in to comment.