Revisão | f07c95bc5c3f962399518a1d0d5df3356e0ce650 (tree) |
---|---|
Hora | 2017-03-05 15:04:16 |
Autor | SUEHIRO <supersuehiro@user...> |
Commiter | SUEHIRO |
ソフト描画のスケール制限ができてなくて危ないのを修正
@@ -1315,16 +1315,18 @@ public &Anim<frame_t> | ||
1315 | 1315 | 1.0, 1.0, xs, xs, ys, 0.0, (float).com.GameWidth/2.0, fx, false); |
1316 | 1316 | ret; |
1317 | 1317 | } |
1318 | + xs *= h; | |
1319 | + ys *= v; | |
1318 | 1320 | .m.limRange!float?(xs=, -16000.0/.com.WidthScale, 16000.0/.com.WidthScale); |
1319 | 1321 | .m.limRange!float?( |
1320 | 1322 | ys=, -16000.0/.com.HeightScale, 16000.0/.com.HeightScale); |
1321 | 1323 | .sdl.renderMugenZoom( |
1322 | 1324 | .com.scrrect=, rx*.com.WidthScale, |
1323 | - (y+ys*v*(float)`frames[`drawidx].y)*.com.HeightScale, | |
1325 | + (y+ys*(float)`frames[`drawidx].y)*.com.HeightScale, | |
1324 | 1326 | `spr~pxl, `palFoo(fx), `mask, `spr~rct=, |
1325 | - #(xs*h)*(float)`spr~rct.x*.com.WidthScale, | |
1326 | - #(ys*v)*(float)`spr~rct.y*.com.HeightScale, `tile=, | |
1327 | - xs*h*.com.WidthScale, xs*h*.com.WidthScale, ys*v*.com.HeightScale, | |
1327 | + #xs*(float)`spr~rct.x*.com.WidthScale, | |
1328 | + #ys*(float)`spr~rct.y*.com.HeightScale, `tile=, | |
1329 | + xs*.com.WidthScale, xs*.com.WidthScale, ys*.com.HeightScale, | |
1328 | 1330 | 0.0, uagl, `alphaFoo(), `spr~rle, `spr~pluginbuf=); |
1329 | 1331 | /*?*/ |
1330 | 1332 | } |
@@ -1333,11 +1335,11 @@ public &Anim<frame_t> | ||
1333 | 1335 | ^&.com.PalFX fx, bool oVer, uint color, int alpha) |
1334 | 1336 | { |
1335 | 1337 | if(#`spr == 0 || #`spr~pxl == 0) ret; |
1336 | - float h = (float)`frames[`drawidx].h, v = (float)`frames[`drawidx].v; | |
1337 | - float xs = xscale, ys = yscale, agl = angle; | |
1338 | - `exParam(`frames[`drawidx]=, h=, v=, agl=); | |
1339 | - float x2 = x + xs*h*(float)`frames[`drawidx].x; | |
1340 | - float y2 = y + ys*vscale*v*(float)`frames[`drawidx].y; | |
1338 | + float xs = xscale * (float)`frames[`drawidx].h; | |
1339 | + float ys = yscale * (float)`frames[`drawidx].v, agl = angle; | |
1340 | + `exParam(`frames[`drawidx]=, xs=, ys=, agl=); | |
1341 | + float x2 = x + xs*(float)`frames[`drawidx].x; | |
1342 | + float y2 = y + ys*vscale*(float)`frames[`drawidx].y; | |
1341 | 1343 | /?/*.cfg.OpenGL: |
1342 | 1344 | if(color != 0x0 && `spr~rle != -12) loop{index i = 0; do: |
1343 | 1345 | .com.tmppl[i] = color; |
@@ -1346,20 +1348,20 @@ public &Anim<frame_t> | ||
1346 | 1348 | `spr~rle == -12 ? [void(int alp){ |
1347 | 1349 | .sdl.RenderMugenGlFcS(: |
1348 | 1350 | `spr~pxl<>, `spr~rct=, |
1349 | - #(xs*h)*(float)`spr~rct.x*.com.WidthScale, | |
1350 | - #(ys*v)*(float)`spr~rct.y*.com.HeightScale, `tile=, | |
1351 | - xs*h*.com.WidthScale, xs*h*.com.WidthScale, | |
1352 | - ys*v*.com.HeightScale, vscale, 0.0, agl, | |
1351 | + #xs*(float)`spr~rct.x*.com.WidthScale, | |
1352 | + #ys*(float)`spr~rct.y*.com.HeightScale, `tile=, | |
1353 | + xs*.com.WidthScale, xs*.com.WidthScale, | |
1354 | + ys*.com.HeightScale, vscale, 0.0, agl, | |
1353 | 1355 | alp, .com.scrrect=, (x2+(float).com.GameWidth/2.0)*.com.WidthScale, |
1354 | 1356 | y2*.com.HeightScale, color:); |
1355 | 1357 | }] |
1356 | 1358 | : [void(int alp){ |
1357 | 1359 | .sdl.RenderMugenGl(: |
1358 | 1360 | `spr~pxl<>, .com.tmppl<>=, `mask, `spr~rct=, |
1359 | - #(xs*h)*(float)`spr~rct.x*.com.WidthScale, | |
1360 | - #(ys*v)*(float)`spr~rct.y*.com.HeightScale, `tile=, | |
1361 | - xs*h*.com.WidthScale, xs*h*.com.WidthScale, | |
1362 | - ys*v*.com.HeightScale, vscale, 0.0, agl, | |
1361 | + #xs*(float)`spr~rct.x*.com.WidthScale, | |
1362 | + #ys*(float)`spr~rct.y*.com.HeightScale, `tile=, | |
1363 | + xs*.com.WidthScale, xs*.com.WidthScale, | |
1364 | + ys*.com.HeightScale, vscale, 0.0, agl, | |
1363 | 1365 | alp, .com.scrrect=, (x2+(float).com.GameWidth/2.0)*.com.WidthScale, |
1364 | 1366 | y2*.com.HeightScale:); |
1365 | 1367 | }]; |
@@ -1373,9 +1375,9 @@ public &Anim<frame_t> | ||
1373 | 1375 | .sdl.renderMugenShadow( |
1374 | 1376 | .com.scrrect=, (x2+(float).com.GameWidth/2.0)*.com.WidthScale, |
1375 | 1377 | y2*.com.HeightScale, `spr~pxl, color, `spr~rct=, |
1376 | - #(xs*h)*(float)`spr~rct.x*.com.WidthScale, | |
1377 | - #(ys*v)*(float)`spr~rct.y*.com.HeightScale, | |
1378 | - xs*h*.com.WidthScale, ys*v*.com.HeightScale, vscale, | |
1378 | + #xs*(float)`spr~rct.x*.com.WidthScale, | |
1379 | + #ys*(float)`spr~rct.y*.com.HeightScale, | |
1380 | + xs*.com.WidthScale, ys*.com.HeightScale, vscale, | |
1379 | 1381 | uagl, alpha, `spr~rle, `spr~pluginbuf=); |
1380 | 1382 | /*?*/ |
1381 | 1383 | } |