mirror of https://github.com/bjornbytes/lovr.git
Compile fixes;
This commit is contained in:
parent
77a32333e0
commit
211e3ef0f8
|
@ -620,7 +620,6 @@ static int l_lovrGraphicsNewTexture(lua_State* L) {
|
||||||
if (info.imageCount > 0) {
|
if (info.imageCount > 0) {
|
||||||
info.images = images;
|
info.images = images;
|
||||||
Image* image = images[0];
|
Image* image = images[0];
|
||||||
uint32_t layers = lovrImageGetLayerCount(image);
|
|
||||||
uint32_t levels = lovrImageGetLevelCount(image);
|
uint32_t levels = lovrImageGetLevelCount(image);
|
||||||
info.format = lovrImageGetFormat(image);
|
info.format = lovrImageGetFormat(image);
|
||||||
info.width = lovrImageGetWidth(image);
|
info.width = lovrImageGetWidth(image);
|
||||||
|
|
|
@ -105,6 +105,9 @@ static int l_lovrTextureHasUsage(lua_State* L) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const luaL_Reg lovrTexture[] = {
|
const luaL_Reg lovrTexture[] = {
|
||||||
|
{ "newView", l_lovrTextureNewView },
|
||||||
|
{ "isView", l_lovrTextureIsView },
|
||||||
|
{ "getParent", l_lovrTextureGetParent },
|
||||||
{ "getType", l_lovrTextureGetType },
|
{ "getType", l_lovrTextureGetType },
|
||||||
{ "getFormat", l_lovrTextureGetFormat },
|
{ "getFormat", l_lovrTextureGetFormat },
|
||||||
{ "getWidth", l_lovrTextureGetWidth },
|
{ "getWidth", l_lovrTextureGetWidth },
|
||||||
|
@ -113,5 +116,6 @@ const luaL_Reg lovrTexture[] = {
|
||||||
{ "getDimensions", l_lovrTextureGetDimensions },
|
{ "getDimensions", l_lovrTextureGetDimensions },
|
||||||
{ "getMipmapCount", l_lovrTextureGetMipmapCount },
|
{ "getMipmapCount", l_lovrTextureGetMipmapCount },
|
||||||
{ "getSampleCount", l_lovrTextureGetSampleCount },
|
{ "getSampleCount", l_lovrTextureGetSampleCount },
|
||||||
|
{ "hasUsage ", l_lovrTextureHasUsage },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
|
@ -331,7 +331,7 @@ Texture* lovrTextureCreate(TextureInfo* info) {
|
||||||
uint32_t levelCount = 0;
|
uint32_t levelCount = 0;
|
||||||
uint32_t levelOffsets[16];
|
uint32_t levelOffsets[16];
|
||||||
uint32_t levelSizes[16];
|
uint32_t levelSizes[16];
|
||||||
gpu_buffer* scratchpad;
|
gpu_buffer* scratchpad = NULL;
|
||||||
|
|
||||||
if (info->imageCount > 0) {
|
if (info->imageCount > 0) {
|
||||||
levelCount = lovrImageGetLevelCount(info->images[0]);
|
levelCount = lovrImageGetLevelCount(info->images[0]);
|
||||||
|
@ -355,7 +355,7 @@ Texture* lovrTextureCreate(TextureInfo* info) {
|
||||||
uint32_t slice = info->imageCount == 1 ? layer : 0;
|
uint32_t slice = info->imageCount == 1 ? layer : 0;
|
||||||
uint32_t size = lovrImageGetLayerSize(image, level);
|
uint32_t size = lovrImageGetLayerSize(image, level);
|
||||||
lovrCheck(size == levelSizes[level], "Texture/Image size mismatch!");
|
lovrCheck(size == levelSizes[level], "Texture/Image size mismatch!");
|
||||||
void* pixels = lovrImageGetLayerData(image, level, layer);
|
void* pixels = lovrImageGetLayerData(image, level, slice);
|
||||||
memcpy(data, pixels, size);
|
memcpy(data, pixels, size);
|
||||||
data += size;
|
data += size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue