Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Common/Animator/ssplayer_animedecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ SsAnimeDecoder::SsAnimeDecoder() :
curAnimeTotalFrame(0),
nowPlatTime(0) ,
nowPlatTimeOld(0),
frameDelta(0),
curAnimation(nullptr),
curSequence(nullptr),
myModel(nullptr),
project(nullptr),
stateNum(0),
curCellMapManager(),
partState(),
instancePartsHide(false),
Expand Down
8 changes: 5 additions & 3 deletions Common/Animator/ssplayer_cellmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ struct SsCellValue
SsTexFilterMode::_enum filterMode; ///< テクスチャのフィルタモード

SsCellValue() :
cell(0) ,
texture(0)
{}
cell(nullptr) ,
texture(nullptr),
filterMode(SsTexFilterMode::_enum::nearlest),
wrapMode(SsTexWrapMode::_enum::clamp)
{}
};

class SsCelMapLinker
Expand Down
47 changes: 31 additions & 16 deletions Common/Animator/ssplayer_effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,46 @@ class SsEffectRenderAtom

public:

SsEffectRenderAtom() :
parent(0),
m_isInit(false),
m_isLive(true),
_lifetime(10.0f),
_life(1.0f),
rotation(0),
position(0,0,0),
scale(1.0f,1.0f),
m_isCreateChild(false)
{
}
SsEffectRenderAtom()
{
init();
}

