commit
a50554ed87
|
@ -393,7 +393,7 @@ export namespace Live2DCubismFramework
|
|||
* @param vertexInde 物理点のインデックス
|
||||
* @return 物理点の位置
|
||||
*/
|
||||
public getParticlePosition(physicsSettingIndex: number, vertexIndex): CubismVector2
|
||||
public getParticlePosition(physicsSettingIndex: number, vertexIndex: number): CubismVector2
|
||||
{
|
||||
let ret: CubismVector2 = new CubismVector2(0, 0);
|
||||
ret.x = this._json.getRoot().getMap().getValue(PhysicsSettings).getVector().at(physicsSettingIndex).getMap().getValue(Vertices).getVector().at(vertexIndex).getMap().getValue(Position).getMap().getValue(X).toFloat();
|
||||
|
|
|
@ -242,7 +242,7 @@ export namespace Live2DCubismFramework
|
|||
/**
|
||||
* モデル描画の実装
|
||||
*/
|
||||
public abstract doDrawModel();
|
||||
public abstract doDrawModel(): void;
|
||||
|
||||
/**
|
||||
* 描画オブジェクト(アートメッシュ)を描画する
|
||||
|
@ -258,17 +258,17 @@ export namespace Live2DCubismFramework
|
|||
*/
|
||||
public abstract drawMesh(textureNo: number, indexCount: number, vertexCount: number,
|
||||
indexArray: Uint16Array, vertexArray: Float32Array, uvArray: Float32Array,
|
||||
opacity: number, colorBlendMode: CubismRenderer.CubismBlendMode);
|
||||
opacity: number, colorBlendMode: CubismRenderer.CubismBlendMode): void;
|
||||
|
||||
/**
|
||||
* モデル描画直前のレンダラのステートを保持する
|
||||
*/
|
||||
public abstract saveProfile();
|
||||
public abstract saveProfile(): void;
|
||||
|
||||
/**
|
||||
* モデル描画直前のレンダラのステートを復帰させる
|
||||
*/
|
||||
public abstract restoreProfile();
|
||||
public abstract restoreProfile(): void;
|
||||
|
||||
protected _mvpMatrix4x4: CubismMatrix44; // Model-View-Projection 行列
|
||||
protected _modelColor: CubismRenderer.CubismTextureColor; // モデル自体のカラー(RGBA)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
"lib": [
|
||||
"dom",
|
||||
"es2018"
|
||||
]
|
||||
],
|
||||
"noImplicitAny": true
|
||||
}
|
||||
}
|
|
@ -9,17 +9,17 @@ import {Live2DCubismFramework as live2dcubismframework, Option} from "../live2dc
|
|||
import CubismFramework = live2dcubismframework.CubismFramework;
|
||||
import { CSM_LOG_LEVEL, CSM_LOG_LEVEL_VERBOSE, CSM_LOG_LEVEL_DEBUG, CSM_LOG_LEVEL_INFO, CSM_LOG_LEVEL_WARNING, CSM_LOG_LEVEL_ERROR } from "../cubismframeworkconfig";
|
||||
|
||||
export const CubismLogPrint = (level: Option.LogLevel, fmt: string, ... args) =>
|
||||
export const CubismLogPrint = (level: Option.LogLevel, fmt: string, ... args: any[]) =>
|
||||
{
|
||||
Live2DCubismFramework.CubismDebug.print(level, "[CSM]" + fmt, args);
|
||||
}
|
||||
|
||||
export const CubismLogPrintIn = (level: Option.LogLevel, fmt: string, ... args) =>
|
||||
export const CubismLogPrintIn = (level: Option.LogLevel, fmt: string, ... args: any[]) =>
|
||||
{
|
||||
CubismLogPrint(level, fmt + "\n", args);
|
||||
}
|
||||
|
||||
export let CSM_ASSERT = (expr) =>
|
||||
export let CSM_ASSERT = (expr: any) =>
|
||||
{
|
||||
console.assert(expr);
|
||||
};
|
||||
|
|
|
@ -349,7 +349,7 @@ export namespace Live2DCubismFramework
|
|||
*/
|
||||
public checkEndOfFile(): boolean
|
||||
{
|
||||
return this._root[1].equals("EOF");
|
||||
return this._root.getArray()[1].equals("EOF");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* Copyright(c) Live2D Inc. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by the Live2D Open Software license
|
||||
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
|
||||
*/
|
||||
|
||||
import {Live2DCubismFramework as icubismallocator} from "../../../../Framework/icubismallcator";
|
||||
import Csm_ICubismAllocator = icubismallocator.ICubismAllocator;
|
||||
|
||||
/**
|
||||
* メモリアロケーションを実装するクラス。
|
||||
*
|
||||
* メモリ確保・解放処理のインターフェースの実装。
|
||||
* フレームワークから呼び出される。
|
||||
*/
|
||||
export class LAppAllocator extends Csm_ICubismAllocator
|
||||
{
|
||||
public allocate(size: number): any
|
||||
{
|
||||
return new ArrayBuffer(size);
|
||||
}
|
||||
|
||||
public deallocate(memory: any): void
|
||||
{
|
||||
if(memory)
|
||||
{
|
||||
memory = void 0;
|
||||
}
|
||||
}
|
||||
|
||||
public allocateAligned(size: number, alignment: number): any
|
||||
{
|
||||
let offset: number, shift: number, alignedAddress;
|
||||
let allocation: ArrayBuffer, preamble: ArrayBuffer[];
|
||||
|
||||
offset = alignment - 1 + ArrayBuffer.length;
|
||||
|
||||
allocation = this.allocate(size + offset);
|
||||
|
||||
alignedAddress = allocation.byteLength + ArrayBuffer.length;
|
||||
|
||||
shift = alignedAddress % alignment;
|
||||
|
||||
if (shift)
|
||||
{
|
||||
alignedAddress += (alignment - shift);
|
||||
}
|
||||
|
||||
preamble = <ArrayBuffer[]>alignedAddress;
|
||||
preamble[-1] = allocation;
|
||||
|
||||
return <ArrayBuffer>alignedAddress;
|
||||
}
|
||||
|
||||
public deallocateAligned(alignedMemory: any): void
|
||||
{
|
||||
let preamble: ArrayBuffer[];
|
||||
|
||||
preamble = <ArrayBuffer[]>alignedMemory;
|
||||
|
||||
this.deallocate(preamble[-1]);
|
||||
}
|
||||
|
||||
public constructor()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
|
@ -10,7 +10,6 @@ import {Live2DCubismFramework as cubismmatrix44} from "../../../../Framework/mat
|
|||
import Csm_CubismMatrix44 = cubismmatrix44.CubismMatrix44;
|
||||
import Csm_CubismFramework = live2dcubismframework.CubismFramework;
|
||||
import Csm_Option = Option;
|
||||
import { LAppAllocator } from "./lappallocator";
|
||||
import { LAppView } from "./lappview";
|
||||
import { LAppPal } from "./lapppal";
|
||||
import { LAppTextureManager } from "./lapptexturemanager";
|
||||
|
@ -245,7 +244,6 @@ export class LAppDelegate
|
|||
this._mouseY = 0.0;
|
||||
this._isEnd = false;
|
||||
|
||||
this._cubismAllocator = new LAppAllocator();
|
||||
this._cubismOption = new Csm_Option();
|
||||
this._view = new LAppView();
|
||||
this._textureManager = new LAppTextureManager();
|
||||
|
@ -271,7 +269,6 @@ export class LAppDelegate
|
|||
LAppPal.updateTime();
|
||||
}
|
||||
|
||||
_cubismAllocator: LAppAllocator; // Cubism3 Allocator
|
||||
_cubismOption: Csm_Option; // Cubism3 Option
|
||||
_view: LAppView; // View情報
|
||||
_captured: boolean; // クリックしているか
|
||||
|
@ -286,7 +283,7 @@ export class LAppDelegate
|
|||
/**
|
||||
* クリックしたときに呼ばれる。
|
||||
*/
|
||||
function onClickBegan(e): void
|
||||
function onClickBegan(e: MouseEvent): void
|
||||
{
|
||||
LAppDelegate.getInstance()._captured = true;
|
||||
if(!LAppDelegate.getInstance()._view)
|
||||
|
@ -304,9 +301,9 @@ function onClickBegan(e): void
|
|||
/**
|
||||
* マウスポインタが動いたら呼ばれる。
|
||||
*/
|
||||
function onMouseMoved(e): void
|
||||
function onMouseMoved(e: MouseEvent): void
|
||||
{
|
||||
let rect = e.target.getBoundingClientRect();
|
||||
let rect = e.toElement.getBoundingClientRect();
|
||||
let posX: number = e.clientX - rect.left;
|
||||
let posY: number = e.clientY - rect.top;
|
||||
|
||||
|
@ -327,10 +324,10 @@ function onMouseMoved(e): void
|
|||
/**
|
||||
* クリックが終了したら呼ばれる。
|
||||
*/
|
||||
function onClickEnded(e): void
|
||||
function onClickEnded(e: MouseEvent): void
|
||||
{
|
||||
LAppDelegate.getInstance()._captured = false;
|
||||
let rect = e.target.getBoundingClientRect();
|
||||
let rect = e.toElement.getBoundingClientRect();
|
||||
let posX: number = e.clientX - rect.left;
|
||||
let posY: number = e.clientY - rect.top;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ export class LAppTextureManager
|
|||
* @param fileName 読み込む画像ファイルパス名
|
||||
* @return 画像情報、読み込み失敗時はnullを返す
|
||||
*/
|
||||
public createTextureFromPngFile(fileName, callback): TextureInfo
|
||||
public createTextureFromPngFile(fileName: string, callback: any): TextureInfo
|
||||
{
|
||||
// search loaded texture already
|
||||
for(let i: number = 0; i < this._textures.getSize(); i++)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
"lib": [
|
||||
"dom",
|
||||
"es2018"
|
||||
]
|
||||
],
|
||||
"noImplicitAny": true
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue