summaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2013-06-24 04:17:50 +0200
committerKahrl <kahrl@gmx.net>2013-07-02 03:03:10 +0200
commit8161ab573fd6f8a45b3986278ce7fc1596140526 (patch)
tree0aea4fce4e14e035b386ee773e8abd68bc51bea6 /src/nodedef.cpp
parentcaf0b67e47fd4c6b2a2bc61c36010e2adf9db388 (diff)
downloadminetest-8161ab573fd6f8a45b3986278ce7fc1596140526.tar.gz
minetest-8161ab573fd6f8a45b3986278ce7fc1596140526.tar.bz2
minetest-8161ab573fd6f8a45b3986278ce7fc1596140526.zip
Remove texture atlas / AtlasPointer, rename getTextureRaw to getTexture
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r--src/nodedef.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index 7d8ce70d3..13e7e9958 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -674,7 +674,9 @@ public:
// Tiles (fill in f->tiles[])
for(u16 j=0; j<6; j++){
// Texture
- f->tiles[j].texture = tsrc->getTexture(tiledef[j].name);
+ f->tiles[j].texture = tsrc->getTexture(
+ tiledef[j].name,
+ &f->tiles[j].texture_id);
// Alpha
f->tiles[j].alpha = f->alpha;
// Material type
@@ -689,10 +691,9 @@ public:
if(f->tiles[j].material_flags &
MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES)
{
- // Get raw texture size to determine frame count by
+ // Get texture size to determine frame count by
// aspect ratio
- video::ITexture *t = tsrc->getTextureRaw(tiledef[j].name);
- v2u32 size = t->getOriginalSize();
+ v2u32 size = f->tiles[j].texture->getOriginalSize();
int frame_height = (float)size.X /
(float)tiledef[j].animation.aspect_w *
(float)tiledef[j].animation.aspect_h;
@@ -715,8 +716,9 @@ public:
// Special tiles (fill in f->special_tiles[])
for(u16 j=0; j<CF_SPECIAL_COUNT; j++){
// Texture
- f->special_tiles[j].texture =
- tsrc->getTexture(f->tiledef_special[j].name);
+ f->special_tiles[j].texture = tsrc->getTexture(
+ f->tiledef_special[j].name,
+ &f->special_tiles[j].texture_id);
// Alpha
f->special_tiles[j].alpha = f->alpha;
// Material type
@@ -731,10 +733,9 @@ public:
if(f->special_tiles[j].material_flags &
MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES)
{
- // Get raw texture size to determine frame count by
+ // Get texture size to determine frame count by
// aspect ratio
- video::ITexture *t = tsrc->getTextureRaw(f->tiledef_special[j].name);
- v2u32 size = t->getOriginalSize();
+ v2u32 size = f->special_tiles[j].texture->getOriginalSize();
int frame_height = (float)size.X /
(float)f->tiledef_special[j].animation.aspect_w *
(float)f->tiledef_special[j].animation.aspect_h;