SsEffectRenderAtom( SsEffectNode* refdata , SsEffectRenderAtom* _p)
{
init();

SsEffectRenderAtom( SsEffectNode* refdata , SsEffectRenderAtom* _p){
data = refdata;
setParent(_p);

_lifetime = 0;
position = SsVector3(0,0,0);
scale = SsVector2(0,0);
rotation = 0.0f;
}

virtual ~SsEffectRenderAtom(){}

// コンストラクタの共通初期化処理
void init()
{
position = SsVector3(0, 0, 0);
rotation = 0;
scale = SsVector2(1.0f, 1.0f);

parent = nullptr;
data = nullptr;

m_isLive = true;
m_isInit = false;
m_isCreateChild = false;

_lifetime = 10.0f;
_exsitTime = 0.0f;
_life = 1.0f;

undead = false;
alpha = 1.0f;
}

void setParent( SsEffectRenderAtom* _p ){ parent = _p; }
SsRenderType::_enum getMyType(){ return SsRenderType::BaseNode;}

Expand Down Expand Up @@ -169,7 +184,7 @@ class SsEffectDrawBatch
std::list<SsEffectRenderAtom*> drawlist;


SsEffectDrawBatch() : priority(0) , dispCell(0),targetNode(0) {}
SsEffectDrawBatch() : priority(0) , dispCell(nullptr), targetNode(nullptr), blendType(SsRenderBlendType::_enum::Mix) {}
~SsEffectDrawBatch(){}

void drawSetting();
Expand Down
10 changes: 7 additions & 3 deletions Common/Animator/ssplayer_effect2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ void SsEffectRenderV2::particleDraw(SsEffectEmitter* e , double time , SsEffectE
lp.stime = drawe->stime;
lp.lifetime = drawe->endtime;
lp.pid = 0;
lp.rot = 0;

if ( parent )lp.pid = plp->id;

Expand All @@ -643,8 +644,10 @@ void SsEffectRenderV2::particleDraw(SsEffectEmitter* e , double time , SsEffectE
pp.pid = plp->pid;
//パーティクルが発生した時間の親の位置を取る

#if 0 // memo: ptime は参照されない。2025/07/09
int ptime = lp.stime + pp.stime;
if ( ptime > lp.lifetime ) ptime = lp.lifetime;
#endif

//逆算はデバッグしずらいかもしれない
parent->updateParticle( (float)lp.stime + pp.stime , &pp);
Expand Down Expand Up @@ -843,16 +846,17 @@ void SsEffectRenderV2::reload()
layoutScale.y = (float)(this->effectData->layoutScaleY) / 100.0f;

//MEMO: cnumはスコープ内ワークなので、スマートポインタ化していません。
int* cnum = new int[list.size()];
for(size_t i=0; i<list.size(); i++)
int cnum_count = list.size();
int* cnum = new int[cnum_count];
for (size_t i = 0; i < cnum_count; i++)
{
cnum[i] = 0;
}

bool _Infinite = false;
//パラメータを取得
//以前のデータ形式から変換
for ( size_t i = 0 ; i < list.size() ; i ++ )
for ( size_t i = 0 ; i < cnum_count; i ++ )
{
SsEffectNode *node = list[i];

Expand Down
2 changes: 1 addition & 1 deletion Common/Animator/ssplayer_effect2.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ struct particleParameter
int overrideRSeed;


particleParameter(){}
particleParameter(): delay(0.0f), overrideRSeed(0), userOverrideRSeed(false) {}
};


Expand Down
8 changes: 4 additions & 4 deletions Common/Animator/ssplayer_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ class SsMeshPart

public:
SsMeshPart() :
isBind(false), targetCell(0)
isBind(false), targetCell(nullptr), targetTexture(nullptr), myPartState(nullptr)
, indices_num(0), tri_size(0), ver_size(0), outter_vertexnum(0)
, bindBoneInfo()
, weightColors()
, vertices_outer()
, draw_vertices()
, myPartState(0)
, vertices(), colors(), uvs(), indices()
, update_vertices_outer()
, offset_world_vertices()
Expand All @@ -95,7 +95,8 @@ class SsMeshPart


SsMeshPart(SsPartState* s) :
isBind(false), targetCell(0)
isBind(false), targetCell(nullptr), targetTexture(nullptr), myPartState(s)
, indices_num(0), tri_size(0), ver_size(0), outter_vertexnum(0)
, weightColors()
, bindBoneInfo()
, vertices_outer()
Expand All @@ -104,7 +105,6 @@ class SsMeshPart
, update_vertices_outer()
, offset_world_vertices()
{
myPartState = s;
}

~SsMeshPart()
Expand Down
2 changes: 1 addition & 1 deletion Common/Helper/IsshTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class SSTextureFactory
static ISSTexture* create() { return m_texture_base_class->create(); }

public:
SSTextureFactory(){}
SSTextureFactory(): auto_release_baseclass(true) {}
SSTextureFactory(ISSTexture* texture_base_class , bool auto_release_baseclass = true)
{
m_myInst = this ; m_texture_base_class = texture_base_class;
Expand Down
9 changes: 5 additions & 4 deletions Common/Helper/sshTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class treeitem : public __myclass

if ( l > 32 ) l = 32;
for ( size_t i = 0 ; i < l ; i++ ) m_ident[i] = _ident[i];
m_ident[l+1] = 0;
// 1バイトのオーバーラン修正
//m_ident[l+1] = 0;
m_ident[l] = 0;

}

Expand Down Expand Up @@ -176,7 +178,7 @@ class treeitem : public __myclass
}
}

if ( root->child == sub )
if ( root->child == sub && sub != nullptr)
{
treeitem* temp = root->child;
if ( temp )
Expand All @@ -187,8 +189,7 @@ class treeitem : public __myclass
temp->sibling_next->parent = root;
}
}
root->child = root->child->sibling_next;

root->child = root->child ? root->child->sibling_next : nullptr;
}

