├── .gitignore ├── Build ├── CMakeLists.txt ├── Converter │ ├── BinaryDataWriter.cpp │ ├── BinaryDataWriter.h │ ├── FileUtil.cpp │ ├── FileUtil.h │ ├── Lump.cpp │ ├── Lump.h │ ├── LumpExporter.cpp │ ├── LumpExporter.h │ ├── SsPlayerConverter.h │ └── main.cpp ├── PythonBinder │ ├── bind_Animation.cpp │ ├── bind_Animation.h │ ├── bind_AnimePack.cpp │ ├── bind_AnimePack.h │ ├── bind_Cellmap.cpp │ ├── bind_Cellmap.h │ ├── bind_SSXML.cpp │ ├── bind_SSXML.h │ ├── bind_SsAnimeDecoder.cpp │ ├── bind_SsAnimeDecoder.h │ ├── bind_SsAttribute.cpp │ ├── bind_SsAttribute.h │ ├── bind_SsKeyframe.cpp │ ├── bind_SsKeyframe.h │ ├── bind_SsPart.cpp │ ├── bind_SsPart.h │ ├── bind_SsPartAnime.cpp │ ├── bind_SsPartAnime.h │ ├── package_SpriteStudio.cpp │ ├── package_SpriteStudio.h │ └── script_base_conv.cpp ├── Ss5ConverterGUI │ ├── Application-000.icns │ ├── Application-000.ico │ ├── Application-000.png │ ├── LICENSE │ ├── Ss5ConverterGUI.pro │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── mainwindow.ui │ └── readme.txt ├── TestData │ ├── Accelerate.ssae │ ├── NewAnimation.ssae │ ├── Parent.ssae │ ├── RoboProject.sspj │ ├── all.ssae │ ├── allcheck.sspj │ ├── arm01.ssae │ ├── base_offset.ssae │ ├── blendmode.ssae │ ├── car.png │ ├── car.ssae │ ├── car.ssce │ ├── car.sspj │ ├── color_bar.png │ ├── color_bar.ssce │ ├── inherit.ssae │ ├── instance │ │ ├── frame.ssae │ │ ├── fream.png │ │ ├── fream.ssce │ │ ├── light1.ssae │ │ ├── light2.ssae │ │ ├── light3.ssae │ │ ├── light4.ssae │ │ ├── light5.ssae │ │ ├── mask.ssae │ │ ├── stage.png │ │ ├── stage.ssce │ │ ├── stageanim3.sspj │ │ ├── stageeffect.png │ │ ├── stageeffect.ssce │ │ ├── stageeffect2.ssae │ │ ├── tk01.png │ │ ├── tk01.ssae │ │ └── tk01.ssce │ ├── layout.ssae │ ├── layout2.ssae │ ├── nullparts.ssae │ ├── object01.ssae │ ├── robo_01.png │ ├── robo_01.ssae │ ├── robo_01.ssce │ ├── robo_02.ssae │ ├── robo_03.ssae │ ├── robo_04.ssae │ ├── robo_05.ssae │ ├── robo_x.ssae │ ├── rotation.ssae │ ├── sand.ssae │ ├── senjyu01.png │ ├── senjyu01.ssae │ ├── senjyu01.ssce │ ├── senjyu2.sspj │ ├── test.dat │ ├── trans.ssae │ └── vertex.ssae ├── TestScript │ ├── SpriteStudio_pythonモジュール仕様書.txt │ ├── readme.txt │ ├── scriptbase_converter.exe │ ├── sstype.py │ ├── sstype.pyc │ └── testscript.py ├── UnitTest │ ├── gtest-all.cc │ ├── gtest │ │ └── gtest.h │ ├── gtest_main.cc │ ├── readme.txt │ ├── unit_ssloader_ssae.cc │ ├── unit_ssloader_ssce.cc │ └── unit_ssloader_sspj.cc ├── Viewer │ ├── CMakeLists.txt │ └── source │ │ ├── main_dx9.cpp │ │ ├── main_gl.cpp │ │ ├── myscene.cpp │ │ ├── myscene.h │ │ └── script_base_conv.cpp ├── example │ ├── LICENSE.txt │ ├── Roboto-Bold.ttf │ ├── Roboto-Light.ttf │ ├── Roboto-Regular.ttf │ ├── TanukiMagic.ttf │ ├── demo.c │ ├── demo.h │ ├── entypo.ttf │ ├── example_fbo.c │ ├── example_gl2.c │ ├── example_gl3.c │ ├── example_gles2.c │ ├── example_gles3.c │ ├── images.txt │ ├── images │ │ ├── image1.jpg │ │ ├── image10.jpg │ │ ├── image11.jpg │ │ ├── image12.jpg │ │ ├── image2.jpg │ │ ├── image3.jpg │ │ ├── image4.jpg │ │ ├── image5.jpg │ │ ├── image6.jpg │ │ ├── image7.jpg │ │ ├── image8.jpg │ │ └── image9.jpg │ ├── perf.c │ ├── perf.h │ ├── screenshot-01.png │ ├── screenshot-02.png │ └── stb_image_write.h ├── fonts │ ├── Roboto-Bold.ttf │ ├── Roboto-Light.ttf │ ├── Roboto-Regular.ttf │ └── entypo.ttf └── plistConverter │ ├── ReadMe.txt │ ├── plistConverter.cpp │ ├── plistConverter.sln │ ├── plistConverter.v12.suo │ ├── plistConverter.vcxproj │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h ├── Common ├── Animator │ ├── ISsEffectRender.h │ ├── MersenneTwister.h │ ├── ssplayer_PartState.cpp │ ├── ssplayer_PartState.h │ ├── ssplayer_animedecode.cpp │ ├── ssplayer_animedecode.h │ ├── ssplayer_cellmap.cpp │ ├── ssplayer_cellmap.h │ ├── ssplayer_effect.cpp │ ├── ssplayer_effect.h │ ├── ssplayer_effect2.cpp │ ├── ssplayer_effect2.h │ ├── ssplayer_effectfunction.cpp │ ├── ssplayer_effectfunction.h │ ├── ssplayer_macro.h │ ├── ssplayer_matrix.cpp │ ├── ssplayer_matrix.h │ ├── ssplayer_render.cpp │ ├── ssplayer_render.h │ ├── ssplayer_types.h │ └── xorshift32.h ├── Drawer │ ├── GLSL │ │ ├── sprite.fs │ │ ├── sprite.vs │ │ └── sprite_pot.fs │ ├── ssplayer_render_dx9.cpp │ ├── ssplayer_render_dx9.h │ ├── ssplayer_render_gl.cpp │ ├── ssplayer_render_gl.h │ ├── ssplayer_shader_gl.cpp │ └── ssplayer_shader_gl.h ├── Helper │ ├── DebugPrint.cpp │ ├── DebugPrint.h │ ├── DirectX │ │ ├── SSTextureDX9.cpp │ │ ├── SSTextureDX9.h │ │ ├── d3dsimple.cpp │ │ └── d3dsimple.h │ ├── IsshTexture.cpp │ ├── IsshTexture.h │ ├── MacOS │ │ ├── OSXFileOpen.h │ │ └── OSXFileOpen.mm │ ├── OpenGL │ │ ├── SSTextureGL.cpp │ │ └── SSTextureGL.h │ ├── Win │ │ └── WinMain.cpp │ ├── XPFileOpenDlg.cpp │ ├── XPFileOpenDlg.h │ ├── ssHelper.h │ ├── sshObject.cpp │ ├── sshObject.h │ ├── sshScene.cpp │ ├── sshScene.h │ ├── sshTask.cpp │ ├── sshTask.h │ ├── sshTextureBMP.cpp │ ├── sshTextureBMP.h │ ├── stb_image.c │ └── stb_image.h └── Loader │ ├── SsEffectBehavior.cpp │ ├── SsEffectBehavior.h │ ├── SsEffectElement.cpp │ ├── SsEffectElement.h │ ├── babel │ ├── apple.csv │ ├── babel.cpp │ ├── babel.h │ ├── c932-uni.dat │ ├── cp932.csv │ ├── euc-scr.dat │ ├── euc-sjis.dat │ ├── euc-uni.csv │ ├── euc2-uni.dat │ ├── euc3-uni.dat │ ├── scoremap.csv │ ├── sjis-euc.csv │ ├── sjis-euc.dat │ ├── sjis-scr.dat │ ├── uni-c932.dat │ ├── uni-euc.dat │ ├── uni-scr.dat │ ├── uni-utc.dat │ ├── utc-uni.dat │ └── utc.csv │ ├── ssInterpolation.cpp │ ├── ssInterpolation.h │ ├── ssarchiver.cpp │ ├── ssarchiver.h │ ├── ssattribute.cpp │ ├── ssattribute.h │ ├── ssloader.h │ ├── ssloader_ssae.cpp │ ├── ssloader_ssae.h │ ├── ssloader_ssce.cpp │ ├── ssloader_ssce.h │ ├── ssloader_ssee.cpp │ ├── ssloader_ssee.h │ ├── ssloader_sspj.cpp │ ├── ssloader_sspj.h │ ├── ssstring_uty.cpp │ ├── ssstring_uty.h │ ├── sstypes.cpp │ ├── sstypes.h │ ├── ssvalue.cpp │ ├── ssvalue.h │ └── tinyxml2 │ ├── tinyxml2.cpp │ └── tinyxml2.h ├── Doxyfile ├── LICENSE ├── PlayerDoxyfile ├── README.md └── Tools ├── README.md ├── Ss5Converter.zip ├── Ss5Converter_Mac.zip ├── plistConverter.zip ├── viewer_sample.zip └── viewer_sample_Mac.zip /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | 15 | # Viusal C 16 | *.vcproj 17 | *.ncb 18 | *.sln 19 | *.suo 20 | *.vcproj.* 21 | AntTweakBar.dll 22 | glew32.dll 23 | 24 | CMakeCache.txt 25 | CMakeFiles 26 | CMakeScripts 27 | Debug 28 | cmake_install.cmake/Users/kurooka/Documents/workspace/SpriteStudio5-SDK/.gitignore 29 | project.pbxproj 30 | sssdk.xcodeproj 31 | *.swp 32 | *.vcxproj 33 | *.filters 34 | *.user 35 | *.opensdf 36 | *.sdf 37 | *.ipch 38 | AntTweakBar64.dll 39 | glew32mx.dll 40 | Release/ 41 | Build/Viewer/python27_d.dll 42 | Build/Viewer/RelWithDebInfo/scriptbase_converter.exe 43 | Build/Viewer/RelWithDebInfo/ 44 | Build/Viewer/Win32/RelWithDebInfo/ 45 | Build/Viewer/scriptbase_converter.dir/ 46 | Build/Viewer/ssAnimater.dir/ 47 | Build/Viewer/ssHelper.dir/RelWithDebInfo/CL.read.1.tlog 48 | Build/Viewer/ssHelper.dir/ 49 | Build/Viewer/ssloader.dir/ 50 | Build/Viewer/viewer_sample_dx9.dir/ 51 | Build/Viewer/viewer_sample_gl.dir/ 52 | Build/TestScript/build/ 53 | Build/TestScript/psd2ss/build/ 54 | Build/TestScript/psd2ss/dist/ 55 | Build/TestScript/psd2ss/setuptools/ 56 | Build/AntTweakBar.lib 57 | Build/AntTweakBar64.lib 58 | Common/Animator/57314826.txt 59 | Build/TestScript/SpriteStudio_pythonモジュール仕様書.txt 60 | Tools/viewer_sample_Mac/viewer_sample_gl 61 | Tools/viewer_sample_gl 62 | Build/Viewer/cmake_install.cmake 63 | Build/cmake_install.cmake 64 | SpriteStudio5-SDK.zip 65 | Build/Ss5Converter.dir/ 66 | Build/Win32/RelWithDebInfo/ 67 | Build/ssAnimater.dir/ 68 | Build/ssHelper.dir/ 69 | Build/ssloader.dir/ 70 | Build/viewer_sample_dx9.dir/ 71 | Build/viewer_sample_gl.dir/ 72 | -------------------------------------------------------------------------------- /Build/Converter/BinaryDataWriter.cpp: -------------------------------------------------------------------------------- 1 |  2 | #include "BinaryDataWriter.h" 3 | #include 4 | 5 | 6 | BinaryDataWriter::BinaryDataWriter(std::ostream& out, EndiannessType endianness) 7 | : _out(out) 8 | , _endianness(endianness) 9 | { 10 | } 11 | 12 | BinaryDataWriter::~BinaryDataWriter() 13 | { 14 | } 15 | 16 | void BinaryDataWriter::seekp(long pos) 17 | { 18 | _out.seekp(pos); 19 | } 20 | 21 | void BinaryDataWriter::fill(char fillData, size_t size) 22 | { 23 | for (size_t i = 0; i < size; i++) 24 | { 25 | writeByte(fillData); 26 | } 27 | } 28 | 29 | void BinaryDataWriter::align(int unit) 30 | { 31 | long pos = static_cast(_out.tellp()); 32 | int n = static_cast(pos & (unit-1)); 33 | if (n) 34 | { 35 | int nPadding = unit - n; 36 | fill(0, nPadding); 37 | } 38 | } 39 | 40 | void BinaryDataWriter::fixReferences() 41 | { 42 | long currentPos = static_cast(_out.tellp()); 43 | 44 | for (ReferenceMapType::const_iterator i = _referenceMap.begin(), end = _referenceMap.end(); i != end; i++) 45 | { 46 | const Reference& ref = i->second; 47 | if (ref.referencePosList.empty()) continue; // 参照先なし 48 | if (ref.dataPos < 0) 49 | { 50 | throw std::logic_error(i->first + "に対応する dataPos が記録されていません"); 51 | } 52 | 53 | // 参照元のポジションを書き換える 54 | for (Reference::ReferencePosListType::const_iterator posIt = ref.referencePosList.begin(); posIt != ref.referencePosList.end(); posIt++) 55 | { 56 | _out.seekp(*posIt); 57 | writeInt(static_cast(ref.dataPos)); 58 | } 59 | } 60 | 61 | _out.seekp(currentPos); 62 | } 63 | 64 | void BinaryDataWriter::writeReference(const std::string &key, bool align4Bytes) 65 | { 66 | Reference ref; 67 | if (_referenceMap.find(key) != _referenceMap.end()) ref = _referenceMap.at(key); 68 | 69 | if (align4Bytes) align(4); 70 | long pos = static_cast(_out.tellp()); 71 | ref.referencePosList.push_back(pos); 72 | _referenceMap[key] = ref; 73 | writeInt(0); 74 | } 75 | 76 | void BinaryDataWriter::setReference(const std::string &key) 77 | { 78 | Reference ref; 79 | if (_referenceMap.find(key) != _referenceMap.end()) ref = _referenceMap.at(key); 80 | 81 | align(4); 82 | ref.dataPos = static_cast(_out.tellp()); 83 | _referenceMap[key] = ref; 84 | } 85 | 86 | void BinaryDataWriter::writeByte(char data) 87 | { 88 | char buf[1]; 89 | buf[0] = data; 90 | _out.write(buf, sizeof(buf)); 91 | } 92 | 93 | void BinaryDataWriter::writeShort(short data) 94 | { 95 | char buf[2]; 96 | if (_endianness == ET_LITTLE_ENDIAN) 97 | { 98 | buf[0] = static_cast(data); 99 | buf[1] = static_cast(data >> 8); 100 | } 101 | else 102 | { 103 | buf[0] = static_cast(data >> 8); 104 | buf[1] = static_cast(data); 105 | } 106 | _out.write(buf, sizeof(buf)); 107 | } 108 | 109 | void BinaryDataWriter::writeInt(int data) 110 | { 111 | char buf[4]; 112 | if (_endianness == ET_LITTLE_ENDIAN) 113 | { 114 | buf[0] = static_cast(data); 115 | buf[1] = static_cast(data >> 8); 116 | buf[2] = static_cast(data >> 16); 117 | buf[3] = static_cast(data >> 24); 118 | } 119 | else 120 | { 121 | buf[0] = static_cast(data >> 24); 122 | buf[1] = static_cast(data >> 16); 123 | buf[2] = static_cast(data >> 8); 124 | buf[3] = static_cast(data); 125 | } 126 | _out.write(buf, sizeof(buf)); 127 | } 128 | 129 | void BinaryDataWriter::writeFloat(float data) 130 | { 131 | union { 132 | float f; 133 | int i; 134 | } c; 135 | c.f = data; 136 | writeInt(c.i); 137 | } 138 | 139 | void BinaryDataWriter::writeString(const std::string& str) 140 | { 141 | _out.write(str.c_str(), str.length()); 142 | writeByte(0); 143 | } 144 | 145 | -------------------------------------------------------------------------------- /Build/Converter/BinaryDataWriter.h: -------------------------------------------------------------------------------- 1 | #ifndef __BinaryDataWriter__ 2 | #define __BinaryDataWriter__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class BinaryDataWriter 10 | { 11 | public: 12 | struct Reference 13 | { 14 | typedef std::vector ReferencePosListType; 15 | 16 | long dataPos; 17 | ReferencePosListType referencePosList; 18 | 19 | Reference() : dataPos(-1L) {} 20 | }; 21 | 22 | typedef std::map ReferenceMapType; 23 | 24 | enum EndiannessType 25 | { 26 | ET_LITTLE_ENDIAN, 27 | ET_BIG_ENDIAN 28 | }; 29 | 30 | BinaryDataWriter(std::ostream& out, EndiannessType endianness = ET_LITTLE_ENDIAN); 31 | virtual ~BinaryDataWriter(); 32 | 33 | void seekp(long pos); 34 | void fill(char fillData, size_t size); 35 | void align(int n); 36 | 37 | void fixReferences(); 38 | void writeReference(const std::string& key, bool align4Bytes = true); 39 | void setReference(const std::string& key); 40 | 41 | void writeByte(char data); 42 | void writeShort(short data); 43 | void writeInt(int data); 44 | void writeFloat(float data); 45 | void writeString(const std::string& str); 46 | 47 | private: 48 | std::ostream& _out; 49 | EndiannessType _endianness; 50 | ReferenceMapType _referenceMap; 51 | }; 52 | 53 | #endif /* defined(__BinaryDataWriter__) */ 54 | -------------------------------------------------------------------------------- /Build/Converter/FileUtil.cpp: -------------------------------------------------------------------------------- 1 |  2 | #include "FileUtil.h" 3 | 4 | #ifdef _WIN32 5 | #include 6 | #endif // ifdef WIN32 7 | 8 | 9 | namespace FileUtil 10 | { 11 | 12 | std::string replaceBackslash(const std::string& path) 13 | { 14 | std::string npath; 15 | for (std::string::const_iterator it = path.begin(); it != path.end(); it++) 16 | { 17 | char ch = *it; 18 | if (ch == 0x5c) npath += '/'; 19 | else npath += ch; 20 | } 21 | return npath; 22 | } 23 | 24 | 25 | std::string replaceExtension(const std::string& path, const std::string& oldExt, const std::string& newExt) 26 | { 27 | std::string nOldExt = (oldExt.at(0) == '.') ? oldExt : "." + oldExt; 28 | std::string nNewExt = (newExt.at(0) == '.') ? newExt : "." + newExt; 29 | 30 | std::string npath(path); 31 | 32 | std::string::size_type pos = npath.rfind("."); 33 | if (pos != std::string::npos) 34 | { 35 | std::string old = npath.substr(pos); 36 | // 指定の拡張子と一致するときのみ置き換える 37 | if (old == nOldExt) 38 | { 39 | npath = npath.substr(0, pos); 40 | } 41 | } 42 | 43 | npath += nNewExt; 44 | return npath; 45 | } 46 | 47 | 48 | 49 | #ifdef _WIN32 50 | 51 | 52 | static std::string getPath(const std::string& fileName) 53 | { 54 | char drive[_MAX_DRIVE]; 55 | char dir[_MAX_DIR]; 56 | char fname[_MAX_FNAME]; 57 | char ext[_MAX_EXT]; 58 | 59 | _splitpath_s(fileName.c_str(), drive, _MAX_DRIVE, dir, _MAX_DIR, fname, _MAX_FNAME, ext, _MAX_EXT); 60 | 61 | std::string path(drive); 62 | path += dir; 63 | return path; 64 | } 65 | 66 | 67 | std::vector findPath(const std::string& pattern) 68 | { 69 | WIN32_FIND_DATA fd; 70 | 71 | std::string dir = getPath(pattern); 72 | 73 | std::vector list; 74 | HANDLE handle = FindFirstFileEx( 75 | pattern.c_str(), 76 | #if _MSC_VER > 1600 77 | FindExInfoBasic, 78 | #else 79 | FindExInfoStandard, 80 | #endif 81 | &fd, 82 | FindExSearchNameMatch, 83 | NULL, 84 | 0); 85 | 86 | if (handle != INVALID_HANDLE_VALUE) 87 | { 88 | while (true) 89 | { 90 | if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) 91 | { 92 | std::string fullPath = dir + fd.cFileName; 93 | list.push_back(fullPath); 94 | } 95 | 96 | if (!FindNextFile(handle, &fd)) 97 | { 98 | if (GetLastError() == ERROR_NO_MORE_FILES) 99 | { 100 | break; 101 | } 102 | else 103 | { 104 | break; 105 | } 106 | } 107 | } 108 | FindClose(handle); 109 | } 110 | return list; 111 | } 112 | 113 | #endif // ifdef WIN32 114 | 115 | } // namespace FileUtil 116 | 117 | -------------------------------------------------------------------------------- /Build/Converter/FileUtil.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILE_UTIL_H_ 2 | #define _FILE_UTIL_H_ 3 | 4 | #include 5 | #include 6 | 7 | namespace FileUtil 8 | { 9 | std::string replaceBackslash(const std::string& path); 10 | 11 | std::string replaceExtension(const std::string& path, const std::string& oldExt, const std::string& newExt); 12 | 13 | #ifdef _WIN32 14 | std::vector findPath(const std::string& pattern); 15 | #endif // ifdef WIN32 16 | 17 | } 18 | 19 | #endif // _FILE_UTIL_H_ 20 | -------------------------------------------------------------------------------- /Build/Converter/Lump.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Lump.cpp 3 | // 4 | 5 | #include "Lump.h" 6 | #include 7 | 8 | 9 | Lump::Lump(DataType type) : type(type) {} 10 | 11 | Lump::~Lump() 12 | { 13 | switch (type) 14 | { 15 | case S16: 16 | case S32: 17 | case FLOAT: 18 | case COLOR: 19 | break; 20 | case STRING: 21 | delete data.s; 22 | break; 23 | case SET: 24 | delete data.p; 25 | break; 26 | } 27 | } 28 | 29 | Lump* Lump::s16Data(int value) 30 | { 31 | Lump* v = new Lump(S16); 32 | v->data.i = value; 33 | return v; 34 | } 35 | 36 | Lump* Lump::s32Data(int value) 37 | { 38 | Lump* v = new Lump(S32); 39 | v->data.i = value; 40 | return v; 41 | } 42 | 43 | Lump* Lump::floatData(float value) 44 | { 45 | Lump* v = new Lump(FLOAT); 46 | v->data.f = value; 47 | return v; 48 | } 49 | 50 | Lump* Lump::colorData(int color) 51 | { 52 | Lump* v = new Lump(COLOR); 53 | v->data.i = color; 54 | return v; 55 | } 56 | 57 | Lump* Lump::stringData(const std::string& value) 58 | { 59 | Lump* v = new Lump(STRING); 60 | v->data.s = new std::string(value); 61 | return v; 62 | } 63 | 64 | Lump* Lump::set(const std::string& className, bool isReference) 65 | { 66 | size_t len = className.length(); 67 | bool isArray = className.at(len-2) == '[' && className.at(len-1) == ']'; 68 | bool isPointerArray = className.at(len-3) == '*'; 69 | LumpSet::ArrayType arrayType = isArray ? LumpSet::ARRAY : LumpSet::NO_ARRAY; 70 | 71 | std::string name = className; 72 | if (isArray) 73 | { 74 | // ポインタの配列のときは強制的に型を変える 75 | if (isPointerArray) 76 | { 77 | name = "ss::ss_offset"; 78 | } 79 | else 80 | { 81 | name = name.substr(0, len-2); 82 | 83 | // ss_u16型の配列のときは専用配列とする 84 | if (name == "ss::ss_u16") 85 | { 86 | arrayType = LumpSet::U16_ARRAY; 87 | } 88 | } 89 | } 90 | 91 | Lump* v = new Lump(SET); 92 | v->data.p = new LumpSet(name, arrayType, isReference); 93 | return v; 94 | } 95 | 96 | void Lump::add(Lump* lump) 97 | { 98 | assert(type == SET); 99 | data.p->set.push_back(lump); 100 | } 101 | 102 | void Lump::addFirst(Lump* lump) 103 | { 104 | assert(type == SET); 105 | data.p->set.insert(data.p->set.begin(), lump); 106 | } 107 | 108 | size_t Lump::count() const 109 | { 110 | assert(type == SET); 111 | return static_cast(data.p->set.size()); 112 | } 113 | 114 | 115 | 116 | 117 | LumpSet::LumpSet(const std::string& className, ArrayType arrayType, bool isReference) 118 | : className(className) 119 | , arrayType(arrayType) 120 | , isReference(isReference) 121 | {} 122 | 123 | LumpSet::~LumpSet() 124 | { 125 | for (SetType::reverse_iterator it = set.rbegin(); it != set.rend(); it++) 126 | { 127 | Lump* lump = *it; 128 | delete lump; 129 | } 130 | } 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /Build/Converter/Lump.h: -------------------------------------------------------------------------------- 1 | // 2 | // Lump.h 3 | // 4 | 5 | #ifndef Lump_h 6 | #define Lump_h 7 | 8 | #include 9 | #include 10 | 11 | 12 | class LumpSet; 13 | 14 | 15 | class Lump 16 | { 17 | public: 18 | enum DataType 19 | { 20 | S16, 21 | S32, 22 | FLOAT, 23 | COLOR, 24 | STRING, 25 | SET 26 | }; 27 | 28 | const DataType type; 29 | union 30 | { 31 | int i; 32 | float f; 33 | std::string* s; 34 | LumpSet* p; 35 | } data; 36 | 37 | 38 | static Lump* s16Data(int value); 39 | static Lump* s32Data(int value); 40 | static Lump* floatData(float value); 41 | static Lump* colorData(int color); 42 | static Lump* stringData(const std::string& value); 43 | 44 | static Lump* set(const std::string& className, bool isReference = false); 45 | 46 | void add(Lump* lump); 47 | void addFirst(Lump* lump); 48 | size_t count() const; 49 | 50 | ~Lump(); 51 | 52 | private: 53 | explicit Lump(DataType type); 54 | }; 55 | 56 | 57 | 58 | class LumpSet 59 | { 60 | public: 61 | enum ArrayType 62 | { 63 | NO_ARRAY, 64 | ARRAY, 65 | U16_ARRAY 66 | }; 67 | 68 | typedef std::vector SetType; 69 | 70 | const std::string className; 71 | const ArrayType arrayType; 72 | const bool isReference; 73 | SetType set; 74 | 75 | LumpSet(const std::string& className, ArrayType arrayType, bool isReference); 76 | ~LumpSet(); 77 | }; 78 | 79 | 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /Build/Converter/LumpExporter.h: -------------------------------------------------------------------------------- 1 | // 2 | // LumpExporter.h 3 | // 4 | 5 | #ifndef __LumpExporter__ 6 | #define __LumpExporter__ 7 | 8 | #include "Lump.h" 9 | #include 10 | #include 11 | 12 | namespace LumpExporter { 13 | 14 | enum StringEncoding 15 | { 16 | UTF8, 17 | SJIS 18 | }; 19 | 20 | void saveBinary(std::ostream& out, StringEncoding encoding, const Lump* lump, const std::string& creatorComment); 21 | 22 | void saveCSource(std::ostream& out, StringEncoding encoding, const Lump* lump, const std::string& topLabel, const std::string& creatorComment); 23 | 24 | } 25 | 26 | #endif /* defined(__LumpExporter__) */ 27 | -------------------------------------------------------------------------------- /Build/Converter/SsPlayerConverter.h: -------------------------------------------------------------------------------- 1 | // 2 | // SsPlayerConverter.h 3 | // 4 | 5 | #ifndef _SsPlayerConverter_h 6 | #define _SsPlayerConverter_h 7 | 8 | enum SsPlayerConverterResultCode 9 | { 10 | SSPC_SUCCESS = 0, // 成功 11 | SSPC_INTERNAL_ERROR, // 内部エラーが発生しました(※バグなどの不具合が無い限り通常発生しません) 12 | SSPC_NOT_SPECIFY_INPUT_FILE, // 入力ファイルの指定がありません 13 | SSPC_NOT_EXIST_INPUT_FILE, // 指定された入力ファイルが存在しません 14 | SSPC_ILLEGAL_ARGUMENT, // 引数が不正です 15 | SSPC_NOT_SUPPORT_OUTPUT_ENCODING, // 対応していない出力ファイルのエンコーディング形式が指定されました 16 | SSPC_IMPOSSIBLE_PLURAL_SSF_FILES, // ssfファイルが複数指定されています。一つのみ指定可能です 17 | SSPC_SSAX_PARSE_FAILED, // ssaxファイルの解析に失敗しました 18 | SSPC_SSPJ_PARSE_FAILED, // sspjファイルの解析に失敗しました 19 | 20 | END_OF_SSPC 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Build/PythonBinder/bind_Animation.cpp: -------------------------------------------------------------------------------- 1 | // 2 | #include "package_SpriteStudio.h" 3 | #include "bind_AnimePack.h" 4 | #include "ssplayer_animedecode.h" 5 | #include "bind_Animation.h" 6 | 7 | 8 | Bind_SsCellValue* Bind_SsPartState::cellValue() 9 | { 10 | Bind_SsCellValue* temp = new Bind_SsCellValue(); 11 | 12 | temp->bind( &this->bind_inst->cellValue ); 13 | 14 | return temp; 15 | } 16 | 17 | 18 | 19 | Bind_SsAnimeDecoder* Bind_SsPartState::getInstanceDecoder() 20 | { 21 | Bind_SsAnimeDecoder* ad = new Bind_SsAnimeDecoder(); 22 | ad->m_decoder = this->bind_inst->refAnime; 23 | 24 | return ad; 25 | 26 | } -------------------------------------------------------------------------------- /Build/PythonBinder/bind_Animation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/PythonBinder/bind_Animation.h -------------------------------------------------------------------------------- /Build/PythonBinder/bind_AnimePack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/PythonBinder/bind_AnimePack.cpp -------------------------------------------------------------------------------- /Build/PythonBinder/bind_AnimePack.h: -------------------------------------------------------------------------------- 1 | #ifndef __bind_ANIMEPACK__ 2 | #define __bind_ANIMEPACK__ 3 | 4 | 5 | #include "package_SpriteStudio.h" 6 | 7 | 8 | 9 | class Bind_SsAnimeDecoder; 10 | class SsCellMapList; 11 | 12 | class Bind_SsAnimePack 13 | { 14 | public: 15 | SsAnimePack* m_animepack; 16 | SsCellMapList* m_cellmap; 17 | SsProject* m_proj; 18 | 19 | Bind_SsAnimePack(); 20 | bool debug(); 21 | 22 | Bind_SsAnimeDecoder* getAnimeDecoderByName( const char* animename ); 23 | Bind_SsAnimeDecoder* getAnimeDecoderByIndex( int index ); 24 | 25 | }; 26 | 27 | 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Build/PythonBinder/bind_Cellmap.cpp: -------------------------------------------------------------------------------- 1 | #include "bind_Cellmap.h" 2 | 3 | Bind_Cell* Bind_Cellmap::getCell(int index) 4 | { 5 | Bind_Cell* c = new Bind_Cell(); 6 | c->bind( bind_inst->cells[index] ); 7 | 8 | return c; 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /Build/PythonBinder/bind_Cellmap.h: -------------------------------------------------------------------------------- 1 | #ifndef __BIND_CELLMAP__ 2 | #define __BIND_CELLMAP__ 3 | 4 | #include "package_SpriteStudio.h" 5 | 6 | 7 | #include "IsshTexture.h" 8 | #include "ssplayer_cellmap.h" 9 | 10 | 11 | 12 | class Bind_Cell : public myPyBinder 13 | { 14 | public: 15 | Bind_Cell(){} 16 | virtual ~Bind_Cell(){} 17 | 18 | const char* name(){ return bind_inst->name.c_str();} 19 | SsPoint2 pos(){ return bind_inst->pos;} 20 | SsPoint2 size(){ return bind_inst->size;} 21 | SsPoint2 pivot(){ return bind_inst->pivot;} 22 | bool rotated(){ return bind_inst->rotated;} 23 | 24 | 25 | }; 26 | 27 | class Bind_Cellmap : public myPyBinder 28 | { 29 | public: 30 | Bind_Cellmap(){} 31 | virtual ~Bind_Cellmap(){} 32 | 33 | const char* name(){ return bind_inst->name.c_str();} 34 | const char* imagePath(){ return bind_inst->imagePath.c_str();} 35 | SsPoint2 pixelSize(){ return bind_inst->pixelSize;} 36 | bool overrideTexSettings(){ return bind_inst->overrideTexSettings;} 37 | int wrapMode(){ return (int)bind_inst->wrapMode;} 38 | int filterMode(){ return (int)bind_inst->filterMode;} 39 | 40 | int getCellNum() 41 | { 42 | return (int)bind_inst->cells.size(); 43 | } 44 | 45 | Bind_Cell* getCell(int index); 46 | 47 | }; 48 | 49 | class ISSTexture; 50 | class Bind_SsTexture : public myPyBinder 51 | { 52 | public: 53 | Bind_SsTexture(){} 54 | virtual ~Bind_SsTexture(){} 55 | 56 | int getWidth(){ return bind_inst->getWidth(); } 57 | int getHeight(){ return bind_inst->getWidth(); } 58 | const char* getFilename(){ return bind_inst->getFilename(); } 59 | 60 | }; 61 | 62 | struct SsCellValue; 63 | class Bind_SsCellValue : public myPyBinder 64 | { 65 | public: 66 | Bind_SsCellValue(){} 67 | virtual ~Bind_SsCellValue(){} 68 | 69 | SsVector2 getuvs(int index) { return bind_inst->uvs[index]; } 70 | BIND_RETURN_PROPEX( int ,wrapMode ); 71 | BIND_RETURN_PROPEX( int ,filterMode ); 72 | 73 | BIND_NEW_PROP( Bind_Cell , cell ); 74 | BIND_NEW_PROP( Bind_SsTexture , texture ); 75 | 76 | }; 77 | 78 | 79 | #endif 80 | 81 | -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SSXML.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/PythonBinder/bind_SSXML.cpp -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SSXML.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/PythonBinder/bind_SSXML.h -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SsAnimeDecoder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/PythonBinder/bind_SsAnimeDecoder.cpp -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SsAnimeDecoder.h: -------------------------------------------------------------------------------- 1 | #ifndef __bind_ANIMESTATE__ 2 | #define __bind_ANIMESTATE__ 3 | 4 | 5 | #include "package_SpriteStudio.h" 6 | 7 | 8 | class Bind_SsPartAnime; 9 | class Bind_SsPart; 10 | class SsAnimeDecoder; 11 | class Bind_SsPartState; 12 | 13 | class Bind_SsAnimeDecoder 14 | { 15 | private: 16 | 17 | public: 18 | SsAnimeDecoder* m_decoder; 19 | 20 | Bind_SsAnimeDecoder(); 21 | virtual ~Bind_SsAnimeDecoder(); 22 | bool debug(); 23 | 24 | void setFrame( int f ); 25 | void update(); 26 | 27 | int getPartNum(); 28 | Bind_SsPart* getPart(int index); 29 | Bind_SsPartAnime* getPartAnime(int index); 30 | Bind_SsPartState* getPartState( int index ); 31 | 32 | int getFrameLength(); 33 | int getAnimeFPS(); 34 | 35 | 36 | }; 37 | 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SsAttribute.cpp: -------------------------------------------------------------------------------- 1 | #include "ssplayer_animedecode.h" 2 | #include "bind_SsAttribute.h" 3 | 4 | 5 | Bind_SsKeyframe* Bind_SsAttribute::firstKey() 6 | { 7 | SsKeyframe* key = (SsKeyframe*)bind_inst->firstKey(); 8 | if ( key == 0 ) return new Bind_SsKeyframe( 0 , SsAttributeKind::invalid ) ; 9 | prevKey = key; 10 | return new Bind_SsKeyframe( key , this->bind_inst->tag ) ; 11 | } 12 | 13 | 14 | Bind_SsKeyframe* Bind_SsAttribute::nextKey() 15 | { 16 | if ( prevKey == 0 ) return 0; 17 | 18 | SsKeyframe* key = (SsKeyframe*)bind_inst->findRightKey( prevKey->time ); 19 | if ( key == 0 ) return new Bind_SsKeyframe( 0 , SsAttributeKind::invalid ) ; 20 | prevKey = key; 21 | 22 | // PYDEBUG_PRINTF( "prevKeytime = %d" , prevKey->time); 23 | return new Bind_SsKeyframe( key , this->bind_inst->tag ) ; 24 | 25 | } 26 | 27 | 28 | Bind_SsKeyframe* Bind_SsAttribute::findRightKey(int time) 29 | { 30 | SsKeyframe* key = (SsKeyframe*)bind_inst->findRightKey( time ); 31 | if ( key == 0 ) return new Bind_SsKeyframe( 0 , SsAttributeKind::invalid ) ; 32 | prevKey = key; 33 | return new Bind_SsKeyframe( key , this->bind_inst->tag ) ; 34 | 35 | } 36 | 37 | 38 | Bind_SsKeyframe* Bind_SsAttribute::findLeftKey(int time) 39 | { 40 | SsKeyframe* key = (SsKeyframe*)bind_inst->findLeftKey( time ); 41 | if ( key == 0 ) return new Bind_SsKeyframe( 0 , SsAttributeKind::invalid ) ; 42 | prevKey = key; 43 | return new Bind_SsKeyframe( key , this->bind_inst->tag ) ; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SsAttribute.h: -------------------------------------------------------------------------------- 1 | #ifndef __BIND_SSATTRIBUTE__ 2 | #define __BIND_SSATTRIBUTE__ 3 | 4 | 5 | #include "package_SpriteStudio.h" 6 | 7 | 8 | class Bind_SsKeyframe; 9 | 10 | class Bind_SsAttribute : public myPyBinder 11 | { 12 | private: 13 | SsKeyframe* prevKey; 14 | public: 15 | Bind_SsAttribute() : prevKey(0) {} 16 | Bind_SsAttribute(SsAttribute* a) { bind(a);} 17 | virtual ~Bind_SsAttribute() 18 | { 19 | // puts("destruct Bind_SsAttribute"); 20 | } 21 | 22 | Bind_SsKeyframe* firstKey(); 23 | Bind_SsKeyframe* nextKey(); 24 | 25 | Bind_SsKeyframe* findRightKey(int time); 26 | Bind_SsKeyframe* findLeftKey(int time); 27 | 28 | }; 29 | 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SsKeyframe.cpp: -------------------------------------------------------------------------------- 1 | #include "ssplayer_animedecode.h" 2 | #include "bind_SsKeyFrame.h" 3 | 4 | 5 | SsColorAnime* Bind_SsKeyframe::getColorAnime() 6 | { 7 | SsColorAnime* a = new SsColorAnime(); 8 | GetSsColorValue( this->bind_inst , *a ); 9 | 10 | return a; 11 | } 12 | 13 | 14 | SsVertexAnime* Bind_SsKeyframe::getVertexAnime() 15 | { 16 | SsVertexAnime* a = new SsVertexAnime(); 17 | GetSsVertexAnime( this->bind_inst , *a ); 18 | 19 | return a; 20 | } 21 | 22 | 23 | SsRefCell* Bind_SsKeyframe::getRefCell() 24 | { 25 | SsRefCell* cell = new SsRefCell(); 26 | // GetSsVertexAnime( this->bind_inst , *a ); 27 | GetSsRefCell( this->bind_inst , *cell ); 28 | return cell; 29 | } 30 | 31 | 32 | SsUserDataAnime* Bind_SsKeyframe::getUserDataAnime() 33 | { 34 | SsUserDataAnime* udat = new SsUserDataAnime(); 35 | 36 | GetSsUserDataAnime( this->bind_inst , *udat ); 37 | 38 | return udat; 39 | } 40 | -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SsKeyframe.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/PythonBinder/bind_SsKeyframe.h -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SsPart.cpp: -------------------------------------------------------------------------------- 1 | // 2 | #include "bind_SsAnimeDecoder.h" 3 | 4 | 5 | #include "bind_SsPart.h" 6 | 7 | 8 | bool Bind_SsPart::debug() 9 | { 10 | PYDEBUG_PRINTF( "my name Bind_SsPart" ); 11 | return true; 12 | } 13 | -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SsPart.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/PythonBinder/bind_SsPart.h -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SsPartAnime.cpp: -------------------------------------------------------------------------------- 1 | // 2 | #include "bind_SsAnimeDecoder.h" 3 | 4 | 5 | #include "bind_sspartanime.h" 6 | 7 | 8 | Bind_SsAttribute* Bind_SsPartAnime::getAttribute(int Kind ) 9 | { 10 | 11 | 12 | size_t num = this->bind_inst->attributes.size(); 13 | 14 | for ( size_t n = 0 ; n < num ; n++ ) 15 | { 16 | SsAttribute* a = this->bind_inst->attributes[n]; 17 | if ( a->tag == Kind ) return new Bind_SsAttribute(a); 18 | 19 | } 20 | 21 | return new Bind_SsAttribute(0); 22 | } 23 | -------------------------------------------------------------------------------- /Build/PythonBinder/bind_SsPartAnime.h: -------------------------------------------------------------------------------- 1 | #ifndef __bind_SSPARTANIME__ 2 | #define __bind_SSPARTANIME__ 3 | 4 | 5 | #include "package_SpriteStudio.h" 6 | 7 | 8 | class Bind_SsAttribute; 9 | class Bind_SsPartAnime : public myPyBinder 10 | { 11 | private: 12 | public: 13 | 14 | Bind_SsPartAnime(){} 15 | Bind_SsPartAnime(SsPartAnime* panime){ bind(panime);} 16 | virtual ~ Bind_SsPartAnime(){} 17 | 18 | const char* name(){ return bind_inst->partName.c_str(); } 19 | 20 | Bind_SsAttribute* getAttribute(int Kind ); 21 | 22 | }; 23 | 24 | 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Build/PythonBinder/package_SpriteStudio.cpp: -------------------------------------------------------------------------------- 1 | #include "package_SpriteStudio.h" 2 | 3 | 4 | 5 | 6 | 7 | void PYDEBUG_PRINTF( const char* strFormat, ... ) 8 | { 9 | char buffer[256]; 10 | 11 | va_list arglist; 12 | va_start( arglist, strFormat); 13 | _vsnprintf( buffer, 1024, strFormat, arglist); 14 | va_end( arglist); 15 | 16 | puts( buffer ); 17 | 18 | } -------------------------------------------------------------------------------- /Build/PythonBinder/package_SpriteStudio.h: -------------------------------------------------------------------------------- 1 | #ifndef __PACKAGE_SPRITESTUDIO__ 2 | #define __PACKAGE_SPRITESTUDIO__ 3 | 4 | #define BOOST_PYTHON_STATIC_LIB 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | using namespace boost::python; 14 | using namespace std; 15 | 16 | 17 | 18 | 19 | 20 | void PYDEBUG_PRINTF( const char* strFormat, ... ); 21 | 22 | 23 | template 24 | class myPyBinder 25 | { 26 | public: 27 | myclass* bind_inst; 28 | 29 | myPyBinder(){} 30 | 31 | virtual ~myPyBinder(){} 32 | virtual bool debug(){ return true; } 33 | void bind(myclass* c) { bind_inst = c;} 34 | bool isNull(){ return bind_inst ==0 ; } 35 | }; 36 | 37 | 38 | 39 | #define BIND_RETURN_PROP( _a ) this->bind_inst->_a 40 | #define BIND_RETURN_PROPEX( type, _a ) type _a() { return (type)this->bind_inst->_a; } 41 | #define BIND_NEW_PROP( type, _a ) \ 42 | type* _a() { \ 43 | type* new_type = new type();\ 44 | new_type->bind(bind_inst->_a);\ 45 | return new_type;\ 46 | }\ 47 | 48 | 49 | #define BIND_NEW_PROP_REF( type, _a ) \ 50 | type* _a() { \ 51 | type* new_type = new type();\ 52 | new_type->bind(&bind_inst->_a);\ 53 | return new_type;\ 54 | }\ 55 | 56 | 57 | #if 1 58 | 59 | inline void _bp_array_resize( boost::python::numeric::array& _array , int x , int y) 60 | { 61 | if ( y == 0 ) 62 | { 63 | _array.resize( x ); 64 | }else{ 65 | _array.resize( boost::python::make_tuple(x, y) ); 66 | } 67 | } 68 | 69 | #define BIND_RETURN_PROPEX_ARRAY( type , _a ,_dx,_dy) \ 70 | boost::python::numeric::array _a() { \ 71 | std::vector array_;\ 72 | size_t len = sizeof(this->bind_inst->_a) / sizeof(type);\ 73 | for ( size_t i = 0 ; i < len ; i++ )\ 74 | {\ 75 | array_.push_back(this->bind_inst->_a[i]);\ 76 | }\ 77 | boost::python::numeric::array _aa(array_);\ 78 | _bp_array_resize( _aa , _dx , _dy );\ 79 | return _aa; }\ 80 | 81 | #else 82 | 83 | #define BIND_RETURN_PROPEX_ARRAY( type , _a ) \ 84 | boost::python::numeric::array _a() { \ 85 | boost::python::numeric::array _aa(this->bind_inst->_a);\ 86 | _aa.resize( 12 );\ 87 | return _aa; }\ 88 | 89 | #endif 90 | 91 | 92 | #include "ssloader.h" 93 | 94 | 95 | #include "bind_Animation.h" 96 | #include "bind_SsAnimeDecoder.h" 97 | #include "bind_SsAttribute.h" 98 | #include "bind_AnimePack.h" 99 | #include "bind_SsPart.h" 100 | #include "bind_SsPartAnime.h" 101 | #include "bind_SSXML.h" 102 | 103 | #include "bind_SsKeyframe.h" 104 | #include "bind_Cellmap.h" 105 | 106 | 107 | #endif -------------------------------------------------------------------------------- /Build/PythonBinder/script_base_conv.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/PythonBinder/script_base_conv.cpp -------------------------------------------------------------------------------- /Build/Ss5ConverterGUI/Application-000.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/Ss5ConverterGUI/Application-000.icns -------------------------------------------------------------------------------- /Build/Ss5ConverterGUI/Application-000.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/Ss5ConverterGUI/Application-000.ico -------------------------------------------------------------------------------- /Build/Ss5ConverterGUI/Application-000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/Ss5ConverterGUI/Application-000.png -------------------------------------------------------------------------------- /Build/Ss5ConverterGUI/Ss5ConverterGUI.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-09-09T16:57:58 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = Ss5ConveterGUI 12 | TEMPLATE = app 13 | RC_ICONS = Application-000.ico 14 | 15 | 16 | SOURCES += main.cpp\ 17 | mainwindow.cpp 18 | 19 | HEADERS += mainwindow.h 20 | 21 | FORMS += mainwindow.ui 22 | 23 | DISTFILES += \ 24 | Application-000.ico 25 | -------------------------------------------------------------------------------- /Build/Ss5ConverterGUI/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.setText_to_List(a.arguments()); 9 | w.show(); 10 | 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /Build/Ss5ConverterGUI/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace Ui { 15 | class MainWindow; 16 | } 17 | 18 | class MainWindow : public QMainWindow 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit MainWindow(QWidget *parent = 0); 24 | ~MainWindow(); 25 | void setText_to_List(QStringList list); 26 | void dragEnterEvent(QDragEnterEvent *e); 27 | void dropEvent(QDropEvent *e); 28 | 29 | private slots: 30 | void on_pushButton_exit_clicked(); 31 | 32 | void on_pushButton_listclear_clicked(); 33 | 34 | void on_pushButton_convert_clicked(); 35 | 36 | private: 37 | Ui::MainWindow *ui; 38 | QProcess *cnvProcess; 39 | void button_enable(bool flag); 40 | 41 | private slots: 42 | void processErrOutput(); 43 | void processFinished( int exitCode, QProcess::ExitStatus exitStatus); 44 | void on_pushButton_listload_clicked(); 45 | void on_pushButton_listsave_clicked(); 46 | }; 47 | 48 | #endif // MAINWINDOW_H 49 | -------------------------------------------------------------------------------- /Build/Ss5ConverterGUI/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/Ss5ConverterGUI/readme.txt -------------------------------------------------------------------------------- /Build/TestData/NewAnimation.ssae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 30 5 | 11 6 | prio 7 | 320 320 8 | 0 0 9 | FF323232 10 | 32 11 | FF808080 12 | 13 | NewAnimation 14 | 15 | 16 | 17 | 18 | root 19 | 0 20 | -1 21 | null 22 | none 23 | parent 24 | mix 25 | 1 26 | 0 27 | 28 | 29 | 30 | 31 | 32 | 33 | anime 1 34 | 1 35 | 36 | 30 37 | 11 38 | prio 39 | 320 320 40 | 0 0 41 | FF323232 42 | 32 43 | FF808080 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Build/TestData/RoboProject.sspj: -------------------------------------------------------------------------------- 1 | 2 | 3 | RoboProject 4 | 5 | 6 | 7 | 8 | 9 | ssax 10 | 1 11 | 12 | 0 13 | 0 14 | 1 15 | 16 | 1 17 | SSAX 18 | 19 | 0 20 | 1 21 | 22 | 1 23 | 1 24 | 0 25 | 1 26 | 27 | any 28 | 0 29 | 0 30 | 0 31 | 1 32 | 1 33 | 34 | CELL 35 | POSX 36 | POSY 37 | POSZ 38 | ROTX 39 | ROTY 40 | ROTZ 41 | SCLX 42 | SCLY 43 | ALPH 44 | PRIO 45 | FLPH 46 | FLPV 47 | HIDE 48 | VCOL 49 | VERT 50 | PVTX 51 | PVTY 52 | ANCX 53 | ANCY 54 | SIZX 55 | SIZY 56 | UVTX 57 | UVTY 58 | UVRZ 59 | UVSX 60 | UVSY 61 | BNDR 62 | USER 63 | 64 | 65 | POSX 66 | POSY 67 | HIDE 68 | 69 | clamp 70 | linear 71 | linear 72 | 73 | 74 | 30 75 | 11 76 | prio 77 | 320 320 78 | 0 0 79 | FF323232 80 | 32 81 | FF808080 82 | 0 83 | 84 | 85 | 4096 4096 86 | 1 87 | 0 88 | 0 89 | 1 90 | 91 | 92 | robo_01.ssce 93 | 94 | 95 | robo_01.ssae 96 | robo_02.ssae 97 | robo_03.ssae 98 | robo_04.ssae 99 | robo_05.ssae 100 | robo_x.ssae 101 | 102 | robo_x.ssae 103 | robo_x 104 | robo_01.ssce 105 | part 1 106 | robo_x 107 | 108 | -------------------------------------------------------------------------------- /Build/TestData/allcheck.sspj: -------------------------------------------------------------------------------- 1 | 2 | 3 | allcheck 4 | 5 | 6 | 7 | 8 | 9 | ssax 10 | 1 11 | 12 | 0 13 | 1 14 | 15 | 1 16 | SSAX 17 | 18 | 0 19 | 1 20 | 21 | 1 22 | 1 23 | 0 24 | 1 25 | 26 | custom 27 | 0 28 | 29 | CELL 30 | POSX 31 | POSY 32 | ROTZ 33 | SCLX 34 | SCLY 35 | ALPH 36 | PRIO 37 | FLPH 38 | FLPV 39 | HIDE 40 | VCOL 41 | VERT 42 | PVTX 43 | PVTY 44 | ANCX 45 | ANCY 46 | SIZX 47 | SIZY 48 | IFLH 49 | IFLV 50 | UVTX 51 | UVTY 52 | UVRZ 53 | UVSX 54 | UVSY 55 | BNDR 56 | USER 57 | 58 | 59 | POSX 60 | POSY 61 | ROTZ 62 | HIDE 63 | 64 | clamp 65 | linear 66 | 67 | 68 | 30 69 | 11 70 | prio 71 | 320 320 72 | 0 0 73 | FF323232 74 | 32 75 | FF808080 76 | 77 | 78 | 4096 4096 79 | 1 80 | 0 81 | 0 82 | 1 83 | 84 | 85 | color_bar.ssce 86 | 87 | 88 | Accelerate.ssae 89 | Parent.ssae 90 | all.ssae 91 | base_offset.ssae 92 | blendmode.ssae 93 | inherit.ssae 94 | nullparts.ssae 95 | rotation.ssae 96 | sand.ssae 97 | trans.ssae 98 | vertex.ssae 99 | 100 | all.ssae 101 | all 102 | color_bar.ssce 103 | NewCell_13 104 | Label 105 | 106 | -------------------------------------------------------------------------------- /Build/TestData/car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestData/car.png -------------------------------------------------------------------------------- /Build/TestData/car.ssce: -------------------------------------------------------------------------------- 1 | 2 | 3 | car 4 | 5 | car.png 6 | 256 256 7 | 0 8 | clamp 9 | linear 10 | C:/Project/NSSPort/trunk/SpriteStudio/TestProject/car/car.png 11 | 12 | 13 | 4096 4096 14 | 1 15 | 0 16 | 0 17 | 1 18 | 19 | 20 | 21 | 後輪 22 | 0 128 23 | 56 56 24 | 0 0 25 | 0 26 | 27 | 0 28 | 29 | 30 | 車体 31 | 0 0 32 | 224 96 33 | 0 0 34 | 0 35 | 36 | 0 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Build/TestData/car.sspj: -------------------------------------------------------------------------------- 1 | 2 | 3 | car 4 | 5 | 6 | 7 | 8 | 9 | 10 | 1 11 | 12 | 0 13 | 1 14 | 15 | 1 16 | SSAX 17 | 18 | 0 19 | 1 20 | 21 | 1 22 | 1 23 | 0 24 | 25 | ssp_for_cocos2dx 26 | 0 27 | 28 | CELL 29 | POSX 30 | POSY 31 | POSZ 32 | ROTX 33 | ROTY 34 | ROTZ 35 | SCLX 36 | SCLY 37 | ALPH 38 | PRIO 39 | FLPH 40 | FLPV 41 | HIDE 42 | VCOL 43 | VERT 44 | PVTX 45 | PVTY 46 | ANCX 47 | ANCY 48 | SIZX 49 | SIZY 50 | UVTX 51 | UVTY 52 | UVRZ 53 | UVSX 54 | UVSY 55 | BNDR 56 | USER 57 | 58 | 59 | POSX 60 | POSY 61 | HIDE 62 | 63 | clamp 64 | linear 65 | 66 | 67 | 30 68 | 11 69 | prio 70 | 320 320 71 | 0 0 72 | FF323232 73 | 32 74 | FF808080 75 | 76 | 77 | 4096 4096 78 | 1 79 | 0 80 | 0 81 | 1 82 | 83 | 84 | car.ssce 85 | 86 | 87 | car.ssae 88 | 89 | car.ssae 90 | motion 1 91 | motion 1 92 | 93 | -------------------------------------------------------------------------------- /Build/TestData/color_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestData/color_bar.png -------------------------------------------------------------------------------- /Build/TestData/color_bar.ssce: -------------------------------------------------------------------------------- 1 | 2 | 3 | color_bar 4 | 5 | color_bar.png 6 | 256 256 7 | 0 8 | clamp 9 | linear 10 | 11 | 12 | 13 | 4096 4096 14 | 1 15 | 0 16 | 0 17 | 1 18 | 19 | 20 | 21 | NewCell 22 | 0 80 23 | 64 64 24 | 0 0 25 | 0 26 | 27 | 0 28 | 29 | 30 | NewCell_1 31 | 64 80 32 | 64 64 33 | 0 0 34 | 0 35 | 36 | 0 37 | 38 | 39 | NewCell_10 40 | 0 145 41 | 16 15 42 | 0 0 43 | 0 44 | 45 | 0 46 | 47 | 48 | NewCell_11 49 | 192 80 50 | 48 48 51 | 0 0 52 | 0 53 | 54 | 0 55 | 56 | 57 | NewCell_12 58 | 192 160 59 | 48 16 60 | -0.5 -0.5 61 | 0 62 | 63 | 0 64 | 65 | 66 | NewCell_13 67 | 0 160 68 | 16 16 69 | 0 0 70 | 0 71 | 72 | 0 73 | 74 | 75 | NewCell_14 76 | 16 160 77 | 16 16 78 | 0 0 79 | 0 80 | 81 | 0 82 | 83 | 84 | NewCell_15 85 | 32 160 86 | 16 16 87 | 0 0 88 | 0 89 | 90 | 0 91 | 92 | 93 | NewCell_16 94 | 48 160 95 | 16 16 96 | 0 0 97 | 0 98 | 99 | 0 100 | 101 | 102 | NewCell_2 103 | 128 80 104 | 64 64 105 | 0 0 106 | 0 107 | 108 | 0 109 | 110 | 111 | NewCell_3 112 | 0 0 113 | 64 64 114 | 0 0 115 | 0 116 | 117 | 0 118 | 119 | 120 | NewCell_4 121 | 80 0 122 | 64 64 123 | 0 0 124 | 0 125 | 126 | 0 127 | 128 | 129 | NewCell_5 130 | 160 0 131 | 64 64 132 | 0 0 133 | 0 134 | 135 | 0 136 | 137 | 138 | NewCell_6 139 | 64 80 140 | 64 16 141 | -0.5 0 142 | 0 143 | 144 | 0 145 | 146 | 147 | NewCell_7 148 | 128 80 149 | 64 16 150 | -0.5 0 151 | 0 152 | 153 | 0 154 | 155 | 156 | NewCell_8 157 | 0 176 158 | 80 80 159 | 0 0 160 | 0 161 | 162 | 0 163 | 164 | 165 | NewCell_9 166 | 96 176 167 | 64 64 168 | 0 0 169 | 0 170 | 171 | 0 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /Build/TestData/instance/frame.ssae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 30 5 | 11 6 | prio 7 | 320 320 8 | 0 0 9 | FF323232 10 | 32 11 | FF808080 12 | 0 13 | 14 | frame 15 | 16 | 17 | 18 | 19 | root 20 | 0 21 | -1 22 | null 23 | none 24 | parent 25 | 26 | 0 27 | 0 28 | 0 29 | 0 30 | 0 31 | 32 | mix 33 | 1 34 | 0 35 | 0 36 | 1 37 | 38 | 39 | frame 40 | 1 41 | 0 42 | normal 43 | none 44 | parent 45 | 46 | 0 47 | 0 48 | 0 49 | 0 50 | 0 51 | 52 | mix 53 | 1 54 | 0 55 | 0 56 | 1 57 | 58 | 59 | 60 | 61 | fream.ssce 62 | 63 | 64 | 65 | frame 66 | 1 67 | 68 | 30 69 | 11 70 | prio 71 | 720 1280 72 | 0 0 73 | FF323232 74 | 32 75 | FF808080 76 | 0 77 | 78 | 79 | 80 | 81 | root 82 | 83 | 84 | 85 | 0 86 | 87 | 88 | 89 | 90 | 91 | frame 92 | 93 | 94 | 95 | 96 | 0 97 | frame 98 | 99 | 100 | 101 | 102 | 103 | 0 104 | 105 | 106 | 107 | 108 | 0 109 | 110 | 111 | 112 | 113 | 0 114 | 115 | 116 | 117 | 118 | 5 119 | 120 | 121 | 122 | 123 | 0 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /Build/TestData/instance/fream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestData/instance/fream.png -------------------------------------------------------------------------------- /Build/TestData/instance/fream.ssce: -------------------------------------------------------------------------------- 1 | 2 | 3 | fream 4 | 5 | SpriteStudio 6 | 0 7 | fream.png 8 | 1024 2048 9 | 0 10 | clamp 11 | linear 12 | C:/Users/ohno.WEBTECH/Desktop/stageanim2/fream.png 13 | 14 | 15 | 4096 4096 16 | 1 17 | 0 18 | 0 19 | 1 20 | 21 | 22 | 23 | frame 24 | 0 0 25 | 832 1648 26 | 0 0 27 | 0 28 | 29 | 0 30 | 31 | 32 | mask 33 | 774 1408 34 | 5 64 35 | 0 0 36 | 0 37 | 38 | 0 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Build/TestData/instance/light3.ssae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 30 5 | 11 6 | prio 7 | 320 320 8 | 0 0 9 | FF323232 10 | 32 11 | FF808080 12 | 0 13 | 14 | light3 15 | 16 | 17 | 18 | 19 | root 20 | 0 21 | -1 22 | null 23 | none 24 | parent 25 | 26 | 0 27 | 0 28 | 0 29 | 0 30 | 0 31 | 32 | mix 33 | 1 34 | 0 35 | 0 36 | 1 37 | 38 | 39 | light2 40 | 1 41 | 0 42 | normal 43 | none 44 | parent 45 | 46 | 0 47 | 0 48 | 0 49 | 0 50 | 0 51 | 52 | add 53 | 1 54 | 0 55 | 0 56 | 1 57 | 58 | 59 | 60 | 61 | stageeffect.ssce 62 | 63 | 64 | 65 | light3 66 | 1 67 | 68 | 60 69 | 120 70 | prio 71 | 720 1280 72 | 0 0 73 | FF323232 74 | 32 75 | FF808080 76 | 0 77 | 78 | 79 | 80 | 81 | root 82 | 83 | 84 | 85 | 0 86 | 87 | 88 | 89 | 90 | 91 | light2 92 | 93 | 94 | 95 | 96 | 0 97 | light2 98 | 99 | 100 | 101 | 102 | 103 | 0 104 | 105 | 106 | 107 | 108 | 0 109 | 110 | 111 | 112 | 113 | 90 114 | 115 | 116 | 117 | 118 | 2 119 | 120 | 121 | 2.20000004768372 122 | 123 | 124 | 2 125 | 126 | 127 | 128 | 129 | 2 130 | 131 | 132 | 2.5 133 | 134 | 135 | 2 136 | 137 | 138 | 139 | 140 | 0.800000011920929 141 | 142 | 143 | 144 | 145 | 0 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /Build/TestData/instance/stage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestData/instance/stage.png -------------------------------------------------------------------------------- /Build/TestData/instance/stage.ssce: -------------------------------------------------------------------------------- 1 | 2 | 3 | stage 4 | 5 | SpriteStudio 6 | 0 7 | stage.png 8 | 720 1280 9 | 0 10 | clamp 11 | linear 12 | D:/WORKDATA/ss_data/takai/stage.png 13 | 14 | 15 | 4096 4096 16 | 1 17 | 0 18 | 0 19 | 1 20 | 21 | 22 | 23 | NewCell 24 | 0 0 25 | 720 1280 26 | 0 0 27 | 0 28 | 29 | 0 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Build/TestData/instance/stageanim3.sspj: -------------------------------------------------------------------------------- 1 | 2 | 3 | tk01 4 | 5 | 6 | 7 | 8 | 9 | 10 | 1 11 | 12 | 0 13 | 1 14 | 1 15 | 16 | 1 17 | SSP for Cocos2d-x (.ssba) 18 | 19 | 0 20 | 1 21 | 22 | 1 23 | 1 24 | 0 25 | 1 26 | 27 | any 28 | 0 29 | 0 30 | 1 31 | 1 32 | 1 33 | 0 34 | 35 | CELL 36 | POSX 37 | POSY 38 | POSZ 39 | ROTX 40 | ROTY 41 | ROTZ 42 | SCLX 43 | SCLY 44 | ALPH 45 | PRIO 46 | FLPH 47 | FLPV 48 | HIDE 49 | VCOL 50 | VERT 51 | PVTX 52 | PVTY 53 | ANCX 54 | ANCY 55 | SIZX 56 | SIZY 57 | IFLH 58 | IFLV 59 | UVTX 60 | UVTY 61 | UVRZ 62 | UVSX 63 | UVSY 64 | BNDR 65 | USER 66 | 67 | 68 | POSX 69 | POSY 70 | ROTZ 71 | HIDE 72 | 73 | clamp 74 | nearlest 75 | linear 76 | 77 | 78 | 79 | 30 80 | 11 81 | prio 82 | 320 320 83 | 0 0 84 | FF323232 85 | 32 86 | FF808080 87 | 0 88 | 89 | 90 | 4096 4096 91 | 1 92 | 0 93 | 0 94 | 1 95 | 96 | 97 | fream.ssce 98 | stage.ssce 99 | stageeffect.ssce 100 | tk01.ssce 101 | 102 | 103 | frame.ssae 104 | light1.ssae 105 | light2.ssae 106 | light3.ssae 107 | light4.ssae 108 | light5.ssae 109 | mask.ssae 110 | stageeffect2.ssae 111 | tk01.ssae 112 | 113 | light5.ssae 114 | light5 115 | stageeffect.ssce 116 | light1 117 | root 118 | 119 | -------------------------------------------------------------------------------- /Build/TestData/instance/stageeffect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestData/instance/stageeffect.png -------------------------------------------------------------------------------- /Build/TestData/instance/stageeffect.ssce: -------------------------------------------------------------------------------- 1 | 2 | 3 | tk01 4 | 5 | SpriteStudio 6 | 0 7 | stageeffect.png 8 | 512 512 9 | 0 10 | clamp 11 | linear 12 | D:/WORKDATA/takai/tk01.png 13 | 14 | 15 | 4096 4096 16 | 1 17 | 0 18 | 0 19 | 1 20 | 21 | 22 | 23 | light1 24 | 0 0 25 | 512 208 26 | -0.4609375 0.0384615398943424 27 | 0 28 | 29 | 0 30 | 31 | 32 | light2 33 | 0 208 34 | 512 96 35 | -0.36328125 0 36 | 0 37 | 38 | 0 39 | 40 | 41 | light3 42 | 160 320 43 | 160 160 44 | 0 0 45 | 0 46 | 47 | 0 48 | 49 | 50 | light4 51 | 320 320 52 | 128 128 53 | 0 0 54 | 0 55 | 56 | 0 57 | 58 | 59 | light5 60 | 448 320 61 | 64 64 62 | 0 0 63 | 0 64 | 65 | 0 66 | 67 | 68 | light6 69 | 448 384 70 | 64 64 71 | 0 0 72 | 0 73 | 74 | 0 75 | 76 | 77 | light7 78 | 448 448 79 | 64 64 80 | 0 0 81 | 0 82 | 83 | 0 84 | 85 | 86 | spotlight1 87 | 0 320 88 | 64 112 89 | 0 0.357142865657806 90 | 0 91 | 92 | 0 93 | 94 | 95 | spotlight2 96 | 64 320 97 | 96 144 98 | 0 0.347222208976746 99 | 0 100 | 101 | 0 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /Build/TestData/instance/tk01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestData/instance/tk01.png -------------------------------------------------------------------------------- /Build/TestData/object01.ssae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 30 5 | 11 6 | prio 7 | 320 320 8 | 0 0 9 | FF323232 10 | 32 11 | FF808080 12 | 13 | object01 14 | 15 | 16 | 17 | 18 | root 19 | 0 20 | -1 21 | null 22 | none 23 | parent 24 | mix 25 | 1 26 | 0 27 | 28 | 29 | sword_1 30 | 1 31 | 0 32 | normal 33 | none 34 | parent 35 | mix 36 | 1 37 | 0 38 | 39 | 40 | 41 | 42 | senjyu01.ssce 43 | 44 | 45 | 46 | anime 1 47 | 1 48 | 49 | 30 50 | 11 51 | prio 52 | 320 320 53 | 0 -0.5 54 | FF323232 55 | 32 56 | FF808080 57 | 58 | 59 | 60 | 61 | sword_1 62 | 63 | 64 | 65 | 66 | 0 67 | sword_1 68 | 69 | 70 | 71 | 72 | 73 | 0 74 | 75 | 76 | 77 | 78 | 0 79 | 80 | 81 | 82 | 83 | 0 84 | 85 | 86 | 87 | 88 | 0 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Build/TestData/robo_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestData/robo_01.png -------------------------------------------------------------------------------- /Build/TestData/robo_01.ssce: -------------------------------------------------------------------------------- 1 | 2 | 3 | robo_01 4 | 5 | robo_01.png 6 | 512 512 7 | L:/endo/NewSpriteStudio/TestProjects/ssax/daibutsu/robo_01.png 8 | 9 | 10 | 4096 4096 11 | 1 12 | 0 13 | 0 14 | 1 15 | 16 | 17 | 18 | part 1 19 | 0 0 20 | 94 121 21 | 0.00 0.00 22 | 0 23 | 24 | 0 25 | 26 | 27 | part 1_1 28 | 96 192 29 | 96 96 30 | 0.00 0.00 31 | 0 32 | 33 | 0 34 | 35 | 36 | part 2 37 | 93 1 38 | 125 109 39 | 0.00 0.00 40 | 0 41 | 42 | 0 43 | 44 | 45 | part 3 46 | 96 111 47 | 116 85 48 | 0.00 0.00 49 | 0 50 | 51 | 0 52 | 53 | 54 | part 4 55 | 0 121 56 | 56 60 57 | 0.00 0.00 58 | 0 59 | 60 | 0 61 | 62 | 63 | part 5 64 | 0 181 65 | 70 78 66 | 0.00 0.00 67 | 0 68 | 69 | 0 70 | 71 | 72 | part 6 73 | 0 256 74 | 57 79 75 | 0.00 0.00 76 | 0 77 | 78 | 0 79 | 80 | 81 | part 7 82 | 216 2 83 | 64 80 84 | 0.00 0.00 85 | 0 86 | 87 | 0 88 | 89 | 90 | part 8 91 | 214 82 92 | 65 70 93 | 0.00 0.00 94 | 0 95 | 96 | 0 97 | 98 | 99 | part 9 100 | 213 152 101 | 69 101 102 | 0.00 0.00 103 | 0 104 | 105 | 0 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /Build/TestData/senjyu01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestData/senjyu01.png -------------------------------------------------------------------------------- /Build/TestData/senjyu2.sspj: -------------------------------------------------------------------------------- 1 | 2 | 3 | senjyu2 4 | 5 | 6 | hoge 7 | 8 | 9 | 10 | 1 11 | 12 | 0 13 | 1 14 | 15 | 1 16 | SSAX 17 | 18 | 0 19 | 1 20 | 21 | 1 22 | 1 23 | 0 24 | 1 25 | 26 | custom 27 | 0 28 | 29 | CELL 30 | POSX 31 | POSY 32 | POSZ 33 | ROTX 34 | ROTY 35 | ROTZ 36 | SCLX 37 | SCLY 38 | ALPH 39 | PRIO 40 | FLPH 41 | FLPV 42 | HIDE 43 | VCOL 44 | VERT 45 | PVTX 46 | PVTY 47 | ANCX 48 | ANCY 49 | SIZX 50 | SIZY 51 | IFLH 52 | IFLV 53 | UVTX 54 | UVTY 55 | UVRZ 56 | UVSX 57 | UVSY 58 | BNDR 59 | USER 60 | 61 | 62 | POSX 63 | POSY 64 | ROTZ 65 | HIDE 66 | 67 | clamp 68 | nearlest 69 | 70 | 71 | 30 72 | 11 73 | prio 74 | 320 320 75 | 0 0 76 | FF323232 77 | 32 78 | FF808080 79 | 80 | 81 | 4096 4096 82 | 1 83 | 0 84 | 0 85 | 1 86 | 87 | 88 | senjyu01.ssce 89 | 90 | 91 | arm01.ssae 92 | layout.ssae 93 | layout2.ssae 94 | senjyu01.ssae 95 | 96 | layout2.ssae 97 | anime 1 98 | senjyu01.ssce 99 | lowarm 100 | root 101 | 102 | -------------------------------------------------------------------------------- /Build/TestData/test.dat: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Build/TestScript/SpriteStudio_pythonモジュール仕様書.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestScript/SpriteStudio_pythonモジュール仕様書.txt -------------------------------------------------------------------------------- /Build/TestScript/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestScript/readme.txt -------------------------------------------------------------------------------- /Build/TestScript/scriptbase_converter.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestScript/scriptbase_converter.exe -------------------------------------------------------------------------------- /Build/TestScript/sstype.py: -------------------------------------------------------------------------------- 1 | class AttributeKind: 2 | invalid=-1 3 | cell=0 4 | posx=1 5 | posy=2 6 | posz=3 7 | rotx=4 8 | roty=5 9 | rotz=6 10 | sclx=7 11 | scly=8 12 | alpha=9 13 | prio=10 14 | fliph=11 15 | flipv=12 16 | hide=13 17 | color=14 18 | vertex=15 19 | pivotx=16 20 | pivoty=17 21 | anchorx=18 22 | anchory=19 23 | sizex=20 24 | sizey=21 25 | imgfliph=22 26 | imgflipv=23 27 | uvtx=24 28 | uvty=25 29 | uvrz=26 30 | uvsx=27 31 | uvsy=28 32 | boundr=29 33 | user=30 34 | num = 31 35 | 36 | class InterpolationType: 37 | invalid = -1 38 | none = 0 39 | linear = 1 40 | hermite = 2 41 | bezier = 3 42 | acceleration = 4 43 | deceleration = 5 44 | num = 6 45 | 46 | 47 | InterpolationTypeDic = { 48 | -1:"invalid", 49 | 0 : "none", 50 | 1 : "linear", 51 | 2 : "hermite", 52 | 3 : "bezier", 53 | 4 : "acceleration", 54 | 5 : "deceleration", 55 | } 56 | 57 | AttributeKindDic = { 58 | "invalid" : -1, 59 | "cell" : 0, 60 | "posx" : 1, 61 | "posy" : 2, 62 | "posz" : 3, 63 | "rotx" : 4, 64 | "roty" : 5, 65 | "rotz" : 6, 66 | "sclx" : 7, 67 | "scly" : 8, 68 | "alpha" : 9, 69 | "prio" : 10, 70 | "fliph" : 11, 71 | "flipv" : 12, 72 | "hide" : 13, 73 | "color" : 14, 74 | "vertex": 15, 75 | "pivotx": 16, 76 | "pivoty": 17, 77 | "anchorx":18, 78 | "anchory":19, 79 | "sizex": 20, 80 | "sizey": 21, 81 | "imgfliph":22, 82 | "imgflipv":23, 83 | "uvtx":24, 84 | "uvty":25, 85 | "uvrz":26, 86 | "uvsx":27, 87 | "uvsy":28, 88 | "boundr":29, 89 | "user":30, 90 | } 91 | 92 | AttributeKindSS4Dic = { 93 | -1 : "invalid", 94 | 0 : "CELL", 95 | 1 : "POSX", 96 | 2 : "POSY" , 97 | 3 : "-" , 98 | 4 : "-" , 99 | 5 : "-" , 100 | 6 : "ANGL" , 101 | 7 : "SCAX" , 102 | 8 : "SCAX" , 103 | 9 : "TRAN" , 104 | 10 : "PRIO" , 105 | 11 : "FLPH" , 106 | 12 : "FLPV" , 107 | 13 : "HIDE" , 108 | 14 : "PCOL" , 109 | 15 : "VERT", 110 | 16 : "ORFX", 111 | 17 : "ORFY", 112 | 18 : "-", 113 | 19 : "-", 114 | 20 : "-", 115 | 21 : "-", 116 | 22 : "-", 117 | 23 : "-", 118 | 24 : "IMGX", 119 | 25 : "IMGY", 120 | 26 : "-", 121 | 27 : "IMGW", 122 | 28 : "IMGH", 123 | 29 : "-", 124 | 30 : "UDAT", 125 | } 126 | 127 | def AttributeKindToSS4Tag(kind): 128 | return AttributeKindSS4Dic[kind] 129 | 130 | 131 | def InterpolationTypeToString(kind): 132 | return InterpolationTypeDic[kind] 133 | -------------------------------------------------------------------------------- /Build/TestScript/sstype.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/TestScript/sstype.pyc -------------------------------------------------------------------------------- /Build/UnitTest/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | std::cout << "Running main() from gtest_main.cc\n"; 36 | 37 | testing::InitGoogleTest(&argc, argv); 38 | int ret = RUN_ALL_TESTS(); 39 | 40 | 41 | getchar(); 42 | 43 | return ret; 44 | } 45 | -------------------------------------------------------------------------------- /Build/UnitTest/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/UnitTest/readme.txt -------------------------------------------------------------------------------- /Build/UnitTest/unit_ssloader_ssce.cc: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------- 2 | // ssae読み込みの単体テスト 3 | //-------------------------------------------------------- 4 | 5 | #include "gtest/gtest.h" 6 | #include "../loader/ssloader_ssce.h" 7 | 8 | // Loadのテスト 9 | TEST(ssloader_ssce_test,Load) { 10 | 11 | SsCellMap* cell = ssloader_ssce::Load( "testdata/senjyu01.ssce"); 12 | 13 | //成功チェック 14 | ASSERT_TRUE( cell != 0 ); 15 | 16 | //セルマップのチェック 17 | ASSERT_TRUE( cell->wrapMode == SsTexWrapMode::clamp ); 18 | ASSERT_TRUE( cell->filterMode == SsTexFilterMode::linear ); 19 | 20 | ASSERT_TRUE( cell->pixelSize.x == 1024 ); 21 | ASSERT_TRUE( cell->pixelSize.y == 1024 ); 22 | 23 | ASSERT_TRUE( cell->imagePath == "senjyu01.png" ); 24 | ASSERT_TRUE( cell->name == "senjyu01" ); 25 | 26 | ASSERT_TRUE( cell->overrideTexSettings == false ); 27 | 28 | 29 | //セルのチェック 30 | 31 | EXPECT_LT( 0 , (int)cell->cells.size() ); 32 | ASSERT_TRUE( cell->cells[0]->name == "arm_l" ); 33 | ASSERT_TRUE( cell->cells[0]->pivot.x == 0.4296875 ); 34 | ASSERT_TRUE( cell->cells[0]->pivot.y < -0.354 && cell->cells[0]->pivot.y > -0.356 ); 35 | 36 | ASSERT_TRUE( cell->cells[0]->size.x == 128 ); 37 | ASSERT_TRUE( cell->cells[0]->size.y == 192 ); 38 | 39 | ASSERT_TRUE( cell->cells[0]->pos.x == 128 ); 40 | ASSERT_TRUE( cell->cells[0]->pos.y == 0 ); 41 | 42 | ASSERT_TRUE( cell->cells[0]->rotated == 0 ); 43 | 44 | 45 | delete cell; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /Build/UnitTest/unit_ssloader_sspj.cc: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------- 2 | // sspj読み込みの単体テスト 3 | //-------------------------------------------------------- 4 | 5 | #include "gtest/gtest.h" 6 | #include "../loader/ssloader_sspj.h" 7 | 8 | // Loadのテスト 9 | TEST(ssloader_sspj_test,Load) { 10 | 11 | SsProject* proj = ssloader_sspj::Load( "testdata/senjyu2.sspj" ); 12 | 13 | //ロード失敗 14 | ASSERT_TRUE( NULL != proj ); 15 | 16 | // 17 | EXPECT_EQ( 4 , proj->getAnimePackNum() ); 18 | EXPECT_EQ( 1 , proj->getCellMapNum() ); 19 | 20 | //SettingがXMLドキュメントと同一か確認する 21 | ASSERT_TRUE( proj->getProjectSetting().animeBaseDirectory == "hoge" ); 22 | ASSERT_TRUE( proj->getProjectSetting().cellMapBaseDirectory == "" ); 23 | ASSERT_TRUE( proj->getProjectSetting().imageBaseDirectory == "" ); 24 | ASSERT_TRUE( proj->getProjectSetting().exportBaseDirectory == "" ); 25 | ASSERT_TRUE( proj->getProjectSetting().queryExportBaseDirectory ); 26 | 27 | //アニメファイル名リストとアニメファイルのリストの最終的な数量を確認する 28 | ASSERT_TRUE( proj->getAnimePackNum() == proj->getAnimePackList().size() ); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Build/Viewer/source/main_dx9.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/Viewer/source/main_dx9.cpp -------------------------------------------------------------------------------- /Build/Viewer/source/myscene.h: -------------------------------------------------------------------------------- 1 | #ifndef __SAMPLESCENE__ 2 | #define __SAMPLESCENE__ 3 | 4 | #include "ssHelper.h" 5 | //#include "./player/ssplayer_animedecode.h" 6 | 7 | class SsAnimeDecoder; 8 | class SsCellMapList; 9 | 10 | 11 | ///サンプル用のシーンクラス  12 | class SampleScene : public tkScene 13 | { 14 | public: 15 | struct AnimePackSelecterType; 16 | bool isLoop; 17 | 18 | 19 | private: 20 | 21 | int sceneLoop; 22 | 23 | SsAnimeDecoder* m_player; 24 | SsCellMapList* m_cellmap; 25 | 26 | 27 | SsProject* m_proj; 28 | int m_select_animepack_index; 29 | int m_select_anime_index; 30 | 31 | std::vector AnimePackSelecter; 32 | SsVector2 m_animeOffsetpos; 33 | int m_nowPlayFrame; 34 | double m_nowPlayFrameD; 35 | 36 | bool m_isAnimeAutoPlay; 37 | 38 | //UIへの情報表示用 39 | int m_InfoAnimeEndFrame; 40 | int m_InfoAnimeFps; 41 | 42 | float m_Zoom; 43 | float m_Speed; 44 | 45 | bool m_isLoading; 46 | bool m_framereset; 47 | 48 | public: 49 | SampleScene() : m_isAnimeAutoPlay (false),sceneLoop(0) , m_isLoading(false),m_framereset(false){} 50 | virtual ~SampleScene() 51 | { 52 | destroy(); 53 | } 54 | 55 | virtual void draw(); 56 | virtual void update(double delta); 57 | virtual void init(); 58 | virtual void destroy(); 59 | 60 | void ProjectFileLoad(); 61 | 62 | void UIRebuild(); 63 | 64 | void AnimePackSelecterRelease(); 65 | void ChangeAnimation( int packIndex , int animeIndex ); 66 | 67 | 68 | void AnimePlay(){ m_isAnimeAutoPlay = true; } 69 | void AnimePause(){ m_isAnimeAutoPlay = false; } 70 | void AnimeReset(); 71 | 72 | }; 73 | 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /Build/Viewer/source/script_base_conv.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/Viewer/source/script_base_conv.cpp -------------------------------------------------------------------------------- /Build/example/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Mikko Mononen memon@inside.org 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | 19 | -------------------------------------------------------------------------------- /Build/example/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/Roboto-Bold.ttf -------------------------------------------------------------------------------- /Build/example/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/Roboto-Light.ttf -------------------------------------------------------------------------------- /Build/example/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/Roboto-Regular.ttf -------------------------------------------------------------------------------- /Build/example/TanukiMagic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/TanukiMagic.ttf -------------------------------------------------------------------------------- /Build/example/demo.h: -------------------------------------------------------------------------------- 1 | #ifndef DEMO_H 2 | #define DEMO_H 3 | 4 | #include "nanovg.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | struct DemoData { 11 | int fontNormal, fontBold, fontIcons; 12 | int images[12]; 13 | }; 14 | typedef struct DemoData DemoData; 15 | 16 | int loadDemoData(NVGcontext* vg, DemoData* data); 17 | void freeDemoData(NVGcontext* vg, DemoData* data); 18 | void renderDemo(NVGcontext* vg, float mx, float my, float width, float height, float t, int blowup, DemoData* data); 19 | 20 | void saveScreenShot(int w, int h, int premult, const char* name); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif // DEMO_H -------------------------------------------------------------------------------- /Build/example/entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/entypo.ttf -------------------------------------------------------------------------------- /Build/example/example_gl2.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013 Mikko Mononen memon@inside.org 3 | // 4 | // This software is provided 'as-is', without any express or implied 5 | // warranty. In no event will the authors be held liable for any damages 6 | // arising from the use of this software. 7 | // Permission is granted to anyone to use this software for any purpose, 8 | // including commercial applications, and to alter it and redistribute it 9 | // freely, subject to the following restrictions: 10 | // 1. The origin of this software must not be misrepresented; you must not 11 | // claim that you wrote the original software. If you use this software 12 | // in a product, an acknowledgment in the product documentation would be 13 | // appreciated but is not required. 14 | // 2. Altered source versions must be plainly marked as such, and must not be 15 | // misrepresented as being the original software. 16 | // 3. This notice may not be removed or altered from any source distribution. 17 | // 18 | 19 | #include 20 | #ifdef NANOVG_GLEW 21 | # include 22 | #endif 23 | #include 24 | #include "nanovg.h" 25 | #define NANOVG_GL2_IMPLEMENTATION 26 | #include "nanovg_gl.h" 27 | #include "demo.h" 28 | #include "perf.h" 29 | 30 | 31 | void errorcb(int error, const char* desc) 32 | { 33 | printf("GLFW error %d: %s\n", error, desc); 34 | } 35 | 36 | int blowup = 0; 37 | int screenshot = 0; 38 | int premult = 0; 39 | 40 | static void key(GLFWwindow* window, int key, int scancode, int action, int mods) 41 | { 42 | NVG_NOTUSED(scancode); 43 | NVG_NOTUSED(mods); 44 | if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) 45 | glfwSetWindowShouldClose(window, GL_TRUE); 46 | if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) 47 | blowup = !blowup; 48 | if (key == GLFW_KEY_S && action == GLFW_PRESS) 49 | screenshot = 1; 50 | if (key == GLFW_KEY_P && action == GLFW_PRESS) 51 | premult = !premult; 52 | } 53 | 54 | int main() 55 | { 56 | GLFWwindow* window; 57 | DemoData data; 58 | NVGcontext* vg = NULL; 59 | PerfGraph fps; 60 | double prevt = 0; 61 | 62 | if (!glfwInit()) { 63 | printf("Failed to init GLFW."); 64 | return -1; 65 | } 66 | 67 | initGraph(&fps, GRAPH_RENDER_FPS, "Frame Time"); 68 | 69 | glfwSetErrorCallback(errorcb); 70 | 71 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); 72 | glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); 73 | #ifdef DEMO_MSAA 74 | glfwWindowHint(GLFW_SAMPLES, 4); 75 | #endif 76 | 77 | window = glfwCreateWindow(1000, 600, "NanoVG", NULL, NULL); 78 | // window = glfwCreateWindow(1000, 600, "NanoVG", glfwGetPrimaryMonitor(), NULL); 79 | if (!window) { 80 | glfwTerminate(); 81 | return -1; 82 | } 83 | 84 | glfwSetKeyCallback(window, key); 85 | 86 | glfwMakeContextCurrent(window); 87 | #ifdef NANOVG_GLEW 88 | if(glewInit() != GLEW_OK) { 89 | printf("Could not init glew.\n"); 90 | return -1; 91 | } 92 | #endif 93 | 94 | #ifdef DEMO_MSAA 95 | vg = nvgCreateGL2(NVG_STENCIL_STROKES); 96 | #else 97 | vg = nvgCreateGL2(NVG_ANTIALIAS | NVG_STENCIL_STROKES); 98 | #endif 99 | if (vg == NULL) { 100 | printf("Could not init nanovg.\n"); 101 | return -1; 102 | } 103 | 104 | if (loadDemoData(vg, &data) == -1) 105 | return -1; 106 | 107 | glfwSwapInterval(0); 108 | 109 | glfwSetTime(0); 110 | prevt = glfwGetTime(); 111 | 112 | while (!glfwWindowShouldClose(window)) 113 | { 114 | double mx, my, t, dt; 115 | int winWidth, winHeight; 116 | int fbWidth, fbHeight; 117 | float pxRatio; 118 | 119 | t = glfwGetTime(); 120 | dt = t - prevt; 121 | prevt = t; 122 | updateGraph(&fps, dt); 123 | 124 | glfwGetCursorPos(window, &mx, &my); 125 | glfwGetWindowSize(window, &winWidth, &winHeight); 126 | glfwGetFramebufferSize(window, &fbWidth, &fbHeight); 127 | 128 | // Calculate pixel ration for hi-dpi devices. 129 | pxRatio = (float)fbWidth / (float)winWidth; 130 | 131 | // Update and render 132 | glViewport(0, 0, fbWidth, fbHeight); 133 | if (premult) 134 | glClearColor(0,0,0,0); 135 | else 136 | glClearColor(0.3f, 0.3f, 0.32f, 1.0f); 137 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); 138 | 139 | nvgBeginFrame(vg, winWidth, winHeight, pxRatio); 140 | 141 | renderDemo(vg, mx,my, winWidth,winHeight, t, blowup, &data); 142 | renderGraph(vg, 5,5, &fps); 143 | 144 | nvgEndFrame(vg); 145 | 146 | if (screenshot) { 147 | screenshot = 0; 148 | saveScreenShot(fbWidth, fbHeight, premult, "dump.png"); 149 | } 150 | 151 | glfwSwapBuffers(window); 152 | glfwPollEvents(); 153 | } 154 | 155 | freeDemoData(vg, &data); 156 | 157 | nvgDeleteGL2(vg); 158 | 159 | glfwTerminate(); 160 | return 0; 161 | } 162 | -------------------------------------------------------------------------------- /Build/example/example_gles2.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013 Mikko Mononen memon@inside.org 3 | // 4 | // This software is provided 'as-is', without any express or implied 5 | // warranty. In no event will the authors be held liable for any damages 6 | // arising from the use of this software. 7 | // Permission is granted to anyone to use this software for any purpose, 8 | // including commercial applications, and to alter it and redistribute it 9 | // freely, subject to the following restrictions: 10 | // 1. The origin of this software must not be misrepresented; you must not 11 | // claim that you wrote the original software. If you use this software 12 | // in a product, an acknowledgment in the product documentation would be 13 | // appreciated but is not required. 14 | // 2. Altered source versions must be plainly marked as such, and must not be 15 | // misrepresented as being the original software. 16 | // 3. This notice may not be removed or altered from any source distribution. 17 | // 18 | 19 | #include 20 | #define GLFW_INCLUDE_ES2 21 | #include 22 | #include "nanovg.h" 23 | #define NANOVG_GLES2_IMPLEMENTATION 24 | #include "nanovg_gl.h" 25 | #include "nanovg_gl_utils.h" 26 | #include "demo.h" 27 | #include "perf.h" 28 | 29 | 30 | void errorcb(int error, const char* desc) 31 | { 32 | printf("GLFW error %d: %s\n", error, desc); 33 | } 34 | 35 | int blowup = 0; 36 | int screenshot = 0; 37 | int premult = 0; 38 | 39 | static void key(GLFWwindow* window, int key, int scancode, int action, int mods) 40 | { 41 | NVG_NOTUSED(scancode); 42 | NVG_NOTUSED(mods); 43 | if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) 44 | glfwSetWindowShouldClose(window, GL_TRUE); 45 | if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) 46 | blowup = !blowup; 47 | if (key == GLFW_KEY_S && action == GLFW_PRESS) 48 | screenshot = 1; 49 | if (key == GLFW_KEY_P && action == GLFW_PRESS) 50 | premult = !premult; 51 | } 52 | 53 | int main() 54 | { 55 | GLFWwindow* window; 56 | DemoData data; 57 | NVGcontext* vg = NULL; 58 | PerfGraph fps; 59 | double prevt = 0; 60 | 61 | if (!glfwInit()) { 62 | printf("Failed to init GLFW."); 63 | return -1; 64 | } 65 | 66 | initGraph(&fps, GRAPH_RENDER_FPS, "Frame Time"); 67 | 68 | glfwSetErrorCallback(errorcb); 69 | 70 | glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); 71 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); 72 | glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); 73 | 74 | window = glfwCreateWindow(1000, 600, "NanoVG", NULL, NULL); 75 | // window = glfwCreateWindow(1000, 600, "NanoVG", glfwGetPrimaryMonitor(), NULL); 76 | if (!window) { 77 | glfwTerminate(); 78 | return -1; 79 | } 80 | 81 | glfwSetKeyCallback(window, key); 82 | 83 | glfwMakeContextCurrent(window); 84 | 85 | vg = nvgCreateGLES2(NVG_ANTIALIAS | NVG_STENCIL_STROKES); 86 | if (vg == NULL) { 87 | printf("Could not init nanovg.\n"); 88 | return -1; 89 | } 90 | 91 | if (loadDemoData(vg, &data) == -1) 92 | return -1; 93 | 94 | glfwSwapInterval(0); 95 | 96 | glfwSetTime(0); 97 | prevt = glfwGetTime(); 98 | 99 | while (!glfwWindowShouldClose(window)) 100 | { 101 | double mx, my, t, dt; 102 | int winWidth, winHeight; 103 | int fbWidth, fbHeight; 104 | float pxRatio; 105 | 106 | t = glfwGetTime(); 107 | dt = t - prevt; 108 | prevt = t; 109 | updateGraph(&fps, dt); 110 | 111 | glfwGetCursorPos(window, &mx, &my); 112 | glfwGetWindowSize(window, &winWidth, &winHeight); 113 | glfwGetFramebufferSize(window, &fbWidth, &fbHeight); 114 | // Calculate pixel ration for hi-dpi devices. 115 | pxRatio = (float)fbWidth / (float)winWidth; 116 | 117 | // Update and render 118 | glViewport(0, 0, fbWidth, fbHeight); 119 | if (premult) 120 | glClearColor(0,0,0,0); 121 | else 122 | glClearColor(0.3f, 0.3f, 0.32f, 1.0f); 123 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); 124 | 125 | glEnable(GL_BLEND); 126 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 127 | glEnable(GL_CULL_FACE); 128 | glDisable(GL_DEPTH_TEST); 129 | 130 | nvgBeginFrame(vg, winWidth, winHeight, pxRatio); 131 | 132 | renderDemo(vg, mx,my, winWidth,winHeight, t, blowup, &data); 133 | renderGraph(vg, 5,5, &fps); 134 | 135 | nvgEndFrame(vg); 136 | 137 | if (screenshot) { 138 | screenshot = 0; 139 | saveScreenShot(fbWidth, fbHeight, premult, "dump.png"); 140 | } 141 | 142 | glEnable(GL_DEPTH_TEST); 143 | 144 | glfwSwapBuffers(window); 145 | glfwPollEvents(); 146 | } 147 | 148 | freeDemoData(vg, &data); 149 | 150 | nvgDeleteGLES2(vg); 151 | 152 | glfwTerminate(); 153 | return 0; 154 | } 155 | -------------------------------------------------------------------------------- /Build/example/example_gles3.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2013 Mikko Mononen memon@inside.org 3 | // 4 | // This software is provided 'as-is', without any express or implied 5 | // warranty. In no event will the authors be held liable for any damages 6 | // arising from the use of this software. 7 | // Permission is granted to anyone to use this software for any purpose, 8 | // including commercial applications, and to alter it and redistribute it 9 | // freely, subject to the following restrictions: 10 | // 1. The origin of this software must not be misrepresented; you must not 11 | // claim that you wrote the original software. If you use this software 12 | // in a product, an acknowledgment in the product documentation would be 13 | // appreciated but is not required. 14 | // 2. Altered source versions must be plainly marked as such, and must not be 15 | // misrepresented as being the original software. 16 | // 3. This notice may not be removed or altered from any source distribution. 17 | // 18 | 19 | #include 20 | #define GLFW_INCLUDE_ES3 21 | #include 22 | #include "nanovg.h" 23 | #define NANOVG_GLES3_IMPLEMENTATION 24 | #include "nanovg_gl.h" 25 | #include "nanovg_gl_utils.h" 26 | #include "demo.h" 27 | #include "perf.h" 28 | 29 | 30 | void errorcb(int error, const char* desc) 31 | { 32 | printf("GLFW error %d: %s\n", error, desc); 33 | } 34 | 35 | int blowup = 0; 36 | int screenshot = 0; 37 | int premult = 0; 38 | 39 | static void key(GLFWwindow* window, int key, int scancode, int action, int mods) 40 | { 41 | NVG_NOTUSED(scancode); 42 | NVG_NOTUSED(mods); 43 | if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) 44 | glfwSetWindowShouldClose(window, GL_TRUE); 45 | if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) 46 | blowup = !blowup; 47 | if (key == GLFW_KEY_S && action == GLFW_PRESS) 48 | screenshot = 1; 49 | if (key == GLFW_KEY_P && action == GLFW_PRESS) 50 | premult = !premult; 51 | } 52 | 53 | int main() 54 | { 55 | GLFWwindow* window; 56 | DemoData data; 57 | NVGcontext* vg = NULL; 58 | PerfGraph fps; 59 | double prevt = 0; 60 | 61 | if (!glfwInit()) { 62 | printf("Failed to init GLFW."); 63 | return -1; 64 | } 65 | 66 | initGraph(&fps, GRAPH_RENDER_FPS, "Frame Time"); 67 | 68 | glfwSetErrorCallback(errorcb); 69 | 70 | glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); 71 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); 72 | glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); 73 | 74 | window = glfwCreateWindow(1000, 600, "NanoVG", NULL, NULL); 75 | // window = glfwCreateWindow(1000, 600, "NanoVG", glfwGetPrimaryMonitor(), NULL); 76 | if (!window) { 77 | glfwTerminate(); 78 | return -1; 79 | } 80 | 81 | glfwSetKeyCallback(window, key); 82 | 83 | glfwMakeContextCurrent(window); 84 | 85 | vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES); 86 | if (vg == NULL) { 87 | printf("Could not init nanovg.\n"); 88 | return -1; 89 | } 90 | 91 | if (loadDemoData(vg, &data) == -1) 92 | return -1; 93 | 94 | glfwSwapInterval(0); 95 | 96 | glfwSetTime(0); 97 | prevt = glfwGetTime(); 98 | 99 | while (!glfwWindowShouldClose(window)) 100 | { 101 | double mx, my, t, dt; 102 | int winWidth, winHeight; 103 | int fbWidth, fbHeight; 104 | float pxRatio; 105 | 106 | t = glfwGetTime(); 107 | dt = t - prevt; 108 | prevt = t; 109 | updateGraph(&fps, dt); 110 | 111 | glfwGetCursorPos(window, &mx, &my); 112 | glfwGetWindowSize(window, &winWidth, &winHeight); 113 | glfwGetFramebufferSize(window, &fbWidth, &fbHeight); 114 | // Calculate pixel ration for hi-dpi devices. 115 | pxRatio = (float)fbWidth / (float)winWidth; 116 | 117 | // Update and render 118 | glViewport(0, 0, fbWidth, fbHeight); 119 | if (premult) 120 | glClearColor(0,0,0,0); 121 | else 122 | glClearColor(0.3f, 0.3f, 0.32f, 1.0f); 123 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); 124 | 125 | glEnable(GL_BLEND); 126 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 127 | glEnable(GL_CULL_FACE); 128 | glDisable(GL_DEPTH_TEST); 129 | 130 | nvgBeginFrame(vg, winWidth, winHeight, pxRatio); 131 | 132 | renderDemo(vg, mx,my, winWidth,winHeight, t, blowup, &data); 133 | renderGraph(vg, 5,5, &fps); 134 | 135 | nvgEndFrame(vg); 136 | 137 | glEnable(GL_DEPTH_TEST); 138 | 139 | if (screenshot) { 140 | screenshot = 0; 141 | saveScreenShot(fbWidth, fbHeight, premult, "dump.png"); 142 | } 143 | 144 | glfwSwapBuffers(window); 145 | glfwPollEvents(); 146 | } 147 | 148 | freeDemoData(vg, &data); 149 | 150 | nvgDeleteGLES3(vg); 151 | 152 | glfwTerminate(); 153 | return 0; 154 | } 155 | -------------------------------------------------------------------------------- /Build/example/images.txt: -------------------------------------------------------------------------------- 1 | Image credits 2 | http://cuteoverload.com/2013/11/05/mom-taxi-xvi-birthday-party/ 3 | http://cuteoverload.com/2013/11/05/benson-hedges-private-eye-in-the-case-of-the-crafty-craftsman/ 4 | http://cuteoverload.com/2013/11/05/no-underwater-ballets/ 5 | http://cuteoverload.com/2013/11/05/every-nose-has-a-story/ 6 | http://cuteoverload.com/2013/11/04/nosevember-nozzle-nose/ 7 | http://cuteoverload.com/2013/11/04/this-just-in-super-strength-cute/ 8 | http://cuteoverload.com/2013/11/03/have-a-bunderful-sunday/ 9 | http://cuteoverload.com/2013/11/02/caturday-sense-a-common-theme-here/ 10 | http://cuteoverload.com/2013/11/01/nosevember-1st-24-hours-of-noses-1148pm-pt/ 11 | http://cuteoverload.com/2013/04/02/there-might-be-something-cuter-than-this/ 12 | http://cuteoverload.com/2013/07/17/snorting-micro-peeg-gets-belleh-rubs-interwebs-explode/ 13 | http://cuteoverload.com/2013/08/07/bark-in-the-park-v3-0/ -------------------------------------------------------------------------------- /Build/example/images/image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image1.jpg -------------------------------------------------------------------------------- /Build/example/images/image10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image10.jpg -------------------------------------------------------------------------------- /Build/example/images/image11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image11.jpg -------------------------------------------------------------------------------- /Build/example/images/image12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image12.jpg -------------------------------------------------------------------------------- /Build/example/images/image2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image2.jpg -------------------------------------------------------------------------------- /Build/example/images/image3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image3.jpg -------------------------------------------------------------------------------- /Build/example/images/image4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image4.jpg -------------------------------------------------------------------------------- /Build/example/images/image5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image5.jpg -------------------------------------------------------------------------------- /Build/example/images/image6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image6.jpg -------------------------------------------------------------------------------- /Build/example/images/image7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image7.jpg -------------------------------------------------------------------------------- /Build/example/images/image8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image8.jpg -------------------------------------------------------------------------------- /Build/example/images/image9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/images/image9.jpg -------------------------------------------------------------------------------- /Build/example/perf.h: -------------------------------------------------------------------------------- 1 | #ifndef PERF_H 2 | #define PERF_H 3 | 4 | #include "nanovg.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | enum GraphrenderStyle { 11 | GRAPH_RENDER_FPS, 12 | GRAPH_RENDER_MS, 13 | }; 14 | 15 | #define GRAPH_HISTORY_COUNT 100 16 | struct PerfGraph { 17 | int style; 18 | char name[32]; 19 | float values[GRAPH_HISTORY_COUNT]; 20 | int head; 21 | }; 22 | typedef struct PerfGraph PerfGraph; 23 | 24 | void initGraph(PerfGraph* fps, int style, const char* name); 25 | void updateGraph(PerfGraph* fps, float frameTime); 26 | void renderGraph(NVGcontext* vg, float x, float y, PerfGraph* fps); 27 | float getGraphAverage(PerfGraph* fps); 28 | 29 | #define GPU_QUERY_COUNT 5 30 | struct GPUtimer { 31 | int supported; 32 | int cur, ret; 33 | unsigned int queries[GPU_QUERY_COUNT]; 34 | }; 35 | typedef struct GPUtimer GPUtimer; 36 | 37 | void initGPUTimer(GPUtimer* timer); 38 | void startGPUTimer(GPUtimer* timer); 39 | int stopGPUTimer(GPUtimer* timer, float* times, int maxTimes); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif // PERF_H -------------------------------------------------------------------------------- /Build/example/screenshot-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/screenshot-01.png -------------------------------------------------------------------------------- /Build/example/screenshot-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/example/screenshot-02.png -------------------------------------------------------------------------------- /Build/fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /Build/fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /Build/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /Build/fonts/entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/fonts/entypo.ttf -------------------------------------------------------------------------------- /Build/plistConverter/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | コンソール アプリケーション: plistConverter プロジェクトの概要 3 | ======================================================================== 4 | 5 | この plistConverter アプリケーションは、AppWizard により作成されました。 6 | 7 | このファイルには、plistConverter アプリケーションを構成する各ファイルの内容の概要が含まれています。 8 | 9 | 10 | plistConverter.vcxproj 11 | これは、アプリケーション ウィザードを使用して生成された VC++ プロジェクトのメイン プロジェクト ファイルです。ファイルを生成した Visual C++ のバージョンに関する情報と、アプリケーション ウィザードで選択されたプラットフォーム、構成、およびプロジェクト機能に関する情報が含まれています。 12 | 13 | plistConverter.vcxproj.filters 14 | これは、アプリケーション ウィザードで生成された VC++ プロジェクトのフィルター ファイルです。このファイルには、プロジェクト内のファイルとフィルターとの間の関連付けに関する情報が含まれています。この関連付けは、特定のノードで同様の拡張子を持つファイルのグループ化を示すために IDE で使用されます (たとえば、".cpp" ファイルは "ソース ファイル" フィルターに関連付けられています)。 15 | 16 | plistConverter.cpp 17 | これは、メインのアプリケーション ソース ファイルです。 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | その他の標準ファイル : 21 | 22 | StdAfx.h, StdAfx.cpp 23 | これらのファイルは、plistConverter.pch という名前のプリコンパイル済みヘッダー (PCH) ファイルと、StdAfx.obj という名前のプリコンパイル済みの型ファイルをビルドするために使用されます。 24 | 25 | ///////////////////////////////////////////////////////////////////////////// 26 | その他のメモ : 27 | 28 | AppWizard では "TODO:" コメントを使用して、ユーザーが追加またはカスタマイズする必要のあるソース コードを示します。 29 | 30 | ///////////////////////////////////////////////////////////////////////////// 31 | -------------------------------------------------------------------------------- /Build/plistConverter/plistConverter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/plistConverter/plistConverter.cpp -------------------------------------------------------------------------------- /Build/plistConverter/plistConverter.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Express 2013 for Windows Desktop 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plistConverter", "plistConverter.vcxproj", "{4454205A-0597-4E14-BC2C-29E63CCD82C3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {4454205A-0597-4E14-BC2C-29E63CCD82C3}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {4454205A-0597-4E14-BC2C-29E63CCD82C3}.Debug|Win32.Build.0 = Debug|Win32 16 | {4454205A-0597-4E14-BC2C-29E63CCD82C3}.Release|Win32.ActiveCfg = Release|Win32 17 | {4454205A-0597-4E14-BC2C-29E63CCD82C3}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Build/plistConverter/plistConverter.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/plistConverter/plistConverter.v12.suo -------------------------------------------------------------------------------- /Build/plistConverter/plistConverter.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {4454205A-0597-4E14-BC2C-29E63CCD82C3} 15 | Win32Proj 16 | plistConverter 17 | 18 | 19 | 20 | Application 21 | true 22 | v120 23 | Unicode 24 | 25 | 26 | Application 27 | false 28 | v120 29 | true 30 | Unicode 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | 45 | 46 | false 47 | 48 | 49 | 50 | Use 51 | Level3 52 | Disabled 53 | WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) 54 | true 55 | 56 | 57 | Console 58 | true 59 | 60 | 61 | 62 | 63 | Level3 64 | Use 65 | MaxSpeed 66 | true 67 | true 68 | WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) 69 | true 70 | 71 | 72 | Console 73 | true 74 | true 75 | true 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | Create 89 | Create 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /Build/plistConverter/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/plistConverter/stdafx.cpp -------------------------------------------------------------------------------- /Build/plistConverter/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/plistConverter/stdafx.h -------------------------------------------------------------------------------- /Build/plistConverter/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Build/plistConverter/targetver.h -------------------------------------------------------------------------------- /Common/Animator/ISsEffectRender.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Animator/ISsEffectRender.h -------------------------------------------------------------------------------- /Common/Animator/ssplayer_PartState.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Animator/ssplayer_PartState.cpp -------------------------------------------------------------------------------- /Common/Animator/ssplayer_PartState.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSPLAYER_PARTSTATE__ 2 | #define __SSPLAYER_PARTSTATE__ 3 | 4 | //#include "../loader/ssloader.h" 5 | //#include "../Helper/ssHelper.h" 6 | 7 | 8 | class SsAnimeDecoder; 9 | //class SsEffectRenderer; 10 | class SsEffectRenderV2; 11 | 12 | 13 | 14 | ///パーツの状態を保持するクラスです。 15 | struct SsPartState 16 | { 17 | int index; ///パーツのインデックスと一対一になるID 18 | 19 | float vertices[3 * 5]; ///< 座標 20 | float colors[4 * 4]; ///< カラー (4頂点分) 21 | float uvs[2 * 5]; ///< UV (4隅+中央) 22 | float matrix[4 * 4]; ///< 行列 23 | 24 | 25 | SsPartState* parent; /// 親へのポインタ 26 | float* inheritRates; ///< 継承設定の参照先。inheritType がparentだと親のを見に行く。透過的に遡るのでルートから先に設定されている必要がある。 27 | 28 | SsVector3 position; ///< 位置。あくまで親パーツ基準のローカル座標 29 | SsVector3 rotation; ///< 回転角。degree 30 | SsVector2 scale; ///< スケール 31 | float alpha; ///< 不透明度 0~1 32 | int prio; ///< 優先度 33 | bool hFlip; ///< 水平反転 34 | bool vFlip; ///< 垂直反転 35 | bool hide; ///< 非表示にする 36 | SsVector2 pivotOffset; ///< 原点のオフセット。旧SSの原点は左上基準にしたこの値に相当する。0,0が中央+0.5,+0.5が右上になる。参照セルがある場合はセルの原点に+する=オフセット扱いになる。 37 | SsVector2 anchor; ///< アンカーポイント。親パーツのどの位置に引っ付けるか?0,0が中央+0.5,+0.5が右上になる。 38 | SsVector2 size; ///< 表示サイズ 39 | bool imageFlipH; /// セル画像を水平反転するか 40 | bool imageFlipV; /// セル画像を垂直反転するか 41 | SsVector2 uvTranslate; ///< UV 平行移動 42 | float uvRotation; ///< UV 回転 43 | SsVector2 uvScale; ///< UV スケール 44 | float boundingRadius; ///< 当たり判定用の円の半径 45 | 46 | SsCellValue cellValue; ///< セルアニメの値 47 | SsColorAnime colorValue; ///< カラーアニメの値 48 | SsVertexAnime vertexValue; ///< 頂点アニメの値 49 | SsEffectAttr effectValue; ///< エフェクトの値 50 | int effectTime; 51 | float effectTimeTotal; 52 | int effectseed; 53 | 54 | bool noCells; /// セル参照が見つからない 55 | bool is_color_blend; /// カラーブレンドが使用される (描画コストが高いシェーダが使われるためフラグ化) 56 | bool is_vertex_transform; /// 頂点変形が使用される (描画コストが高いシェーダが使われるためフラグ化) 57 | 58 | SsInstanceAttr instanceValue; 59 | 60 | SsBlendType::_enum alphaBlendType; 61 | 62 | SsAnimeDecoder* refAnime; 63 | SsEffectRenderV2* refEffect; 64 | 65 | //V4互換計算用 66 | SsVector3 _temp_position; 67 | SsVector3 _temp_rotation; 68 | SsVector2 _temp_scale; 69 | 70 | 71 | SsPartState(); 72 | 73 | virtual ~SsPartState(); 74 | void destroy(); 75 | void init(); 76 | bool inherits_(SsAttributeKind::_enum kind) const {return inheritRates[(int)kind] != 0.f;} 77 | void reset(); 78 | }; 79 | 80 | 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /Common/Animator/ssplayer_animedecode.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSPLAYER_ANIMEDECODE__ 2 | #define __SSPLAYER_ANIMEDECODE__ 3 | 4 | #include "../loader/ssloader.h" 5 | #include "../Helper/ssHelper.h" 6 | 7 | 8 | #include "ssplayer_types.h" 9 | #include "ssplayer_cellmap.h" 10 | #include "ssplayer_PartState.h" 11 | #include "ssplayer_macro.h" 12 | 13 | 14 | 15 | 16 | class SsAnimeDecoder; 17 | class SsCelMapLinker; 18 | 19 | 20 | //パーツとアニメを関連付ける 21 | typedef std::pair SsPartAndAnime; 22 | 23 | 24 | //パーツのソート順 25 | class SsPartStateLess 26 | { 27 | public: 28 | bool operator()(const SsPartState* lhs, const SsPartState* rhs) const 29 | { 30 | if (lhs->prio == rhs->prio) 31 | return lhs->index < rhs->index; 32 | return lhs->prio < rhs->prio; 33 | } 34 | }; 35 | 36 | 37 | 38 | class SsAnimeDecoder 39 | { 40 | public: 41 | bool rootPartFunctionAsVer4; 42 | bool dontUseMatrixForTransform; 43 | 44 | private: 45 | 46 | ///パーツ情報とパーツアニメーションを結びつけアレイにしたもの 47 | std::vector partAnime; 48 | 49 | ///パーツ名からアニメ情報をとるために使うもし、そういった用途が無い場合はローカル変数でも機能する 50 | std::map partAnimeDic; 51 | 52 | SsCellMapList* curCellMapManager;///アニメに関連付けられているセルマップ 53 | 54 | SsPartState* partState; ///パーツの現在の状態が格納されています。 55 | std::list sortList; ///ソート状態 56 | 57 | 58 | int seedOffset; //エフェクトのシードへ影響 59 | float nowPlatTime; 60 | float nowPlatTimeOld; //前のフレームで再生した時間 61 | float frameDelta; 62 | int curAnimeEndFrame; 63 | int curAnimeFPS; 64 | SsAnimation* curAnimation; 65 | bool instancePartsHide; 66 | 67 | 68 | private: 69 | void updateState( int nowTime , SsPart* part , SsPartAnime* part_anime , SsPartState* state ); 70 | void updateInstance( int nowTime , SsPart* part , SsPartAnime* part_anime , SsPartState* state ); 71 | void updateEffect( float frameDelta , int nowTime , SsPart* part , SsPartAnime* part_anime , SsPartState* state ); 72 | 73 | 74 | void updateMatrix(SsPart* part , SsPartAnime* anime , SsPartState* state); 75 | void update_matrix_ss4(SsPart* part , SsPartAnime* anime , SsPartState* state); 76 | 77 | void updateVertices(SsPart* part , SsPartAnime* anime , SsPartState* state); 78 | 79 | int CalcAnimeLabel2Frame(const SsString& str, int offset, SsAnimation* Animation ); 80 | int findAnimetionLabel(const SsString& str, SsAnimation* Animation); 81 | 82 | 83 | public: 84 | SsAnimeDecoder(); 85 | virtual ~SsAnimeDecoder() 86 | { 87 | if ( curCellMapManager ) 88 | delete curCellMapManager; 89 | 90 | if ( partState ) 91 | delete [] partState; 92 | } 93 | 94 | virtual void update( float frameDelta = 1.0f ); 95 | virtual void draw(); 96 | 97 | void setAnimation( SsModel* model , SsAnimation* anime , SsCellMapList* cellmap , SsProject* sspj=0 ); 98 | 99 | void setPlayFrame( float time ) { nowPlatTime = time; } 100 | int getAnimeEndFrame() { return curAnimeEndFrame; } 101 | int getAnimeFPS() { 102 | return curAnimeFPS; } 103 | 104 | 105 | std::list& getPartSortList(){return sortList;} 106 | std::vector& getPartAnime(){ return partAnime; } 107 | 108 | template int SsGetKeyValue( int time , SsAttribute* attr , mytype& value ); 109 | template void SsInterpolationValue( int time , const SsKeyframe* leftkey , const SsKeyframe* rightkey , mytype& v ); 110 | void SsInterpolationValue( int time , const SsKeyframe* leftkey , const SsKeyframe* rightkey , SsCellValue& v ); 111 | void SsInterpolationValue( int time , const SsKeyframe* leftkey , const SsKeyframe* rightkey , SsColorAnime& v ); 112 | void SsInterpolationValue( int time , const SsKeyframe* leftkey , const SsKeyframe* rightkey , SsVertexAnime& v ); 113 | void SsInterpolationValue( int time , const SsKeyframe* leftkey , const SsKeyframe* rightkey , SsInstanceAttr& v ); 114 | void SsInterpolationValue( int time , const SsKeyframe* leftkey , const SsKeyframe* rightkey , SsEffectAttr& v ); 115 | 116 | 117 | void setInstancePartsHide(bool hide){ 118 | instancePartsHide = hide; 119 | } 120 | void restart(); 121 | void reset(); 122 | 123 | void setSeedOffset(int a ){ seedOffset = a; } 124 | int getSeedOffset(){ return seedOffset; } 125 | }; 126 | 127 | 128 | 129 | #endif 130 | -------------------------------------------------------------------------------- /Common/Animator/ssplayer_cellmap.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSPLAYER_CELLMAP__ 2 | #define __SSPLAYER_CELLMAP__ 3 | 4 | 5 | 6 | class SsAnimeDecoder; 7 | class SsCelMapLinker; 8 | 9 | ///パーツが使用するセルの情報 10 | struct SsCellValue 11 | { 12 | SsCell* cell; ///参照しているセル 13 | ISSTexture* texture; ///テクスチャ 14 | SsVector2 uvs[5]; ///使用するUV座標 15 | SsTexWrapMode::_enum wrapMode; ///< テクスチャのラップモード 16 | SsTexFilterMode::_enum filterMode; ///< テクスチャのフィルタモード 17 | 18 | SsCellValue() : 19 | cell(0) , 20 | texture(0) 21 | {} 22 | }; 23 | 24 | class SsCelMapLinker 25 | { 26 | public: 27 | SsCellMap* cellMap; 28 | ISSTexture* tex; 29 | 30 | std::map CellDic; 31 | 32 | public: 33 | SsCelMapLinker() 34 | : cellMap(0) , tex(0) 35 | {} 36 | 37 | SsCelMapLinker(SsCellMap* cellmap ,SsString filePath ) 38 | { 39 | 40 | cellMap = cellmap; 41 | size_t num = cellMap->cells.size(); 42 | for ( size_t i = 0 ; i < num ; i++ ) 43 | { 44 | CellDic[cellMap->cells[i]->name] = cellMap->cells[i]; 45 | } 46 | 47 | if (!SSTextureFactory::isExist() ) 48 | { 49 | puts( "SSTextureFactory not created yet." ); 50 | throw; 51 | } 52 | 53 | tex = SSTextureFactory::create(); 54 | 55 | //SsString fullpath = filePath + cellmap->imagePath; 56 | 57 | std::string fullpath = getFullPath( filePath , path2dir( cellmap->imagePath ) ); 58 | fullpath = fullpath + path2file( cellmap->imagePath ); 59 | fullpath = nomarizeFilename(fullpath); 60 | 61 | if ( !tex->Load( fullpath.c_str() ) ) 62 | { 63 | delete tex; 64 | tex = 0; 65 | } 66 | 67 | } 68 | 69 | virtual ~SsCelMapLinker() 70 | { 71 | CellDic.clear(); 72 | 73 | if ( tex ) 74 | delete tex; 75 | } 76 | 77 | SsCell* findCell( const SsString& name ){ return CellDic[name]; } 78 | 79 | }; 80 | 81 | //プロジェクト全体で保持しているセルマップ 82 | //現在はprojectのセルマップの列挙とssaeの列挙は同一 83 | class SsCellMapList 84 | { 85 | private: 86 | //同名セルマップは上書き 87 | std::map CellMapDic; 88 | std::vector CellMapList;//添え字参照用 89 | 90 | typedef std::map::iterator CellMapDicItr; 91 | SsString CellMapPath; 92 | 93 | private: 94 | void addIndex(SsCellMap* cellmap); 95 | void addMap(SsCellMap* cellmap); 96 | 97 | public: 98 | SsCellMapList(){} 99 | virtual ~SsCellMapList() 100 | { 101 | for ( CellMapDicItr itr = CellMapDic.begin() ; itr != CellMapDic.end() ; itr ++) 102 | { 103 | delete itr->second; 104 | } 105 | 106 | for ( size_t i = 0 ; i < CellMapList.size(); i++ ) 107 | { 108 | delete CellMapList[i]; 109 | } 110 | CellMapList.clear(); 111 | CellMapDic.clear(); 112 | } 113 | 114 | void clear(); 115 | size_t size(){ return CellMapList.size(); } 116 | 117 | void setCellMapPath( const SsString& filepath ); 118 | 119 | //projectとanimepackからアニメーションの再生に必要なセルマップのリストを作成する 120 | //アニメパックのセルリストに登載されている順にセルマップを読み込みインデックス化する 121 | //SsProjectを介してセルを検索しているのはセルがそこにアレイで確保されているから 122 | //もし既に読み込み済みだったりする場合は、アニメパックのセルID順にセルマップを登録すればいい 123 | void set(SsProject* proj , SsAnimePack* animepack ); 124 | 125 | SsCelMapLinker* getCellMapLink( const SsString& name ); 126 | SsCelMapLinker* getCellMapLink( int index ) 127 | { 128 | return CellMapList[index]; 129 | } 130 | 131 | 132 | }; 133 | 134 | 135 | 136 | //void getCellValue( int cellMapid , SsString& cellName , SsCellValue& v ); 137 | void getCellValue( SsCellMapList* cellList, int cellMapid , SsString& cellName , SsCellValue& v ); 138 | void getCellValue( SsCellMapList* cellList, SsString& cellMapName , SsString& cellName , SsCellValue& v ); 139 | 140 | void calcUvs( SsCellValue* cellv ); 141 | 142 | #endif 143 | -------------------------------------------------------------------------------- /Common/Animator/ssplayer_effect2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Animator/ssplayer_effect2.cpp -------------------------------------------------------------------------------- /Common/Animator/ssplayer_effect2.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Animator/ssplayer_effect2.h -------------------------------------------------------------------------------- /Common/Animator/ssplayer_effectfunction.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Animator/ssplayer_effectfunction.h -------------------------------------------------------------------------------- /Common/Animator/ssplayer_macro.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSPLAYER_MACRO__ 2 | #define __SSPLAYER_MACRO__ 3 | 4 | 5 | 6 | #define __PI__ (3.14159265358979323846f) 7 | #define RadianToDegree(Radian) ((double)Radian * (180.0f / __PI__)) 8 | #define DegreeToRadian(Degree) ((double)Degree * (__PI__ / 180.0f)) 9 | 10 | #define foreach(T, c, i) for(T::iterator i = c.begin(); i!=c.end(); ++i) 11 | 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /Common/Animator/ssplayer_matrix.cpp: -------------------------------------------------------------------------------- 1 | #include "ssplayer_matrix.h" 2 | #include 3 | #include 4 | //#include 5 | #include 6 | #include 7 | 8 | void IdentityMatrix( float* matrix ) 9 | { 10 | 11 | float ident[] = { 12 | 1.0f , 0.0f , 0.0f , 0.0f , 13 | 0.0f , 1.0f , 0.0f , 0.0f , 14 | 0.0f , 0.0f , 1.0f , 0.0f , 15 | 0.0f , 0.0f , 0.0f , 1.0f }; 16 | 17 | 18 | memcpy( matrix , ident , sizeof(float) * 16 ); 19 | 20 | } 21 | 22 | 23 | void ScaleMatrix( float* _matrix , const float x , const float y , const float z) 24 | { 25 | memset( _matrix , 0 , sizeof(float) * 16 ); 26 | 27 | _matrix[ 4 * 0 + 0 ] = x; 28 | _matrix[ 4 * 1 + 1 ] = y; 29 | _matrix[ 4 * 2 + 2 ] = z; 30 | _matrix[ 4 * 3 + 3 ] = 1.0f; 31 | 32 | 33 | } 34 | 35 | void TranslationMatrix( float* _matrix , const float x , const float y , const float z ) 36 | { 37 | memset( _matrix , 0 , sizeof(float) * 16 ); 38 | 39 | _matrix[ 0 ] = 1.0f; 40 | _matrix[ 5 ] = 1.0f; 41 | _matrix[ 10 ] = 1.0f; 42 | 43 | 44 | _matrix[ 12 ] = x; 45 | _matrix[ 13 ] = y; 46 | _matrix[ 14 ] = z; 47 | _matrix[ 15 ] = 1.0f; 48 | 49 | } 50 | 51 | 52 | void MultiplyMatrix(const float *m0, const float *m1, float *matrix) 53 | { 54 | 55 | float _temp[16]; 56 | 57 | for (int i = 0; i < 16; ++i) { 58 | int j = i & ~3, k = i & 3; 59 | 60 | _temp[i] = m0[j + 0] * m1[ 0 + k] 61 | + m0[j + 1] * m1[ 4 + k] 62 | + m0[j + 2] * m1[ 8 + k] 63 | + m0[j + 3] * m1[12 + k]; 64 | } 65 | 66 | memcpy( matrix , _temp , sizeof(float) * 16 ); 67 | 68 | 69 | } 70 | 71 | 72 | 73 | void Matrix4RotationX( float* _matrix ,const float radians ) 74 | { 75 | 76 | _matrix[0] = 1.0f; 77 | _matrix[1] = 0.0f; 78 | _matrix[2] = 0.0f; 79 | _matrix[3] = 0.0f; 80 | 81 | _matrix[4] = 0.0f; 82 | _matrix[5] = cosf(radians); 83 | _matrix[6] = sinf(radians); 84 | _matrix[7] = 0.0f; 85 | 86 | _matrix[8] = 0.0f; 87 | _matrix[9] = -sinf(radians); 88 | _matrix[10] = cosf(radians); 89 | _matrix[11] = 0.0f; 90 | 91 | _matrix[12] = 0.0f; 92 | _matrix[13] = 0.0f; 93 | _matrix[14] = 0.0f; 94 | _matrix[15] = 1.0f; 95 | 96 | 97 | } 98 | 99 | 100 | void Matrix4RotationY( float* _matrix ,const float radians ) 101 | { 102 | 103 | _matrix[0] = cosf(radians); 104 | _matrix[1] = 0.0f; 105 | _matrix[2] = -sinf(radians); 106 | _matrix[3] = 0.0f; 107 | 108 | _matrix[4] = 0.0f; 109 | _matrix[5] = 1.0f; 110 | _matrix[6] = 0.0f; 111 | _matrix[7] = 0.0f; 112 | 113 | _matrix[8] = sinf(radians); 114 | _matrix[9] = 0.0f; 115 | _matrix[10] = cosf(radians); 116 | _matrix[11] = 0.0f; 117 | 118 | _matrix[12] = 0.0f; 119 | _matrix[13] = 0.0f; 120 | _matrix[14] = 0.0f; 121 | _matrix[15] = 1.0f; 122 | 123 | 124 | } 125 | 126 | 127 | 128 | void Matrix4RotationZ( float* _matrix ,const float radians ) 129 | { 130 | _matrix[0] = cosf(radians); 131 | _matrix[1] = sinf(radians); 132 | _matrix[2] = 0.0f; 133 | _matrix[3] = 0.0f; 134 | 135 | _matrix[4] = -sinf(radians); 136 | _matrix[5] = cosf(radians); 137 | _matrix[6] = 0.0f; 138 | _matrix[7] = 0.0f; 139 | 140 | _matrix[8] = 0.0f; 141 | _matrix[9] = 0.0f; 142 | _matrix[10] = 1.0f; 143 | _matrix[11] = 0.0f; 144 | 145 | _matrix[12] = 0.0f; 146 | _matrix[13] = 0.0f; 147 | _matrix[14] = 0.0f; 148 | _matrix[15] = 1.0f; 149 | 150 | } 151 | 152 | 153 | -------------------------------------------------------------------------------- /Common/Animator/ssplayer_matrix.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSPLAYER_MATRIX__ 2 | #define __SSPLAYER_MATRIX__ 3 | 4 | 5 | #include 6 | 7 | void IdentityMatrix( float* matrix ); 8 | void ScaleMatrix( float* _matrix , const float x , const float y , const float z); 9 | void TranslationMatrix( float* _matrix , const float x , const float y , const float z ); 10 | void MultiplyMatrix(const float *m0, const float *m1, float *matrix); 11 | void Matrix4RotationX( float* _matrix ,const float radians ); 12 | void Matrix4RotationY( float* _matrix ,const float radians ); 13 | void Matrix4RotationZ( float* _matrix ,const float radians ); 14 | 15 | inline void TranslationMatrixM( float* _matrix , const float x , const float y , const float z ) 16 | { 17 | float _m[16]; 18 | IdentityMatrix( _m ); 19 | TranslationMatrix( _m , x , y , z ); 20 | 21 | MultiplyMatrix( _m , _matrix , _matrix ); 22 | } 23 | 24 | inline void ScaleMatrixM( float* _matrix , const float x , const float y , const float z ) 25 | { 26 | 27 | float _m[16]; 28 | IdentityMatrix( _m ); 29 | ScaleMatrix( _m , x , y , z ); 30 | MultiplyMatrix( _m , _matrix , _matrix ); 31 | } 32 | 33 | inline void RotationXYZMatrixM( float* _matrix , const float x , const float y , const float z ) 34 | { 35 | 36 | if ( x != 0.0f ) 37 | { 38 | float _m[16]; 39 | IdentityMatrix( _m ); 40 | Matrix4RotationX( _m , x ); 41 | 42 | MultiplyMatrix( _m , _matrix , _matrix ); 43 | } 44 | 45 | if ( y != 0.0f ) 46 | { 47 | float _m[16]; 48 | IdentityMatrix( _m ); 49 | Matrix4RotationY( _m , y ); 50 | 51 | MultiplyMatrix( _m , _matrix , _matrix ); 52 | } 53 | 54 | if ( z != 0.0f ) 55 | { 56 | float _m[16]; 57 | IdentityMatrix( _m ); 58 | Matrix4RotationZ( _m , z ); 59 | 60 | MultiplyMatrix( _m , _matrix , _matrix ); 61 | } 62 | } 63 | 64 | 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /Common/Animator/ssplayer_render.cpp: -------------------------------------------------------------------------------- 1 | #include "ssplayer_render.h" 2 | 3 | ISsRenderer* SsCurrentRenderer::m_currentrender = 0; 4 | -------------------------------------------------------------------------------- /Common/Animator/ssplayer_render.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSPLAYER_RENDER__ 2 | #define __SSPLAYER_RENDER__ 3 | 4 | 5 | #include "sstypes.h" 6 | 7 | 8 | 9 | struct SsPartState; 10 | struct SsCellValue; 11 | 12 | class ISsRenderer 13 | { 14 | public: 15 | virtual void initialize() = 0; 16 | virtual void renderSetup() = 0; 17 | virtual void renderPart(SsPartState* state) = 0; 18 | 19 | virtual void renderSpriteSimple( float matrix[16], 20 | int width, int height, 21 | SsVector2& pivot , 22 | SsVector2 uv1, SsVector2 uv2, 23 | const SsFColor& color ) = 0; 24 | 25 | virtual void SetAlphaBlendMode(SsBlendType::_enum type)=0; 26 | virtual void SetTexture( SsCellValue* cell )=0; 27 | 28 | 29 | }; 30 | 31 | class SsCurrentRenderer 32 | { 33 | private: 34 | static ISsRenderer* m_currentrender; 35 | public: 36 | SsCurrentRenderer(){} 37 | SsCurrentRenderer(ISsRenderer* render) 38 | { 39 | SetCurrentRender(render); 40 | } 41 | virtual ~SsCurrentRenderer() 42 | { 43 | if ( m_currentrender ) delete m_currentrender; 44 | } 45 | static void SetCurrentRender( ISsRenderer* render ) 46 | { 47 | render->initialize(); 48 | m_currentrender = render; 49 | } 50 | static ISsRenderer* getRender(){ return m_currentrender; } 51 | 52 | 53 | 54 | }; 55 | 56 | 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /Common/Animator/ssplayer_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSPLAYER_TYPES__ 2 | #define __SSPLAYER_TYPES__ 3 | 4 | #include "../loader/ssloader.h" 5 | #include "../Helper/ssHelper.h" 6 | 7 | 8 | 9 | 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Common/Animator/xorshift32.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __XORSHIFT32__ 3 | #define __XORSHIFT32__ 4 | 5 | #ifdef WIN32 6 | 7 | #ifndef uint32_t 8 | typedef unsigned int _uint32_t; 9 | #endif 10 | #else 11 | typedef uint32_t _uint32_t; 12 | #endif 13 | 14 | class xorshift32 15 | { 16 | protected: 17 | 18 | 19 | _uint32_t y; 20 | 21 | 22 | public: 23 | xorshift32(){} 24 | ~xorshift32(){} 25 | 26 | void init_genrand(unsigned long seed) {y=seed;} 27 | 28 | _uint32_t genrand_uint32(){ 29 | y = y ^ ( y << 13 ); 30 | y = y ^ ( y >> 17 ); 31 | y = y ^ ( y << 15 ); 32 | 33 | return y; 34 | } 35 | 36 | float genrand_float32() { 37 | _uint32_t v = genrand_uint32(); 38 | _uint32_t res = (v >> 9) | 0x3f800000; 39 | float r = (*(float*)&res) - 1.0f; 40 | 41 | return r; 42 | } 43 | 44 | } ; 45 | 46 | 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Common/Drawer/GLSL/sprite.fs: -------------------------------------------------------------------------------- 1 | " \n\ 2 | uniform sampler2DRect textureRect; \n\ 3 | uniform int selector; \n\ 4 | \n\ 5 | void main (void) \n\ 6 | {\n\ 7 | vec4 Pixel;\n\ 8 | Pixel = texture2DRect(textureRect, gl_TexCoord[0].st); \n\ 9 | float rate = gl_SecondaryColor.a; \n\ 10 | Pixel.r = Pixel.r / Pixel.a; \n\ 11 | Pixel.g = Pixel.g / Pixel.a; \n\ 12 | Pixel.b = Pixel.b / Pixel.a; \n\ 13 | vec4 PixelBlend = gl_Color; \n\ 14 | vec4 color[4]; \n\ 15 | color[0] = ( Pixel * (1.0 - rate ) ) + ( PixelBlend * rate); \n\ 16 | color[1] = ( Pixel * (1.0 - rate )) + ( Pixel * PixelBlend * rate ); \n\ 17 | color[2] = Pixel + PixelBlend * rate; \n\ 18 | color[3] = Pixel - PixelBlend * rate; \n\ 19 | int sel = selector; \n\ 20 | vec4 out_color = color[sel]; \n\ 21 | out_color.w = Pixel.w * gl_Color.a; \n\ 22 | gl_FragColor = out_color; \n\ 23 | }\n\ 24 | "; -------------------------------------------------------------------------------- /Common/Drawer/GLSL/sprite.vs: -------------------------------------------------------------------------------- 1 | "\n\ 2 | #version 120 \n\ 3 | uniform float rates[5]; \n\ 4 | attribute vec2 vertexID; \n\ 5 | \n\ 6 | void main(void) \n\ 7 | { \n\ 8 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; \n\ 9 | gl_Position = ftransform(); \n\ 10 | \n\ 11 | gl_FrontColor = gl_Color; \n\ 12 | gl_FrontSecondaryColor = gl_Color; \n\ 13 | \n\ 14 | int id = int(vertexID.x); \n\ 15 | \n\ 16 | gl_FrontSecondaryColor.a = rates[id]; \n\ 17 | }\n\ 18 | "; 19 | -------------------------------------------------------------------------------- /Common/Drawer/GLSL/sprite_pot.fs: -------------------------------------------------------------------------------- 1 | "uniform sampler2D textureRect;\n\ 2 | uniform int selector;\n\ 3 | \n\ 4 | void main (void)\n\ 5 | {\n\ 6 | \n\ 7 | vec4 Pixel;\n\ 8 | \n\ 9 | Pixel = texture2D(textureRect, gl_TexCoord[0].st);\n\ 10 | float rate = gl_SecondaryColor.a;\n\ 11 | \n\ 12 | Pixel.r = Pixel.r / Pixel.a;\n\ 13 | Pixel.g = Pixel.g / Pixel.a;\n\ 14 | Pixel.b = Pixel.b / Pixel.a;\n\ 15 | \n\ 16 | vec4 PixelBlend = gl_Color;\n\ 17 | \n\ 18 | vec4 color[4];\n\ 19 | color[0] = ( Pixel * (1.0 - rate ) ) + ( PixelBlend * rate);\n\ 20 | color[1] = ( Pixel * (1.0 - rate )) + ( Pixel * PixelBlend * rate );\n\ 21 | color[2] = Pixel + PixelBlend * rate;\n\ 22 | color[3] = Pixel - PixelBlend * rate;\n\ 23 | \n\ 24 | int sel = selector;\n\ 25 | vec4 out_color = color[sel];\n\ 26 | \n\ 27 | out_color.w = Pixel.w * gl_Color.a;\n\ 28 | gl_FragColor = out_color;\n\ 29 | \n\ 30 | }"; 31 | -------------------------------------------------------------------------------- /Common/Drawer/ssplayer_render_dx9.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | 6 | #include "../helper/DirectX/SSTextureDX9.h" 7 | #include "ssplayer_animedecode.h" 8 | #include "ssplayer_render_dx9.h" 9 | #include "ssplayer_matrix.h" 10 | //#include "ssplayer_shader_gl.h" 11 | 12 | 13 | enum{ 14 | PG_SHADER_NPOT, 15 | PG_SHADER_POT, 16 | }; 17 | 18 | 19 | 20 | 21 | inline float blendColorValue_(SsBlendType::_enum type, u8 color8, float rate) 22 | { 23 | float c = static_cast(color8) / 255.f; 24 | return c; 25 | 26 | switch (type) 27 | { 28 | case SsBlendType::mix: 29 | // GPU側で補間させるので何もしない。 30 | break; 31 | case SsBlendType::mul: 32 | // カラー値→1(テクスチャの色)に向けて補間する。 33 | c = c * rate + 1 * (1 - rate); 34 | break; 35 | case SsBlendType::add: 36 | case SsBlendType::sub: 37 | // c はテクスチャカラーに対してのオフセットになるため単純に率をかければいい。 38 | c = c * rate; 39 | break; 40 | } 41 | 42 | return c; 43 | } 44 | 45 | 46 | inline void blendColor_(float * dest, SsBlendType::_enum blendType, const SsColorBlendValue& color) 47 | { 48 | const SsColor * srcColor = &color.rgba; 49 | float rate = color.rate; 50 | 51 | dest[0] = blendColorValue_(blendType, srcColor->r, rate); 52 | dest[1] = blendColorValue_(blendType, srcColor->g, rate); 53 | dest[2] = blendColorValue_(blendType, srcColor->b, rate); 54 | 55 | } 56 | 57 | 58 | void SsRenderDX9::initialize() 59 | { 60 | 61 | } 62 | 63 | void SsRenderDX9::renderSetup() 64 | { 65 | 66 | } 67 | 68 | 69 | void SsRenderDX9::renderPart( SsPartState* state ) 70 | { 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /Common/Drawer/ssplayer_render_dx9.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSPLAYER_RENDER_DX9__ 2 | #define __SSPLAYER_RENDER_DX9__ 3 | 4 | #include "ssplayer_render.h" 5 | 6 | struct SsPartState; 7 | 8 | class SsRenderDX9 : public ISsRenderer 9 | { 10 | private: 11 | //static bool m_isInit; 12 | 13 | public: 14 | SsRenderDX9(){} 15 | virtual ~SsRenderDX9(){} 16 | 17 | virtual void initialize(); 18 | virtual void renderSetup(); 19 | virtual void renderPart( SsPartState* state ); 20 | virtual void renderSpriteSimple( float matrix[16], 21 | int width, int height, 22 | SsVector2& pivot , 23 | SsVector2 uv1, SsVector2 uv2, 24 | const SsFColor& color ){} 25 | 26 | //後実装 27 | virtual void SetAlphaBlendMode(SsBlendType::_enum type){} 28 | virtual void SetTexture( SsCellValue* cell ){} 29 | 30 | 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Common/Drawer/ssplayer_render_gl.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSPLAYER_RENDER_GL__ 2 | #define __SSPLAYER_RENDER_GL__ 3 | 4 | #include "../Animator/ssplayer_render.h" 5 | 6 | struct SsPartState; 7 | 8 | class SsRenderGL : public ISsRenderer 9 | { 10 | private: 11 | //static bool m_isInit; 12 | 13 | public: 14 | SsRenderGL(){} 15 | virtual ~SsRenderGL(){} 16 | 17 | virtual void initialize(); 18 | virtual void renderSetup(); 19 | virtual void renderPart( SsPartState* state ); 20 | 21 | virtual void renderSpriteSimple( float matrix[16], 22 | int width, int height, 23 | SsVector2& pivot , 24 | SsVector2 uv1, SsVector2 uv2, 25 | const SsFColor& color ); 26 | 27 | virtual void SetAlphaBlendMode(SsBlendType::_enum type); 28 | virtual void SetTexture( SsCellValue* cell ); 29 | 30 | 31 | 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Common/Drawer/ssplayer_shader_gl.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSOPENGLSHADER__ 2 | #define __SSOPENGLSHADER__ 3 | 4 | #include 5 | #include 6 | 7 | #define PUT_UNIFORM_WARNIG (1) 8 | 9 | 10 | class SSOpenGLShader { 11 | public: 12 | GLhandleARB h; 13 | 14 | protected: 15 | std::string myname; 16 | std::string source; 17 | 18 | public: 19 | SSOpenGLShader( const std::string& str, const GLenum shader_type ); 20 | SSOpenGLShader( const std::string& name, const std::string& str, const GLenum shader_type ); 21 | virtual ~SSOpenGLShader(); 22 | virtual int Compile( void ); 23 | inline GLhandleARB GetHandle( void ) const { return h; } 24 | }; 25 | 26 | 27 | class SSOpenGLVertexShader : public SSOpenGLShader 28 | { 29 | public: 30 | SSOpenGLVertexShader( const std::string& str ); 31 | SSOpenGLVertexShader( const std::string& name , const std::string& str ); 32 | virtual ~SSOpenGLVertexShader(){} 33 | 34 | }; 35 | 36 | 37 | class SSOpenGLFragmentShader : public SSOpenGLShader 38 | { 39 | public: 40 | SSOpenGLFragmentShader( const std::string& filename ); 41 | SSOpenGLFragmentShader( const std::string& name , const std::string& str ); 42 | virtual ~SSOpenGLFragmentShader(){} 43 | 44 | }; 45 | 46 | 47 | class SSOpenGLProgramObject { 48 | public: 49 | GLhandleARB h; 50 | 51 | protected: 52 | 53 | public: 54 | SSOpenGLProgramObject( ); 55 | virtual ~SSOpenGLProgramObject( ); 56 | 57 | GLhandleARB GetID(){ return h; } 58 | 59 | virtual void Attach( const SSOpenGLShader *s ); 60 | virtual int Link( void ); 61 | virtual void Use( void ); 62 | 63 | inline void Enable( void ) { Use(); } 64 | void Disable( void ); 65 | GLint GetUniformLocation( const char *name ); 66 | 67 | GLint GetAttribLocation( const char *name ); 68 | }; 69 | 70 | extern SSOpenGLProgramObject* glpgObject; //カレントシェーダーオブジェクチE 71 | 72 | class SSOpenGLShaderMan 73 | { 74 | private: 75 | std::vector m_shader_list; 76 | static SSOpenGLShaderMan* m_Myinst; 77 | public: 78 | SSOpenGLShaderMan(){} 79 | virtual ~SSOpenGLShaderMan(){} 80 | 81 | static SSOpenGLProgramObject* SetCurrent(int index) 82 | { 83 | glpgObject = m_Myinst->m_shader_list[index]; 84 | return glpgObject; 85 | } 86 | 87 | static void Create() 88 | { 89 | if ( m_Myinst == 0) 90 | m_Myinst = new SSOpenGLShaderMan(); 91 | } 92 | 93 | static void Destory() 94 | { 95 | m_Myinst->_Destroy(); 96 | } 97 | 98 | void _Destroy() 99 | { 100 | for ( std::vector::iterator itr = m_shader_list.begin(); 101 | itr != m_shader_list.end() ; itr++ ) 102 | { 103 | delete (*itr); 104 | } 105 | m_Myinst->m_shader_list.clear(); 106 | 107 | if ( m_Myinst != 0) 108 | { 109 | delete m_Myinst; 110 | m_Myinst = 0; 111 | } 112 | } 113 | 114 | static void PushPgObject(SSOpenGLProgramObject *obj) 115 | { 116 | m_Myinst->m_shader_list.push_back(obj); 117 | } 118 | 119 | }; 120 | 121 | 122 | 123 | int SsGL_CheckShaderReady( void ); 124 | extern SSOpenGLShaderMan* glshaderMan; 125 | 126 | 127 | #endif 128 | 129 | -------------------------------------------------------------------------------- /Common/Helper/DebugPrint.cpp: -------------------------------------------------------------------------------- 1 | #include "DebugPrint.h" 2 | #include "stdio.h" 3 | #include 4 | #include 5 | 6 | 7 | #if _WIN32 8 | #include 9 | #endif 10 | 11 | 12 | 13 | void DEBUG_PRINTF( const char* strFormat, ... ) 14 | { 15 | char strBuffer[1024]; 16 | 17 | va_list arglist; 18 | va_start( arglist, strFormat); 19 | #if _WIN32 20 | _vsnprintf(strBuffer, 1024, strFormat, arglist); 21 | va_end(arglist); 22 | OutputDebugStringA(strBuffer); 23 | #else 24 | vsnprintf(strBuffer, 1024, strFormat, arglist); 25 | va_end(arglist); 26 | #endif // MASTER_RELEASE 27 | 28 | std::cerr << strBuffer << "\n"; 29 | 30 | 31 | } 32 | 33 | void THROW_ERROR_MESSAGE_MAIN( std::string str , char* fname , size_t line ) 34 | { 35 | char ___str__buffer[1024]; 36 | sprintf( ___str__buffer , "%s(%d) : %s \n" , fname , line , str.c_str() ); 37 | std::string ___err_message = ___str__buffer; 38 | 39 | DEBUG_PRINTF( ___str__buffer ); 40 | throw ThrowErrorMessage( 0 , ___err_message ); 41 | } 42 | -------------------------------------------------------------------------------- /Common/Helper/DebugPrint.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEBUG_PRINTF__ 2 | #define __DEBUG_PRINTF__ 3 | 4 | #include 5 | 6 | 7 | void DEBUG_PRINTF( const char* strFormat, ... ); 8 | 9 | struct ThrowErrorMessage{ 10 | std::string message; 11 | int error_no; 12 | 13 | ThrowErrorMessage( int no , std::string str ){ error_no = no ; message = str; } 14 | }; 15 | 16 | 17 | #define THROW_ERROR_MESSAGE(str) \ 18 | {\ 19 | THROW_ERROR_MESSAGE_MAIN( str , __FILE__ , __LINE__ );\ 20 | }\ 21 | 22 | void THROW_ERROR_MESSAGE_MAIN( std::string str , char* fname , size_t line ); 23 | 24 | 25 | 26 | #endif -------------------------------------------------------------------------------- /Common/Helper/DirectX/SSTextureDX9.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | #include "stb_image.h" 6 | #include "ssHelper.h" 7 | #include "SSTextureDX9.h" 8 | 9 | #if 0 10 | /* ===================================================================================== 11 | テクスチャファイルの読み込み 12 | ===================================================================================== */ 13 | GLuint LoadTextureGL( const char* Filename ,int& width , int& height) 14 | { 15 | 16 | int bpp; 17 | stbi_uc* image = stbi_load( Filename, &width , &height , &bpp , 0 ); 18 | if ( image == 0 ) return 0; 19 | 20 | int target = GL_TEXTURE_RECTANGLE_ARB; 21 | 22 | if (SsUtTextureisPow2(width) && 23 | SsUtTextureisPow2(height)) 24 | { 25 | target = GL_TEXTURE_2D; 26 | } 27 | 28 | 29 | GLuint glyphTexture = 0; 30 | glGenTextures(1, &glyphTexture); 31 | //glActiveTexture(GL_TEXTURE0); 32 | glBindTexture(target, glyphTexture); 33 | 34 | glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_REPEAT); 35 | glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_REPEAT); 36 | //glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_FALSE); 37 | glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 38 | glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 39 | 40 | if ( bpp == 4 ) 41 | { 42 | glTexImage2D(target, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image); 43 | }else if ( bpp == 3 ) 44 | { 45 | glTexImage2D(target, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, image); 46 | } 47 | stbi_image_free (image); 48 | 49 | return glyphTexture; 50 | } 51 | #endif 52 | 53 | 54 | SSTextureDX9::~SSTextureDX9() 55 | { 56 | //glDeleteTextures( 1 , &tex ); 57 | } 58 | 59 | bool SSTextureDX9::Load( const char* filename ) 60 | { 61 | //tex = LoadTextureGL( fname , tex_width , tex_height ); 62 | //return tex != 0; 63 | 64 | return true; 65 | } 66 | -------------------------------------------------------------------------------- /Common/Helper/DirectX/SSTextureDX9.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSTEXTUREDX9__ 2 | #define __SSTEXTUREDX9__ 3 | 4 | 5 | #include "IsshTexture.h" 6 | 7 | //テクスチャクラス ( DirectX9 ) 8 | class SSTextureDX9 : public ISSTexture 9 | { 10 | public: 11 | int tex_width; 12 | int tex_height; 13 | 14 | public: 15 | SSTextureDX9() : tex_width(0) , tex_height(0){} 16 | virtual ~SSTextureDX9(); 17 | bool Load( const char* filename ); 18 | 19 | virtual int getWidth() { return tex_width; } 20 | virtual int getHeight() { return tex_height; } 21 | 22 | virtual ISSTexture* create(){ return new SSTextureDX9(); } 23 | }; 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Common/Helper/DirectX/d3dsimple.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Helper/DirectX/d3dsimple.cpp -------------------------------------------------------------------------------- /Common/Helper/DirectX/d3dsimple.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Helper/DirectX/d3dsimple.h -------------------------------------------------------------------------------- /Common/Helper/IsshTexture.cpp: -------------------------------------------------------------------------------- 1 | #include "IsshTexture.h" 2 | 3 | ISSTexture* SSTextureFactory::m_texture_base_class = 0; 4 | SSTextureFactory* SSTextureFactory::m_myInst = 0; 5 | 6 | -------------------------------------------------------------------------------- /Common/Helper/IsshTexture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Helper/IsshTexture.h -------------------------------------------------------------------------------- /Common/Helper/MacOS/OSXFileOpen.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSXFileOpen.h 3 | // sssdk 4 | // 5 | // Created by kurooka on 2013/07/18. 6 | // 7 | // 8 | #ifndef __OSXFILEOPEN__ 9 | #define __OSXFILEOPEN__ 10 | 11 | #ifndef _WIN32 12 | 13 | class MacOSXFileOpenDlg 14 | { 15 | private: 16 | char* filepath; 17 | 18 | public: 19 | MacOSXFileOpenDlg() : filepath(0){} 20 | virtual ~MacOSXFileOpenDlg(){} 21 | 22 | bool show(); 23 | 24 | const char* getFilePath() 25 | { 26 | return filepath; 27 | } 28 | }; 29 | 30 | #endif 31 | 32 | //void testOpenDlg(); 33 | #endif -------------------------------------------------------------------------------- /Common/Helper/MacOS/OSXFileOpen.mm: -------------------------------------------------------------------------------- 1 | #ifndef _WIN32 2 | 3 | // 4 | // OSXFileOpen.m 5 | // sssdk 6 | // 7 | // Created by kurooka on 2013/07/18. 8 | // 9 | // 10 | 11 | #import "OSXFileOpen.h" 12 | 13 | 14 | #import 15 | #import 16 | 17 | 18 | extern void GlContexMakeCurrent(); 19 | 20 | bool MacOSXFileOpenDlg::show() 21 | { 22 | NSOpenPanel *openPanel = [NSOpenPanel openPanel]; 23 | NSArray *allowedFileTypes = [NSArray arrayWithObjects:@"sspj",@"'sspj'",nil]; 24 | // NSOpenPanel interface has changed since Mac OSX v10.6. 25 | [openPanel setAllowedFileTypes:allowedFileTypes]; 26 | NSInteger pressedButton = [openPanel runModal]; 27 | 28 | if( pressedButton == NSOKButton ){ 29 | 30 | // get file path 31 | NSURL * filePath = [openPanel URL]; 32 | NSString *urlString = [filePath path]; 33 | // open file here 34 | NSLog(@"file opened '%@'", filePath); 35 | 36 | filepath = (char*)[urlString UTF8String];//形式を変換 37 | GlContexMakeCurrent(); 38 | return true; 39 | }else if( pressedButton == NSCancelButton ){ 40 | NSLog(@"Cancel button was pressed."); 41 | }else{ 42 | // error 43 | } 44 | 45 | GlContexMakeCurrent(); 46 | return false; 47 | } 48 | 49 | 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Common/Helper/OpenGL/SSTextureGL.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifndef _WIN32 5 | #include 6 | #include 7 | #include 8 | #else 9 | #include 10 | #include 11 | #endif 12 | 13 | #include "../stb_image.h" 14 | #include "../ssHelper.h" 15 | #include "SSTextureGL.h" 16 | 17 | 18 | /* ===================================================================================== 19 | テクスチャファイルの読み込み 20 | ===================================================================================== */ 21 | GLuint LoadTextureGL( const char* Filename ,int& width , int& height) 22 | { 23 | 24 | int bpp; 25 | stbi_uc* image = stbi_load( Filename, &width , &height , &bpp , 0 ); 26 | if ( image == 0 ) return 0; 27 | 28 | int target = GL_TEXTURE_RECTANGLE_ARB; 29 | 30 | if (SsUtTextureisPow2(width) && 31 | SsUtTextureisPow2(height)) 32 | { 33 | target = GL_TEXTURE_2D; 34 | } 35 | 36 | 37 | GLuint glyphTexture = 0; 38 | glGenTextures(1, &glyphTexture); 39 | glBindTexture(target, glyphTexture); 40 | 41 | glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL ); 42 | glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_REPEAT); 43 | glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_REPEAT); 44 | glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 45 | glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 46 | 47 | if ( bpp == 4 ) 48 | { 49 | stbi_uc *ip = image; 50 | for ( int i = 0 ; i < width * height ; i++ ) 51 | { 52 | stbi_uc* r = ip; ip ++; 53 | stbi_uc* g = ip; ip ++; 54 | stbi_uc* b = ip; ip ++; 55 | stbi_uc* a = ip; ip ++; 56 | // if ( *a == 0 ) 57 | { 58 | //*r = *g = *b = 0xff; 59 | int _a = *a; 60 | int _r = *r; 61 | int _g = *g; 62 | int _b = *b; 63 | *r = ( _r * _a) >> 8 ; 64 | *g = ( _g * _a) >> 8 ; 65 | *b = ( _b * _a) >> 8 ; 66 | } 67 | } 68 | glTexImage2D(target, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image); 69 | }else if ( bpp == 3 ) 70 | { 71 | glTexImage2D(target, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, image); 72 | } 73 | stbi_image_free (image); 74 | 75 | return glyphTexture; 76 | } 77 | 78 | 79 | 80 | SSTextureGL::~SSTextureGL() 81 | { 82 | glDeleteTextures( 1 , &tex ); 83 | } 84 | 85 | bool SSTextureGL::Load( const char* fname ) 86 | { 87 | //int tex_width; 88 | //int tex_height; 89 | 90 | tex = LoadTextureGL( fname , tex_width , tex_height ); 91 | return tex != 0; 92 | } 93 | -------------------------------------------------------------------------------- /Common/Helper/OpenGL/SSTextureGL.h: -------------------------------------------------------------------------------- 1 | #ifndef __TKTEXTURE__ 2 | #define __TKTEXTURE__ 3 | 4 | #include 5 | #include "../IsshTexture.h" 6 | 7 | 8 | class SSTextureGL : public ISSTexture 9 | { 10 | public: 11 | GLuint tex; 12 | int tex_width; 13 | int tex_height; 14 | 15 | public: 16 | SSTextureGL() : tex_width(0) , tex_height(0) , tex(0){} 17 | virtual ~SSTextureGL(); 18 | bool Load( const char* fname ); 19 | 20 | virtual int getWidth() { return tex_width; } 21 | virtual int getHeight() { return tex_height; } 22 | 23 | virtual ISSTexture* create(){ return new SSTextureGL(); } 24 | 25 | }; 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Common/Helper/Win/WinMain.cpp: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | 4 | 5 | 6 | extern int main(void); 7 | HINSTANCE g_hInstance; 8 | 9 | int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE hPrevInst, 10 | LPSTR lpszArgs, int nWinMode) 11 | { 12 | 13 | 14 | g_hInstance = hThisInst; 15 | return main(); 16 | 17 | } 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Common/Helper/XPFileOpenDlg.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Windows / OSX 共通で呼び出せるファイル選択ダイアログライブラリ 3 | // 4 | // 5 | // XPFileOpenDlg.cpp 6 | // sssdk 7 | // 8 | // Created by kurooka on 2013/07/18. 9 | // 10 | // 11 | #include "MacOS/OSXFileOpen.h" 12 | #include "XPFileOpenDlg.h" 13 | 14 | #ifdef _WIN32 15 | //コモンダイアログを使うため 16 | #include 17 | #include 18 | #include 19 | #include 20 | #endif 21 | 22 | #include "string" 23 | 24 | bool XPFileOpenDlg::Show() 25 | { 26 | #ifdef _WIN32 27 | static OPENFILENAME ofn; 28 | static TCHAR filename_full[MAX_PATH]; // ファイル名(フルパス)を受け取る領域 29 | static TCHAR filename[MAX_PATH]; // ファイル名を受け取る領域 30 | 31 | // 構造体に情報をセット 32 | ZeroMemory( &ofn, sizeof(ofn) ); // 最初にゼロクリアしておく 33 | ofn.lStructSize = sizeof(ofn); // 構造体のサイズ 34 | ofn.hwndOwner = 0; // コモンダイアログの親ウィンドウハンドル 35 | ofn.lpstrFilter = _T("sspj(*.sspj)\0*.sspj\0All files(*.*)\0*.*\0\0"); // ファイルの種類 36 | ofn.lpstrFile = filename_full; // 選択されたファイル名(フルパス)を受け取る変数のアドレス 37 | ofn.lpstrFileTitle = filename; // 選択されたファイル名を受け取る変数のアドレス 38 | ofn.nMaxFile = sizeof(filename_full); // lpstrFileに指定した変数のサイズ 39 | ofn.nMaxFileTitle = sizeof(filename); // lpstrFileTitleに指定した変数のサイズ 40 | ofn.Flags = OFN_FILEMUSTEXIST; // フラグ指定 41 | ofn.lpstrTitle = _T("ファイルを開く"); // コモンダイアログのキャプション 42 | ofn.lpstrDefExt = _T("sspj"); // デフォルトのファイルの種類 43 | 44 | // ファイルを開くコモンダイアログを作成 45 | if( !GetOpenFileName( &ofn ) ) 46 | { 47 | }else{ 48 | //マルチバイト変換 (ユニコードの場合失敗する) 49 | size_t nLen; 50 | 51 | nLen = ::_tcslen(filename_full) + 1; 52 | pszChar = new char[nLen]; 53 | if(pszChar) 54 | ::strcpy_s(pszChar,nLen * sizeof(char),filename_full); 55 | 56 | return true; 57 | } 58 | 59 | #else 60 | MacOSXFileOpenDlg dlg; 61 | if ( dlg.show() ) 62 | { 63 | //pszCharへの実装をする 64 | pszChar = new char[2048]; 65 | strcpy( pszChar , dlg.getFilePath() ); 66 | return true; 67 | } 68 | #endif 69 | 70 | return false; 71 | } 72 | -------------------------------------------------------------------------------- /Common/Helper/XPFileOpenDlg.h: -------------------------------------------------------------------------------- 1 | // 2 | // Windows / OSX 共通で呼び出せるファイル選択ダイアログライブラリ 3 | // 4 | // XPFileOpenDlg.h 5 | // sssdk 6 | // 7 | // Created by kurooka on 2013/07/18. 8 | // 9 | // 10 | 11 | #ifndef __XP_FILEOPENDLG__ 12 | #define __XP_FILEOPENDLG__ 13 | 14 | class XPFileOpenDlg { 15 | private: 16 | char* pszChar; 17 | public: 18 | XPFileOpenDlg() : pszChar(0) {} 19 | virtual ~XPFileOpenDlg() 20 | { 21 | if ( pszChar ) 22 | delete [] pszChar; 23 | } 24 | bool Show(); 25 | 26 | const char* getFilePath(){ return pszChar;} 27 | 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Common/Helper/ssHelper.h: -------------------------------------------------------------------------------- 1 | #ifndef __GLHELPER__ 2 | #define __GLHELPER__ 3 | 4 | #include "../loader/ssloader.h" 5 | 6 | 7 | #include "sshObject.h" 8 | #include "sshTask.h" 9 | #include "sshScene.h" 10 | #include "IsshTexture.h" 11 | 12 | #include "XPFileOpenDlg.h" 13 | #include "DebugPrint.h" 14 | 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Common/Helper/sshObject.cpp: -------------------------------------------------------------------------------- 1 | #include "sshObject.h" 2 | 3 | -------------------------------------------------------------------------------- /Common/Helper/sshObject.h: -------------------------------------------------------------------------------- 1 | #ifndef __TKOBJECT__ 2 | #define __TKOBJECT__ 3 | 4 | #include "sshTask.h" 5 | 6 | 7 | class tkObject : public task_base{ 8 | public: 9 | tkObject(){} 10 | virtual ~ tkObject(){} 11 | }; 12 | 13 | 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Common/Helper/sshScene.cpp: -------------------------------------------------------------------------------- 1 | #include "sshScene.h" 2 | -------------------------------------------------------------------------------- /Common/Helper/sshScene.h: -------------------------------------------------------------------------------- 1 | #ifndef __TKSCENE__ 2 | #define __TKSCENE__ 3 | 4 | 5 | #include "sshObject.h" 6 | 7 | ///シーングラフを構築するためのクラス 8 | ///色々オミットする シーンを既定できればOK 9 | class tkScene : public tkObject 10 | { 11 | public: 12 | tkScene(){} 13 | virtual ~tkScene(){} 14 | 15 | virtual void draw(){}; 16 | virtual void update(double delta){}; 17 | virtual void init(){}; 18 | }; 19 | 20 | 21 | 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /Common/Helper/sshTask.cpp: -------------------------------------------------------------------------------- 1 | //#include "stdafx.h" 2 | #include "sshTask.h" 3 | //#include "Debug.h" 4 | 5 | task_manager_singleton* task_manager_singleton::g_myinst = 0; 6 | unsigned long treeitem_uid::m_tree_item_uid = 0; 7 | 8 | 9 | task_manager::task_manager() 10 | :m_root(0) , m_priority_max(0) 11 | { 12 | m_root = new task_base(); 13 | m_root->setIdentify( "task_root" ); 14 | } 15 | 16 | task_manager::~task_manager() 17 | { 18 | destroy_tasks(); 19 | } 20 | 21 | void task_manager::destroy_tasks() 22 | { 23 | // get_root()->destroy(); 24 | delete(m_root); 25 | m_root = 0; 26 | } 27 | 28 | 29 | void task_manager::unresist_task( task_base *parent , task_base* unreg_task) 30 | { 31 | parent->prependtask( unreg_task ); 32 | } 33 | 34 | 35 | void task_manager::resist_task( task_base *parent , task_base* reg_task) 36 | { 37 | task_base* _parent = parent; 38 | if ( _parent == 0 ) 39 | { 40 | _parent = get_root(); 41 | } 42 | 43 | if ( _parent ) 44 | { 45 | reg_task->init(); 46 | _parent->appendchild(reg_task); 47 | } 48 | } 49 | 50 | 51 | void task_manager::draw_resist_tasks_sub(task_base* task) 52 | { 53 | 54 | if ( !task->isdrawpause() ) 55 | { 56 | // task->exec_drawfunc( priority ); 57 | task->draw(); 58 | 59 | if ( task->get_child() ) 60 | { 61 | draw_resist_tasks_sub( task->get_child() ); 62 | } 63 | } 64 | if ( task->get_sibling() ) 65 | { 66 | draw_resist_tasks_sub( task->get_sibling() ); 67 | } 68 | 69 | } 70 | 71 | 72 | void task_manager::draw_resist_tasks() 73 | { 74 | task_base* ptr = get_root(); 75 | 76 | draw_resist_tasks_sub(ptr); 77 | } 78 | 79 | void task_manager::exec_resist_tasks_sub(task_base* task,double delta_time) 80 | { 81 | 82 | if ( !task->ispause() ) 83 | { 84 | task->update(delta_time); 85 | 86 | if ( task->get_child() ) 87 | { 88 | exec_resist_tasks_sub( task->get_child(),delta_time ); 89 | } 90 | } 91 | if ( task->get_sibling() ) 92 | { 93 | exec_resist_tasks_sub( task->get_sibling(),delta_time ); 94 | } 95 | } 96 | 97 | 98 | void task_manager::exec_resist_tasks(double delta_time) 99 | { 100 | 101 | task_base* ptr = get_root(); 102 | exec_resist_tasks_sub(ptr,delta_time); 103 | 104 | } 105 | 106 | /* 107 | void task_manager::debug_print_tasks_sub(task_base* task , int t ) 108 | { 109 | 110 | for ( int i = 0 ; i < t ; i++ ) CommonLib::DEBUG_PRINTF( "\t" ); 111 | CommonLib::DEBUG_PRINTF( "%s\n" , task->getIdentify() ); 112 | 113 | if ( task->get_child() ) 114 | { 115 | debug_print_tasks_sub( task->get_child() , t+1); 116 | } 117 | if ( task->get_sibling() ) 118 | { 119 | debug_print_tasks_sub( task->get_sibling() , t ); 120 | } 121 | } 122 | 123 | void task_manager::debug_print_tasks() 124 | { 125 | debug_print_tasks_sub( get_root() , 0 ); 126 | } 127 | 128 | */ 129 | 130 | 131 | -------------------------------------------------------------------------------- /Common/Helper/sshTextureBMP.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "stb_image.h" 5 | #include "ssHelper.h" 6 | #include "sshTextureBMP.h" 7 | 8 | 9 | 10 | 11 | 12 | bool SSTextureBMP::Load( const char* fname ) 13 | { 14 | int bpp; 15 | 16 | m_filename = ""; 17 | 18 | stbi_uc* image = stbi_load( fname, &tex_width , &tex_height , &bpp , 0 ); 19 | if ( image == 0 ) 20 | { 21 | const char* msg = stbi_failure_reason(); 22 | std::cerr << fname << " err:" << msg << "\n"; 23 | return false; 24 | } 25 | 26 | m_filename = fname; 27 | 28 | stbi_image_free (image); 29 | return true; 30 | } 31 | -------------------------------------------------------------------------------- /Common/Helper/sshTextureBMP.h: -------------------------------------------------------------------------------- 1 | #ifndef __TKTEXTURE__ 2 | #define __TKTEXTURE__ 3 | 4 | #include "IsshTexture.h" 5 | 6 | 7 | 8 | //画像ファイルの縦横サイズを調べる目的等で使用する 9 | //画像ファイルデータは読み捨てる クラス名が適切でないかも 10 | //画像の加工等を行う場合は拡張をお願いします。 11 | class SSTextureBMP : public ISSTexture 12 | { 13 | public: 14 | int tex_width; 15 | int tex_height; 16 | 17 | std::string m_filename; 18 | 19 | public: 20 | SSTextureBMP() : tex_width(0) , tex_height(0) , m_filename(""){} 21 | virtual ~SSTextureBMP(){} 22 | bool Load( const char* fname ); 23 | 24 | virtual int getWidth() { return tex_width; } 25 | virtual int getHeight() { return tex_height; } 26 | 27 | virtual ISSTexture* create(){ return new SSTextureBMP(); } 28 | virtual const char* getFilename(){ return m_filename.c_str(); } 29 | }; 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Common/Loader/SsEffectBehavior.cpp: -------------------------------------------------------------------------------- 1 | #include "SsEffectBehavior.h" 2 | 3 | 4 | 5 | 6 | SsEffectElementBase* SsEffectBehavior::Factory(const char* name , XMLElement* e ) 7 | { 8 | SsEffectElementBase * ret = 0; 9 | 10 | if ( strcmp( name , "Basic" ) == 0 ) ret = new ParticleElementBasic(); 11 | if ( strcmp( name , "OverWriteSeed" ) == 0 ) ret = new ParticleElementRndSeedChange(); 12 | if ( strcmp( name , "Delay" ) == 0 ) ret = new ParticleElementDelay(); 13 | if ( strcmp( name , "Gravity" ) == 0 ) ret = new ParticleElementGravity(); 14 | if ( strcmp( name , "init_position" ) == 0 ) ret = new ParticleElementPosition(); 15 | // if ( strcmp( name , "trans_position" ) == 0 ) ret = new ParticleElementTransPosition(); 16 | if ( strcmp( name , "init_rotation" ) == 0 ) ret = new ParticleElementRotation(); 17 | if ( strcmp( name , "trans_rotation" ) == 0 ) ret = new ParticleElementRotationTrans(); 18 | if ( strcmp( name , "trans_speed" ) == 0 ) ret = new ParticleElementTransSpeed(); 19 | if ( strcmp( name , "add_tangentiala" ) == 0 ) ret = new ParticleElementTangentialAcceleration(); 20 | if ( strcmp( name , "init_vertexcolor" ) == 0 ) ret = new ParticleElementInitColor(); 21 | if ( strcmp( name , "trans_vertexcolor" ) == 0 ) ret = new ParticleElementTransColor(); 22 | if ( strcmp( name , "trans_colorfade" ) == 0 ) ret = new ParticleElementAlphaFade(); 23 | if ( strcmp( name , "init_size" ) == 0 ) ret = new ParticleElementSize(); 24 | if ( strcmp( name , "trans_size" ) == 0 ) ret = new ParticleElementTransSize(); 25 | if ( strcmp( name , "add_pointgravity" ) == 0 ) ret = new ParticlePointGravity(); 26 | if ( strcmp( name , "TurnToDirection" ) == 0 ) ret = new ParticleTurnToDirectionEnabled(); 27 | if ( strcmp( name , "InfiniteEmit" ) == 0 ) ret = new ParticleInfiniteEmitEnabled(); 28 | 29 | if ( ret ) 30 | { 31 | SsXmlIArchiver _ar(e); 32 | ret->__Serialize( &_ar ); 33 | } 34 | 35 | return ret; 36 | } 37 | 38 | 39 | void SsEffectBehavior::EffectElementLoader(ISsXmlArchiver* ar) 40 | { 41 | SsXmlIArchiver list_ar( ar , "list" ); 42 | 43 | XMLElement* e = list_ar.getxml()->FirstChildElement(); 44 | 45 | while( e ) 46 | { 47 | const char* value = e->Attribute( "name" ); 48 | 49 | SsEffectElementBase* v = Factory( value , e ); 50 | 51 | if ( v ) 52 | { 53 | plist.push_back(v); 54 | } 55 | e = e->NextSiblingElement(); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /Common/Loader/SsEffectBehavior.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSEFFECTBEHAVIOR__ 2 | #define __SSEFFECTBEHAVIOR__ 3 | 4 | #include "SsEffectElement.h" 5 | #include "sstypes.h" 6 | #include "ssvalue.h" 7 | 8 | class SsEffectElementBase; 9 | class SsEffectRenderer; 10 | 11 | class SsEffectBehavior 12 | { 13 | public: 14 | std::vector plist; 15 | 16 | public: 17 | SsCell* refCell; 18 | SsString CellName; 19 | SsString CellMapName; 20 | SsRenderBlendType::_enum BlendType; 21 | 22 | public: 23 | SsEffectBehavior() : refCell(0),BlendType(SsRenderBlendType::invalid) {} 24 | virtual ~SsEffectBehavior(){} 25 | 26 | SSSERIALIZE_BLOCK 27 | { 28 | SSAR_DECLARE(CellName); 29 | SSAR_DECLARE(CellMapName); 30 | SSAR_DECLARE_ENUM( BlendType ); 31 | 32 | if ( ar->getxml() ) 33 | EffectElementLoader( ar ); 34 | } 35 | 36 | SsEffectElementBase* Factory(const char* name , XMLElement* e ); 37 | 38 | void EffectElementLoader(ISsXmlArchiver* ar); 39 | void setup(); 40 | /* 41 | //エフェクトデータのセットアップ 42 | void initalize( SsEffectRenderEmitter* emmiter){} 43 | void updateEmmiter(SsEffectRenderEmitter* emmiter){} 44 | void initializeParticle( SsEffectRenderEmitter* e , SsEffectRenderParticle* particle ){} 45 | void updateParticle( SsEffectRenderEmitter* e , SsEffectRenderParticle* particle ){} 46 | */ 47 | 48 | 49 | }; 50 | 51 | 52 | 53 | 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Common/Loader/SsEffectElement.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "ssloader.h" 5 | 6 | 7 | //loaderのモジュールでレンダラー側のモジュールを参照しているのが筋が良く無い 8 | 9 | #include "SsEffectElement.h" 10 | #include "ssplayer_animedecode.h" 11 | #include "ssplayer_effect.h" 12 | #include "ssplayer_macro.h" 13 | #include "ssplayer_matrix.h" 14 | #include "ssplayer_render.h" 15 | #include "ssplayer_effectfunction.h" 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Common/Loader/babel/babel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Loader/babel/babel.cpp -------------------------------------------------------------------------------- /Common/Loader/babel/babel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Loader/babel/babel.h -------------------------------------------------------------------------------- /Common/Loader/babel/scoremap.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Common/Loader/babel/scoremap.csv -------------------------------------------------------------------------------- /Common/Loader/ssInterpolation.cpp: -------------------------------------------------------------------------------- 1 | #include "ssloader.h" 2 | #include "ssInterpolation.h" 3 | 4 | 5 | 6 | //--------------------------------------------------------------------------- 7 | /** 8 | 等速運動 9 | */ 10 | //--------------------------------------------------------------------------- 11 | static float // nowにおける補間された値 12 | linear_( 13 | float start, // 始点 14 | float end, // 終点 15 | float now) // 現在の時間 0.f~1.f 16 | { 17 | return start + (now * (end - start)); 18 | } 19 | 20 | //--------------------------------------------------------------------------- 21 | /** 22 | 加速運動 23 | */ 24 | //--------------------------------------------------------------------------- 25 | static float // nowにおける補間された値 26 | accelerating_( 27 | float start, // 始点 28 | float end, // 終点 29 | float now) // 現在の時間 0.f~1.f 30 | { 31 | float rate = now * now; 32 | return start + (rate * (end - start)); 33 | } 34 | 35 | //--------------------------------------------------------------------------- 36 | /** 37 | 減速運動 38 | */ 39 | //--------------------------------------------------------------------------- 40 | static float // nowにおける補間された値 41 | decelerating_( 42 | float start, // 始点 43 | float end, // 終点 44 | float now) // 現在の時間 0.f~1.f 45 | { 46 | float time = 1 - now; 47 | float rate = 1 - time * time; 48 | return start + (rate * (end - start)); 49 | } 50 | 51 | 52 | static float bezier_(float start, float end, float time, const SsCurve * c) 53 | { 54 | //値が変化しない場合は左キーを補間値とする 55 | if ((start == end) && (c->startValue == 0.0f) && (c->endValue == 0.0f)) 56 | { 57 | return start; 58 | } 59 | 60 | 61 | float fCurrentPos = (c->endKeyTime - c->startKeyTime) * time + c->startKeyTime; 62 | 63 | float fRet = end; 64 | float fCurrentCalc = 0.5f; 65 | float fCalcRange = 0.5f; 66 | 67 | float fTemp1; 68 | float fTemp2; 69 | float fTemp3; 70 | 71 | float fCurrentX; 72 | 73 | for(int iLoop = 0; iLoop < 8; iLoop++ ) 74 | {// more count of loop, better precision increase 75 | fTemp1 = 1.0f - fCurrentCalc; 76 | fTemp2 = fTemp1 * fTemp1; 77 | fTemp3 = fTemp2 * fTemp1; 78 | fCurrentX = ( fTemp3 * c->startKeyTime ) + 79 | ( 3 * fTemp2 * fCurrentCalc * (c->startTime + c->startKeyTime) ) + 80 | ( 3 * fTemp1 * fCurrentCalc * fCurrentCalc * (c->endTime + c->endKeyTime) ) + 81 | ( fCurrentCalc * fCurrentCalc * fCurrentCalc * c->endKeyTime); 82 | 83 | fCalcRange /= 2.0f; 84 | if( fCurrentX > fCurrentPos ) 85 | { 86 | fCurrentCalc -= fCalcRange; 87 | } 88 | else 89 | { 90 | fCurrentCalc += fCalcRange; 91 | } 92 | } 93 | 94 | // finally calculate with current value 95 | fTemp1 = 1.0f - fCurrentCalc; 96 | fTemp2 = fTemp1 * fTemp1; 97 | fTemp3 = fTemp2 * fTemp1; 98 | fRet = ( fTemp3 * start ) + 99 | ( 3 * fTemp2 * fCurrentCalc * (c->startValue + start) ) + 100 | ( 3 * fTemp1 * fCurrentCalc * fCurrentCalc * (c->endValue + end) ) + 101 | ( fCurrentCalc * fCurrentCalc * fCurrentCalc * end ); 102 | 103 | return fRet; 104 | } 105 | 106 | /** 107 | エルミートでは c->startTime, c->endTime は必要ない 108 | 109 | スロープ値を事前計算しておけばカーブ計算用パラメータは1つになる 110 | が、ベジェと共用するためこのままの形にしておく。 111 | */ 112 | static float hermite_(float start, float end, float time, const SsCurve * c) 113 | { 114 | float t2 = time * time; 115 | float t3 = t2 * time; 116 | float result = 117 | (2 * t3 - 3 * t2 + 1) * start + 118 | (-2 * t3 + 3 * t2) * end + 119 | (t3 - 2 * t2 + time) * (c->startValue - start) + 120 | (t3 - t2) * (c->endValue - end); 121 | return result; 122 | } 123 | 124 | //---------------------------------------------------------------------------- 125 | /** 126 | タイプを指定して補間する 127 | */ 128 | //---------------------------------------------------------------------------- 129 | float SsInterpolate(SsInterpolationType::_enum type, float time, float start, float end, const SsCurve * curve) 130 | { 131 | float r; 132 | switch (type) 133 | { 134 | case SsInterpolationType::none: 135 | r = start; 136 | break; 137 | case SsInterpolationType::linear: 138 | r = linear_(start, end, time); 139 | break; 140 | case SsInterpolationType::acceleration: 141 | r = accelerating_(start, end, time); 142 | break; 143 | case SsInterpolationType::deceleration: 144 | r = decelerating_(start, end, time); 145 | break; 146 | case SsInterpolationType::bezier: 147 | r = bezier_(start, end, time, curve); 148 | break; 149 | case SsInterpolationType::hermite: 150 | r = hermite_(start, end, time, curve); 151 | break; 152 | default: 153 | //SS_ASSERT_ID(type); 154 | break; 155 | } 156 | return r; 157 | } 158 | -------------------------------------------------------------------------------- /Common/Loader/ssInterpolation.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSINTERPOLATION__ 2 | #define __SSINTERPOLATION__ 3 | 4 | 5 | class SsCurve; 6 | 7 | ///補間でカーブパラメータが必要なタイプか判定する 8 | inline bool SsNeedsCurveParams(SsInterpolationType::_enum type) 9 | { 10 | switch (type) 11 | { 12 | case SsInterpolationType::bezier: 13 | case SsInterpolationType::hermite: 14 | return true; 15 | } 16 | return false; 17 | } 18 | 19 | ///カーブパラメータ、補完方法により保管された値を生成する 20 | float SsInterpolate(SsInterpolationType::_enum type, float time, float start, float end, const SsCurve * curve); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Common/Loader/ssarchiver.cpp: -------------------------------------------------------------------------------- 1 | #include "ssarchiver.h" 2 | #include "ssstring_uty.h" 3 | 4 | bool SsXmlIArchiver::dc_attr( const char* name , SsString& member ) 5 | { 6 | AR_SELF_CHECK(); 7 | const char* v = 0; 8 | 9 | v = getxml()->Attribute( name ); 10 | if ( v != 0 ) member= v; 11 | 12 | 13 | return true; 14 | } 15 | bool SsXmlIArchiver::dc_attr( const char* name , int& member ) 16 | { 17 | AR_SELF_CHECK(); 18 | 19 | const char* v = getxml()->Attribute( name ); 20 | 21 | member = atoi(v); 22 | 23 | return true; 24 | } 25 | 26 | bool SsXmlIArchiver::dc( const char* name , int& member ) 27 | { 28 | 29 | AR_SELF_CHECK(); 30 | SsString str; 31 | dc( name , str ); 32 | member = atoi( str.c_str() ); 33 | 34 | return true; 35 | } 36 | 37 | bool SsXmlIArchiver::dc( const char* name , float& member ) 38 | { 39 | AR_SELF_CHECK(); 40 | SsString str; 41 | dc( name , str ); 42 | member = (float)atof( str.c_str() ); 43 | 44 | return true; 45 | } 46 | 47 | bool SsXmlIArchiver::dc( const char* name , SsString& member ) 48 | { 49 | AR_SELF_CHECK(); 50 | XMLElement* e = getxml()->FirstChildElement( name ); 51 | if ( e ) 52 | { 53 | if ( e->GetText() ) 54 | { 55 | //Winではsjisへ変換する 56 | member = babel::utf8_to_sjis( e->GetText() ); 57 | }else{ 58 | member =""; 59 | } 60 | return true; 61 | } 62 | return false; 63 | } 64 | 65 | bool SsXmlIArchiver::dc( const char* name , bool& member ) 66 | { 67 | AR_SELF_CHECK(); 68 | member = false; 69 | XMLElement* e = getxml()->FirstChildElement( name ); 70 | if ( e ) 71 | { 72 | int ret = GetTextToInt( e , 0 ); 73 | if ( ret == 1)member = true; 74 | return true; 75 | } 76 | 77 | return false; 78 | } 79 | 80 | bool SsXmlIArchiver::dc( const char* name , std::vector& list ) 81 | { 82 | AR_SELF_CHECK(); 83 | list.clear(); 84 | XMLElement* e = getxml()->FirstChildElement( name ); 85 | if (e==0)return false; 86 | e = e->FirstChildElement( "value" ); 87 | while( e ) 88 | { 89 | const char* txt = e->GetText(); 90 | //Winではsjisへ変換する 91 | std::string sjis_str = babel::utf8_to_sjis( txt ); 92 | 93 | list.push_back( sjis_str ); 94 | e = e->NextSiblingElement(); 95 | } 96 | 97 | return true; 98 | } 99 | 100 | bool SsXmlIArchiver::dc( const char* name , SsPoint2& member ) 101 | { 102 | AR_SELF_CHECK(); 103 | 104 | XMLElement* e = getxml()->FirstChildElement( name ); 105 | 106 | if ( e ) 107 | { 108 | std::string str = e->GetText(); 109 | return StringToPoint2( str , member ); 110 | 111 | } 112 | return false; 113 | 114 | } 115 | 116 | bool SsXmlIArchiver::dc( const char* name , SsCurve& member ) 117 | { 118 | AR_SELF_CHECK(); 119 | 120 | XMLElement* e = getxml()->FirstChildElement( name ); 121 | 122 | if ( e ) 123 | { 124 | std::vector str_list; 125 | split_string( e->GetText() , ' ' , str_list ); 126 | if ( str_list.size() < 4 ) 127 | { 128 | return false; 129 | }else{ 130 | member.startTime = (float)atof( str_list[0].c_str() ); 131 | member.startValue = (float)atof( str_list[1].c_str() ); 132 | member.endTime = (float)atof( str_list[2].c_str() ); 133 | member.endValue = (float)atof( str_list[3].c_str() ); 134 | 135 | return true; 136 | } 137 | } 138 | return false; 139 | } 140 | 141 | 142 | bool StringToPoint2( const std::string& str , SsPoint2& point ) 143 | { 144 | std::vector str_list; 145 | split_string( str , ' ' , str_list ); 146 | if ( str_list.size() < 2 ) 147 | { 148 | point.x = 0; 149 | point.y = 0; 150 | return false; 151 | }else{ 152 | point.x = (float)atof( str_list[0].c_str() ); 153 | point.y = (float)atof( str_list[1].c_str() ); 154 | } 155 | 156 | return true; 157 | } 158 | 159 | 160 | bool StringToIRect( const std::string& str , SsIRect& rect ) 161 | { 162 | std::vector str_list; 163 | split_string( str , ' ' , str_list ); 164 | if ( str_list.size() < 4 ) 165 | { 166 | rect.x = 0; 167 | rect.y = 0; 168 | rect.w = 0; 169 | rect.h = 0; 170 | return false; 171 | }else{ 172 | rect.x = (int)atof( str_list[0].c_str() ); 173 | rect.y = (int)atof( str_list[1].c_str() ); 174 | rect.w = (int)atof( str_list[2].c_str() ); 175 | rect.h = (int)atof( str_list[3].c_str() ); 176 | } 177 | 178 | return true; 179 | } 180 | 181 | 182 | void SsArchiverInit() 183 | { 184 | babel::init_babel(); 185 | 186 | } 187 | -------------------------------------------------------------------------------- /Common/Loader/ssattribute.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSATRIBUTE__ 2 | #define __SSATRIBUTE__ 3 | 4 | #include "sstypes.h" 5 | #include "ssvalue.h" 6 | #include "ssInterpolation.h" 7 | #include 8 | #include 9 | 10 | 11 | 12 | 13 | 14 | //アニメーション中のキーフレームの内容を表現するクラス 15 | class SsKeyframe 16 | { 17 | public: 18 | int time; ///< 時間 19 | SsInterpolationType::_enum ipType; ///< 補間タイプ 20 | SsCurve curve; ///< 曲線補間計算用パラメータ 21 | SsValue value; ///< 値 22 | public: 23 | SsKeyframe() : 24 | ipType(SsInterpolationType::invalid) , 25 | time(0) 26 | {} 27 | virtual ~SsKeyframe(){} 28 | 29 | SSSERIALIZE_BLOCK 30 | { 31 | SSAR_DECLARE_ATTRIBUTE( time ); 32 | SSAR_DECLARE_ATTRIBUTE_ENUM( ipType ); 33 | 34 | if ( SsNeedsCurveParams(ipType) ) 35 | { 36 | SSAR_DECLARE( curve ); 37 | } 38 | 39 | SsValueSeriarizer( ar , value ); 40 | 41 | } 42 | }; 43 | 44 | typedef std::vector AttributeKeyList; 45 | typedef std::map AttributeKeyDic; 46 | 47 | 48 | //タグ毎に存在するキーフレームを格納するクラス 49 | class SsAttribute //Tag毎に存在する 50 | { 51 | 52 | public: 53 | //キーフレームデータ : Value(タグによって異なるの組み) 54 | SsAttributeKind::_enum tag; 55 | AttributeKeyList key; 56 | 57 | AttributeKeyDic key_dic; 58 | 59 | public: 60 | SsAttribute(){} 61 | virtual ~SsAttribute(){ 62 | for ( AttributeKeyList::iterator itr = key.begin() ; 63 | itr != key.end() ; itr ++ ) delete (*itr); 64 | } 65 | 66 | 67 | SSSERIALIZE_BLOCK 68 | { 69 | SSAR_DECLARE_ATTRIBUTE_ENUM( tag ); 70 | SSAR_DECLARE_LISTEX( key , "" ); 71 | 72 | key_dic.clear(); 73 | for ( AttributeKeyList::iterator itr = key.begin() ; itr != key.end() ; itr++) 74 | { 75 | int time = (*itr)->time; 76 | SsKeyframe* key = (*itr); 77 | key_dic[time] = key; 78 | } 79 | } 80 | 81 | bool isEmpty() 82 | { 83 | return key.empty(); 84 | } 85 | 86 | const SsKeyframe* firstKey(); 87 | 88 | ///時間から左側のキーを取得 89 | const SsKeyframe* findLeftKey( int time ); 90 | 91 | //時間から右側のキーを取得する 92 | const SsKeyframe* findRightKey( int time ); 93 | 94 | 95 | }; 96 | 97 | 98 | void GetSsColorValue( const SsKeyframe* key , SsColorAnime& v ); 99 | void GetSsVertexAnime( const SsKeyframe* key , SsVertexAnime& v ); 100 | void GetSsRefCell( const SsKeyframe* key , SsRefCell& v ); 101 | void GetSsUserDataAnime( const SsKeyframe* key , SsUserDataAnime& v ); 102 | void GetSsInstparamAnime( const SsKeyframe* key , SsInstanceAttr& v ); 103 | void GetSsEffectParamAnime( const SsKeyframe* key , SsEffectAttr& v ); 104 | 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /Common/Loader/ssloader.h: -------------------------------------------------------------------------------- 1 | /*! \mainpage 2 | * 3 | * \section 初めに 4 | * 5 | * このドキュメントはOPTPiX SpriteStudioのデータを取り扱うためのC++ライブラリのドキュメントです。
6 | * また、SpriteStudioから排出されるXMLデータの構造を記載するドキュメントとなります。 7 | * 8 | * \section 本SDKの構成について 9 | * 本SDKは、下記のライブラリが含まれております。
10 | * ・OPTPiX SpriteStudioのネイティブのファイルフォーマットである、sspj、ssae、ssceの読み込み用ライブラリ
11 | * ・読み込んだデータの描画再生サンプル(簡易ビューア―)
12 | * 13 | * \section SpriteStudioのXMLデータ構造について 14 | * 15 | * 基本的にsssdkのクラス名、メンバー名はXML内ドキュメントのタグと一致しております。\n 16 | * そのためXML内のタグの意味を知りたい場合、このドキュメントのクラスのメンバー、又は列挙型のドキュメントを参照下さい。\n 17 | * \n 18 | * OPTPiX SpriteStuidoで作成されるファイル形式はsspj、ssae、ssceの三種類となります。 19 | * 旧形式のssaxにつきましては、別途あるssaxのドキュメントを参照下さい。 20 | * (SpriteStudioのユーザーサポートページにございます。) 21 | * 22 | * \section sspjファイルについて 23 | * \n 24 | * sspjは、SpriteStudioのプロジェクトファイルです。 25 | * このファイルには、プロジェクトに格納されているアニメーション、テクスチャ、セルマップの参照先の記載、 26 | * 参照ファイル名の格納が行われています。 27 | * \n 28 | * \section ssaeファイルについて 29 | * ssaeファイルは、アニメーションデータのパーツの内容とその組み合わせを記述した「Model」部と「Model」を使用してキーフレームアニメーションを記載したAnimation部で構成されています。\n 30 | * Model部はXMLドキュメント中ので定義され、Animation部はXMLドキュメント中の以下で定義されます。\n 31 | * のブロックには、が複数格納される場合があります。(同一のModelでアニメーションを作成している場合)\n 32 | * \n 33 | *
 34 |  *	
 35 |  *		
 36 |  *			アニメーションの再生設定
 37 |  *		
 38 |  *		アニメーション名称
 39 |  *		
 40 |  *			
 41 |  *			アニメーションを構成するパーツの種別、組み合わせデータの記述
 42 |  *				:
 43 |  *				:
 44 |  *			
 45 |  *		
 46 |  *		
 47 |  *			アニメーションで使用しているセルマップのファイル名リスト
 48 |  *				:
 49 |  *				:
 50 |  *		
 51 |  *		
 52 |  *			
 53 |  *				アニメーションデータ
 54 |  *					:
 55 |  *					:
 56 |  *			
 57 |  *		
 58 |  *	
 59 |  * 
