Commit graph

3173 commits

Author SHA1 Message Date
Richard Davey
42066f20dd Merge pull request #1372 from pnstickne/wip-tileset-non-even
Tilemap - Tiled image size calculation
2014-11-27 13:10:04 +00:00
Paul
47c49b18cf Tilemap - Tiled image size calculation
Addresses https://github.com/photonstorm/phaser/issues/1371 - where Tiled
used floor calculations and Phaser used round calculations.

There are no breaking changes with the demos; however, if there was code
that relied on behavior that _deviated_ from the defactor Tilemap behavior
then may be prone to "incorrect results" if using tileset images that are
not correctly aligned to tilesize multiples.

This also adds/corrects some warnings:
- A warning when the tileset size is not an even multiple (it was
  suppressed due to using `round` prior to the checks.
- A warning if loading an image changes the cols/rows of a Tileset
- A specific warning for Tileset Image Collections which are not yet
  supported
2014-11-26 19:50:07 -08:00
photonstorm
2488359277 RC12 Prep. 2014-11-26 13:13:50 +00:00
photonstorm
471ad20b4a Added Time.physicsElapsedMS and used in Sprite lifespan and Tweens. 2014-11-26 13:13:25 +00:00
photonstorm
fb733ddcca onPreRenderCallback wasn't being cleared on a State swap. 2014-11-26 13:12:51 +00:00
photonstorm
fc457f5aca Added missing docs. 2014-11-26 04:16:52 +00:00
Richard Davey
4f88ec06c5 Merge pull request #1364 from pnstickne/wip-doc-fixes
yuidoc-to-jsdoc - bug fix and jsobj-like mapping
2014-11-26 00:44:37 +00:00
photonstorm
667d477a16 P2.BodyDebug always lagged behind the position of the Body it was tracking by one frame, which became visible at high speeds. It now syncs its position in the Body.postUpdate which prevents this from happening (thanks @valueerror) 2014-11-25 22:21:11 +00:00
photonstorm
3d3920efab Various jsdoc fixes. 2014-11-25 21:13:25 +00:00
Richard Davey
9880ccbfe6 Merge pull request #1369 from clark-stevenson/dev
Fixed #1368
2014-11-25 19:15:01 +00:00
Paul
056d18cb43 yuidoc-to-jsdoc - jshint fix 2014-11-25 10:15:29 -08:00
Clark Stevenson
e0270fdbb9 Fixed #1368 2014-11-25 17:30:33 +00:00
photonstorm
e86f00eb55 Text.lineSpacing works correctly again. Before no space was added between the lines (thanks @intimidate #1367 and @brejep #1366) 2014-11-25 17:06:17 +00:00
Richard Davey
bc588ef09f Merge pull request #1367 from Gynzy/dev
fix issue with lineSpacing, no space was added between the lines. The co...
2014-11-25 16:39:11 +00:00
Tim van den Eijnden
990867547e fix issue with lineSpacing, no space was added between the lines. The complete text moved down instead 2014-11-25 16:45:29 +01:00
Tim van den Eijnden
7880fdec5f Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/loader/Cache.js
2014-11-25 16:26:49 +01:00
photonstorm
72eaee3139 Adjusted Sprite.preUpdate to remove the lifespan calculation. 2014-11-25 14:18:18 +00:00
photonstorm
1068563914 jsdoc fixes. 2014-11-25 14:15:55 +00:00
Richard Davey
eec846666a Merge pull request #1363 from pnstickne/wip-time-clarify
Time - clarify, Game update expose, and Sprite lifespan update
2014-11-25 14:15:41 +00:00
photonstorm
7aaa63e7a5 When you change State the P2 Physics world is no longer fully cleared. All of the bodies, springs, fixtures, materials and constraints are removed - but config settings such as gravity, restitution, the contact solver, etc are all retained. The P2.World object is only created the very first time you call Physics.startSystem. Every subsequent call hits P2.World.reset instead (#1292) 2014-11-25 12:09:03 +00:00
Paul
12b2d4485c yuidoc-to-jsdoc - bug fix and jsobj-like mapping
Fixed bug with incorrect generation of "Array<>".

Added a primitive type-accepter for jsobject-like (for some very primitive
value); but it covers the PIXI case.
2014-11-25 02:34:59 -08:00
Paul
e28197e6fa Time - documentation
- Removed previous elapsed/elapsedMS deprecation as they act differently
  when the game has been resumed, assuming that it has been properly
  paused.

- Refined documentation

- Moved a few properties for better logical grouping

- Annotated timeToCall and timeExpected as protected
2014-11-25 01:46:30 -08:00
Paul
e8869e057a Game/Time - updateNumber and updatesThsiFrame
- Changed `count` from 0d9678e512 to
  `updateNumber` and expanded documentation; also moved primary usage back
  to local variable.

- Added `updatesThisFrame` which allows (logic) code to detect if it is
  the last update, or if there are pending updates the same frame. While
  it could be adventageous in certain cases it will be problematic if such
  update logic relies in the supplied delta time, as such should change if
  fixed-timing is deviated from or extended updates are done.

- Formatting and documentation.
2014-11-25 01:04:36 -08:00
Paul
e2f65f58a8 Merge commit '0d9678e512f9037b686ca480907c90f82d5b631e' into wip-time-clarify 2014-11-25 00:35:31 -08:00
Paul
5f9025f800 Sprite/Time - lifespan based on physicsTime
- Lifespan is updated based on physics time which makes this consistent
  with fixed-step updates and tweens, etc.
2014-11-25 00:33:13 -08:00
Paul
fb6e602d60 Time - documentation
- Updating documentation for clarity, esp. wrt the now / elapsed /
  physicsTime.

- Marked elapsedMS as deprecated as it is just elapsed based on Date.now
  instead of the high-res timer; both provide roughly equivalent behavior,
  with elapsedMS just falling back to worse-case behavior.
2014-11-25 00:33:06 -08:00
photonstorm
0d9678e512 Promoted Game time loop count to protected public var. Checked in Sprite.lifespan decrement to avoid over-decreasing the lifespan (#1358) 2014-11-25 02:50:39 +00:00
photonstorm
b3ccdf6914 Replaced screen shot. 2014-11-25 02:49:42 +00:00
photonstorm
1ef0f0a9fe Rounded off bounds. 2014-11-25 02:49:34 +00:00
photonstorm
aa86d2fbf3 Phaser 2.2.0 RC11 Build files. 2014-11-25 00:48:53 +00:00
photonstorm
aa68e9433d Grunt task updates. 2014-11-25 00:48:40 +00:00
photonstorm
abea71fdcb 2.2.0 RC11 Docs Export. 2014-11-25 00:24:31 +00:00
photonstorm
c9996f41b0 Tidying up. 2014-11-25 00:24:29 +00:00
photonstorm
54e79f5b25 Grunt and docs updates. 2014-11-25 00:24:29 +00:00
photonstorm
7de47fd80a Template update. 2014-11-25 00:24:29 +00:00
photonstorm
1a313415e3 Tidying up. 2014-11-25 00:24:29 +00:00
photonstorm
04160c31b0 Moved docgen into the Resources folder. 2014-11-25 00:24:29 +00:00
photonstorm
f8a1632450 Grunt task updates. 2014-11-25 00:24:28 +00:00
photonstorm
c4b81ff6ea jsdoc fixes. 2014-11-25 00:24:28 +00:00
photonstorm
0e73a6428a RC11. 2014-11-25 00:24:28 +00:00
photonstorm
2579a67d78 RequireJS Template fix. 2014-11-25 00:24:28 +00:00
Richard Davey
6247a19180 Merge pull request #1360 from clark-stevenson/dev
Definition Updates
2014-11-24 16:08:12 +00:00
Clark Stevenson
3c860a4ad5 Definition Updates 2014-11-24 15:53:47 +00:00
Richard Davey
386c6df4fc Merge pull request #1359 from pnstickne/wip-optimize-signal
Signal - memory optimization / reductions
2014-11-24 13:35:29 +00:00
photonstorm
5b757eaee7 jshint fix 2014-11-24 13:15:38 +00:00
Paul
e62442bcb7 Signal - memory optimization / reductions
There are a fair amount of Signal objects created. In the current
implementation these are somewhat "fat" objects for two reasons:

- A closure / ad-hoc `dispatch` is created for each new Signal - this
  increases the retained size by 138+ bytes/Signal in Chrome.

- There are a number of instance variables that never change from their
  default value, and the bindings array is always created, even if never
  used.

This change "lightens" the Signals such that there is significantly less
penalty for having many (unusued) signals.

As an example of how much this _does_ play a role, in the "Random Sprite"
demo ~2000 Signals are created, with only 12 of these signals being
subscribed to. This results in a shallow size of ~300K and a retained size
of ~600K (which is almost as much memory as required by the
Sprites/Sprites themselves!) for .. nothing.

With these changes the shallow and retained sizes are less than 50K each -
and this is with only ~200 sprites!

This change addresses these issues by

- Changing it so there is _no_ `dispatch` closure created. This is a
  _breaking change_ (although there is no usage of such in core where it
  breaks); the code referenced "#24", but no such issue could be found on
  github.

  In the rare case that code needs to obtain a dispatch-closure, the
  `boundDispatch` property can be used to trivially obtain a (cached)
  closure.

- The properties and default values are moved into the prototype; and the
  `_bindings` array creation is deferred. This change, coupled with the
  removal of the automatic closure, results in a very lightweight
  ~24bytes/object (in Chrome) for unbound signals.

This is minor breaking change, as per the removal of the automatic
closure; but no such need/usage was found in the core. (There may be cases
in the examples, which were not checked.)

If merely opting for the array creation delay and keeping the default
properties in the prototype the shallow size is still halved; less
significant but still a consideration.
2014-11-24 04:55:29 -08:00
photonstorm
2d50334cd3 Updated lifeSpan to use elapsedMS instead. 2014-11-24 12:54:39 +00:00
photonstorm
aa62eb94fc Added Time.elapsedMS (as Time.elapsed isn't always an ms value) 2014-11-24 12:54:27 +00:00
photonstorm
06b2a2c6a0 Added Tween.generateData back in, now all the Particles and Tween examples work properly. 2014-11-24 12:34:42 +00:00
photonstorm
af8167258e Moving doc build to grunt. 2014-11-24 11:12:09 +00:00