Exemplo n.º 1
0
void IModelRenderContainer::DelFeature(const CFeature* f)
{
	FeatureSet& fs = features[TEX_TYPE(f)];

	if (spring::VectorErase(fs, const_cast<CFeature*>(f))) {
		numFeatures -= 1;
	}

	if (fs.empty()) {
		features.erase(TEX_TYPE(f));
	}
}
Exemplo n.º 2
0
void CProjectileDrawer::RenderProjectileCreated(const CProjectile* p)
{
	texturehandlerS3O->UpdateDraw();

	if (GML::SimEnabled() && !GML::ShareLists() && p->model && TEX_TYPE(p) < 0)
		TEX_TYPE(p) = texturehandlerS3O->LoadS3OTextureNow(p->model);

	if (p->model) {
		modelRenderers[MDL_TYPE(p)]->AddProjectile(p);
	} else {
		renderProjectiles.insert(const_cast<CProjectile*>(p));
	}
}
Exemplo n.º 3
0
void IModelRenderContainer::DelUnit(const CUnit* u)
{
	UnitSet& us = units[TEX_TYPE(u)];

	// Unit can be absent from this container, since we can't
	// know in UnitDrawer.cpp whether it's cloaked or not.
	if (spring::VectorErase(us, const_cast<CUnit*>(u))) {
		numUnits -= 1;
	}

	if (us.empty()) {
		units.erase(TEX_TYPE(u));
	}
}
Exemplo n.º 4
0
void CProjectileDrawer::RenderProjectileCreated(const CProjectile* p)
{
	texturehandlerS3O->UpdateDraw();

#if defined(USE_GML) && GML_ENABLE_SIM && !GML_SHARE_LISTS
	if(p->model && TEX_TYPE(p) < 0)
		TEX_TYPE(p) = texturehandlerS3O->LoadS3OTextureNow(p->model);
#endif

	if (p->model) {
		modelRenderers[MDL_TYPE(p)]->AddProjectile(p);
	} else {
		renderProjectiles.insert(const_cast<CProjectile*>(p));
	}
}
Exemplo n.º 5
0
void CFeatureDrawer::RenderFeatureCreated(const CFeature* feature)
{
	CFeature* f = const_cast<CFeature*>(feature);
	texturehandlerS3O->UpdateDraw();

	if (GML::SimEnabled() && !GML::ShareLists() && feature->model && TEX_TYPE(feature) < 0)
		TEX_TYPE(f) = texturehandlerS3O->LoadS3OTextureNow(feature->model);

	if (feature->def->drawType == DRAWTYPE_MODEL) {
		f->drawQuad = -1;
		UpdateDrawQuad(f);

		unsortedFeatures.insert(f);
	}
}
Exemplo n.º 6
0
void CFeatureDrawer::RenderFeatureCreated(const CFeature* feature)
{
	CFeature* f = const_cast<CFeature*>(feature);
#if defined(USE_GML) && GML_ENABLE_SIM
	if(f->model && TEX_TYPE(f) < 0)
		TEX_TYPE(f) = texturehandlerS3O->LoadS3OTextureNow(f->model);
#endif

	if (f->def->drawType == DRAWTYPE_MODEL) {
		f->drawQuad = -1;
		UpdateDrawQuad(f);

		unsortedFeatures.insert(f);
	}
}
Exemplo n.º 7
0
void IModelRenderContainer::AddFeature(const CFeature* f)
{
	FeatureSet& fs = features[TEX_TYPE(f)];

	if (!spring::VectorInsertUnique(fs, const_cast<CFeature*>(f)))
		assert(false);

	numFeatures += 1;
}
Exemplo n.º 8
0
void IModelRenderContainer::DelProjectile(const CProjectile* p)
{
	ProjectileSet& ps = projectiles[TEX_TYPE(p)];

	if (!spring::VectorErase(ps, const_cast<CProjectile*>(p)))
		assert(false);

	numProjectiles -= 1;
}
Exemplo n.º 9
0
void IModelRenderContainer::AddUnit(const CUnit* u)
{
	UnitSet& us = units[TEX_TYPE(u)];

	// updating a unit's draw-position requires mutability
	if (!spring::VectorInsertUnique(us, const_cast<CUnit*>(u)))
		assert(false);

	numUnits += 1;
}
Exemplo n.º 10
0
void IModelRenderContainer::AddProjectile(const CProjectile* p)
{
	ProjectileSet& ps = projectiles[TEX_TYPE(p)];

	// updating a projectile's draw-position requires mutability
	if (!spring::VectorInsertUnique(ps, const_cast<CProjectile*>(p)))
		assert(false);

	numProjectiles += 1;
}