Ejemplo n.º 1
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
GOSImage*
GOSImagePool::GetImage(PCSTR image_name, gos_TextureFormat format, int32_t size, gos_TextureHints hints)
{
	Check_Object(this);
	MString imageName = image_name;
	Verify(imageName.GetLength() > 0);
	//
	//---------------------------
	// Get the image for the name
	//---------------------------
	//
	GOSImage* image;
	if((image = imageHash.Find(imageName)) == nullptr)
	{
		gos_PushCurrentHeap(Heap);
		image = new GOSImage(image_name, hints);
		Register_Object(image);
		gos_PopCurrentHeap();
		imageHash.AddValue(image, image->imageName);
	}
#ifdef _ARMOR
	else
	{
	}
#endif
	Check_Object(image);
	return image;
}
Ejemplo n.º 2
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
MLRPointLight::MLRPointLight(
	Stuff::MemoryStream *stream,
	int version
) :
	MLRInfiniteLightWithFalloff(DefaultData, stream, version)
{
	Check_Object(stream);
	Verify(gos_GetCurrentHeap() == Heap);
	lightMap = NULL;
	if (version > 7)
	{
		MString name;
		*stream >> name;
		if (name.GetLength() > 0)
		{
			Check_Object(MLRTexturePool::Instance);
			MLRTexture *texture = (*MLRTexturePool::Instance)(name, 0);
			if (!texture)
				texture = MLRTexturePool::Instance->Add(name, 0);
			Check_Object(texture);
			lightMap = new MLRLightMap(texture);
			Check_Object(lightMap);
			lightMask |= MLRState::LightMapLightingMode;
		}
	}
Ejemplo n.º 3
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
GOSImage*
GOSImagePool::GetImage(PCSTR image_name)
{
	Check_Object(this);
	MString imageName = image_name;
	Verify(imageName.GetLength() > 0);
	//
	//---------------------------
	// Get the image for the name
	//---------------------------
	//
	GOSImage* image;
	if((image = imageHash.Find(imageName)) == nullptr)
	{
		gos_PushCurrentHeap(Heap);
		image = new GOSImage(image_name);
		Register_Object(image);
		gos_PopCurrentHeap();
		imageHash.AddValue(image, image->imageName);
	}
	Check_Object(image);
	return image;
}