Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LUAMTA_FUNCTION(texture, SetData)
- {
- auto self = my->ToTexture(1);
- auto buffer = (unsigned char *)my->ToString(2);
- auto rect = my->ToRect(3, Rect(0, 0, self->GetWidth(), self->GetHeight()));
- if (buffer[2])
- {
- gEnv->pRenderer->UpdateTextureInVideoMemory(
- self->GetTextureID(),
- buffer,
- rect.x,
- rect.y,
- rect.w,
- rect.h,
- my->ToEnum<ETEX_Format>(4, eTF_A8R8G8B8)
- );
- my->Push(true);
- return 1;
- }
- return 0;
- }
- LUAMTA_FUNCTION(texture, GeteData)
- {
- auto self = my->ToTexture(1);
- my->Push((const char *)self->GetSystemCopy());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment