| 403 | // additional frames can be used for various shaders |
| 404 | |
| 405 | Texture *textureload(const char *name, int clamp, bool mipmap, bool canreduce, float scale, bool trydl) |
| 406 | { |
| 407 | defformatstring(pname)("%.7g ", scale); |
| 408 | copystring(pname + TEXSCALEPREFIXSIZE, name, MAXSTRLEN - TEXSCALEPREFIXSIZE); |
| 409 | path(pname + TEXSCALEPREFIXSIZE); |
| 410 | Texture *t = textures.access(pname); |
| 411 | if(t) return t; |
| 412 | int xs, ys, bpp; |
| 413 | GLuint id = loadsurface(pname + TEXSCALEPREFIXSIZE, xs, ys, bpp, clamp, mipmap, canreduce, scale, trydl); |
| 414 | if(!id) return notexture; |
| 415 | char *key = newstring(pname); |
| 416 | t = &textures[key]; |
| 417 | t->name = key + TEXSCALEPREFIXSIZE; |
| 418 | t->xs = xs; |
| 419 | t->ys = ys; |
| 420 | t->bpp = bpp; |
| 421 | t->clamp = clamp; |
| 422 | t->mipmap = mipmap; |
| 423 | t->canreduce = canreduce; |
| 424 | t->id = id; |
| 425 | t->scale = scale; |
| 426 | return t; |
| 427 | } |
| 428 | |
| 429 | struct Slot |
| 430 | { |
no test coverage detected