Skip to content

Commit

Permalink
Legacy support.
Browse files Browse the repository at this point in the history
  • Loading branch information
cubism-dev committed Dec 6, 2018
1 parent 47e93ff commit ea80cee
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Framework/physics/cubismphysics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ export namespace Live2DCubismFramework
this._options.gravity
);

let destinationParameterIndex = currentOutput[i].destinationParameterIndex;
let outParameterValue = parameterValue.slice(destinationParameterIndex);
let destinationParameterIndex: number = currentOutput[i].destinationParameterIndex;
let outParameterValue: Float32Array = (!Float32Array.prototype.slice && 'subarray' in Float32Array.prototype)
? JSON.parse(JSON.stringify(parameterValue.subarray(destinationParameterIndex))) // 値渡しするため、JSON.parse, JSON.stringify
: parameterValue.slice(destinationParameterIndex);

updateOutputParameterValue(
outParameterValue,
Expand Down
5 changes: 4 additions & 1 deletion Sample/TypeScript/Demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
このブラウザは
<code>&lt;canvas&lt;</code>要素をサポートしていません。
</canvas>

<!-- Promise-polyfill -->
<script src = "https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js "> </script>

<!-- Live2DCubismCore -->
<script src="../../../Core/live2dcubismcore.min.js"></script>
<script src = "../../../Core/live2dcubismcore.min.js"></script>

<!-- User's Script -->
<script src = "./dist/index.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion Sample/TypeScript/Demo/src/lappmodel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {Live2DCubismFramework as cubismmotion} from "../../../../Framework/motio
import {Live2DCubismFramework as cubismmotionqueuemanager} from "../../../../Framework/motion/cubismmotionqueuemanager";
import {Live2DCubismFramework as csmstring} from "../../../../Framework/type/csmstring";
import {Live2DCubismFramework as csmrect } from "../../../../Framework/type/csmrectf";
import { Live2DCubismFramework as CubismRenderer_WebGL } from "../../../../Framework/rendering/cubismrenderer_WebGL";
import {CubismLogInfo} from "../../../../Framework/utils/cubismdebug";
import csmRect = csmrect.csmRect;
import csmString = csmstring.csmString;
Expand All @@ -47,6 +46,7 @@ import CubismDefaultParameterId = cubismdefaultparameterid;
import {LAppDefine} from "./lappdefine";
import {LAppPal} from "./lapppal";
import { gl, canvas, frameBuffer} from "./lappdelegate";
import "whatwg-fetch";

function createBuffer(path: string, callBack: any): void
{
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"webpack-cli": "^3.1.0",
"glob": "^7.1.2"
},
"dependencies": {
"whatwg-fetch": "^3.0.0"
},
"private": true
}

0 comments on commit ea80cee

Please sign in to comment.