123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|46|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> C/C++/C#/Other -> Reverse tile map?

Mon, 27 Apr 2015, 23:51
spinal
OK, everyone knows it's super easy to grab a tile number from a map eg,


But how the hell do i do it the other way? That is get an x,y from a tile number?

I'm currently trying this -



That graphics_draw_bitmap_in_rect basically just plonks the whole image down at (x*8)-x1, (y*8)-y1 and clips the right/bottom. I don't know if it's open source or not, so I haven't looked into a better way of clipping the top/left yet, so this'll do.
Anyway, does that look right to you guys? The map image (max_white_bitmap) is 32x872 pixels (10x61 tiles).

-=-=-
Check out my excellent homepage!
Thu, 08 Oct 2015, 03:46
spinal
Where's this thread gone?
Thu, 08 Oct 2015, 04:29
Jayenkai
*shrugs*
No idea where/why that vanished.
Weird..
Could've been something to do with when I was changing the server, or when the site broke that time. Not a clue.

-=-=-
''Load, Next List!''
Thu, 08 Oct 2015, 04:33
Jayenkai
If..



Then..



-=-=-
''Load, Next List!''
Thu, 08 Oct 2015, 06:04
rockford
Yep that's how I would have done it too. I used to do that in DIV.