mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
Merge branch '3.8' into 4.0-beta
This commit is contained in:
commit
4fb6a7f535
@ -170,21 +170,13 @@ namespace Spine.Unity {
|
|||||||
string fileText = file.text;
|
string fileText = file.text;
|
||||||
const int maxCharsToCheck = 256;
|
const int maxCharsToCheck = 256;
|
||||||
int numCharsToCheck = Math.Min(fileText.Length, maxCharsToCheck);
|
int numCharsToCheck = Math.Min(fileText.Length, maxCharsToCheck);
|
||||||
if (fileText.IndexOf("\"skeleton\"", 0, numCharsToCheck) != -1 ||
|
|
||||||
fileText.IndexOf("\"hash\"", 0, numCharsToCheck) != -1 ||
|
|
||||||
fileText.IndexOf("\"spine\"", 0, numCharsToCheck) != -1)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
int jsonCharCount = 0;
|
|
||||||
const string jsonChars = "{}:\",";
|
|
||||||
for (int i = 0; i < numCharsToCheck; ++i) {
|
for (int i = 0; i < numCharsToCheck; ++i) {
|
||||||
char c = fileText[i];
|
char c = fileText[i];
|
||||||
if (jsonChars.IndexOf(c) != -1 || char.IsWhiteSpace(c))
|
if (char.IsWhiteSpace(c))
|
||||||
++jsonCharCount;
|
continue;
|
||||||
|
return c == '{';
|
||||||
}
|
}
|
||||||
if (jsonCharCount > numCharsToCheck / 10)
|
|
||||||
return true;
|
return true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CompatibilityProblemInfo GetCompatibilityProblemInfo (VersionInfo fileVersion) {
|
public static CompatibilityProblemInfo GetCompatibilityProblemInfo (VersionInfo fileVersion) {
|
||||||
|
|||||||
@ -47,6 +47,7 @@ void GetLightContributionBlinnPhong(inout float3 diffuseResult, inout float3 spe
|
|||||||
diffuseResult += lightDiffuse * max(0.0, dot(normal, -lightDirection));
|
diffuseResult += lightDiffuse * max(0.0, dot(normal, -lightDirection));
|
||||||
half3 halfVector = normalize(-lightDirection + viewDirection);
|
half3 halfVector = normalize(-lightDirection + viewDirection);
|
||||||
float nDotH = max(0, dot(normal, halfVector));
|
float nDotH = max(0, dot(normal, halfVector));
|
||||||
|
specularExponent = max(0.00001, specularExponent); // prevent fx compiler error at pow() below
|
||||||
specularResult += lightSpecular * pow(nDotH, specularExponent);
|
specularResult += lightSpecular * pow(nDotH, specularExponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user