Fix ccclass warns on render pipeline properties (#5885)

This commit is contained in:
Leslie Leigh (李的序)
2019-12-12 18:43:17 +08:00
committed by pandamicro
parent a7115f18d3
commit 5599130328
3 changed files with 12 additions and 10 deletions
+5 -1
View File
@@ -638,9 +638,13 @@ export const string = type(CCString);
*/
export function type (type: Function): PropertyDecorator;
export function type (type: [Function]): PropertyDecorator;
export function type<T> (type: PrimitiveType<T>): PropertyDecorator;
export function type<T> (type: PrimitiveType<T> | Function): PropertyDecorator {
export function type<T> (type: [PrimitiveType<T>]): PropertyDecorator;
export function type<T> (type: PrimitiveType<T> | Function | [PrimitiveType<T>] | [Function]): PropertyDecorator {
return property({
type,
});
@@ -1,7 +1,8 @@
import { ccclass, property } from '../data/class-decorator';
import { ccclass, property, type } from '../data/class-decorator';
import { ccenum } from '../value-types/enum';
import { GFXFormat, GFXLoadOp, GFXStoreOp, GFXTextureLayout, GFXTextureType, GFXTextureUsageBit, GFXTextureViewType} from '../gfx/define';
import { CCString } from '../data';
ccenum(GFXTextureType);
ccenum(GFXTextureViewType);
@@ -50,10 +51,8 @@ export class FrameBufferDesc {
public name: string = '';
@property
public renderPass: number = 0;
@property({
type: [String],
})
public colorViews = [];
@type([CCString])
public colorViews: string[] = [];
@property
public depthStencilView: string = '';
}
+3 -4
View File
@@ -2,7 +2,7 @@
* @category pipeline
*/
import { ccclass, property } from '../data/class-decorator';
import { ccclass, property, type } from '../data/class-decorator';
import { ccenum } from '../value-types/enum';
import { GFXCommandBuffer } from '../gfx/command-buffer';
import { IGFXColor, IGFXRect, GFXClearFlag, GFXCommandBufferType } from '../gfx/define';
@@ -16,6 +16,7 @@ import { RenderFlow } from './render-flow';
import { RenderPipeline } from './render-pipeline';
import { opaqueCompareFn, RenderQueue, transparentCompareFn } from './render-queue';
import { RenderView } from './render-view';
import { CCString } from '../data';
const colors: IGFXColor[] = [ { r: 0, g: 0, b: 0, a: 1 } ];
const bufs: GFXCommandBuffer[] = [];
@@ -46,9 +47,7 @@ class RenderQueueDesc {
type: RenderQueueSortMode,
})
public sortMode: RenderQueueSortMode = RenderQueueSortMode.FRONT_TO_BACK;
@property({
type: [String],
})
@type([CCString])
public stages: string[] = [];
}