summaryrefslogtreecommitdiff
path: root/src/tile.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-12-01 13:00:27 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-12-01 13:00:27 +0200
commit1da3a8e24b3366179ff50c4bae170dec8bed0475 (patch)
tree9c73b8fc95d298dbad5b1d875c4be5c9fe6040f5 /src/tile.cpp
parent35097149515e80e9a11c51161f0138b68ee07a3e (diff)
downloadminetest-1da3a8e24b3366179ff50c4bae170dec8bed0475.tar.gz
minetest-1da3a8e24b3366179ff50c4bae170dec8bed0475.tar.bz2
minetest-1da3a8e24b3366179ff50c4bae170dec8bed0475.zip
Fix getTextureRaw to always return an image that is not in the texture atlas and fix plain "^[forcesingle" handling
Diffstat (limited to 'src/tile.cpp')
-rw-r--r--src/tile.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tile.cpp b/src/tile.cpp
index 29c6b3e67..27454c321 100644
--- a/src/tile.cpp
+++ b/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