mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
[ue4][c] Fixed spine-ue4 for UE 4.15, need to explicitely include IAssetTool.h. Also fixed atlas.c to not use assignment in a conditional, something VC++ does not support
This commit is contained in:
parent
fcb6e61815
commit
cde9b3e89d
@ -184,7 +184,8 @@ spAtlas* spAtlas_create (const char* begin, int length, const char* dir, void* r
|
|||||||
while (readLine(&begin, end, &str)) {
|
while (readLine(&begin, end, &str)) {
|
||||||
if (str.end - str.begin == 0) {
|
if (str.end - str.begin == 0) {
|
||||||
page = 0;
|
page = 0;
|
||||||
} else if (!page) {
|
}
|
||||||
|
else if (!page) {
|
||||||
char* name = mallocString(&str);
|
char* name = mallocString(&str);
|
||||||
char* path = MALLOC(char, dirLength + needsSlash + strlen(name) + 1);
|
char* path = MALLOC(char, dirLength + needsSlash + strlen(name) + 1);
|
||||||
memcpy(path, dir, dirLength);
|
memcpy(path, dir, dirLength);
|
||||||
@ -223,7 +224,8 @@ spAtlas* spAtlas_create (const char* begin, int length, const char* dir, void* r
|
|||||||
page->uWrap = SP_ATLAS_REPEAT;
|
page->uWrap = SP_ATLAS_REPEAT;
|
||||||
else if (*str.begin == 'y')
|
else if (*str.begin == 'y')
|
||||||
page->vWrap = SP_ATLAS_REPEAT;
|
page->vWrap = SP_ATLAS_REPEAT;
|
||||||
} else if (equals(&str, "xy")) {
|
}
|
||||||
|
else if (equals(&str, "xy")) {
|
||||||
page->uWrap = SP_ATLAS_REPEAT;
|
page->uWrap = SP_ATLAS_REPEAT;
|
||||||
page->vWrap = SP_ATLAS_REPEAT;
|
page->vWrap = SP_ATLAS_REPEAT;
|
||||||
}
|
}
|
||||||
@ -231,7 +233,8 @@ spAtlas* spAtlas_create (const char* begin, int length, const char* dir, void* r
|
|||||||
|
|
||||||
_spAtlasPage_createTexture(page, path);
|
_spAtlasPage_createTexture(page, path);
|
||||||
FREE(path);
|
FREE(path);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
spAtlasRegion *region = spAtlasRegion_create();
|
spAtlasRegion *region = spAtlasRegion_create();
|
||||||
if (lastRegion)
|
if (lastRegion)
|
||||||
lastRegion->next = region;
|
lastRegion->next = region;
|
||||||
@ -258,12 +261,14 @@ spAtlas* spAtlas_create (const char* begin, int length, const char* dir, void* r
|
|||||||
if (region->rotate) {
|
if (region->rotate) {
|
||||||
region->u2 = (region->x + region->height) / (float)page->width;
|
region->u2 = (region->x + region->height) / (float)page->width;
|
||||||
region->v2 = (region->y + region->width) / (float)page->height;
|
region->v2 = (region->y + region->width) / (float)page->height;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
region->u2 = (region->x + region->width) / (float)page->width;
|
region->u2 = (region->x + region->width) / (float)page->width;
|
||||||
region->v2 = (region->y + region->height) / (float)page->height;
|
region->v2 = (region->y + region->height) / (float)page->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(count = readTuple(&begin, end, tuple))) return abortAtlas(self);
|
count = readTuple(&begin, end, tuple);
|
||||||
|
if (!count) return abortAtlas(self);
|
||||||
if (count == 4) { /* split is optional */
|
if (count == 4) { /* split is optional */
|
||||||
region->splits = MALLOC(int, 4);
|
region->splits = MALLOC(int, 4);
|
||||||
region->splits[0] = toInt(tuple);
|
region->splits[0] = toInt(tuple);
|
||||||
@ -271,7 +276,8 @@ spAtlas* spAtlas_create (const char* begin, int length, const char* dir, void* r
|
|||||||
region->splits[2] = toInt(tuple + 2);
|
region->splits[2] = toInt(tuple + 2);
|
||||||
region->splits[3] = toInt(tuple + 3);
|
region->splits[3] = toInt(tuple + 3);
|
||||||
|
|
||||||
if (!(count = readTuple(&begin, end, tuple))) return abortAtlas(self);
|
count = readTuple(&begin, end, tuple);
|
||||||
|
if (!count) return abortAtlas(self);
|
||||||
if (count == 4) { /* pad is optional, but only present with splits */
|
if (count == 4) { /* pad is optional, but only present with splits */
|
||||||
region->pads = MALLOC(int, 4);
|
region->pads = MALLOC(int, 4);
|
||||||
region->pads[0] = toInt(tuple);
|
region->pads[0] = toInt(tuple);
|
||||||
|
|||||||
@ -34,6 +34,7 @@
|
|||||||
#include "AssetRegistryModule.h"
|
#include "AssetRegistryModule.h"
|
||||||
#include "AssetToolsModule.h"
|
#include "AssetToolsModule.h"
|
||||||
#include "PackageTools.h"
|
#include "PackageTools.h"
|
||||||
|
#include "Developer/AssetTools/Public/IAssetTools.h"
|
||||||
#include "Developer/DesktopPlatform/Public/IDesktopPlatform.h"
|
#include "Developer/DesktopPlatform/Public/IDesktopPlatform.h"
|
||||||
#include "Developer/DesktopPlatform/Public/DesktopPlatformModule.h"
|
#include "Developer/DesktopPlatform/Public/DesktopPlatformModule.h"
|
||||||
#include "spine/spine.h"
|
#include "spine/spine.h"
|
||||||
|
|||||||
@ -34,6 +34,7 @@
|
|||||||
#include "AssetRegistryModule.h"
|
#include "AssetRegistryModule.h"
|
||||||
#include "AssetToolsModule.h"
|
#include "AssetToolsModule.h"
|
||||||
#include "PackageTools.h"
|
#include "PackageTools.h"
|
||||||
|
#include "Developer/AssetTools/Public/IAssetTools.h"
|
||||||
#include "Developer/DesktopPlatform/Public/IDesktopPlatform.h"
|
#include "Developer/DesktopPlatform/Public/IDesktopPlatform.h"
|
||||||
#include "Developer/DesktopPlatform/Public/DesktopPlatformModule.h"
|
#include "Developer/DesktopPlatform/Public/DesktopPlatformModule.h"
|
||||||
#include "spine/spine.h"
|
#include "spine/spine.h"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"FileVersion": 3,
|
"FileVersion": 3,
|
||||||
"EngineAssociation": "4.14",
|
"EngineAssociation": "4.15",
|
||||||
"Category": "",
|
"Category": "",
|
||||||
"Description": "",
|
"Description": "",
|
||||||
"Modules": [
|
"Modules": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user