aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Patrick Guerrero <jeanpatrick.guerrero@gmail.com>2021-03-16 19:55:10 +0100
committersfan5 <sfan5@live.de>2021-03-16 23:27:15 +0100
commit66b5c086644ac18845731d6f3556d9e7cde4ee28 (patch)
tree13648e3b04ea462209eb1de6fa6a6c5b76fffb66
parent62e3593944846c0e7395586183986e0f11ad9544 (diff)
downloadminetest-66b5c086644ac18845731d6f3556d9e7cde4ee28.tar.gz
minetest-66b5c086644ac18845731d6f3556d9e7cde4ee28.tar.bz2
minetest-66b5c086644ac18845731d6f3556d9e7cde4ee28.zip
Fix deprecated calls with Irrlicht 1.9
-rw-r--r--src/client/guiscalingfilter.cpp2
-rw-r--r--src/client/shader.h5
-rw-r--r--src/client/tile.cpp6
-rw-r--r--src/irrlicht_changes/CGUITTFont.cpp6
4 files changed, 8 insertions, 11 deletions
diff --git a/src/client/guiscalingfilter.cpp b/src/client/guiscalingfilter.cpp
index 406c096e6..8c565a52f 100644
--- a/src/client/guiscalingfilter.cpp
+++ b/src/client/guiscalingfilter.cpp
@@ -129,7 +129,7 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver,
#endif
// Convert the scaled image back into a texture.
- scaled = driver->addTexture(scalename, destimg, NULL);
+ scaled = driver->addTexture(scalename, destimg);
destimg->drop();
g_txrCache[scalename] = scaled;
diff --git a/src/client/shader.h b/src/client/shader.h
index 38ab76704..49a563115 100644
--- a/src/client/shader.h
+++ b/src/client/shader.h
@@ -96,9 +96,10 @@ public:
if (has_been_set && std::equal(m_sent, m_sent + count, value))
return;
if (is_pixel)
- services->setPixelShaderConstant(m_name, value, count);
+ services->setPixelShaderConstant(services->getPixelShaderConstantID(m_name), value, count);
else
- services->setVertexShaderConstant(m_name, value, count);
+ services->setVertexShaderConstant(services->getVertexShaderConstantID(m_name), value, count);
+
std::copy(value, value + count, m_sent);
has_been_set = true;
}
diff --git a/src/client/tile.cpp b/src/client/tile.cpp
index f2639757e..7e3901247 100644
--- a/src/client/tile.cpp
+++ b/src/client/tile.cpp
@@ -837,17 +837,16 @@ static video::IImage *createInventoryCubeImage(
image = scaled;
}
sanity_check(image->getPitch() == 4 * size);
- return reinterpret_cast<u32 *>(image->lock());
+ return reinterpret_cast<u32 *>(image->getData());
};
auto free_image = [] (video::IImage *image) -> void {
- image->unlock();
image->drop();
};
video::IImage *result = driver->createImage(video::ECF_A8R8G8B8, {cube_size, cube_size});
sanity_check(result->getPitch() == 4 * cube_size);
result->fill(video::SColor(0x00000000u));
- u32 *target = reinterpret_cast<u32 *>(result->lock());
+ u32 *target = reinterpret_cast<u32 *>(result->getData());
// Draws single cube face
// `shade_factor` is face brightness, in range [0.0, 1.0]
@@ -906,7 +905,6 @@ static video::IImage *createInventoryCubeImage(
{0, 5}, {1, 5},
});
- result->unlock();
return result;
}
diff --git a/src/irrlicht_changes/CGUITTFont.cpp b/src/irrlicht_changes/CGUITTFont.cpp
index bd4e700de..960b2320a 100644
--- a/src/irrlicht_changes/CGUITTFont.cpp
+++ b/src/irrlicht_changes/CGUITTFont.cpp
@@ -103,7 +103,7 @@ video::IImage* SGUITTGlyph::createGlyphImage(const FT_Bitmap& bits, video::IVide
// Load the monochrome data in.
const u32 image_pitch = image->getPitch() / sizeof(u16);
- u16* image_data = (u16*)image->lock();
+ u16* image_data = (u16*)image->getData();
u8* glyph_data = bits.buffer;
for (s32 y = 0; y < (s32)bits.rows; ++y)
@@ -119,7 +119,6 @@ video::IImage* SGUITTGlyph::createGlyphImage(const FT_Bitmap& bits, video::IVide
}
image_data += image_pitch;
}
- image->unlock();
break;
}
@@ -133,7 +132,7 @@ video::IImage* SGUITTGlyph::createGlyphImage(const FT_Bitmap& bits, video::IVide
// Load the grayscale data in.
const float gray_count = static_cast<float>(bits.num_grays);
const u32 image_pitch = image->getPitch() / sizeof(u32);
- u32* image_data = (u32*)image->lock();
+ u32* image_data = (u32*)image->getData();
u8* glyph_data = bits.buffer;
for (s32 y = 0; y < (s32)bits.rows; ++y)
{
@@ -145,7 +144,6 @@ video::IImage* SGUITTGlyph::createGlyphImage(const FT_Bitmap& bits, video::IVide
}
glyph_data += bits.pitch;
}
- image->unlock();
break;
}
default: