当前位置: 首页>>代码示例>>C++>>正文


C++ SUB_CAST函数代码示例

本文整理汇总了C++中SUB_CAST函数的典型用法代码示例。如果您正苦于以下问题:C++ SUB_CAST函数的具体用法?C++ SUB_CAST怎么用?C++ SUB_CAST使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SUB_CAST函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _spBoundingBoxAttachment_dispose

void _spBoundingBoxAttachment_dispose (spAttachment* attachment) {
	spBoundingBoxAttachment* self = SUB_CAST(spBoundingBoxAttachment, attachment);

	_spAttachment_deinit(attachment);

	FREE(self->vertices);
	FREE(self);
}
开发者ID:skatpgusskat,项目名称:December,代码行数:8,代码来源:BoundingBoxAttachment.cpp

示例2: Skin_getAttachment

Attachment* Skin_getAttachment (const Skin* self, int slotIndex, const char* name) {
	const _Entry* entry = SUB_CAST(_Internal, self) ->entries;
	while (entry) {
		if (entry->slotIndex == slotIndex && strcmp(entry->name, name) == 0) return entry->attachment;
		entry = entry->next;
	}
	return 0;
}
开发者ID:artickiwi,项目名称:WormsRemake,代码行数:8,代码来源:Skin.c

示例3: spSkeletonBounds_dispose

void spSkeletonBounds_dispose (spSkeletonBounds* self) {
	int i;
	for (i = 0; i < SUB_CAST(_spSkeletonBounds, self)->capacity; ++i)
		if (self->polygons[i]) spPolygon_dispose(self->polygons[i]);
	FREE(self->polygons);
	FREE(self->boundingBoxes);
	FREE(self);
}
开发者ID:253056965,项目名称:cocos2d-x-lite,代码行数:8,代码来源:SkeletonBounds.c

示例4: SkeletonBounds_dispose

void SkeletonBounds_dispose (SkeletonBounds* self) {
	int i = 0;
	for (; i < SUB_CAST(_Internal, self)->capacity; ++i)
		if (self->polygons[i]) BoundingPolygon_dispose(self->polygons[i]);
	FREE(self->polygons);
	FREE(self->boundingBoxes);
	FREE(self);
}
开发者ID:alaa-eddine,项目名称:spine-runtimes,代码行数:8,代码来源:SkeletonBounds.c

示例5: _spPathAttachment_dispose

void _spPathAttachment_dispose (spAttachment* attachment) {
	spPathAttachment* self = SUB_CAST(spPathAttachment, attachment);

	_spVertexAttachment_deinit(SUPER(self));

	FREE(self->lengths);
	FREE(self);
}
开发者ID:602147629,项目名称:PlanetWar,代码行数:8,代码来源:PathAttachment.c

示例6: _Cocos2dxAtlasPage_dispose

void _Cocos2dxAtlasPage_dispose (AtlasPage* page) {
	Cocos2dxAtlasPage* self = SUB_CAST(Cocos2dxAtlasPage, page);
	_AtlasPage_deinit(SUPER(self));

	CC_SAFE_RELEASE_NULL(self->texture);
	CC_SAFE_RELEASE_NULL(self->atlas);

	FREE(page);
}
开发者ID:Creativegame,项目名称:spine-runtimes,代码行数:9,代码来源:spine-cocos2dx.cpp

示例7: _Cocos2dxRegionAttachment_draw

void _Cocos2dxRegionAttachment_draw (Attachment* attachment, Slot* slot) {
	Cocos2dxRegionAttachment* self = SUB_CAST(Cocos2dxRegionAttachment, attachment);
	Cocos2dxSkeleton* skeleton = SUB_CAST(Cocos2dxSkeleton, slot->skeleton);

	GLubyte r = SUPER(skeleton)->r * slot->r * 255;
	GLubyte g = SUPER(skeleton)->g * slot->g * 255;
	GLubyte b = SUPER(skeleton)->b * slot->b * 255;
	GLubyte a = SUPER(skeleton)->a * slot->a * 255;
	ccV3F_C4B_T2F_Quad* quad = &self->quad;
	quad->bl.colors.r = r;
	quad->bl.colors.g = g;
	quad->bl.colors.b = b;
	quad->bl.colors.a = a;
	quad->tl.colors.r = r;
	quad->tl.colors.g = g;
	quad->tl.colors.b = b;
	quad->tl.colors.a = a;
	quad->tr.colors.r = r;
	quad->tr.colors.g = g;
	quad->tr.colors.b = b;
	quad->tr.colors.a = a;
	quad->br.colors.r = r;
	quad->br.colors.g = g;
	quad->br.colors.b = b;
	quad->br.colors.a = a;

	float* offset = SUPER(self)->offset;
	quad->bl.vertices.x = offset[0] * slot->bone->m00 + offset[1] * slot->bone->m01 + slot->bone->worldX;
	quad->bl.vertices.y = offset[0] * slot->bone->m10 + offset[1] * slot->bone->m11 + slot->bone->worldY;
	quad->tl.vertices.x = offset[2] * slot->bone->m00 + offset[3] * slot->bone->m01 + slot->bone->worldX;
	quad->tl.vertices.y = offset[2] * slot->bone->m10 + offset[3] * slot->bone->m11 + slot->bone->worldY;
	quad->tr.vertices.x = offset[4] * slot->bone->m00 + offset[5] * slot->bone->m01 + slot->bone->worldX;
	quad->tr.vertices.y = offset[4] * slot->bone->m10 + offset[5] * slot->bone->m11 + slot->bone->worldY;
	quad->br.vertices.x = offset[6] * slot->bone->m00 + offset[7] * slot->bone->m01 + slot->bone->worldX;
	quad->br.vertices.y = offset[6] * slot->bone->m10 + offset[7] * slot->bone->m11 + slot->bone->worldY;

	// cocos2dx doesn't handle batching for us, so we'll just force a single texture per skeleton.
	skeleton->node->atlas = self->atlas;
	if (self->atlas->getCapacity() <= skeleton->node->quadCount) {
		if (!self->atlas->resizeCapacity(self->atlas->getCapacity() * 2)) return;
	}
	self->atlas->updateQuad(quad, skeleton->node->quadCount++);
}
开发者ID:Creativegame,项目名称:spine-runtimes,代码行数:43,代码来源:spine-cocos2dx.cpp

示例8: _AnimationState_clearQueue

void _AnimationState_clearQueue (AnimationState* self) {
	_Internal* internal = SUB_CAST(_Internal, self);
	_Entry* entry = internal->queue;
	while (entry) {
		_Entry* nextEntry = entry->next;
		FREE(entry);
		entry = nextEntry;
	}
	internal->queue = 0;
}
开发者ID:0x0c,项目名称:cocos2d-x,代码行数:10,代码来源:AnimationState.cpp

示例9: _spMeshAttachment_dispose

void _spMeshAttachment_dispose (spAttachment* attachment) {
	spMeshAttachment* self = SUB_CAST(spMeshAttachment, attachment);
	_spAttachment_deinit(attachment);
	FREE(self->path);
	FREE(self->vertices);
	FREE(self->regionUVs);
	FREE(self->uvs);
	FREE(self->triangles);
	FREE(self->edges);
	FREE(self);
}
开发者ID:867344633,项目名称:spine-runtimes,代码行数:11,代码来源:MeshAttachment.c

示例10: spSkin_attachAll

void spSkin_attachAll (const spSkin* self, spSkeleton* skeleton, const spSkin* oldSkin) {
	const _Entry *entry = SUB_CAST(_spSkin, oldSkin)->entries;
	while (entry) {
		spSlot *slot = skeleton->slots[entry->slotIndex];
		if (slot->attachment == entry->attachment) {
			spAttachment *attachment = spSkin_getAttachment(self, entry->slotIndex, entry->name);
			if (attachment) spSlot_setAttachment(slot, attachment);
		}
		entry = entry->next;
	}
}
开发者ID:120pulsations,项目名称:Torque2D,代码行数:11,代码来源:Skin.c

示例11: spSkin_dispose

void spSkin_dispose (spSkin* self) {
	_Entry* entry = SUB_CAST(_spSkin, self)->entries;
	while (entry) {
		_Entry* nextEntry = entry->next;
		_Entry_dispose(entry);
		entry = nextEntry;
	}

	FREE(self->name);
	FREE(self);
}
开发者ID:120pulsations,项目名称:Torque2D,代码行数:11,代码来源:Skin.c

示例12: _spSkinnedMeshAttachment_dispose