if ( root->sibling_next )
Expand Down
34 changes: 17 additions & 17 deletions Common/Loader/SsEffectBehavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ SsEffectElementBase* SsEffectBehavior::Factory(const char* name , libXML::XMLEle
SsEffectElementBase * ret = 0;

if ( strcmp( name , "Basic" ) == 0 ) ret = new ParticleElementBasic();
if ( strcmp( name , "OverWriteSeed" ) == 0 ) ret = new ParticleElementRndSeedChange();
if ( strcmp( name , "Delay" ) == 0 ) ret = new ParticleElementDelay();
if ( strcmp( name , "Gravity" ) == 0 ) ret = new ParticleElementGravity();
if ( strcmp( name , "init_position" ) == 0 ) ret = new ParticleElementPosition();
// if ( strcmp( name , "trans_position" ) == 0 ) ret = new ParticleElementTransPosition();
if ( strcmp( name , "init_rotation" ) == 0 ) ret = new ParticleElementRotation();
if ( strcmp( name , "trans_rotation" ) == 0 ) ret = new ParticleElementRotationTrans();
if ( strcmp( name , "trans_speed" ) == 0 ) ret = new ParticleElementTransSpeed();
if ( strcmp( name , "add_tangentiala" ) == 0 ) ret = new ParticleElementTangentialAcceleration();
if ( strcmp( name , "init_vertexcolor" ) == 0 ) ret = new ParticleElementInitColor();
if ( strcmp( name , "trans_vertexcolor" ) == 0 ) ret = new ParticleElementTransColor();
if ( strcmp( name , "trans_colorfade" ) == 0 ) ret = new ParticleElementAlphaFade();
if ( strcmp( name , "init_size" ) == 0 ) ret = new ParticleElementSize();
if ( strcmp( name , "trans_size" ) == 0 ) ret = new ParticleElementTransSize();
if ( strcmp( name , "add_pointgravity" ) == 0 ) ret = new ParticlePointGravity();
if ( strcmp( name , "TurnToDirection" ) == 0 ) ret = new ParticleTurnToDirectionEnabled();
if ( strcmp( name , "InfiniteEmit" ) == 0 ) ret = new ParticleInfiniteEmitEnabled();
else if ( strcmp( name , "OverWriteSeed" ) == 0 ) ret = new ParticleElementRndSeedChange();
else if ( strcmp( name , "Delay" ) == 0 ) ret = new ParticleElementDelay();
else if ( strcmp( name , "Gravity" ) == 0 ) ret = new ParticleElementGravity();
else if ( strcmp( name , "init_position" ) == 0 ) ret = new ParticleElementPosition();
// else if ( strcmp( name , "trans_position" ) == 0 ) ret = new ParticleElementTransPosition();
else if ( strcmp( name , "init_rotation" ) == 0 ) ret = new ParticleElementRotation();
else if ( strcmp( name , "trans_rotation" ) == 0 ) ret = new ParticleElementRotationTrans();
else if ( strcmp( name , "trans_speed" ) == 0 ) ret = new ParticleElementTransSpeed();
else if ( strcmp( name , "add_tangentiala" ) == 0 ) ret = new ParticleElementTangentialAcceleration();
else if ( strcmp( name , "init_vertexcolor" ) == 0 ) ret = new ParticleElementInitColor();
else if ( strcmp( name , "trans_vertexcolor" ) == 0 ) ret = new ParticleElementTransColor();
else if ( strcmp( name , "trans_colorfade" ) == 0 ) ret = new ParticleElementAlphaFade();
else if ( strcmp( name , "init_size" ) == 0 ) ret = new ParticleElementSize();
else if ( strcmp( name , "trans_size" ) == 0 ) ret = new ParticleElementTransSize();
else if ( strcmp( name , "add_pointgravity" ) == 0 ) ret = new ParticlePointGravity();
else if ( strcmp( name , "TurnToDirection" ) == 0 ) ret = new ParticleTurnToDirectionEnabled();
else if ( strcmp( name , "InfiniteEmit" ) == 0 ) ret = new ParticleInfiniteEmitEnabled();

if ( ret )
{
Expand Down
5 changes: 3 additions & 2 deletions Common/Loader/SsEffectElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "sstypes.h"
#include "ssarchiver.h"
#include "ssstring_uty.h"
#include "SsEffectElement.h"

namespace spritestudio6
Expand Down Expand Up @@ -119,8 +120,8 @@ typedef VarianceValue<SsU8Color> SsU8cVValue;

template<> inline bool VarianceValue<float>::inputString( SsString _value , SsString _subvalue )
{
value = (float)atof(_value.c_str());
subvalue = (float)atof(_subvalue.c_str());
value = (float)double_from_string(_value.c_str());
subvalue = (float)double_from_string(_subvalue.c_str());

return true;
}
Expand Down
27 changes: 14 additions & 13 deletions Common/Loader/ssarchiver.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "ssarchiver.h"
#include "ssstring_uty.h"
#include "sscharconverter.h"
#include <errno.h>

namespace spritestudio6
{
Expand Down Expand Up @@ -47,7 +48,7 @@ bool SsXmlIArchiver::dc( const char* name , float& member )
SPRITESTUDIO6SDK_AR_SELF_CHECK();
SsString str;
dc( name , str );
member = (float)atof( str.c_str() );
member = (float)double_from_string( str.c_str() );
if (str == "")
{
return false;
Expand Down Expand Up @@ -178,10 +179,10 @@ bool SsXmlIArchiver::dc( const char* name , SsCurve& member )
{
return false;
}else{
member.startTime = (float)atof( str_list[0].c_str() );
member.startValue = (float)atof( str_list[1].c_str() );
member.endTime = (float)atof( str_list[2].c_str() );
member.endValue = (float)atof( str_list[3].c_str() );
member.startTime = (float)double_from_string( str_list[0].c_str() );
member.startValue = (float)double_from_string( str_list[1].c_str() );
member.endTime = (float)double_from_string( str_list[2].c_str() );
member.endValue = (float)double_from_string( str_list[3].c_str() );

return true;
}
Expand Down Expand Up @@ -234,8 +235,8 @@ bool SsXmlIArchiver::dc(const char* name, SsBoneBind& member)
}
else
{
member.boneIndex = (float)atof(str_list[0].c_str());
member.blend = (float)atof(str_list[1].c_str());
member.boneIndex = (float)double_from_string(str_list[0].c_str());
member.blend = (float)double_from_string(str_list[1].c_str());

return true;
}
Expand Down Expand Up @@ -296,8 +297,8 @@ bool StringToPoint2( const std::string& str , SsPoint2& point )
point.y = 0;
return false;
}else{
point.x = (float)atof( str_list[0].c_str() );
point.y = (float)atof( str_list[1].c_str() );
point.x = (float)double_from_string( str_list[0].c_str() );
point.y = (float)double_from_string( str_list[1].c_str() );
}

return true;
Expand All @@ -316,10 +317,10 @@ bool StringToIRect( const std::string& str , SsIRect& rect )
rect.h = 0;
return false;
}else{
rect.x = (int)atof( str_list[0].c_str() );
rect.y = (int)atof( str_list[1].c_str() );
rect.w = (int)atof( str_list[2].c_str() );
rect.h = (int)atof( str_list[3].c_str() );
rect.x = (int)double_from_string( str_list[0].c_str() );
rect.y = (int)double_from_string( str_list[1].c_str() );
rect.w = (int)double_from_string( str_list[2].c_str() );
rect.h = (int)double_from_string( str_list[3].c_str() );
}

return true;
Expand Down
9 changes: 6 additions & 3 deletions Common/Loader/ssarchiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#include <vector>
#include <map>

#include "../Helper/DebugPrint.h"


// MEMO: 定義順の関係でここでusingしてしまうと問題が発生する
// using namespace tinyxml2;

Expand All @@ -23,7 +26,7 @@ namespace EnumSsArchiver
{
enum Type
{
unkown = 0, //不明
unknown = 0, //不明
in, //Input
out, //Output
};
Expand All @@ -50,10 +53,10 @@ class ISsXmlArchiver

public:

virtual EnumSsArchiver::Type getType(){ return EnumSsArchiver::unkown;}
virtual EnumSsArchiver::Type getType(){ return EnumSsArchiver::unknown;}


ISsXmlArchiver(){}
ISsXmlArchiver(): m_xml(nullptr) {}
virtual ~ISsXmlArchiver(){}

libXML::XMLElement* getxml(){ return m_xml;}
Expand Down
5 changes: 3 additions & 2 deletions Common/Loader/ssattribute.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "ssloader.h"
#include "sstypes.h"
#include "ssattribute.h"
#include "ssstring_uty.h"
#include "../Helper/DebugPrint.h"

namespace spritestudio6
Expand Down Expand Up @@ -359,8 +360,8 @@ void GetSsDeformAnime(const SsKeyframe* key, SsDeformAttr& v)
if (cnt < datasize)
{
int idx = (int)atoi(str_list[1 + (cnt * 3)].c_str()); //index
float x = (float)atof(str_list[2 + (cnt * 3)].c_str()); //x
float y = (float)atof(str_list[3 + (cnt * 3)].c_str()); //y
float x = (float)double_from_string(str_list[2 + (cnt * 3)].c_str()); //x
float y = (float)double_from_string(str_list[3 + (cnt * 3)].c_str()); //y


if (i == idx)
Expand Down
Loading
Loading