Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LF2 Bitmap Loading Algorithm
#1
So I was pretty confident I knew how it was done, until today I saw a grid which was parsed and displayed in LF2 correctly, when according to what I "knew", shouldn't have.

Here was my theory:
-- The width of the grid is divided (and probably floored ceiled ) by the X in "row: X".
-- Similarly, the height of the grid is divided by the Y in "col: Y".
-- Multiples of the result would act as the top-left coordinate of the clip in the grid.
- e.g:
- 700x500 sheets loaded with "row: 7 col: 5"
- 700/7 = 100. The clips/dirtyrects' left coordinates are multiples of that (7 of them, since row: 7): 0, 100, 200, 300, 400, 500, 600
- 500/5 = 100. and since col: 5: 0,..400
-- Now what sets the width and height of the clips recangles are the width and height specified in the "w: h:" tags.
-e.g:
- "w: 99 h: 99" would extend the rectangles from their left-top position to the right-bottom by 99 pixels, leaving out the 1 pixel lines. A value of 95 would leave space for a 5 pixel line and so it works.

Now here is the grid I came across:
[Image: KG7nfZg.png]

Original size: 1776x856

Code:
file(190-239):       sprite\sys\One_Piece\luffyts_3.bmp w: 175 h: 160 row: 10 col: 5

What I thought was the algorithm would kill the chances this would display correctly at step 1. Any idea how LF2 does this?
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:


Messages In This Thread
LF2 Bitmap Loading Algorithm - by A-Man - 10-18-2015, 09:13 PM
RE: LF2 Bitmap Loading Algorithm - by STM1993 - 10-19-2015, 01:51 AM
RE: LF2 Bitmap Loading Algorithm - by A-Man - 10-19-2015, 04:45 AM
RE: LF2 Bitmap Loading Algorithm - by STM1993 - 10-19-2015, 05:22 AM
RE: LF2 Bitmap Loading Algorithm - by A-Man - 10-19-2015, 08:32 AM
RE: LF2 Bitmap Loading Algorithm - by A-Man - 10-19-2015, 02:51 PM



Users browsing this thread: 1 Guest(s)