mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-01-31 04:30:38 +00:00
resize the modelviewer's texture display if it would have gone offscreen.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5915 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
36f750ba23
commit
9bd8625d90
1 changed files with 11 additions and 2 deletions
|
@ -3964,9 +3964,18 @@ static void M_ModelViewerDraw(int x, int y, struct menucustom_s *c, struct emenu
|
||||||
}
|
}
|
||||||
if (shader->defaulttextures->base)
|
if (shader->defaulttextures->base)
|
||||||
{
|
{
|
||||||
Draw_FunString(0, y, va("%s: %s (%s)", t, shader->defaulttextures->base->ident, shader->defaulttextures->base->subpath?shader->defaulttextures->base->subpath:""));
|
float w, h;
|
||||||
|
Draw_FunString(0, y, va("%s: %s (%s), %s %u*%u*%u",
|
||||||
|
t, shader->defaulttextures->base->ident, shader->defaulttextures->base->subpath?shader->defaulttextures->base->subpath:"",
|
||||||
|
Image_FormatName(shader->defaulttextures->base->format), shader->defaulttextures->base->width, shader->defaulttextures->base->height, shader->defaulttextures->base->depth));
|
||||||
y+=8;
|
y+=8;
|
||||||
R2D_Image(0, y, shader->defaulttextures->base->width, shader->defaulttextures->base->height, 0, 0, 1, 1, shader);
|
|
||||||
|
w = (float)vid.width / shader->defaulttextures->base->width;
|
||||||
|
h = (float)(vid.height-y) / shader->defaulttextures->base->height;
|
||||||
|
h = min(min(w,h), 1);
|
||||||
|
w = h*shader->defaulttextures->base->width;
|
||||||
|
h = h*shader->defaulttextures->base->height;
|
||||||
|
R2D_Image(0, y, w, h, 0, 0, 1, 1, shader);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Draw_FunString(0, y, va("%s: <NO TEXTURE>", t));
|
Draw_FunString(0, y, va("%s: <NO TEXTURE>", t));
|
||||||
|
|
Loading…
Reference in a new issue