Skip to content
Merged
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
4 changes: 2 additions & 2 deletions gd_spritestudio/gd_node_ssplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void GdNodeSsPlayer::setPlayerResource( const Ref<GdResourceSsPlayer>& resPlayer
{
m_ResPlayer = resPlayer;

m_strAnimationSelected.resize(0);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • godot 4.5 から rezsize は廃止、clear() が代替
  • 一方で godot-cpp 4.5 では resize は現存、 clear はなし

empty string を入れることで両方対応する。

m_strAnimationSelected = "";
fetchAnimation();

NOTIFY_PROPERTY_LIST_CHANGED();
Expand Down Expand Up @@ -132,7 +132,7 @@ void GdNodeSsPlayer::setAnimePack( const String& strName )

postAnimePackChanged( m_strAnimePackSelected );

m_strAnimationSelected.resize(0);
m_strAnimationSelected = "";
fetchAnimation();

NOTIFY_PROPERTY_LIST_CHANGED();
Expand Down
2 changes: 1 addition & 1 deletion gd_spritestudio/gd_packet_ssanimepack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bool GdPacketSsAnimePack::write( const String& strRaw )
if ( c.length() > 0 ) {
libXML::XMLDocument xml;

if ( libXML::XML_SUCCESS == xml.Parse( c, c.length() ) ) {
if ( libXML::XML_SUCCESS == xml.Parse( c.get_data(), c.length() ) ) {
SsXmlIArchiver ar( xml.GetDocument(), "SpriteStudioAnimePack" );
SsAnimePack animePack;

Expand Down
2 changes: 1 addition & 1 deletion gd_spritestudio/gd_packet_sscellmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bool GdPacketSsCellMap::write( const String& strRaw )
if ( c.length() > 0 ) {
libXML::XMLDocument xml;

if ( libXML::XML_SUCCESS == xml.Parse( c, c.length() ) ) {
if ( libXML::XML_SUCCESS == xml.Parse( c.get_data(), c.length() ) ) {
SsXmlIArchiver ar( xml.GetDocument(), "SpriteStudioCellMap" );
SsCellMap cellMap;

Expand Down
2 changes: 1 addition & 1 deletion gd_spritestudio/gd_packet_sseffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bool GdPacketSsEffect::write( const String& strRaw )
if ( c.length() > 0 ) {
libXML::XMLDocument xml;

if ( libXML::XML_SUCCESS == xml.Parse( c, c.length() ) ) {
if ( libXML::XML_SUCCESS == xml.Parse( c.get_data(), c.length() ) ) {
SsXmlIArchiver ar( xml.GetDocument(), "SpriteStudioEffect" );
SsEffectFile effect;

Expand Down
2 changes: 1 addition & 1 deletion gd_spritestudio/gd_packet_ssproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bool GdPacketSsProject::write( const String& strRaw )
if ( c.length() > 0 ) {
libXML::XMLDocument xml;

if ( libXML::XML_SUCCESS == xml.Parse( c, c.length() ) ) {
if ( libXML::XML_SUCCESS == xml.Parse( c.get_data(), c.length() ) ) {
SsXmlIArchiver ar( xml.GetDocument(), "SpriteStudioProject" );
SsProject project;

Expand Down
2 changes: 1 addition & 1 deletion gd_spritestudio/gd_resource_ssdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

GdResourceSsDocument::GdResourceSsDocument()
{
m_strSource.resize(0);
m_strSource = "";
}

GdResourceSsDocument::~GdResourceSsDocument()
Expand Down
8 changes: 2 additions & 6 deletions gd_spritestudio/gd_resource_ssproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ GdResourceSsProject::GdResourceSsProject()
m_pProject = NULL;
m_strRoot = "";

for ( int i = 0; i < m_mapResAnimePack.size(); i++ ) {
m_mapResAnimePack.erase( m_mapResAnimePack.getk( i ) );
}
m_mapResAnimePack.clear();
m_vecResCellMap.clear();
m_vecResEffect.clear();
}
Expand All @@ -29,9 +27,7 @@ GdResourceSsProject::~GdResourceSsProject()
m_pProject = NULL;
}

for ( int i = 0; i < m_mapResAnimePack.size(); i++ ) {
m_mapResAnimePack.erase( m_mapResAnimePack.getk( i ) );
}
m_mapResAnimePack.clear();
m_vecResCellMap.clear();
m_vecResEffect.clear();
}
Expand Down
6 changes: 3 additions & 3 deletions gd_spritestudio/gd_resource_ssproject.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
#ifdef SPRITESTUDIO_GODOT_EXTENSION
#include <godot_cpp/classes/resource.hpp>
#include <godot_cpp/classes/resource_loader.hpp>
#include <godot_cpp/templates/vmap.hpp>
Copy link
Collaborator Author

@Naruto Naruto Sep 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.5 から vmap が廃止、大体として hash_map を利用する。

#include <godot_cpp/templates/hash_map.hpp>
using namespace godot;
#else
#ifdef GD_V4
#include "core/io/resource.h"
#include "core/io/resource_loader.h"
#include "core/templates/vmap.h"
#include "core/templates/hash_map.h"
#endif
#ifdef GD_V3
#include "core/resource.h"
Expand Down Expand Up @@ -86,7 +86,7 @@ private :
String m_strImage;
String m_strEffect;

VMap<String,Ref<GdResourceSsAnimePack>> m_mapResAnimePack;
HashMap<String,Ref<GdResourceSsAnimePack>> m_mapResAnimePack;
Vector<Ref<GdResourceSsCellMap>> m_vecResCellMap;
Vector<Ref<GdResourceSsEffect>> m_vecResEffect;
};
Expand Down
10 changes: 5 additions & 5 deletions gd_spritestudio/ss_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ SsProject* SsContainer::loadProjectFromFile( const String& strPath, bool bAutoDe
auto c = strXml.utf8();

if ( c.length() > 0 ) {
pProject = ssloader_sspj::Parse_ProjectOnly( c, c.length() );
pProject = ssloader_sspj::Parse_ProjectOnly( c.get_data(), c.length() );
}
}else
if ( strExt == "gdsspj" ) {
Expand Down Expand Up @@ -131,7 +131,7 @@ SsAnimePack* SsContainer::loadAnimePackFromFile( const String& strPath, bool bAu
auto c = strXml.utf8();

if ( c.length() > 0 ) {
pAnimePack = ssloader_ssae::Parse( c, c.length() );
pAnimePack = ssloader_ssae::Parse( c.get_data(), c.length() );
}
}else
if ( strExt == "gdssae" ) {
Expand Down Expand Up @@ -176,7 +176,7 @@ SsCellMap* SsContainer::loadCellMapFromFile( const String& strPath, bool bAutoDe
auto c = strXml.utf8();

if ( c.length() > 0 ) {
pCellMap = ssloader_ssce::Parse( c, c.length() );
pCellMap = ssloader_ssce::Parse( c.get_data(), c.length() );
}
}else
if ( strExt == "gdssce" ) {
Expand Down Expand Up @@ -220,12 +220,12 @@ SsEffectFile* SsContainer::loadEffectFromFile( const String& strPath, bool bAuto
String strXml = GdIO::loadStringFromFile( strPath );
auto c = strXml.utf8();

pEffect = NULL;//ssloader_ssee::Parse( c, c.length() );
pEffect = NULL;//ssloader_ssee::Parse( c.get_data(), c.length() );

if ( c.length() > 0 ) {
libXML::XMLDocument xml;

libXML::XMLError xmlerr = xml.Parse(c, c.length());
libXML::XMLError xmlerr = xml.Parse(c.get_data(), c.length());

if ( libXML::XML_SUCCESS == xmlerr)
{
Expand Down
2 changes: 1 addition & 1 deletion gd_spritestudio/ss_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,7 @@ bool SsIO::pull( StreamPeerBuffer& st, SsEffectBehavior& behavior )

bool SsIO::pull( StreamPeerBuffer& st, SsString& str )
{
str = st.get_utf8_string().utf8();
str = st.get_utf8_string().utf8().get_data();

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion gd_spritestudio/ss_renderer_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ void SsRendererImpl::makePrimitive( SsPartState* state )
// glTranslatef( uvw + uv_trans.x , uvh + uv_trans.y , 0 );
// glRotatef( state->uvRotation, 0.0, 0.0, 1.0);
TranslationMatrix( transMat, uvw + uv_trans.x, uvh + uv_trans.y, 0 );
Matrix4RotationZ( rotateMat, state->uvRotation * Math_PI / 180.0 );
Matrix4RotationZ( rotateMat, state->uvRotation * 3.1415926535897932384626433833 / 180.0 );
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.4 から Math_PI, 4.5 からは Math::PI となる。

両方対応のため直値で利用する。


float uvsh = state->uvScale.x;
float uvsv = state->uvScale.y;
Expand Down
Loading