60 | *\n 61 | * 62 | * \subsection ssaeファイル partListブロックの解説 63 | * \n 64 | * partListブロックは、1つのパーツをと定義しパーツの配列として機能しています。\n 65 | * valueの中のタグについては、SsPartのクラス説明ページを参照下さい。\n 66 | * \n 67 | * 68 | * \subsection ssaeファイル animeブロックの解説 69 | * 70 | * ブロックは、アニメーションの再生FPSや名称などの設定値とそれぞれのキーフレームでパーツに適用するアトリビュート値が格納されています。\n 71 | * キーフレームのアトリビュート値はブロックに記載されています。\n 72 | * のコンテナとなっており、はモデルで定義された各パーツに対応したアトリビュート値がキーフレーム値と一緒に記載されています。\n 73 | * \n 74 | * (例)\n 75 | *
 76 |  * 	
 77 |  *		
 78 |  *			\0\
 79 |  *		
 80 |  *	
 81 |  * 
82 | * \n 83 | * ここで、アトリビュートはPOSX=パーツの座標Xを示しており、そのキーフレームはtime=0の場所、補完方法はliner=線形補間となっており、\n 84 | * その値はvalue=0となっています。このvalue値がパーツの座標Xに適用されます。\n 85 | * このブロックはキーフレームがエディタ上で作成されている場合、作成されただけここに記載が行われます。\n 86 | * アトリビュートの種類については、SsAttributeKind で検索、補完方法については、SsInterpolationTypeを参照下さい。\n 87 | * \n 88 | * \section ssceファイルについて 89 | * ssceファイルは、OPTPiX SpriteStudioで作成されたセルマップの情報が記述されているファイルです。\n 90 | * 各セルは、のブロック内で一つづつ要素で記述が行われています。\n 91 | * 92 | * 例) 93 | *
 94 | * 	
 95 | *		
 96 | *			arm_l
 97 | *			128 0
 98 | *			128 192
 99 | *			0.4296875 -0.354166656732559
