Fix to no implicit any

translate
cubism-dev 2018-09-27 17:44:42 +09:00
parent 0c39eb6a47
commit 263a621104
7 changed files with 15 additions and 87 deletions

View File

@ -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();

View File

@ -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

View File

@ -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);
};

View File

@ -349,7 +349,7 @@ export namespace Live2DCubismFramework
*/
public checkEndOfFile(): boolean
{
return this._root[1].equals("EOF");
return this._root.getArray()[1].equals("EOF");
}
/**

View File

@ -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();
}
}

View File

@ -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;

View File

@ -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++)