MCPcopy Create free account
hub / github.com/defold/defold / ToImageType

Function ToImageType

engine/gui/src/gui_script.cpp:2100–2116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2098 }
2099
2100 static dmImage::Type ToImageType(lua_State* L, const char* type_str)
2101 {
2102 if (strcmp(type_str, "rgb") == 0) {
2103 return dmImage::TYPE_RGB;
2104 } else if (strcmp(type_str, "rgba") == 0) {
2105 return dmImage::TYPE_RGBA;
2106 } else if (strcmp(type_str, "l") == 0) {
2107 return dmImage::TYPE_LUMINANCE;
2108 } else if (strcmp(type_str, "astc") == 0) {
2109 return dmImage::TYPE_RGBA;
2110 } else {
2111 luaL_error(L, "unsupported texture format '%s'", type_str);
2112 }
2113
2114 // never reached
2115 return (dmImage::Type) 0;
2116 }
2117
2118 static dmImage::CompressionType ToImageCompressionType(const char* type_str)
2119 {

Callers 2

LuaNewTextureFunction · 0.85
LuaSetTextureDataFunction · 0.85

Calls 1

luaL_errorFunction · 0.85

Tested by

no test coverage detected