#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;
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;
}
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]
{0, 5}, {1, 5},
});
- result->unlock();
return result;
}
// 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)
}
image_data += image_pitch;
}
- image->unlock();
break;
}
// 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)
{
}
glyph_data += bits.pitch;
}
- image->unlock();
break;
}
default: