mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
delete Topology enum
This commit is contained in:
+2
-25
@@ -98,29 +98,6 @@ export enum AttributeType {
|
||||
|
||||
ccenum(AttributeType);
|
||||
|
||||
export enum Topology {
|
||||
/**
|
||||
* Point list.
|
||||
*/
|
||||
POINT_LIST = GFXPrimitiveMode.POINT_LIST,
|
||||
|
||||
/**
|
||||
* Line list.
|
||||
*/
|
||||
LINE_LIST = GFXPrimitiveMode.LINE_LIST,
|
||||
|
||||
/**
|
||||
* Triangle list.
|
||||
*/
|
||||
TRIANGLE_LIST = GFXPrimitiveMode.TRIANGLE_LIST,
|
||||
}
|
||||
|
||||
ccenum(Topology);
|
||||
|
||||
function toGFXTopology (topology: Topology) {
|
||||
return topology as unknown as GFXPrimitiveMode;
|
||||
}
|
||||
|
||||
export enum IndexUnit {
|
||||
/**
|
||||
* 8 bits unsigned integer.
|
||||
@@ -262,7 +239,7 @@ export interface IPrimitive {
|
||||
/**
|
||||
* This primitive's topology.
|
||||
*/
|
||||
topology: Topology;
|
||||
primitiveMode: GFXPrimitiveMode;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -501,7 +478,7 @@ export class Mesh extends Asset {
|
||||
}
|
||||
|
||||
return {
|
||||
primitiveMode: toGFXTopology(primitive.topology),
|
||||
primitiveMode: primitive.primitiveMode,
|
||||
inputAssembler: gfxDevice.createInputAssembler(inputAssemblerInfo),
|
||||
} as IRenderingSubmesh ;
|
||||
});
|
||||
|
||||
+2
-14
@@ -4,7 +4,7 @@ import Texture2D from '../../assets/texture-2d';
|
||||
import { Filter, PixelFormat, WrapMode } from '../../assets/texture-base';
|
||||
import { Vec3 } from '../../core/value-types';
|
||||
import { AttributeBaseType, AttributeType,
|
||||
IMeshStruct, IndexUnit, IPrimitive, IVertexAttribute, IVertexBundle, Mesh, Topology } from '../assets/mesh';
|
||||
IMeshStruct, IndexUnit, IPrimitive, IVertexAttribute, IVertexBundle, Mesh } from '../assets/mesh';
|
||||
import { IGeometry } from '../primitive/defines';
|
||||
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ export function createMesh (geometry: IGeometry) {
|
||||
|
||||
// Create primitive.
|
||||
const primitive: IPrimitive = {
|
||||
topology: _getTopology(geometry.primitiveMode),
|
||||
primitiveMode: geometry.primitiveMode,
|
||||
vertexBundelIndices: [0],
|
||||
};
|
||||
if (indexBuffer) {
|
||||
@@ -192,18 +192,6 @@ class BufferBlob {
|
||||
}
|
||||
}
|
||||
|
||||
function _getTopology (primitiveMode: GFXPrimitiveMode) {
|
||||
switch (primitiveMode) {
|
||||
case GFXPrimitiveMode.POINT_LIST:
|
||||
return Topology.POINT_LIST;
|
||||
case GFXPrimitiveMode.LINE_LIST:
|
||||
return Topology.LINE_LIST;
|
||||
case GFXPrimitiveMode.TRIANGLE_LIST:
|
||||
return Topology.TRIANGLE_LIST;
|
||||
}
|
||||
return Topology.POINT_LIST;
|
||||
}
|
||||
|
||||
function _writeVertices (
|
||||
target: DataView, offset: number, stride: number, attribute: IVertexAttribute, data: number[]) {
|
||||
const writer = _getVerticesWriter(target, attribute.baseType);
|
||||
|
||||
Reference in New Issue
Block a user