Page 1 of 2

Is it possible to 'mirror' the screen easily?

Posted: Mon Jan 18, 2016 8:51 am
by POLYGAMe
For my racing game I'm using a textured road. Obviously I'd like to save as much memory as possible so cutting the road in half and mirroring the other side would be awesome. Is this easily achievable? I haven't seen anything obvious in the various VDP functions I've been playing with.

Thanks in advance!

Re: Is it possible to 'mirror' the screen easily?

Posted: Mon Jan 18, 2016 10:44 am
by Stef
You have vertical and horizontal flip support on a tile basis. Rescomp is able to generate and optimize automatically you tilemap data given a image which use flipped tiles.

Re: Is it possible to 'mirror' the screen easily?

Posted: Mon Jan 18, 2016 1:44 pm
by POLYGAMe
Cool thanks! I'll look into rescomp :)

Re: Is it possible to 'mirror' the screen easily?

Posted: Mon Jan 18, 2016 5:14 pm
by alko
:D :) :( :cry:
strangely, why I have totally mirrored tiles so obtained...

Image

Image

Re: Is it possible to 'mirror' the screen easily?

Posted: Mon Jan 18, 2016 6:43 pm
by r57shell
alko
That means that program you use sux :D

Re: Is it possible to 'mirror' the screen easily?

Posted: Mon Jan 18, 2016 7:38 pm
by alko
I use only VDP_drawImageEx(..)
as assures Stef, it should automatically optimize mirrored tiles...
or not?

Re: Is it possible to 'mirror' the screen easily?

Posted: Mon Jan 18, 2016 8:09 pm
by troudki
hi,
where i can find this "vdp ram " windows tools ?
thx

Re: Is it possible to 'mirror' the screen easily?

Posted: Mon Jan 18, 2016 9:07 pm
by alko
troudki wrote: where i can find this "vdp ram " windows tools ?
http://elektropage.ru/publ/programmy_dl ... 38-1-0-122

Re: Is it possible to 'mirror' the screen easily?

Posted: Mon Jan 18, 2016 10:10 pm
by Stef
alko wrote:I use only VDP_drawImageEx(..)
as assures Stef, it should automatically optimize mirrored tiles...
or not?
VDP_drawImageEx(...) just draw an image given a specified tileset and tilemap. What matter is the tool used to convert your image to internal binary format. Rescomp should take care of it, normally it detects duplicate / flipped tiles and arrange tileset/tilemap for that.
I forgot to reply in the appropriate topic but i tested rescomp on your image and it works as expected, I obtain 135 uniq tiles over the 240 base tiles which is expected given the input image.

Re: Is it possible to 'mirror' the screen easily?

Posted: Mon Jan 18, 2016 11:51 pm
by POLYGAMe
So rescomp is part of the sgdk... do I need to do anything to utilise it or is it always used when I import resources? Am I right in assuming that if my image is symmetrical it will handle it for me? That sounds better than trying to work out how to fill empty tiles with flipped matching tiles :)

Re: Is it possible to 'mirror' the screen easily?

Posted: Tue Jan 19, 2016 9:12 am
by Stef
As long you image is symmetric on tile basis (8x8 pixel block) it will work.
And yeah, rescomp is used automatically when you use .res file to declare your resources.

Re: Is it possible to 'mirror' the screen easily?

Posted: Tue Jan 19, 2016 9:27 am
by POLYGAMe
Awesome :D Pretty sure I can finish the road "engine" this weekend :) Thanks for all your help, Stef!!!

Re: Is it possible to 'mirror' the screen easily?

Posted: Tue Jan 19, 2016 8:04 pm
by alko
What matter is the tool used to convert your image to internal binary format.
rescomp which comes complete with SGDK.
I obtain 135 uniq tiles over the 240 base tiles which is expected given the input image.
As well as in my case .
Only RLE- algorithm .
No mirroring optimization .

8*16+6=134 tiles.
Image

Re: Is it possible to 'mirror' the screen easily?

Posted: Tue Jan 19, 2016 9:03 pm
by Stef
Hmm sorry you're right, i forgot to count about the blank tiles, it's why we obtain 135 uniq tiles (counting 1 blank) :-/ Ok i will check that in deep ! It seems that flipped tiles are definitely not optimized (they should !)

Re: Is it possible to 'mirror' the screen easily?

Posted: Tue Jan 19, 2016 9:07 pm
by alko
Thanx :oops: