﻿ [Axe] Tableau dynamique
23 May, 2013, 20:24:53
 OmnomIRC You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

 Pages: [1]   Go Down
 Author Topic: [Axe] Tableau dynamique -  (Read 1672 times) 0 Members and 1 Guest are viewing this topic.
calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)

Offline

Gender:
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207

Total Post Ratings: +62

 « on: 25 October, 2010, 17:23:19 » 0

 1234 [b]Edit:[/b] Annoying code tag bug. Try to ignore x.xOkay :)So, one line at a time:[code]0->A
Initialize A, like we've been doing
 1 L*2+(GDB2->I)->E
You can store to variable inside expressions. We need I to point to the beginning of the data containing the size, so it is stored.
Since the size data for each map is 2 bytes, we multiply L by 2, then add it to the beginning of the size data to get the end where we stop.
 1 Repeat I=E
Just repeat until we reach the end.
 1 {I}*{I+1}+A->A
I points to the X-size of the current map, and I+1 points to the Y-size of it. (I had had I-1, but I fixed it.)
We multiply these to get the total size of the current map, and add it to A. The multiplication comes first because otherwise it would evaluate as (A+{I})*{I+1} and not A+({I}*{I+1})
 1 I+2->I
Add 2 to move on to the next set of data.
 123 End/code]Finish our loop
Copy(A+GDB1,L1,{E-1}*{E-2})[/code]
A is the correct offset, so we add it to GDB1 to get to the start of the map data.
Alternatively, we could have done GDB1->A at the beginning and just A on this line instead of A+GDB1.
L1 is the destination.
E is the end of the size data we've scanned. The data for the map you're loading is right before it. So {E-1} is the Y-size and {E-2} is the X-size. We multiply those to get the size of the map which we're copying.
 « Last Edit: 25 October, 2010, 17:25:33 by calcdude84se » Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."