parent
9980a3d94a
commit
18c9eea067
17
src/glwin.c
17
src/glwin.c
|
@ -318,17 +318,22 @@ SceneDraw1(double t, EWin ** ewins, int num)
|
||||||
|
|
||||||
w = EobjGetW(GLWin.eo);
|
w = EobjGetW(GLWin.eo);
|
||||||
h = EobjGetH(GLWin.eo);
|
h = EobjGetH(GLWin.eo);
|
||||||
|
w = (3 * w) / 4;
|
||||||
|
|
||||||
DrawBackground(texture[sel_bg], w, h);
|
DrawBackground(texture[sel_bg], w, h);
|
||||||
|
|
||||||
i = sqrt(w * h / (1.5 * num));
|
i = sqrt(w * h / (1.0 * num));
|
||||||
ny = h / i;
|
nx = (w + i - 1) / i;
|
||||||
nx = num / ny;
|
if (nx <= 0)
|
||||||
|
nx = 1;
|
||||||
|
ny = (num + nx - 1) / nx;
|
||||||
|
if (ny <= 0)
|
||||||
|
ny = 1;
|
||||||
#if 0
|
#if 0
|
||||||
Eprintf("wxh=%fx%f num=%d nx,ny=%d,%d\n", w, h, num, nx, ny);
|
Eprintf("wxh=%fx%f num=%d nx,ny=%d,%d\n", w, h, num, nx, ny);
|
||||||
#endif
|
#endif
|
||||||
w /= nx;
|
w = EobjGetW(GLWin.eo) / nx;
|
||||||
h /= ny;
|
h = EobjGetH(GLWin.eo) / ny;
|
||||||
|
|
||||||
k = 0;
|
k = 0;
|
||||||
for (j = 0; j < ny; j++)
|
for (j = 0; j < ny; j++)
|
||||||
|
@ -344,7 +349,7 @@ SceneDraw1(double t, EWin ** ewins, int num)
|
||||||
dx = (fabs(dx) < 1.0) ? 0. : dx * sin(5. * t);
|
dx = (fabs(dx) < 1.0) ? 0. : dx * sin(5. * t);
|
||||||
dy = 100.0f * exp(-t);
|
dy = 100.0f * exp(-t);
|
||||||
dy = (fabs(dy) < 1.0) ? 0. : dy * cos(5. * t);
|
dy = (fabs(dy) < 1.0) ? 0. : dy * cos(5. * t);
|
||||||
sz = (k == sel_ewin) ? 1.0f : 0.5f;
|
sz = (k == sel_ewin) ? 0.6f : 0.5f;
|
||||||
DrawQube(EobjGetTexture(eo),
|
DrawQube(EobjGetTexture(eo),
|
||||||
dx + (0.5f + i) * w, dy + (0.5f + j) * h, 500.0f,
|
dx + (0.5f + i) * w, dy + (0.5f + j) * h, 500.0f,
|
||||||
sz * EobjGetW(eo), sz * EobjGetH(eo), rot_x, rot_y);
|
sz * EobjGetW(eo), sz * EobjGetH(eo), rot_x, rot_y);
|
||||||
|
|
Loading…
Reference in New Issue