100 | *			0
101 | *			
102 | *			0
103 | *		
104 | *		:
105 | *		:
106 | * 
107 | *\n 108 | * 基本的にssceは、複雑なフォーマットにはなっておらず、cellの配列として記述が行われておりますので、\n 109 | * 各タグを本ドキュメントで検索頂けるとご使用いただけます。\n 110 | * \n 111 | */ 112 | 113 | #ifndef __SSLIB__ 114 | #define __SSLIB__ 115 | 116 | #include "sstypes.h" 117 | #include "ssarchiver.h" 118 | #include "ssattribute.h" 119 | #include "ssloader_sspj.h" 120 | #include "ssloader_ssae.h" 121 | #include "ssloader_ssce.h" 122 | #include "ssloader_ssee.h" 123 | 124 | #include "ssInterpolation.h" 125 | 126 | //SDKを更新する場合はバージョン番号を変更してください 127 | #define SPRITESTUDIOSDK_VERSION "SpriteStudio 5 SDK Version 1.7.1" 128 | 129 | 130 | 131 | #endif -------------------------------------------------------------------------------- /Common/Loader/ssloader_ssae.cpp: -------------------------------------------------------------------------------- 1 | #include "ssloader_ssae.h" 2 | 3 | 4 | SsAnimePack* ssloader_ssae::Load(const std::string& filename ) 5 | { 6 | 7 | SsAnimePack* anime = new SsAnimePack(); 8 | 9 | XMLDocument xml; 10 | if ( XML_SUCCESS == xml.LoadFile( filename.c_str() ) ) 11 | { 12 | SsXmlIArchiver ar( xml.GetDocument() , "SpriteStudioAnimePack" ); 13 | anime->__Serialize( &ar ); 14 | }else{ 15 | delete anime; 16 | anime = 0; 17 | } 18 | 19 | return anime; 20 | } 21 | 22 | 23 | SsAnimation* SsAnimePack::findAnimation(SsString& name) 24 | { 25 | 26 | for ( std::vector::iterator itr = animeList.begin() 27 | ; itr != animeList.end() ; ++itr ) 28 | { 29 | if ( (*itr)->name == name ) 30 | { 31 | return (*itr); 32 | } 33 | } 34 | return 0; 35 | } -------------------------------------------------------------------------------- /Common/Loader/ssloader_ssce.cpp: -------------------------------------------------------------------------------- 1 | #include "ssloader_ssce.h" 2 | #include "ssstring_uty.h" 3 | 4 | 5 | 6 | SsCellMap* ssloader_ssce::Load(const std::string& filename ) 7 | { 8 | SsString _basepath = ""; 9 | 10 | 11 | SsCellMap* cellmap = new SsCellMap(); 12 | 13 | XMLDocument xml; 14 | if ( XML_SUCCESS == xml.LoadFile( filename.c_str() ) ) 15 | { 16 | SsXmlIArchiver ar( xml.GetDocument() , "SpriteStudioCellMap" ); 17 | cellmap->__Serialize( &ar ); 18 | cellmap->fname = path2file( filename ); 19 | }else{ 20 | delete cellmap; 21 | cellmap = 0; 22 | } 23 | 24 | return cellmap; 25 | } 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Common/Loader/ssloader_ssce.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSLOADER_SSCE__ 2 | #define __SSLOADER_SSCE__ 3 | 4 | #include "sstypes.h" 5 | #include "ssarchiver.h" 6 | 7 | 8 | ///パーツに使用される画素の矩形範囲を示した構造です。 9 | class SsCell 10 | { 11 | public: 12 | //--------- ランタイム用データとして保存すべきもの 13 | SsString name; ///< セル名称 14 | SsPoint2 pos; ///< 左上の座標 15 | SsPoint2 size; ///< WHピクセルサイズ 16 | SsPoint2 pivot; ///< WHピクセルサイズ 17 | // SsVector2 pivot; ///< 原点。size /2 が中央=0,0になる。 18 | bool rotated; ///< 左方向に90度回転されている。uvs の割り当てが変わる。 19 | 20 | SsCell(){} 21 | virtual ~SsCell(){} 22 | 23 | 24 | ///シリアライズのための宣言です。 25 | SSSERIALIZE_BLOCK 26 | { 27 | SSAR_DECLARE( name ); 28 | SSAR_DECLARE( pos ); 29 | SSAR_DECLARE( size ); 30 | SSAR_DECLARE( pivot ); 31 | SSAR_DECLARE( rotated ); 32 | } 33 | }; 34 | 35 | 36 | 37 | //!セルマップデータを表現するためのクラスです。 38 | /*! 39 | @class SsCellMap 40 | @breif セルマップは1つのテクスチャファイルとそのテクスチャ内でパーツとして使用する矩形範囲を示したセルをコンテナとして保持するための構造です。
41 |
42 | このデータコンテナはエディット用として下記を読み飛ばします。
43 | imagePathAtImport;///< インポート時の参照元画像のフルパス
44 | packInfoFilePath; ///< パック情報ファイル。TexturePacker 等のデータをインポートした場合のみ有効
45 | texPackSettings; ///< パック時の参照情報
46 | */ 47 | class SsCellMap 48 | { 49 | public: 50 | SsString version; 51 | SsString fname; ///< セルマップのファイルネーム 52 | SsString name; ///< このセルマップの名称です。 53 | SsString imagePath; ///< 参照画像ファイルパス。プロジェクトの画像基準相対 54 | SsPoint2 pixelSize; ///< 画像のピクセルWHサイズ 55 | bool overrideTexSettings;///< テクスチャ設定をプロジェクトの設定ではなく下記設定を使う 56 | SsTexWrapMode::_enum wrapMode; ///< テクスチャのラップモード 57 | SsTexFilterMode::_enum filterMode; ///< テクスチャのフィルタモード 58 | 59 | std::vector cells; 60 | 61 | SsString loadFilepath; ///<実際にロードした場所 62 | 63 | 64 | SsCellMap(){} 65 | virtual ~SsCellMap() 66 | { 67 | for ( std::vector::iterator itr = cells.begin() ; 68 | itr != cells.end() ; itr ++ ) delete (*itr); 69 | } 70 | 71 | ///シリアライズのための宣言です。 72 | SSSERIALIZE_BLOCK 73 | { 74 | SSAR_DECLARE_ATTRIBUTE(version); 75 | SSAR_DECLARE( name ); 76 | SSAR_DECLARE( imagePath ); 77 | SSAR_DECLARE( pixelSize ); 78 | SSAR_DECLARE( overrideTexSettings ); 79 | SSAR_DECLARE_ENUM( wrapMode ); 80 | SSAR_DECLARE_ENUM( filterMode ); 81 | 82 | SSAR_DECLARE_LISTEX( cells ,"cell" ); 83 | } 84 | }; 85 | 86 | 87 | //!sspjのローダークラスです。 88 | class ssloader_ssce 89 | { 90 | public: 91 | ssloader_ssce(){} 92 | virtual ~ssloader_ssce(){} 93 | 94 | static SsCellMap* Load(const std::string& filename ); 95 | 96 | }; 97 | 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /Common/Loader/ssloader_ssee.cpp: -------------------------------------------------------------------------------- 1 | #include "ssloader_sspj.h" 2 | #include "ssloader_ssae.h" 3 | #include "ssloader_ssce.h" 4 | #include "ssloader_ssee.h" 5 | #include "ssstring_uty.h" 6 | 7 | #include "../Helper/DebugPrint.h" 8 | 9 | SsEffectFile* ssloader_ssee::Load(const std::string& filename ) 10 | { 11 | 12 | SsString _basepath = ""; 13 | 14 | 15 | SsEffectFile* effectFile = new SsEffectFile(); 16 | 17 | XMLDocument xml; 18 | if ( XML_SUCCESS == xml.LoadFile( filename.c_str() ) ) 19 | { 20 | SsXmlIArchiver ar( xml.GetDocument() , "SpriteStudioEffect" ); 21 | effectFile->__Serialize( &ar ); 22 | }else{ 23 | delete effectFile; 24 | effectFile = 0; 25 | } 26 | 27 | return effectFile; 28 | 29 | } 30 | 31 | 32 | void ssloader_ssee::loadPostProcessing( SsEffectFile* file , SsProject* pj ) 33 | { 34 | 35 | for ( size_t i = 0 ; i < file->effectData.nodeList.size(); i++) 36 | { 37 | 38 | SsEffectBehavior* beh = &file->effectData.nodeList[i]->behavior; 39 | beh->refCell = 0; 40 | if ( beh->CellMapName == "" )continue; 41 | SsCellMap* map =pj->findCellMap( beh->CellMapName ); 42 | 43 | if ( map ) 44 | { 45 | for ( size_t n = 0 ; n < map->cells.size() ; n++ ) 46 | { 47 | if ( map->cells[n]->name == beh->CellName ) 48 | { 49 | beh->refCell = map->cells[n]; 50 | } 51 | } 52 | if ( beh->refCell == 0 ) 53 | { 54 | DEBUG_PRINTF("not fount cell : %s , %s", beh->CellMapName.c_str(), beh->CellName.c_str()); 55 | } 56 | } 57 | } 58 | 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /Common/Loader/ssloader_ssee.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSLOADER_SSEE__ 2 | #define __SSLOADER_SSEE__ 3 | 4 | #include "sstypes.h" 5 | #include "ssarchiver.h" 6 | 7 | #include "SsEffectBehavior.h" 8 | 9 | 10 | 11 | class SimpleTree 12 | { 13 | public: 14 | SimpleTree *parent; 15 | SimpleTree *ctop; 16 | SimpleTree *prev; 17 | SimpleTree *next; 18 | 19 | public: 20 | SimpleTree() 21 | : parent(0),ctop(0),prev(0),next(0) 22 | {} 23 | virtual ~SimpleTree() 24 | { 25 | destroy(); 26 | } 27 | 28 | void addChildEnd( SimpleTree* c ){ 29 | if ( ctop == 0 ) 30 | { 31 | ctop = c; 32 | }else{ 33 | ctop->addSiblingEnd( c ); 34 | } 35 | c->parent = this; 36 | } 37 | void addSiblingEnd( SimpleTree* c ) 38 | { 39 | if ( next == 0 ) 40 | { 41 | c->prev = this; 42 | next = c; 43 | }else{ 44 | next->addSiblingEnd(c); 45 | } 46 | 47 | c->parent = this->parent; 48 | } 49 | 50 | void destroysub(SimpleTree *t) 51 | { 52 | if ( t->ctop ) 53 | { 54 | destroysub(t->ctop); 55 | } 56 | if ( t->next ) 57 | { 58 | destroysub(t->next); 59 | } 60 | 61 | t->ctop = 0; 62 | t->next = 0; 63 | t->prev = 0; 64 | delete t; 65 | } 66 | void destroy() 67 | { 68 | if ( this->ctop ) 69 | destroysub(this->ctop); 70 | } 71 | }; 72 | 73 | 74 | 75 | 76 | 77 | 78 | class SsEffectNode : public SimpleTree 79 | { 80 | public: 81 | int arrayIndex; 82 | int parentIndex; 83 | SsEffectNodeType::_enum type; 84 | bool visible; 85 | 86 | SsEffectBehavior behavior; 87 | 88 | public: 89 | SsEffectNode() : 90 | arrayIndex(0), parentIndex(0), 91 | type(SsEffectNodeType::invalid) 92 | {} 93 | ~SsEffectNode(){} 94 | 95 | SSSERIALIZE_BLOCK 96 | { 97 | SSAR_DECLARE(arrayIndex); 98 | SSAR_DECLARE(parentIndex); 99 | SSAR_DECLARE_ENUM(type); 100 | SSAR_DECLARE(visible); 101 | SSAR_STRUCT_DECLARE(behavior); 102 | } 103 | 104 | 105 | SsEffectNodeType::_enum GetType(){ return type; } 106 | 107 | SsEffectBehavior* GetMyBehavior(){ return &behavior;} 108 | 109 | }; 110 | 111 | 112 | class SsEffectModel 113 | { 114 | private: 115 | SsEffectNode* root; 116 | 117 | public: 118 | std::vector nodeList; 119 | int lockRandSeed; // ランダムシード固定値 120 | bool isLockRandSeed; // ランダムシードを固定するか否か 121 | int fps; // 122 | SsString bgcolor; 123 | SsString effectName; 124 | int layoutScaleX; 125 | int layoutScaleY; 126 | 127 | 128 | public: 129 | SsEffectModel() : root(0) 130 | {} 131 | 132 | virtual ~SsEffectModel(){ 133 | if (root) 134 | { 135 | delete root; 136 | } 137 | root = 0; 138 | } 139 | 140 | //アクセス 141 | SsEffectNode* GetRoot(){ return root;} 142 | 143 | 144 | //シリアライザ 145 | SSSERIALIZE_BLOCK 146 | { 147 | SSAR_DECLARE(lockRandSeed); 148 | SSAR_DECLARE(isLockRandSeed); 149 | SSAR_DECLARE(fps); 150 | SSAR_DECLARE(bgcolor); 151 | SSAR_DECLARE(layoutScaleX); 152 | if ( layoutScaleX == 0 ) layoutScaleX = 100; 153 | 154 | SSAR_DECLARE(layoutScaleY); 155 | if ( layoutScaleY == 0 ) layoutScaleY = 100; 156 | 157 | SSAR_DECLARE_LISTEX(nodeList,"node"); 158 | 159 | //ツリーの構築 160 | if ( nodeList.size() > 0 ) 161 | { 162 | root = nodeList[0]; 163 | for ( size_t i = 1 ; i < nodeList.size() ; i++ ) 164 | { 165 | int pi = nodeList[i]->parentIndex; 166 | if ( pi >= 0 ) 167 | { 168 | nodeList[pi]->addChildEnd( nodeList[i] ); 169 | } 170 | } 171 | } 172 | 173 | } 174 | 175 | void EffectNodeLoader(ISsXmlArchiver* ar); 176 | 177 | const std::vector& getNodeList() 178 | { 179 | return nodeList; 180 | } 181 | 182 | 183 | }; 184 | 185 | 186 | class SsEffectFile 187 | { 188 | public: 189 | SsEffectModel effectData; //親子構造+各アトリビュート 190 | SsString name; 191 | 192 | SsEffectFile(){} 193 | virtual ~SsEffectFile(){} 194 | 195 | SSSERIALIZE_BLOCK 196 | { 197 | SSAR_DECLARE(name); 198 | SSAR_STRUCT_DECLARE( effectData ); 199 | effectData.effectName = name; 200 | } 201 | 202 | }; 203 | 204 | 205 | class SsProject; 206 | //!sspjのローダークラスです。 207 | class ssloader_ssee 208 | { 209 | public: 210 | ssloader_ssee(){} 211 | virtual ~ssloader_ssee(){} 212 | 213 | static SsEffectFile* Load(const std::string& filename ); 214 | static void loadPostProcessing( SsEffectFile* file , SsProject* pj ); 215 | }; 216 | 217 | 218 | 219 | 220 | 221 | #endif 222 | -------------------------------------------------------------------------------- /Common/Loader/ssloader_sspj.cpp: -------------------------------------------------------------------------------- 1 | #include "ssloader_sspj.h" 2 | #include "ssloader_ssae.h" 3 | #include "ssloader_ssce.h" 4 | #include "ssloader_ssee.h" 5 | 6 | #include "ssstring_uty.h" 7 | #include "../Helper/DebugPrint.h" 8 | 9 | 10 | 11 | 12 | SsString SsProject::getSsceBasepath(){ 13 | return getFullPath( m_proj_filepath , settings.cellMapBaseDirectory ); 14 | } 15 | 16 | 17 | SsString SsProject::getSsaeBasepath() 18 | { 19 | return getFullPath( m_proj_filepath , settings.animeBaseDirectory ); 20 | } 21 | 22 | 23 | SsString SsProject::getSseeBasepath() 24 | { 25 | return getFullPath( m_proj_filepath , settings.animeBaseDirectory ); 26 | } 27 | 28 | 29 | 30 | 31 | SsString SsProject::getImageBasepath() 32 | { 33 | return getFullPath( m_proj_filepath , settings.imageBaseDirectory ); 34 | } 35 | 36 | SsProject::~SsProject() 37 | { 38 | for ( SsAnimePackList::iterator itr = animeList.begin() ; 39 | itr != animeList.end() ; itr ++ ) delete (*itr); 40 | for ( SsSsCellMapList::iterator itr = cellmapList.begin() ; 41 | itr != cellmapList.end() ; itr ++ ) delete (*itr); 42 | for ( SsEffectFileList::iterator itr = effectfileList.begin() ; 43 | itr != effectfileList.end() ; itr ++ ) delete (*itr); 44 | 45 | } 46 | 47 | 48 | SsAnimePack* SsProject::findAnimationPack( SsString& animePackName ) 49 | { 50 | for ( SsAnimePackList::iterator itr = animeList.begin() 51 | ; itr != animeList.end() ; ++itr ) 52 | { 53 | if ( (*itr)->name == animePackName ) 54 | { 55 | return (*itr); 56 | } 57 | } 58 | 59 | return 0; 60 | } 61 | 62 | 63 | 64 | SsAnimation* SsProject::findAnimation( SsString& animePackName , SsString& AnimeName ) 65 | { 66 | SsAnimePack* p = findAnimationPack( animePackName ); 67 | if ( p ) 68 | { 69 | return p->findAnimation(AnimeName); 70 | } 71 | 72 | return 0; 73 | } 74 | 75 | SsEffectFile* SsProject::findEffect( SsString& effectName ) 76 | { 77 | for ( SsEffectFileList::iterator itr = effectfileList.begin() 78 | ; itr != effectfileList.end() ; ++itr ) 79 | { 80 | if ( (*itr)->name == effectName ) 81 | { 82 | return (*itr); 83 | } 84 | } 85 | 86 | return 0; 87 | } 88 | 89 | 90 | SsProject* ssloader_sspj::Load(const std::string& filename ) 91 | { 92 | 93 | XMLDocument xml; 94 | if ( XML_SUCCESS == xml.LoadFile( filename.c_str() ) ) 95 | { 96 | SsXmlIArchiver ar( xml.GetDocument() , "SpriteStudioProject" ); 97 | 98 | SsProject* proj = new SsProject(); 99 | proj->__Serialize( &ar ); 100 | std::string project_filepath = path2dir( filename ); 101 | proj->setFilepath( project_filepath ); 102 | 103 | 104 | //アニメーションリストを元に読み込みます。 105 | for ( size_t i = 0 ;i < proj->getAnimePackNum() ; i++ ) 106 | { 107 | 108 | SsString ssaepath = proj->getAnimePackFilePath(i); 109 | SsAnimePack* anime = ssloader_ssae::Load( ssaepath ); 110 | if ( anime ) 111 | { 112 | proj->animeList.push_back( anime ); 113 | }else{ 114 | //エラー 115 | DEBUG_PRINTF( "Animation load error : %s" , ssaepath.c_str() ); 116 | delete proj; 117 | return 0; 118 | } 119 | } 120 | 121 | //セルマップリストを元に読み込みます。 122 | for ( size_t i = 0 ;i < proj->getCellMapNum() ; i++ ) 123 | { 124 | SsString sscepath = proj->getCellMapFilePath(i); 125 | 126 | SsCellMap* cell = ssloader_ssce::Load( sscepath ); 127 | if ( cell ) 128 | { 129 | cell->loadFilepath = proj->getCelMapFileOriginalPath(i); 130 | proj->cellmapList.push_back( cell ); 131 | }else{ 132 | //エラー 133 | DEBUG_PRINTF( "Cellmap load error : %s" , sscepath.c_str() ); 134 | delete proj; 135 | return 0; 136 | } 137 | } 138 | 139 | for ( size_t i = 0 ;i < proj->getEffectFileNum() ; i++ ) 140 | { 141 | SsString sscepath = proj->getEffectFilePath(i); 142 | 143 | SsEffectFile* efile = ssloader_ssee::Load( sscepath ); 144 | if ( efile ) 145 | { 146 | //efile->loadFilepath = proj->getCelMapFileOriginalPath(i); 147 | proj->effectfileList.push_back( efile ); 148 | ssloader_ssee::loadPostProcessing( efile , proj ); 149 | }else{ 150 | //エラー 151 | DEBUG_PRINTF( "effect load error : %s" , sscepath.c_str() ); 152 | delete proj; 153 | return 0; 154 | } 155 | 156 | 157 | } 158 | return proj; 159 | } 160 | 161 | return 0; 162 | } 163 | 164 | SsCellMap* SsProject::findCellMap( SsString& str ) 165 | { 166 | for ( SsSsCellMapListItr itr = cellmapList.begin() ; 167 | itr != cellmapList.end() ; itr ++) 168 | { 169 | // SsString _name = (*itr)->name; 170 | //_name+=".ssce"; 171 | //sspjの参照名とXML無いのnameタグが一致していないケースがあったのでファイル名で取得 172 | /// SsString _name = (*itr)->fname; 173 | SsString _name = (*itr)->loadFilepath; 174 | 175 | 176 | if ( _name == str ) 177 | { 178 | return (*itr); 179 | } 180 | } 181 | return 0; 182 | } 183 | 184 | SsCellMap* SsProject::getCellMap( int index ) 185 | { 186 | return cellmapList[index]; 187 | } 188 | -------------------------------------------------------------------------------- /Common/Loader/ssstring_uty.cpp: -------------------------------------------------------------------------------- 1 | #include "ssstring_uty.h" 2 | 3 | #ifdef _WIN32 4 | #include 5 | #else 6 | #include 7 | #include 8 | #include 9 | 10 | #endif 11 | 12 | 13 | //========================================================================================= 14 | //! 文字列の切り分け 15 | /*! 16 | 検索キーを元に文字列を切り分け、文字列の配列を返します。 17 | @param[in] in_str 入力文字列 18 | @param[in] key 検索キー 19 | @param[out] out_array 出力文字列配列 20 | @retval なし 21 | 22 | */ 23 | //========================================================================================= 24 | void split_string( const std::string &in_str , 25 | const char key, 26 | std::vector& out_array ) 27 | { 28 | std::istringstream in(in_str); 29 | char c; 30 | out_array.clear(); 31 | while (in) 32 | { 33 | std::string index; 34 | while (in.get(c) && (c != key)) index.push_back(c); 35 | 36 | out_array.push_back( index ); 37 | } 38 | 39 | } 40 | 41 | 42 | std::string path2dir(const std::string &path) { 43 | const std::string::size_type pos = std::max(path.find_last_of('/'), path.find_last_of('\\')); 44 | return (pos == std::string::npos) ? std::string() 45 | : path.substr(0, pos + 1); 46 | } 47 | 48 | std::string path2file(const std::string &path) { 49 | return path.substr(std::max(path.find_last_of('/'), path.find_last_of('\\')) + 1); 50 | } 51 | 52 | 53 | 54 | bool is_digit_string( std::string &in_str , bool* is_priod ) 55 | { 56 | std::istringstream in(in_str); 57 | char c; 58 | 59 | if ( is_priod != NULL )*is_priod = false; 60 | 61 | while (in) 62 | { 63 | in.get(c); 64 | if ( c < 0 ) return false; 65 | 66 | if ( c =='.' ) 67 | { 68 | if ( is_priod != NULL )*is_priod = true; 69 | } 70 | if ( !(isdigit( c ) || c =='.' || c=='-' || c=='+' ) ) 71 | { 72 | return false; 73 | } 74 | } 75 | return true; 76 | } 77 | 78 | 79 | std::string getFullPath( const std::string& basePath , const std::string &relPath ) 80 | { 81 | #ifdef _WIN32 82 | static char curPath[_MAX_PATH]; 83 | 84 | _chdir( basePath.c_str() ); 85 | _getcwd( curPath , _MAX_PATH ); 86 | 87 | static char buffer_[_MAX_PATH]; 88 | _fullpath( buffer_ , relPath.c_str() , _MAX_PATH ); 89 | 90 | _chdir( curPath ); 91 | 92 | std::string temp = buffer_; 93 | temp+= "\\"; 94 | 95 | return temp; 96 | #else 97 | char buffer_[2048]; 98 | char curPath[2048]; 99 | char curPath2[2048]; 100 | getwd(curPath); 101 | 102 | if ( basePath[0]!='/') 103 | { 104 | std::string str = curPath; 105 | str+="/"; 106 | str+= basePath; 107 | realpath( str.c_str() , curPath2 ); 108 | chdir( curPath2 ); 109 | std::string temp = relPath; 110 | realpath(temp.c_str(),buffer_ ); 111 | //std::string ret_str = relPath + "/"; 112 | return relPath; 113 | }else{ 114 | chdir( basePath.c_str()); 115 | std::string temp = basePath + relPath; 116 | realpath(temp.c_str(),buffer_ ); 117 | } 118 | 119 | 120 | chdir(curPath); 121 | std::string ret_temp; 122 | ret_temp = buffer_; 123 | ret_temp+="/"; 124 | return ret_temp; 125 | #endif 126 | 127 | } 128 | std::string Replace( std::string String1, std::string String2, std::string String3 ) 129 | { 130 | std::string::size_type Pos( String1.find( String2 ) ); 131 | 132 | while( Pos != std::string::npos ) 133 | { 134 | String1.replace( Pos, String2.length(), String3 ); 135 | Pos = String1.find( String2, Pos + String3.length() ); 136 | } 137 | 138 | return String1; 139 | } 140 | 141 | std::string nomarizeFilename( std::string str ) 142 | { 143 | std::string ret = str; 144 | ret = Replace( str , "\\\\" , "\\" ); 145 | 146 | return ret; 147 | } 148 | -------------------------------------------------------------------------------- /Common/Loader/ssstring_uty.h: -------------------------------------------------------------------------------- 1 | #ifndef __SSSTRING_UTY__ 2 | #define __SSSTRING_UTY__ 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | /* 14 | * @brief 文字列を指定のkeyで分割して返します。 15 | * 16 | * @param[in] in_str 分割する文字列 17 | * @param[in] key 分割のキーとなる文字列 18 | * @param[out] out_array 分割した文字列を格納する文字列リスト 19 | * @retval なし 20 | */ 21 | void split_string( const std::string &in_str , 22 | const char key, 23 | std::vector& out_array ); 24 | 25 | //bool is_digit_string( std::string &in_str ); 26 | bool is_digit_string( std::string &in_str , bool* is_priod = 0 ); 27 | 28 | /* 29 | * @brief ファイルのフルパスからフォルダパスのみを取得します。 30 | * @param[in] ファイルパス 31 | * @retval ファイルパスからファイル名を取り除いた文字列 32 | */ 33 | std::string path2dir(const std::string &path); 34 | 35 | 36 | /* 37 | * @brief ファイルのフルパスからファイル名のみを取得します。 38 | * @param[in] ファイルパス 39 | * @retval ファイルパスからフォルダ名を取り除いた文字列 40 | */ 41 | std::string path2file(const std::string &path); 42 | 43 | 44 | /* 45 | * @brief 相対パスを絶対パスへ変換する 46 | * param[in] basePath 基準ディレクトリ 47 | * param[int] relPath 相対パス 48 | * retval relpathを絶対パスへ変換した値 49 | */ 50 | std::string getFullPath( const std::string& basePath , const std::string &relPath); 51 | 52 | 53 | std::string nomarizeFilename( std::string str ); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Common/Loader/ssvalue.cpp: -------------------------------------------------------------------------------- 1 | #include "ssarchiver.h" 2 | #include "ssstring_uty.h" 3 | #include "ssvalue.h" 4 | 5 | 6 | 7 | //SsValue用のシリアライザ 8 | void SsValueSeriarizer( ISsXmlArchiver* ar , SsValue& v , const std::string key) 9 | { 10 | 11 | //インプット 12 | XMLElement* e = ar->getxml(); 13 | if ( key != "" ) 14 | { 15 | e = e->FirstChildElement( key.c_str() ); 16 | } 17 | if ( e ) 18 | { 19 | XMLElement* child = e->FirstChildElement(); 20 | 21 | if ( child == 0 ) 22 | { 23 | const char* str = e->GetText(); 24 | 25 | if (str==0) 26 | { 27 | const char* err_log1 = e->Parent()->Value(); 28 | 29 | if ( e->Parent()->ToElement() ) 30 | { 31 | const char* err_log2 = e->Parent()->ToElement()->GetText(); 32 | 33 | if ( e->Parent()->Parent()->ToElement()->FirstAttribute() ) 34 | { 35 | const char* err_log3 = e->Parent()->Parent()->ToElement()->FirstAttribute()->Value(); 36 | } 37 | } 38 | return ; 39 | } 40 | 41 | std::string enc_str = babel::utf8_to_sjis(str); 42 | v = SsValueSeriarizer__MakeValue( enc_str.c_str() ); 43 | }else{ 44 | XMLElement* ce = child; 45 | 46 | SsHash hash; 47 | while(ce) 48 | { 49 | const char* str = ce->GetText(); 50 | if ( str != 0 ) 51 | { 52 | std::string enc_str = babel::utf8_to_sjis(str); 53 | hash[ce->Name()] = SsValueSeriarizer__MakeValue( enc_str.c_str() ); 54 | ce = (XMLElement*)ce->NextSibling(); 55 | }else{ 56 | //さらに子構造があるようだ 57 | //さらに子構造があるようだ 58 | //ce = 0 ; 59 | SsXmlIArchiver ar(ce); 60 | 61 | SsValue tempv; 62 | SsValueSeriarizer( &ar , tempv , ""); 63 | hash[ce->Name()] = tempv; 64 | ce = (XMLElement*)ce->NextSibling(); 65 | } 66 | } 67 | 68 | v = SsValue(hash); 69 | 70 | } 71 | 72 | return ; 73 | } 74 | //assert(e); 75 | 76 | } 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | * Copyrights and Disclaimers 2 | 3 | - Copyrights for the documentation, source files, and sample programs are the property of Web Technology Corp. 4 | If the user includes the sample source in game titles, etc., the user may modify the source as required. 5 | 6 | - The documentation, source files, and sample programs in this package may be used without a license. 7 | The documentation, source files, and sample programs in this package may be freely used when the SpriteStudio user uses SpriteStudio files, for example in development of game titles. 8 | 9 | - Web Technology Corp. accepts no liability for any loss incurred directly or indirectly through use of the documentation, source files, and sample programs in this package. 10 | 11 | - Do not reprint or redistribute this package. 12 | 13 | - The documents in this package were written for experienced application program developers. 14 | General program development techniques have been omitted. 15 | 16 | - SSAE,SSCE,SSPJ,SSOP,SSBP file format specifications are subject to future change. 17 | 18 | - Operation of programs created by customers is excluded from support. 19 | 20 | ■ご注意 21 | 22 | ・本SDK内のドキュメント、ヘッダファイル、サンプルプログラムの著作権は株式 23 | 会社ウェブテクノロジが保有しています。 24 | サンプルソースをユーザ様がゲームタイトルなどに組み込んでご利用される場合 25 | は、必要に応じて改変していただいてかまいません。 26 | 27 | ・本SDK内のドキュメント、ヘッダファイル、サンプルプログラムはライセンスフ 28 | リーで利用できます。本SDK内のドキュメント、ヘッダファイル、サンプルプロ 29 | グラムは、SpriteStudioのユーザ様がゲームタイトルの開発などでSpriteStudio 30 | 用のファイルを利用される場合に、自由にお使いいただけます。 31 | 32 | ・本SDK内のドキュメント、ヘッダファイル、サンプルプログラムを利用したこと 33 | による直接的あるいは間接的に生じる損失があったとしても、株式会社ウェブテ 34 | クノロジはその責を負わないものとします。 35 | 36 | ・本SDKの転載・再配布はご遠慮ください。 37 | 38 | ・本SDK内のドキュメントはアプリケーションプログラム開発経験者向けに書かれ 39 | ています。一般的なプログラム開発の手法等につきましては省略しております。 40 | 41 | ・SSAE,SSCE,SSPJ,SSOP,SSBPファイルフォーマット仕様は、将来、変更される可能性 42 | があります。 43 | 44 | ・お客様が作成されたプログラムの動作に関しましては、サポート対象外とさせて 45 | いただきます。 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### SpriteStudio 5 SDK 2 | 3 | ドキュメントはこちらです。 4 | https://github.com/SpriteStudio/SpriteStudio5-SDK/wiki 5 | -------------------------------------------------------------------------------- /Tools/README.md: -------------------------------------------------------------------------------- 1 | ### OPTPiX SpriteStudio 5 SDK Tools 2 | 3 | SpriteStudio 5 で作成したデータを利用するためのルーツが含まれています。 4 | 5 | - Ss5Converter.zip 6 | - sspjからssbpを作成するWindows用コンバータです。 7 | 8 | - Ss5Converter_Mac.zip 9 | - sspjからssbpを作成するMac用コンバータです。 10 | 11 | - viewer_sample.zip 12 | - SDKを利用したsspjからアニメを再生するWindows版ビュワーです。 13 | 14 | - viewer_sample_Mac.zip 15 | - SDKを利用したsspjからアニメを再生するMac版ビュワーです。 16 | 17 | - plistConverter.zip 18 | - SpriteStudio 5 SDKから出力したスプライトシート(plist)をC#等で利用しやすいxml形式に変換するコンバータです。 19 | 20 | -------------------------------------------------------------------------------- /Tools/Ss5Converter.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Tools/Ss5Converter.zip -------------------------------------------------------------------------------- /Tools/Ss5Converter_Mac.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Tools/Ss5Converter_Mac.zip -------------------------------------------------------------------------------- /Tools/plistConverter.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Tools/plistConverter.zip -------------------------------------------------------------------------------- /Tools/viewer_sample.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Tools/viewer_sample.zip -------------------------------------------------------------------------------- /Tools/viewer_sample_Mac.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteStudio/SpriteStudio5-SDK/2d82131ebc1772e5be233980a833abe78dea6223/Tools/viewer_sample_Mac.zip --------------------------------------------------------------------------------