Merge pull request #34 from cocor-au-lait/feature/avoid-namespace

Feature/avoid namespace
translate
wada 2021-03-02 19:47:56 +09:00 committed by GitHub
commit 2a6e8115a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 80 additions and 91 deletions

1
.gitignore vendored
View File

@ -14,4 +14,5 @@ dist/
.vscode/*
!/.vscode/extensions.json
!/.vscode/launch.json
!/.vscode/settings.json
!/.vscode/tasks.json

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"typescript.tsdk": "./Samples/TypeScript/Demo/node_modules/typescript/lib"
}

View File

@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Fixed
* Avoiding needless namespace syntax to simplify imports by [@cocor-au-lait](https://github.com/cocor-au-lait)
## [4-r.1] - 2020-01-30

@ -1 +1 @@
Subproject commit bd2872a5b1288799b3d50e6379772af992b32ac9
Subproject commit c80e158a66550c5538dca0caf4c542a4bd37022c

View File

@ -5,8 +5,8 @@
"build": "webpack -d --hide-modules",
"build:prod": "webpack -p --hide-modules",
"test": "tsc --noEmit",
"lint": "eslint src -f codeframe --ext .ts",
"lint:fix": "eslint src -f codeframe --ext .ts --fix",
"lint": "eslint src --ext .ts",
"lint:fix": "eslint src --ext .ts --fix",
"serve": "serve ../../.. -p 5000",
"clean": "rimraf dist"
},

View File

@ -5,16 +5,13 @@
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {
Live2DCubismFramework as live2dcubismframework,
Option as Csm_Option
} from '@framework/live2dcubismframework';
import Csm_CubismFramework = live2dcubismframework.CubismFramework;
import { LAppView } from './lappview';
import { CubismFramework, Option } from '@framework/live2dcubismframework';
import * as LAppDefine from './lappdefine';
import { LAppLive2DManager } from './lapplive2dmanager';
import { LAppPal } from './lapppal';
import { LAppTextureManager } from './lapptexturemanager';
import { LAppLive2DManager } from './lapplive2dmanager';
import * as LAppDefine from './lappdefine';
import { LAppView } from './lappview';
export let canvas: HTMLCanvasElement = null;
export let s_instance: LAppDelegate = null;
@ -124,7 +121,7 @@ export class LAppDelegate {
LAppLive2DManager.releaseInstance();
// Cubism SDKの解放
Csm_CubismFramework.dispose();
CubismFramework.dispose();
}
/**
@ -250,7 +247,7 @@ export class LAppDelegate {
this._mouseY = 0.0;
this._isEnd = false;
this._cubismOption = new Csm_Option();
this._cubismOption = new Option();
this._view = new LAppView();
this._textureManager = new LAppTextureManager();
}
@ -262,10 +259,10 @@ export class LAppDelegate {
// setup cubism
this._cubismOption.logFunction = LAppPal.printMessage;
this._cubismOption.loggingLevel = LAppDefine.CubismLoggingLevel;
Csm_CubismFramework.startUp(this._cubismOption);
CubismFramework.startUp(this._cubismOption);
// initialize cubism
Csm_CubismFramework.initialize();
CubismFramework.initialize();
// load model
LAppLive2DManager.getInstance();
@ -275,7 +272,7 @@ export class LAppDelegate {
this._view.initializeSprite();
}
_cubismOption: Csm_Option; // Cubism SDK Option
_cubismOption: Option; // Cubism SDK Option
_view: LAppView; // View情報
_captured: boolean; // クリックしているか
_mouseX: number; // マウスX座標

View File

@ -5,17 +5,14 @@
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import { Live2DCubismFramework as cubismmatrix44 } from '@framework/math/cubismmatrix44';
import { Live2DCubismFramework as csmvector } from '@framework/type/csmvector';
import { Live2DCubismFramework as acubismmotion } from '@framework/motion/acubismmotion';
import Csm_csmVector = csmvector.csmVector;
import Csm_CubismMatrix44 = cubismmatrix44.CubismMatrix44;
import ACubismMotion = acubismmotion.ACubismMotion;
import { CubismMatrix44 } from '@framework/math/cubismmatrix44';
import { ACubismMotion } from '@framework/motion/acubismmotion';
import { csmVector } from '@framework/type/csmvector';
import * as LAppDefine from './lappdefine';
import { canvas } from './lappdelegate';
import { LAppModel } from './lappmodel';
import { LAppPal } from './lapppal';
import { canvas } from './lappdelegate';
import * as LAppDefine from './lappdefine';
export let s_instance: LAppLive2DManager = null;
@ -134,7 +131,7 @@ export class LAppLive2DManager {
*
*/
public onUpdate(): void {
let projection: Csm_CubismMatrix44 = new Csm_CubismMatrix44();
let projection: CubismMatrix44 = new CubismMatrix44();
const { width, height } = canvas;
projection.scale(1.0, width / height);
@ -143,7 +140,7 @@ export class LAppLive2DManager {
projection.multiplyByMatrix(this._viewMatrix);
}
const saveProjection: Csm_CubismMatrix44 = projection.clone();
const saveProjection: CubismMatrix44 = projection.clone();
const modelCount: number = this._models.getSize();
for (let i = 0; i < modelCount; ++i) {
@ -191,14 +188,14 @@ export class LAppLive2DManager {
*
*/
constructor() {
this._viewMatrix = new Csm_CubismMatrix44();
this._models = new Csm_csmVector<LAppModel>();
this._viewMatrix = new CubismMatrix44();
this._models = new csmVector<LAppModel>();
this._sceneIndex = 0;
this.changeScene(this._sceneIndex);
}
_viewMatrix: Csm_CubismMatrix44; // モデル描画に用いるview行列
_models: Csm_csmVector<LAppModel>; // モデルインスタンスのコンテナ
_viewMatrix: CubismMatrix44; // モデル描画に用いるview行列
_models: csmVector<LAppModel>; // モデルインスタンスのコンテナ
_sceneIndex: number; // 表示するシーンのインデックス値
// モーション再生終了のコールバック関数
_finishedMotion = (self: ACubismMotion): void => {

View File

@ -5,49 +5,40 @@
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import { Live2DCubismFramework as live2dcubismframework } from '@framework/live2dcubismframework';
import { Live2DCubismFramework as cubismid } from '@framework/id/cubismid';
import { Live2DCubismFramework as cubismusermodel } from '@framework/model/cubismusermodel';
import { Live2DCubismFramework as icubismmodelsetting } from '@framework/icubismmodelsetting';
import { Live2DCubismFramework as cubismmodelsettingjson } from '@framework/cubismmodelsettingjson';
import { Live2DCubismFramework as cubismdefaultparameterid } from '@framework/cubismdefaultparameterid';
import { Live2DCubismFramework as acubismmotion } from '@framework/motion/acubismmotion';
import { Live2DCubismFramework as cubismeyeblink } from '@framework/effect/cubismeyeblink';
import { Live2DCubismFramework as cubismbreath } from '@framework/effect/cubismbreath';
import { Live2DCubismFramework as csmvector } from '@framework/type/csmvector';
import { Live2DCubismFramework as csmmap } from '@framework/type/csmmap';
import { Live2DCubismFramework as cubismmatrix44 } from '@framework/math/cubismmatrix44';
import { Live2DCubismFramework as cubismmotion } from '@framework/motion/cubismmotion';
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 { CubismLogInfo } from '@framework/utils/cubismdebug';
import csmRect = csmrect.csmRect;
import csmString = csmstring.csmString;
import InvalidMotionQueueEntryHandleValue = cubismmotionqueuemanager.InvalidMotionQueueEntryHandleValue;
import CubismMotionQueueEntryHandle = cubismmotionqueuemanager.CubismMotionQueueEntryHandle;
import CubismMotion = cubismmotion.CubismMotion;
import CubismMatrix44 = cubismmatrix44.CubismMatrix44;
import csmMap = csmmap.csmMap;
import csmVector = csmvector.csmVector;
import CubismBreath = cubismbreath.CubismBreath;
import BreathParameterData = cubismbreath.BreathParameterData;
import CubismEyeBlink = cubismeyeblink.CubismEyeBlink;
import ACubismMotion = acubismmotion.ACubismMotion;
import FinishedMotionCallback = acubismmotion.FinishedMotionCallback;
import CubismFramework = live2dcubismframework.CubismFramework;
import CubismIdHandle = cubismid.CubismIdHandle;
import CubismUserModel = cubismusermodel.CubismUserModel;
import ICubismModelSetting = icubismmodelsetting.ICubismModelSetting;
import CubismModelSettingJson = cubismmodelsettingjson.CubismModelSettingJson;
import CubismDefaultParameterId = cubismdefaultparameterid;
import { LAppPal } from './lapppal';
import { gl, canvas, frameBuffer, LAppDelegate } from './lappdelegate';
import { TextureInfo } from './lapptexturemanager';
import * as LAppDefine from './lappdefine';
import 'whatwg-fetch';
import { CubismDefaultParameterId } from '@framework/cubismdefaultparameterid';
import { CubismModelSettingJson } from '@framework/cubismmodelsettingjson';
import {
BreathParameterData,
CubismBreath
} from '@framework/effect/cubismbreath';
import { CubismEyeBlink } from '@framework/effect/cubismeyeblink';
import { ICubismModelSetting } from '@framework/icubismmodelsetting';
import { CubismIdHandle } from '@framework/id/cubismid';
import { CubismFramework } from '@framework/live2dcubismframework';
import { CubismMatrix44 } from '@framework/math/cubismmatrix44';
import { CubismUserModel } from '@framework/model/cubismusermodel';
import {
ACubismMotion,
FinishedMotionCallback
} from '@framework/motion/acubismmotion';
import { CubismMotion } from '@framework/motion/cubismmotion';
import {
CubismMotionQueueEntryHandle,
InvalidMotionQueueEntryHandleValue
} from '@framework/motion/cubismmotionqueuemanager';
import { csmMap } from '@framework/type/csmmap';
import { csmRect } from '@framework/type/csmrectf';
import { csmString } from '@framework/type/csmstring';
import { csmVector } from '@framework/type/csmvector';
import { CubismLogInfo } from '@framework/utils/cubismdebug';
import * as LAppDefine from './lappdefine';
import { canvas, frameBuffer, gl, LAppDelegate } from './lappdelegate';
import { LAppPal } from './lapppal';
import { TextureInfo } from './lapptexturemanager';
enum LoadStep {
LoadAssets,
LoadModel,

View File

@ -5,7 +5,7 @@
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import { gl, canvas } from './lappdelegate';
import { canvas, gl } from './lappdelegate';
/**
*

View File

@ -5,9 +5,8 @@
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import { Live2DCubismFramework as csmvector } from '@framework/type/csmvector';
import Csm_csmVector = csmvector.csmVector;
import csmVector_iterator = csmvector.iterator;
import { csmVector, iterator } from '@framework/type/csmvector';
import { gl } from './lappdelegate';
/**
@ -19,7 +18,7 @@ export class LAppTextureManager {
*
*/
constructor() {
this._textures = new Csm_csmVector<TextureInfo>();
this._textures = new csmVector<TextureInfo>();
}
/**
@ -27,7 +26,7 @@ export class LAppTextureManager {
*/
public release(): void {
for (
let ite: csmVector_iterator<TextureInfo> = this._textures.begin();
let ite: iterator<TextureInfo> = this._textures.begin();
ite.notEqual(this._textures.end());
ite.preIncrement()
) {
@ -50,7 +49,7 @@ export class LAppTextureManager {
): void {
// search loaded texture already
for (
let ite: csmVector_iterator<TextureInfo> = this._textures.begin();
let ite: iterator<TextureInfo> = this._textures.begin();
ite.notEqual(this._textures.end());
ite.preIncrement()
) {
@ -162,7 +161,7 @@ export class LAppTextureManager {
}
}
_textures: Csm_csmVector<TextureInfo>;
_textures: csmVector<TextureInfo>;
}
/**

View File

@ -5,17 +5,16 @@
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import { Live2DCubismFramework as cubismMatrix44 } from '@framework/math/cubismmatrix44';
import { Live2DCubismFramework as cubismviewmatrix } from '@framework/math/cubismviewmatrix';
import Csm_CubismViewMatrix = cubismviewmatrix.CubismViewMatrix;
import Csm_CubismMatrix44 = cubismMatrix44.CubismMatrix44;
import { TouchManager } from './touchmanager';
import { CubismMatrix44 } from '@framework/math/cubismmatrix44';
import { CubismViewMatrix } from '@framework/math/cubismviewmatrix';
import * as LAppDefine from './lappdefine';
import { canvas, gl, LAppDelegate } from './lappdelegate';
import { LAppLive2DManager } from './lapplive2dmanager';
import { LAppDelegate, canvas, gl } from './lappdelegate';
import { LAppPal } from './lapppal';
import { LAppSprite } from './lappsprite';
import { TextureInfo } from './lapptexturemanager';
import { LAppPal } from './lapppal';
import * as LAppDefine from './lappdefine';
import { TouchManager } from './touchmanager';
/**
*
@ -33,10 +32,10 @@ export class LAppView {
this._touchManager = new TouchManager();
// デバイス座標からスクリーン座標に変換するための
this._deviceToScreen = new Csm_CubismMatrix44();
this._deviceToScreen = new CubismMatrix44();
// 画面の表示の拡大縮小や移動の変換を行う行列
this._viewMatrix = new Csm_CubismViewMatrix();
this._viewMatrix = new CubismViewMatrix();
}
/**
@ -257,8 +256,8 @@ export class LAppView {
}
_touchManager: TouchManager; // タッチマネージャー
_deviceToScreen: Csm_CubismMatrix44; // デバイスからスクリーンへの行列
_viewMatrix: Csm_CubismViewMatrix; // viewMatrix
_deviceToScreen: CubismMatrix44; // デバイスからスクリーンへの行列
_viewMatrix: CubismViewMatrix; // viewMatrix
_programId: WebGLProgram; // シェーダID
_back: LAppSprite; // 背景画像
_gear: LAppSprite; // ギア画像