void _spSkinnedMeshAttachment_dispose (spAttachment* attachment) {
	spSkinnedMeshAttachment* self = SUB_CAST(spSkinnedMeshAttachment, attachment);
	_spAttachment_deinit(attachment);
	FREE(self->path);
	FREE(self->bones);
	FREE(self->weights);
	FREE(self->regionUVs);
	FREE(self->uvs);
	FREE(self->triangles);
	FREE(self->edges);
	FREE(self);
}
开发者ID:253056965,项目名称:cocos2d-x-lite,代码行数:12,代码来源:SkinnedMeshAttachment.c

示例13: spSkin_getAttachmentName

const char* spSkin_getAttachmentName (const spSkin* self, int slotIndex, int attachmentIndex) {
	const _Entry* entry = SUB_CAST(_spSkin, self)->entries;
	int i = 0;
	while (entry) {
		if (entry->slotIndex == slotIndex) {
			if (i == attachmentIndex) return entry->name;
			i++;
		}
		entry = entry->next;
	}
	return 0;
}
开发者ID:120pulsations,项目名称:Torque2D,代码行数:12,代码来源:Skin.c

示例14: _spMeshAttachment_dispose

void _spMeshAttachment_dispose (spAttachment* attachment) {
	spMeshAttachment* self = SUB_CAST(spMeshAttachment, attachment);
	FREE(self->path);
	FREE(self->uvs);
	if (!self->parentMesh) {
		_spVertexAttachment_deinit(SUPER(self));
		FREE(self->regionUVs);
		FREE(self->triangles);
		FREE(self->edges);
	} else
		_spAttachment_deinit(attachment);
	FREE(self);
}
开发者ID:Senspark,项目名称:CocosBuilder,代码行数:13,代码来源:MeshAttachment.c

示例15: RegionAttachment_updateQuad

ccV3F_C4B_T2F_Quad* RegionAttachment_updateQuad (Attachment* attachment, Slot* slot) {
	Cocos2dxRegionAttachment* self = SUB_CAST(Cocos2dxRegionAttachment, attachment);
	Cocos2dxSkeleton* skeleton = SUB_CAST(Cocos2dxSkeleton, slot->skeleton);

	GLubyte r = SUPER(skeleton)->r * slot->r * 255;
	GLubyte g = SUPER(skeleton)->g * slot->g * 255;
	GLubyte b = SUPER(skeleton)->b * slot->b * 255;
	GLubyte a = SUPER(skeleton)->a * slot->a * 255;
	ccV3F_C4B_T2F_Quad* quad = &self->quad;
	quad->bl.colors.r = r;
	quad->bl.colors.g = g;
	quad->bl.colors.b = b;
	quad->bl.colors.a = a;
	quad->tl.colors.r = r;
	quad->tl.colors.g = g;
	quad->tl.colors.b = b;
	quad->tl.colors.a = a;
	quad->tr.colors.r = r;
	quad->tr.colors.g = g;
	quad->tr.colors.b = b;
	quad->tr.colors.a = a;
	quad->br.colors.r = r;
	quad->br.colors.g = g;
	quad->br.colors.b = b;
	quad->br.colors.a = a;

	float* offset = SUPER(self)->offset;
	quad->bl.vertices.x = offset[0] * slot->bone->m00 + offset[1] * slot->bone->m01 + slot->bone->worldX;
	quad->bl.vertices.y = offset[0] * slot->bone->m10 + offset[1] * slot->bone->m11 + slot->bone->worldY;
	quad->tl.vertices.x = offset[2] * slot->bone->m00 + offset[3] * slot->bone->m01 + slot->bone->worldX;
	quad->tl.vertices.y = offset[2] * slot->bone->m10 + offset[3] * slot->bone->m11 + slot->bone->worldY;
	quad->tr.vertices.x = offset[4] * slot->bone->m00 + offset[5] * slot->bone->m01 + slot->bone->worldX;
	quad->tr.vertices.y = offset[4] * slot->bone->m10 + offset[5] * slot->bone->m11 + slot->bone->worldY;
	quad->br.vertices.x = offset[6] * slot->bone->m00 + offset[7] * slot->bone->m01 + slot->bone->worldX;
	quad->br.vertices.y = offset[6] * slot->bone->m10 + offset[7] * slot->bone->m11 + slot->bone->worldY;

	return quad;
}
开发者ID:CocoaLab,项目名称:spine-runtimes,代码行数:38,代码来源:spine-cocos2dx.cpp


注:本文中的SUB_CAST函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。