-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON Plugin #17
JSON Plugin #17
Conversation
This commit changes the TileLayer class to store Cell instances rather than directly referring to Tile*. The Cell class contains the Tile* plus information on whether the tile is horizontally or vertically flipped. The MapReader and MapWriter have been adapted to store and restore the flipped state as flags in the last bits of the global IDs (this means older Tiled versions will refuse to load maps with flipped tiles). The OrthogonalRenderer and IsometricRenderer have been adapted to render the flipped tiles correctly. This implements the first part of issue #3 Sponsored-by: Zipline Games, Inc.
The X key flips horizontally (along the X axis) The Y key flips vertically (along the Y axis) This closes #3 Sponsored-by: Zipline Games, Inc.
Fixed up a bit the code
Porfirio, I just pushed the new Lua export plugin. To map the cells to gids I introduced a GidMapper class which is now used in both the TMX map reader/writer and the Lua exporter. Please use it also in the JSON exporter. You may want to try getting some help with git on IRC to sort things out. Basically you should rebase your stuff on my latest master branch, dropping those commits that you duplicated somehow. There will be conflicts of course, but you'll just have to resolve them (though in the case of my commits, they should just be skipped). |
How do i rebase to the last branch |
Was this actually merged? Porfirio, rebasing is this: |
Of course, those commands only work when you have your own master branch checked out and the remote pointing to my repository is called 'mainline'. |
Ive been a bit busy this weeks sorry! Next month i hope to have time to put code up. 2011/8/21 bjorn <
Porfirio Ribeiro |
I've pulled this plugin based on this commit: And now I'm doing a followup rewrite of the plugin to conform to Tiled coding standards and improve error handling, mostly. I've taken this plugin first (out of three json plugins written so far) since it supported both reading and writing, and it didn't introduce a dependency on any external library. However, I'll probably combine it with the one by @Dchandaman for the export, since auto-generating a JSON file from a QVariantMap is producing some very ugly output (properties in alphabetical rather than logical order, and the auto-formatting is also quite bad in my opinion). |
Hi. Yeah, i used an existing class to read write json, but the generated code is I was about to modify it to produce better JSON, but since someone already Sorry for not updating it lately! 2011/10/1 Thorbjrn Lindeijer <
Porfirio Ribeiro |
The JSON plugin is pushed now, together with my improvements. The output still looks ugly, but I'll fix that later. I noticed the code by @Dchandaman is actualy a direct copy of my LuaTableWriter and LuaPlugin, with small tweaks to change the format into JSON rather than a Lua table. Hence, I'm a bit hesitant to do the same since I don't like that level of code duplication. :-/ |
I see, how about create some class that could write the map with some 2011/10/1 Thorbjrn Lindeijer <
Porfirio Ribeiro |
Yeah, that's probably what I'll try to do. |
Apply sorting trick to windows dailies
First preview of JSON plugin