リビジョン | 611d1fedf1bc004f2ca8d1868820cec0074fce9d (tree) |
---|---|
日時 | 2013-12-31 06:27:25 |
作者 | SUEHIRO <supersuehiro@user...> |
コミッター | SUEHIRO |
ステートコントローラーのzoomに対応
@@ -65,10 +65,9 @@ void drawClsn() | ||
65 | 65 | { |
66 | 66 | public ^&.act.Action anim; |
67 | 67 | public int priority = 0; |
68 | - public float x = 0.0, y = 0.0, cscl = 1.0; | |
68 | + public float x = 0.0, y = 0.0; | |
69 | 69 | public float xscl = 1.0, yscl = 1.0, angle = 0.0, axscl = 1.0, ayscl = 1.0; |
70 | - public bool aset = false, oVer = false; | |
71 | - public short bright = 256; | |
70 | + public bool aset = false, oVer = false, screen = false, bright = false; | |
72 | 71 | public int salpha = -1, dalpha = 0; |
73 | 72 | public ^&.com.PalFX fx; |
74 | 73 | } |
@@ -86,9 +85,9 @@ void drawClsn() | ||
86 | 85 | |
87 | 86 | public void addAnimList( |
88 | 87 | %^&.AnimSprite al=, ^&.act.Action a, int p, |
89 | - float x, float y, float cs, float xs, float ys, | |
88 | + float x, float y, bool scr, float xs, float ys, | |
90 | 89 | float an, bool as, bool oVer, float ax, float ay, |
91 | - int sa, int da, int b, ^&.com.PalFX fx, int sc, int salp, float so) | |
90 | + int sa, int da, bool b, ^&.com.PalFX fx, int sc, int salp, float so) | |
92 | 91 | { |
93 | 92 | ^&.AnimSprite newSprite() |
94 | 93 | { |
@@ -98,7 +97,7 @@ public void addAnimList( | ||
98 | 97 | as~priority = `p; |
99 | 98 | as~x = `x; |
100 | 99 | as~y = `y; |
101 | - as~cscl = `cs; | |
100 | + as~screen = `scr; | |
102 | 101 | as~xscl = `xs; |
103 | 102 | as~yscl = `ys; |
104 | 103 | as~angle = `an; |
@@ -137,7 +136,7 @@ public void addAnimList( | ||
137 | 136 | } |
138 | 137 | } |
139 | 138 | |
140 | -public void drawAnimList(%^&.AnimSprite al=, float x, float y) | |
139 | +public void drawAnimList(%^&.AnimSprite al=, float x, float y, float scl) | |
141 | 140 | { |
142 | 141 | loop{index i = 0; while; do: |
143 | 142 | if(#al[i]~anim > 0) al[i]~[void(as=){ |
@@ -145,19 +144,34 @@ public void drawAnimList(%^&.AnimSprite al=, float x, float y) | ||
145 | 144 | as.anim~ani.dalpha = as.dalpha; |
146 | 145 | branch{ |
147 | 146 | int ob = .com.brightness; |
148 | - .com.brightness = as.bright; | |
149 | - float cs = as.cscl; | |
147 | + if(as.bright) .com.brightness = 256; | |
148 | + float cs = as.screen ? 1.0 : scl, px, py; | |
150 | 149 | cond as.angle != 0.0: |
150 | + branch{ | |
151 | + cond as.screen: | |
152 | + px = as.x; | |
153 | + py = as.y; | |
154 | + else: | |
155 | + px = .com.xoffset-(x-as.x)*cs; | |
156 | + py = | |
157 | + .com.zoffset+.com.yoffset-.stage.envShake.getOffset()-(y-as.y)*cs; | |
158 | + } | |
151 | 159 | as.anim~ani.angleDraw( |
152 | - .com.xoffset-(x-as.x)*cs, | |
153 | - .com.zoffset+.com.yoffset-.stage.envShake.getOffset()-(y-as.y)*cs, | |
154 | - cs*as.xscl, cs*as.yscl, as.angle*(.m.PI/180.0), | |
160 | + px, py, cs*as.xscl, cs*as.yscl, as.angle*(.m.PI/180.0), | |
155 | 161 | as.aset, as.axscl, as.ayscl, as.fx, as.oVer); |
156 | 162 | else: |
163 | + branch{ | |
164 | + cond as.screen: | |
165 | + px = as.x; | |
166 | + py = as.y; | |
167 | + else: | |
168 | + px = .com.xoffset/cs - (x-as.x); | |
169 | + py = | |
170 | + (.com.zoffset+.com.yoffset-.stage.envShake.getOffset())/cs | |
171 | + - (y-as.y); | |
172 | + } | |
157 | 173 | as.anim~ani.draw( |
158 | - .com.scrrect=, .com.xoffset/cs - (x-as.x), | |
159 | - (.com.zoffset+.com.yoffset-.stage.envShake.getOffset())/cs | |
160 | - - (y-as.y), cs, cs, as.xscl, as.xscl, | |
174 | + .com.scrrect=, px, py, cs, cs, as.xscl, as.xscl, | |
161 | 175 | as.yscl, 0.0, (float).com.GameWidth/2.0, as.fx, as.oVer); |
162 | 176 | break: |
163 | 177 | .com.brightness = ob; |
@@ -203,7 +217,7 @@ public void addShadowList(^&.AnimSprite as, int sc, float so, int alpha) | ||
203 | 217 | } |
204 | 218 | } |
205 | 219 | |
206 | -public void drawShadowList(float x, float y) | |
220 | +public void drawShadowList(float x, float y, float scl) | |
207 | 221 | { |
208 | 222 | loop{index i = 0; while; do: |
209 | 223 | if(#.shadows[i]~as~anim == 0 || #.shadows[i]~as~anim~ani.spr == 0){ |
@@ -239,12 +253,11 @@ public void drawShadowList(float x, float y) | ||
239 | 253 | & (int)0xffffff; |
240 | 254 | } |
241 | 255 | float syscl = .stg~sdw.yscale; |
242 | - float cs = ss.as~cscl; | |
243 | 256 | ss.as~anim~ani.shadowDraw( |
244 | - .com.xoffset-(x-ss.as~x)*cs, | |
257 | + .com.xoffset-(x-ss.as~x)*scl, | |
245 | 258 | .com.zoffset + .com.yoffset - .stage.envShake.getOffset() |
246 | - - (y+ss.as~y*syscl-ss.offsety)*cs, | |
247 | - cs*ss.as~xscl, cs*-ss.as~yscl, syscl, ss.as~angle*(.m.PI/180.0), | |
259 | + - (y+ss.as~y*syscl-ss.offsety)*scl, | |
260 | + scl*ss.as~xscl, scl*-ss.as~yscl, syscl, ss.as~angle*(.m.PI/180.0), | |
248 | 261 | ss.as~aset, ss.as~axscl, ss.as~ayscl, .stage.bgPalFX, ss.as~oVer, |
249 | 262 | (uint)color, intensity); |
250 | 263 | }]; |
@@ -253,7 +266,7 @@ public void drawShadowList(float x, float y) | ||
253 | 266 | while i < #.shadows:} |
254 | 267 | } |
255 | 268 | |
256 | -public void drawReflection(float x, float y) | |
269 | +public void drawReflection(float x, float y, float scl) | |
257 | 270 | { |
258 | 271 | loop{index i = 0; while; do: |
259 | 272 | if(#.shadows[i]~as~anim == 0 || #.shadows[i]~as~anim~ani.frames == 0){ |
@@ -275,20 +288,19 @@ public void drawReflection(float x, float y) | ||
275 | 288 | ss.as~anim~ani.salpha = 0; |
276 | 289 | } |
277 | 290 | branch{ |
278 | - float cs = ss.as~cscl; | |
279 | 291 | cond ss.as~angle != 0.0: |
280 | 292 | ss.as~anim~ani.angleDraw( |
281 | - .com.xoffset-(x-ss.as~x)*cs, | |
293 | + .com.xoffset-(x-ss.as~x)*scl, | |
282 | 294 | .com.zoffset + .com.yoffset - .stage.envShake.getOffset() |
283 | - - (y+ss.as~y-ss.offsety)*cs, | |
284 | - cs*ss.as~xscl, cs*-ss.as~yscl, ss.as~angle*(.m.PI/180.0), | |
295 | + - (y+ss.as~y-ss.offsety)*scl, | |
296 | + scl*ss.as~xscl, scl*-ss.as~yscl, ss.as~angle*(.m.PI/180.0), | |
285 | 297 | ss.as~aset, ss.as~axscl, ss.as~ayscl, ss.as~fx, ss.as~oVer); |
286 | 298 | else: |
287 | 299 | ss.as~anim~ani.draw( |
288 | - .com.scrrect=, .com.xoffset/cs - (x-ss.as~x), | |
289 | - (.com.zoffset+.com.yoffset-.stage.envShake.getOffset())/cs | |
300 | + .com.scrrect=, .com.xoffset/scl - (x-ss.as~x), | |
301 | + (.com.zoffset+.com.yoffset-.stage.envShake.getOffset())/scl | |
290 | 302 | - (y+ss.as~y-ss.offsety), |
291 | - cs, cs, ss.as~xscl, ss.as~xscl, -ss.as~yscl, 0.0, | |
303 | + scl, scl, ss.as~xscl, ss.as~xscl, -ss.as~yscl, 0.0, | |
292 | 304 | (float).com.GameWidth/2.0, ss.as~fx, ss.as~oVer); |
293 | 305 | } |
294 | 306 | }]; |
@@ -466,7 +478,7 @@ public void drawReflection(float x, float y) | ||
466 | 478 | public void recAndAddAL( |
467 | 479 | &.act.Action a=, int p, |
468 | 480 | float x, float y, float xs, float ys, float an, bool as, |
469 | - bool oVer, float ax, float ay, bool rec, int br, ^&.com.PalFX cfx) | |
481 | + bool oVer, float ax, float ay, bool rec, bool br, ^&.com.PalFX cfx) | |
470 | 482 | { |
471 | 483 | if( |
472 | 484 | `time == 0 || !.m.inRange!int?(1, 32767, `timegap) |
@@ -485,7 +497,7 @@ public void drawReflection(float x, float y) | ||
485 | 497 | pfxi = i/`framegap - 1; |
486 | 498 | .addAnimList( |
487 | 499 | .anims=, `imgs[`imgidx-i&63].anim, p-2, |
488 | - `imgs[`imgidx-i&63].x, `imgs[`imgidx-i&63].y, .com.scale, | |
500 | + `imgs[`imgidx-i&63].x, `imgs[`imgidx-i&63].y, false, | |
489 | 501 | `imgs[`imgidx-i&63].xscl, `imgs[`imgidx-i&63].yscl, |
490 | 502 | `imgs[`imgidx-i&63].angle, `imgs[`imgidx-i&63].aset, |
491 | 503 | `imgs[`imgidx-i&63].oVer, |
@@ -2021,11 +2033,9 @@ public &Projectile | ||
2021 | 2033 | } |
2022 | 2034 | } |
2023 | 2035 | if(#`ani > 0 && #`ani~ani.spr > 0){ |
2024 | - int br = | |
2025 | - 256 >> (int)( | |
2026 | - .super > 0 && .superdarken != 0 && playerNo != .superplayer); | |
2036 | + bool br = playerNo == .superplayer; | |
2027 | 2037 | .addAnimList( |
2028 | - .anims=, `ani, `sprpriority, `x, `y, .com.scale, | |
2038 | + .anims=, `ani, `sprpriority, `x, `y, false, | |
2029 | 2039 | (float)`facing*`scalex, `scaley, 0.0, false, oVer, 1.0, 1.0, -1, 0, |
2030 | 2040 | br, `palfx, |
2031 | 2041 | `shadowr<<16 | (`shadowg&255)<<8 | (`shadowb&255), 256, 0.0); |
@@ -3156,8 +3166,7 @@ public &Char | ||
3156 | 3166 | float ys = `sysfvar[.fYSCALE]; |
3157 | 3167 | if(#`ani > 0) branch{ |
3158 | 3168 | int sp = `sprpriority; |
3159 | - int br = 256 >> (int)( | |
3160 | - .super > 0 && .superdarken != 0 && `playerno != .superplayer); | |
3169 | + bool br = `playerno == .superplayer; | |
3161 | 3170 | float an; |
3162 | 3171 | branch{ |
3163 | 3172 | cond `ls(.lsANGLEDRAW): |
@@ -3177,7 +3186,7 @@ public &Char | ||
3177 | 3186 | .anims=, `ani, sp, |
3178 | 3187 | x - (float)( |
3179 | 3188 | (int)(`stVal.hb.hitshaketime > 0 && (`stVal.time&1) != 0) * `facing), |
3180 | - y, .com.scale, xs, ys, an, `angleset, `mver0() != 1, | |
3189 | + y, false, xs, ys, an, `angleset, `mver0() != 1, | |
3181 | 3190 | `sysfvar[.fANGLESCALEX], `sysfvar[.fANGLESCALEY], |
3182 | 3191 | `ls(.lsTRANS) ? `sysivar[.iALPHAS] : -1, |
3183 | 3192 | `sysivar[.iALPHAD], br, `getPalfx(), |
@@ -5528,17 +5537,16 @@ public void Explod::update(bool oVer, int playerNo) | ||
5528 | 5537 | ret; |
5529 | 5538 | } |
5530 | 5539 | } |
5531 | - float scl = 1.0, cscl = .com.scale, xofs = 0.0, yofs = 0.0; | |
5540 | + float scl = 1.0; | |
5541 | + bool screen = false; | |
5532 | 5542 | if(`bindtime != 0) branch{ |
5533 | 5543 | cond `postype >= 4: |
5534 | - cscl = 1.0; | |
5544 | + screen = true; | |
5535 | 5545 | `x = |
5536 | - .com.camerax + `offsetx + ( | |
5546 | + `offsetx + ( | |
5537 | 5547 | `postype == 4 |
5538 | 5548 | ? -(float).com.GameWidth/2.0 : (float).com.GameWidth/2.0); |
5539 | - xofs = -.com.xoffset; | |
5540 | - `y = .com.cameray + `offsety - .com.zoffset; | |
5541 | - yofs = -.com.yoffset + .stage.envShake.getOffset(); | |
5549 | + `y = `offsety; | |
5542 | 5550 | else: |
5543 | 5551 | { |
5544 | 5552 | ^&.Char bc = .players.get(`bindid); |
@@ -5591,11 +5599,10 @@ public void Explod::update(bool oVer, int playerNo) | ||
5591 | 5599 | pfx~remap.new(0); |
5592 | 5600 | } |
5593 | 5601 | .addAnimList( |
5594 | - a=, `ani, `sprpriority, `x+xofs, `y+yofs, cscl, | |
5602 | + a=, `ani, `sprpriority, `x, `y, screen, | |
5595 | 5603 | (float)`facing*`scalex*scl, (float)`vfacing*`scaley*scl, |
5596 | 5604 | 0.0, false, oVer, 1.0, 1.0, `alphas < 0 ? -1 : `alphas, |
5597 | - `alphad, 256 >> (int)( | |
5598 | - .super > 0 && .superdarken != 0 && playerNo != .superplayer), | |
5605 | + `alphad, playerNo == .superplayer, | |
5599 | 5606 | pfx, `shadowr<<16 | (`shadowg&255)<<8 | (`shadowb&255), |
5600 | 5607 | `alphas < 0 ? 256 : `alphas, 0.0); |
5601 | 5608 | }]; |
@@ -6674,6 +6681,9 @@ public float action( | ||
6674 | 6681 | .stage.bgPalFX~step(); |
6675 | 6682 | .stage.envShake.next(); |
6676 | 6683 | if(.envcol_time > 0) .envcol_time--; |
6684 | + .com.drawscale = 0.0/0.0; | |
6685 | + .com.zoomposx = 0.0; | |
6686 | + .com.zoomposy = 0.0; | |
6677 | 6687 | branch{ |
6678 | 6688 | cond .super > 0: |
6679 | 6689 | .super--; |
@@ -6724,9 +6734,9 @@ public float action( | ||
6724 | 6734 | { |
6725 | 6735 | if(#.superanim > 0){ |
6726 | 6736 | .addAnimList( |
6727 | - .topanims=, .superanim, 5, .superposx, .superposy, .com.scale, | |
6737 | + .topanims=, .superanim, 5, .superposx, .superposy, false, | |
6728 | 6738 | (float).superfacing, 1.0, 0.0, false, |
6729 | - .chars[.superplayer]<>~mver0() != 1, 1.0, 1.0, -1, 0, 256, | |
6739 | + .chars[.superplayer]<>~mver0() != 1, 1.0, 1.0, -1, 0, true, | |
6730 | 6740 | .superpmap, 0, 0, 0.0); |
6731 | 6741 | if(.superanim~ani.loopend) .superanim.new(0); |
6732 | 6742 | } |
@@ -7164,8 +7174,8 @@ public void draw(float x, float y, float scl) | ||
7164 | 7174 | .stg~bgDraw(false, bgx, bgy, scl); |
7165 | 7175 | comm: |
7166 | 7176 | if(!.gs(.gsGLOBALNOSHADOW)){ |
7167 | - if(.stg~reflection > 0) .drawReflection(x, y); | |
7168 | - .drawShadowList(x, y); | |
7177 | + if(.stg~reflection > 0) .drawReflection(x, y, scl*.stg~ztopscale); | |
7178 | + .drawShadowList(x, y, scl*.stg~ztopscale); | |
7169 | 7179 | } |
7170 | 7180 | { |
7171 | 7181 | float off = .stage.envShake.getOffset(); |
@@ -7230,7 +7240,7 @@ public void draw(float x, float y, float scl) | ||
7230 | 7240 | .fight~ro.draw(0, .ko, winner); |
7231 | 7241 | } |
7232 | 7242 | if(.envcol_time == 0 || .envcol_under != 0){ |
7233 | - .drawAnimList(.anims=, x, y); | |
7243 | + .drawAnimList(.anims=, x, y, scl*.stg~ztopscale); | |
7234 | 7244 | } |
7235 | 7245 | if(.envcol_time == 0 && !.gs(.gsNOFG)) .stg~bgDraw(true, bgx, bgy, scl); |
7236 | 7246 | if(.envcol_time != 0 && .envcol_under == 0){ |
@@ -7238,7 +7248,7 @@ public void draw(float x, float y, float scl) | ||
7238 | 7248 | } |
7239 | 7249 | .fight~draw(1, lpl, names, .gs(.gsNOBARDISPLAY), facefx, .superplayer); |
7240 | 7250 | .fight~ro.draw(1, .ko, winner); |
7241 | - .drawAnimList(.topanims=, x, y); | |
7251 | + .drawAnimList(.topanims=, x, y, scl*.stg~ztopscale); | |
7242 | 7252 | .fight~draw(2, lpl, names, .gs(.gsNOBARDISPLAY), facefx, .superplayer); |
7243 | 7253 | .fight~ro.draw(2, .ko, winner); |
7244 | 7254 | void fade(.com.scrrect.self rect=, int alpha) |
@@ -142,7 +142,8 @@ public float scrxmin = 0.0, scrxmax = 0.0; | ||
142 | 142 | public float zoffset = 0.0; |
143 | 143 | public float yoffset = 0.0; |
144 | 144 | public float xoffset = 0.0; |
145 | -public float scale = 1.0; | |
145 | +public float scale = 1.0, drawscale = 0.0/0.0; | |
146 | +public float zoomposx = 0.0, zoomposy = 0.0; | |
146 | 147 | public float turbo = Speed; |
147 | 148 | public int gametime = 0, time = 0; |
148 | 149 | public int intro = 20; |
@@ -214,7 +214,7 @@ void game() | ||
214 | 214 | if(lastChar >= '\x20' && lastChar < '\x7f') `line .= lastChar; |
215 | 215 | } |
216 | 216 | } |
217 | - float x = 0.0, y = 0.0, l = 0.0, r = 0.0; | |
217 | + float x = 0.0, y = 0.0, l = 0.0, r = 0.0, bl = 0.0, br = 0.0; | |
218 | 218 | float scl = 1.0, sclmul = 1.0; |
219 | 219 | float newx = x, newy = y; |
220 | 220 | int oldp1wins, oldp2wins, olddraws; |
@@ -255,6 +255,25 @@ void game() | ||
255 | 255 | .com.xmin = -((float).com.GameWidth/2.0)/.com.scale + .com.screenleft; |
256 | 256 | .com.xmax = ((float).com.GameWidth/2.0)/.com.scale - .com.screenright; |
257 | 257 | } |
258 | + float xbound(float scl, float x) | |
259 | + { | |
260 | + ret | |
261 | + .m.max!float?( | |
262 | + `bl-(float).com.GameWidth/2.0 + ((float).com.GameWidth/2.0)/scl)<, | |
263 | + .m.min!float?( | |
264 | + `br+(float).com.GameWidth/2.0 - ((float).com.GameWidth/2.0)/scl, x); | |
265 | + } | |
266 | + float ybound(float scl, float y) | |
267 | + { | |
268 | + float tmp = .m.max!float?(0.0, 240.0 - .com.screenZoffset); | |
269 | + ret | |
270 | + .m.min!float?(0.0)<, | |
271 | + .m.min!float?(tmp*(1.0/scl - 1.0))<, | |
272 | + .m.max!float?( | |
273 | + .com.boundhigh-240.0 + .m.max!float?( | |
274 | + (float).com.GameHeight/scl, tmp + .com.screenZoffset/scl), | |
275 | + y + 240.0*(1.0 - .m.min!float?(1.0, scl))); | |
276 | + } | |
258 | 277 | loop{ |
259 | 278 | int stagetime; |
260 | 279 | ^&.sha.Share share; |
@@ -404,10 +423,10 @@ void game() | ||
404 | 423 | while i < stagetime: |
405 | 424 | } |
406 | 425 | if(.com.round == 1) .snd.bgm~play(.chr.stg~bgmusic); |
407 | - float bl = | |
426 | + bl = | |
408 | 427 | (float)(.chr.stg~cam.boundleft - .chr.stg~cam.startx) |
409 | 428 | * .chr.stg~localscl; |
410 | - float br = | |
429 | + br = | |
411 | 430 | (float)(.chr.stg~cam.boundright - .chr.stg~cam.startx) |
412 | 431 | * .chr.stg~localscl; |
413 | 432 | .com.boundhigh = |
@@ -529,20 +548,10 @@ void game() | ||
529 | 548 | : .m.max!float?(0.0)<, .m.min!float?(((float).com.GameWidth/2.0)/scl)<, |
530 | 549 | .m.max!float?(-(l-(newx-x)), r-(newx-x)); |
531 | 550 | x = |
532 | - .m.max!float?( | |
533 | - bl-(float).com.GameWidth/2.0 + ((float).com.GameWidth/2.0)/scl)<, | |
534 | - .m.min!float?( | |
535 | - br+(float).com.GameWidth/2.0 - ((float).com.GameWidth/2.0)/scl)<, | |
551 | + xbound(scl)<, | |
536 | 552 | .m.min!float?(x + l + tmp)<, .m.max!float?(x + r - tmp)<, newx; |
537 | 553 | if(!.com.zoom) x = .m.ceil(x*4.0 - 0.5)/4.0; |
538 | - tmp = .m.max!float?(0.0, 240.0 - .com.screenZoffset); | |
539 | - y = | |
540 | - .m.min!float?(0.0)<, | |
541 | - .m.min!float?(tmp*(1.0/scl - 1.0))<, | |
542 | - .m.max!float?( | |
543 | - .com.boundhigh-240.0 + .m.max!float?( | |
544 | - (float).com.GameHeight/scl, tmp + .com.screenZoffset/scl), | |
545 | - newy + 240.0*(1.0 - .m.min!float?(1.0, scl))); | |
554 | + y = ybound(scl, newy); | |
546 | 555 | if( |
547 | 556 | .com.tickFrame() && (.chr.super <= 0 || .chr.superpausebg == 0) |
548 | 557 | && (.chr.pause <= 0 || .chr.pausebg == 0)) |
@@ -559,7 +568,18 @@ void game() | ||
559 | 568 | break, do; |
560 | 569 | } |
561 | 570 | if(.se.fskip) while; |
562 | - .chr.draw(x, y, scl); | |
571 | + { | |
572 | + float dx = x, dy = y, dscl = scl; | |
573 | + if( | |
574 | + !.m.isnan(.com.drawscale) | |
575 | + && !.m.isnan(.com.zoomposx)&& !.m.isnan(.com.zoomposy)) | |
576 | + { | |
577 | + dscl = .m.max!float?(minscl, .com.drawscale); | |
578 | + dx = xbound(dscl, x + .com.zoomposx * (dscl - scl) / dscl); | |
579 | + dy = y + .com.zoomposy; | |
580 | + } | |
581 | + .chr.draw(dx, dy, dscl); | |
582 | + } | |
563 | 583 | drawDebug(); |
564 | 584 | /?/*.cfg.OpenGL: |
565 | 585 | .sdl.GlSwapBuffers(::); |
@@ -602,6 +602,14 @@ public &Stage | ||
602 | 602 | float bgscl = `hires ? 0.5 : 1.0; |
603 | 603 | float yofs = .envShake.getOffset(); |
604 | 604 | float posx = x, posy = y; |
605 | + branch{ | |
606 | + cond posy > 0.0: | |
607 | + yofs += posy; | |
608 | + posy = 0.0; | |
609 | + cond posy < .com.boundhigh: | |
610 | + yofs += posy - .com.boundhigh; | |
611 | + posy = .com.boundhigh; | |
612 | + } | |
605 | 613 | if(`cam.verticalfollow > 0.0) branch{ |
606 | 614 | float scl2 = `localscl * scl; |
607 | 615 | cond yofs < 0.0: |
@@ -57,6 +57,7 @@ const ^/char kuuhaktokigou = " !=<>()|&+-*/%,[]^|:"\"\t\r\n; | ||
57 | 57 | ForceFeedback, |
58 | 58 | VictoryQuote, |
59 | 59 | RemapPal, |
60 | + Zoom, | |
60 | 61 | Null |
61 | 62 | } |
62 | 63 | &StateCtrl |
@@ -3219,6 +3220,8 @@ public &StateBuilder | ||
3219 | 3220 | if(!`tagOut(am=)) ret false; |
3220 | 3221 | case .CtrlTy::RemapPal: |
3221 | 3222 | if(!`remapPal(am=)) ret false; |
3223 | + case .CtrlTy::Zoom: | |
3224 | + if(!`zoom(am=)) ret false; | |
3222 | 3225 | default: |
3223 | 3226 | { |
3224 | 3227 | bool error = false; |
@@ -7653,6 +7656,33 @@ public &StateBuilder | ||
7653 | 7656 | ret true; |
7654 | 7657 | }]); |
7655 | 7658 | } |
7659 | + bool zoom(&.tbl.NameTable!^/char? param=) | |
7660 | + { | |
7661 | + ret `stateSec(param=,[bool(){ | |
7662 | + `state.ctrlList[-1].task .= ".com.drawscale=.com.scale;"; | |
7663 | + if(!`stateParam(param=, "pos", [`paraF_t(data=){ | |
7664 | + if( | |
7665 | + !`argExpression( | |
7666 | + `state.ctrlList[-1].task=, data=, | |
7667 | + ".com.zoomposx=", ";", 1)) ret false; | |
7668 | + if(.s.equ(",")<, `tokenizer(data=)){ | |
7669 | + if( | |
7670 | + !`fullExpression( | |
7671 | + `state.ctrlList[-1].task=, data=, | |
7672 | + ".com.zoomposy=", ";", 1)) ret false; | |
7673 | + } | |
7674 | + ret true; | |
7675 | + }])) ret false; | |
7676 | + if(!`stateParam(param=, "scale", [`paraF_t(data=){ | |
7677 | + if( | |
7678 | + !`fullExpression( | |
7679 | + `state.ctrlList[-1].task=, data=, | |
7680 | + ".com.drawscale=", ";", 1)) ret false; | |
7681 | + ret true; | |
7682 | + }])) ret false; | |
7683 | + ret true; | |
7684 | + }]); | |
7685 | + } | |
7656 | 7686 | ^/char stateBulid(%char buf=, ^/char def, ^/char st=) |
7657 | 7687 | {:<- |
7658 | 7688 | public bool statedef(^/char sec, ^/char name, ^/char data) |
@@ -7851,6 +7881,8 @@ public &StateBuilder | ||
7851 | 7881 | `state.ctrlList[-1].typ = .CtrlTy::VictoryQuote; |
7852 | 7882 | cond .s.equ(s, "remappal"): |
7853 | 7883 | `state.ctrlList[-1].typ = .CtrlTy::RemapPal; |
7884 | + cond .s.equ(s, "zoom"): | |
7885 | + `state.ctrlList[-1].typ = .CtrlTy::Zoom; | |
7854 | 7886 | cond .s.equ(s, "null"): |
7855 | 7887 | `state.ctrlList[-1].typ = .CtrlTy::Null; |
7856 | 7888 | else: |