| 160 | //========================================================================== |
| 161 | |
| 162 | static int tileImportFromTexture(FScanner& sc, const char* fn, int tilenum, int alphacut, int istexture) |
| 163 | { |
| 164 | FTextureID texid = TexMan.CheckForTexture(fn, ETextureType::Any, FTextureManager::TEXMAN_ForceLookup); |
| 165 | if (!texid.isValid()) return -1; |
| 166 | auto tex = TexMan.GetGameTexture(texid); |
| 167 | |
| 168 | int32_t xsiz = tex->GetTexelWidth(), ysiz = tex->GetTexelHeight(); |
| 169 | |
| 170 | if (xsiz <= 0 || ysiz <= 0) |
| 171 | return -2; |
| 172 | |
| 173 | tbuild->tile[tilenum].imported = TexMan.GetGameTexture(texid); |
| 174 | tbuild->tile[tilenum].tileimage = tbuild->tile[tilenum].imported->GetTexture()->GetImage(); |
| 175 | |
| 176 | if (istexture) |
| 177 | tileSetHightileReplacement(sc, tilenum, 0, fn, (float)(255 - alphacut) * (1.f / 255.f), 1.0f, 1.0f, 1.0, 1.0); |
| 178 | return 0; |
| 179 | |
| 180 | } |
| 181 | |
| 182 | //=========================================================================== |
| 183 | // |
no test coverage detected