diff --git a/cocos/core/3d/framework/camera-component.ts b/cocos/core/3d/framework/camera-component.ts index 2cd70d61c2..ee28f610c9 100644 --- a/cocos/core/3d/framework/camera-component.ts +++ b/cocos/core/3d/framework/camera-component.ts @@ -546,7 +546,7 @@ export class Camera extends Component { protected _createCamera () { this._camera = (legacyCC.director.root as Root).createCamera(); - this._camera.initialize({ + this._camera!.initialize({ name: this.node.name, node: this.node, projection: this._projection, diff --git a/cocos/core/3d/framework/mesh-renderer.ts b/cocos/core/3d/framework/mesh-renderer.ts index 84fdaea7a8..2377dd23d9 100644 --- a/cocos/core/3d/framework/mesh-renderer.ts +++ b/cocos/core/3d/framework/mesh-renderer.ts @@ -351,12 +351,12 @@ export class MeshRenderer extends RenderableComponent { // derived classes should use a morph-able model type(i.e. model type derived from `MorphModel`). // So we should take care of the edge case. const modelType = (preferMorphOverPlain && this._modelType === scene.Model) ? models.MorphModel : this._modelType; - const model = this._model = (legacyCC.director.root as Root).createModel(modelType); + const model = this._model! = (legacyCC.director.root as Root).createModel(modelType); model.visFlags = this.visibility; model.node = model.transform = this.node; this._models.length = 0; this._models.push(this._model); - if (this._morphInstance && model instanceof MorphModel) { + if (this._morphInstance && model instanceof models.MorphModel) { model.setMorphRendering(this._morphInstance); } } diff --git a/cocos/core/pipeline/define.ts b/cocos/core/pipeline/define.ts index 48e266dded..c586ac460f 100644 --- a/cocos/core/pipeline/define.ts +++ b/cocos/core/pipeline/define.ts @@ -9,7 +9,7 @@ import { Layers } from '../scene-graph/layers'; import { legacyCC } from '../global-exports'; import { GFXBindingMappingInfo, GFXDescriptorType, GFXType, GFXShaderStageFlagBit, IGFXDescriptorSetLayoutBinding } from '../gfx'; import { IBlockInfo, ISamplerInfo } from '../assets/effect-asset'; -import { Camera } from '../renderer'; +import { Camera } from '../renderer/scene'; export const PIPELINE_FLOW_FORWARD: string = 'ForwardFlow'; export const PIPELINE_FLOW_SHADOW: string = 'ShadowFlow'; diff --git a/cocos/core/renderer/core/memory-pools.ts b/cocos/core/renderer/core/memory-pools.ts index 1599facc01..222aabeff7 100644 --- a/cocos/core/renderer/core/memory-pools.ts +++ b/cocos/core/renderer/core/memory-pools.ts @@ -31,7 +31,7 @@ import { DEBUG, JSB } from 'internal:constants'; import { NativeBufferPool, NativeObjectPool, NativeArrayPool } from './native-pools'; import { GFXRasterizerState, GFXDepthStencilState, GFXBlendState, IGFXDescriptorSetInfo, GFXDevice, GFXDescriptorSet, GFXShaderInfo, GFXShader, IGFXInputAssemblerInfo, GFXInputAssembler, - IGFXPipelineLayoutInfo, GFXPipelineLayout, GFXFramebuffer, IGFXFramebufferInfo } from '../../gfx'; + IGFXPipelineLayoutInfo, GFXPipelineLayout, GFXFramebuffer, IGFXFramebufferInfo, GFXPrimitiveMode, GFXDynamicStateFlags } from '../../gfx'; import { RenderPassStage } from '../../pipeline/define'; import { BatchingSchemes } from './pass'; import { Vec3, Mat4, IVec4Like } from '../../math'; @@ -168,7 +168,7 @@ class BufferPool
, element: E[keyof E], vec3: Vec3) {
+ public setVec3 , element: V, vec3: Vec3) {
// Web engine has Vec3 property, don't record it in shared memory.
if (!JSB) {
return;
@@ -206,7 +206,7 @@ class BufferPool , element: E[keyof E], vec4: IVec4Like) {
+ public setVec4 , element: V, vec4: IVec4Like) {
// Web engine has Vec4 property, don't record it in shared memory.
if (!JSB) {
return;
@@ -257,7 +257,7 @@ class BufferPool , element: E[keyof E], mat4: Mat4) {
+ public setMat4 , element: V, mat4: Mat4) {
// Web engine has mat4 property, don't record it in shared memory.
if (!JSB) {
return;
@@ -393,15 +393,15 @@ export class ArrayPool {
* @param step The step size to extend the array when exceeding the array size.
* It is the same as size if it is not set.
*/
- public alloc (): Handle {
+ public alloc (): IHandle {
const handle = this._curArrayHandle++;
const array = this._nativeArrayPool.alloc(handle);
this._arrayMap.set(handle, array);
- return (handle | this._arrayHandleFlag) as unknown as Handle ;
+ return (handle | this._arrayHandleFlag) as unknown as IHandle ;
}
- public free (handle: Handle ) {
+ public free (handle: IHandle ) {
let arrayHandle = this._arrayHandleMask & handle as unknown as number;
if (this._arrayMap.get(arrayHandle) === undefined) {
if (DEBUG) console.warn('invalid array pool handle');
@@ -410,7 +410,7 @@ export class ArrayPool {
this._arrayMap.delete(arrayHandle);
}
- public assign (handle: Handle , index: number, value: Handle , index: number, value: IHandle {
array[0] = index > len ? index : len;
}
- public erase (handle: Handle , index: number) {
+ public erase (handle: IHandle , index: number) {
const array = this._arrayMap.get(this._arrayHandleMask & handle as unknown as number);
if (array === undefined || index > array[0]) {
if (DEBUG) console.warn('invalid array pool index or invalid array handle');
@@ -448,7 +448,7 @@ export class ArrayPool {
--array[0];
}
- public push (handle: Handle , value: Handle , value: IHandle {
this.assign(handle, array[0], value);
}
- public pop (handle: Handle ) {
+ public pop (handle: IHandle ) {
const array = this._arrayMap.get(this._arrayHandleMask & handle as unknown as number);
if (array === undefined) {
if (DEBUG) console.warn('invalid array pool handle');
@@ -476,7 +476,7 @@ export class ArrayPool {
* Clear the contents of array.
* @param handle Handle to be clear.
*/
- public clear (handle: Handle ) {
+ public clear (handle: IHandle ) {
const array = this._arrayMap.get(this._arrayHandleMask & handle as unknown as number);
if (array === undefined) {
if (DEBUG) console.warn('invalid array pool handle');
@@ -518,26 +518,26 @@ enum PoolType {
export const NULL_HANDLE = 0 as unknown as IHandle