mirror of
https://github.com/minetest/minetest.git
synced 2024-11-09 17:23:45 +01:00
Fix getTextureRaw to always return an image that is not in the texture atlas and fix plain "^[forcesingle" handling
This commit is contained in:
parent
3509714951
commit
1da3a8e24b
11
src/tile.cpp
11
src/tile.cpp
@ -332,7 +332,7 @@ public:
|
||||
// Gets a separate texture
|
||||
video::ITexture* getTextureRaw(const std::string &name)
|
||||
{
|
||||
AtlasPointer ap = getTexture(name);
|
||||
AtlasPointer ap = getTexture(name + "^[forcesingle");
|
||||
return ap.atlas;
|
||||
}
|
||||
|
||||
@ -1170,6 +1170,15 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg,
|
||||
*/
|
||||
if(part_of_name == "[forcesingle")
|
||||
{
|
||||
// If base image is NULL, create a random color
|
||||
if(baseimg == NULL)
|
||||
{
|
||||
core::dimension2d<u32> dim(1,1);
|
||||
baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
|
||||
assert(baseimg);
|
||||
baseimg->setPixel(0,0, video::SColor(255,myrand()%256,
|
||||
myrand()%256,myrand()%256));
|
||||
}
|
||||
}
|
||||
/*
|
||||
[crackN
|
||||
|
Loading…
Reference in New Issue
Block a user