Mercurial > projects > myrrdin
changeset 7:806b3781f4e4
completed tests, fixed stuff. usable now!
author | fred@reichbier.de |
---|---|
date | Sat, 19 Jul 2008 15:21:09 +0200 |
parents | 510541745cd1 |
children | 156a95e4c018 |
files | import/myrrdin/animatedsprite.d import/myrrdin/imagecache.d import/myrrdin/movingfigure.d import/myrrdin/sprite.d import/myrrdin/spriteconsumer.d import/myrrdin/test.d import/myrrdin/tileconsumer.d import/myrrdin/tilemap.d import/myrrdin/tileset.d import/myrrdin/tools.d import/myrrdin/viewconsumer.d import/myrrdin/xmlmap.d test/dsss.conf test/movingfigure/movingfigure.d test/view/viewconsumer.d |
diffstat | 15 files changed, 69 insertions(+), 90 deletions(-) [+] |
line wrap: on
line diff
--- a/import/myrrdin/animatedsprite.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/animatedsprite.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module animatedsprite; +module myrrdin.animatedsprite; import dsfml.window.all; import dsfml.system.all;
--- a/import/myrrdin/imagecache.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/imagecache.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module imagecache; +module myrrdin.imagecache; import dsfml.window.all; import dsfml.system.all;
--- a/import/myrrdin/movingfigure.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/movingfigure.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module movingfigure; +module myrrdin.movingfigure; import Integer = tango.text.convert.Integer;
--- a/import/myrrdin/sprite.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/sprite.d Sat Jul 19 15:21:09 2008 +0200 @@ -1,4 +1,4 @@ -module sprite; +module myrrdin.sprite; import dsfml.window.all; import dsfml.system.all;
--- a/import/myrrdin/spriteconsumer.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/spriteconsumer.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module spriteconsumer; +module myrrdin.spriteconsumer; import dsfml.window.all; import dsfml.system.all;
--- a/import/myrrdin/test.d Sat Jul 19 15:10:56 2008 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* - myrrdin, a 2d tile engine - Copyright (c) 2008 Friedrich Weber - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the Software), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ - -module test; - -import dsfml.window.all; -import dsfml.system.all; -import dsfml.graphics.all; - -import myrrdin.tileconsumer; -import myrrdin.renderer; -import myrrdin.consumer; -import myrrdin.imagecache; -import myrrdin.tilemap; -import myrrdin.tileset; -import myrrdin.xmlmap; -import myrrdin.tools; -import myrrdin.viewconsumer; -import myrrdin.animatedsprite; -import myrrdin.spriteconsumer; -import myrrdin.movingfigure; - -int main(char[][] args) { - Cache cache = new Cache("gfx"); - Tilemap map = parse_map(cache, read_file_contents("map-example.xml")); - Renderer render = new Renderer("Blubb", 600, 480, 32); -// render.add_consumer(new InteractiveViewConsumer(render)); - TileConsumer consumer = new TileConsumer(render, map); - map.set_view(render.app.getView()); - render.add_consumer(consumer); - render.add_consumer(load_charset(render, cache, "f-", ".png", 10)); -/* SpriteConsumer c = new SpriteConsumer(render); - AnimatedSprite s = new AnimatedSprite; - s.setX(10); - s.setY(10); - Animation a = new Animation; - a.add_frame(map.tileset.tiles[0], 10); - a.add_frame(map.tileset.tiles[1], 10); -// s.setImage(map.tileset.tiles[0]); - s.play_animation(a, true); - c.add_sprite(s); - render.add_consumer(c);*/ - - render.mainloop(); - return 0; -}
--- a/import/myrrdin/tileconsumer.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/tileconsumer.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module tileconsumer; +module myrrdin.tileconsumer; import dsfml.window.all; import dsfml.system.all;
--- a/import/myrrdin/tilemap.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/tilemap.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module tilemap; +module myrrdin.tilemap; import tango.math.Math;
--- a/import/myrrdin/tileset.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/tileset.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module tileset; +module myrrdin.tileset; import dsfml.window.all; import dsfml.system.all;
--- a/import/myrrdin/tools.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/tools.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module tools; +module myrrdin.tools; import tango.io.File;
--- a/import/myrrdin/viewconsumer.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/viewconsumer.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module viewconsumer; +module myrrdin.viewconsumer; import dsfml.window.all; import dsfml.system.all;
--- a/import/myrrdin/xmlmap.d Sat Jul 19 15:10:56 2008 +0200 +++ b/import/myrrdin/xmlmap.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module xmlmap; +module myrrdin.xmlmap; import myrrdin.tileset; import myrrdin.tilemap;
--- a/test/dsss.conf Sat Jul 19 15:10:56 2008 +0200 +++ b/test/dsss.conf Sat Jul 19 15:21:09 2008 +0200 @@ -1,3 +1,7 @@ [movingfigure/movingfigure.d] target=bin/movingfigure buildflags += -I../import + +[view/viewconsumer.d] +target=bin/viewconsumer +buildflags += -I../import
--- a/test/movingfigure/movingfigure.d Sat Jul 19 15:10:56 2008 +0200 +++ b/test/movingfigure/movingfigure.d Sat Jul 19 15:21:09 2008 +0200 @@ -21,7 +21,7 @@ THE SOFTWARE. */ -module test; +module testmovingfigure; import myrrdin.tileconsumer; import myrrdin.renderer; @@ -38,22 +38,10 @@ Cache cache = new Cache("gfx"); Tilemap map = parse_map(cache, read_file_contents("map-example.xml")); Renderer render = new Renderer("Blubb", 600, 480, 32); -// render.add_consumer(new InteractiveViewConsumer(render)); TileConsumer consumer = new TileConsumer(render, map); map.set_view(render.app.getView()); render.add_consumer(consumer); render.add_consumer(load_charset(render, cache, "f-", ".png", 10)); -/* SpriteConsumer c = new SpriteConsumer(render); - AnimatedSprite s = new AnimatedSprite; - s.setX(10); - s.setY(10); - Animation a = new Animation; - a.add_frame(map.tileset.tiles[0], 10); - a.add_frame(map.tileset.tiles[1], 10); -// s.setImage(map.tileset.tiles[0]); - s.play_animation(a, true); - c.add_sprite(s); - render.add_consumer(c);*/ render.mainloop(); return 0;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/view/viewconsumer.d Sat Jul 19 15:21:09 2008 +0200 @@ -0,0 +1,53 @@ +/* + myrrdin, a 2d tile engine + Copyright (c) 2008 Friedrich Weber + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the Software), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + */ + +module testviewconsumer; + +import dsfml.window.all; +import dsfml.system.all; +import dsfml.graphics.all; + +import myrrdin.tileconsumer; +import myrrdin.renderer; +import myrrdin.consumer; +import myrrdin.imagecache; +import myrrdin.tilemap; +import myrrdin.tileset; +import myrrdin.xmlmap; +import myrrdin.tools; +import myrrdin.viewconsumer; +import myrrdin.animatedsprite; +import myrrdin.spriteconsumer; +import myrrdin.movingfigure; + +int main(char[][] args) { + Cache cache = new Cache("gfx"); + Tilemap map = parse_map(cache, read_file_contents("map-example.xml")); + Renderer render = new Renderer("Blubb", 600, 480, 32); + render.add_consumer(new InteractiveViewConsumer(render)); + TileConsumer consumer = new TileConsumer(render, map); + map.set_view(render.app.getView()); + render.add_consumer(consumer); + render.mainloop(); + return 0; +}