slartibartfast
05-28-2004, 03:19 PM
I had a look quite a while back, but the problem with the API is that the function to process a map lnput line expects a single line segment (or point) as a return, which is exactly what you want for a SOE map, but cannot be used for a SEQ Map as a SEQ map has multiple line segments per input file line.
E.g. consider the line A-B-C-D with which is coloured red
a SOE map would look like this
L,Ax,Ay,Az,Bx,By,Bz,R,G,B
L,Bx,By,Bz,Cx,Cy,Cz,R,G,B
L,Cx,Cy,Cz,Dx,Dy,Dz,R,G,B
SEQ map looks like this
M,LineName,RED,4, Ax,Ay,Az,Bx,By,Bz,Cx,Cy,Cz,Dx,Dy,Dz
We either need a way to return an array of points/line segments.
Or we need to have a way to tell mappie that we have not fully processed the line and it should send it back to us, with an integer that we set to tell us how far through the line we have processed.
e.g.
FILEFORMAT_API int ReadData(char* InputString,SFileFormat* Data, int PointCount)
Then the Read Map Function in Mappie should call ReadData multiple times for each input line until PointCount is set to 0.
Read Map Logic.
Open Map File
While NOT EOF
InputString = ReadLine
PointCount = 0
Do
ReadData InputString, Data, PointCount
StoreData Data
Loop Until PointCount = 0
Loop
For the above Map line the code the SEQ code could then take the line
L RED 4pts, A, B, C, D
On the first call the dll would return the line segment A-B and set PointCount =1 to indicate there are more points to process in this line.
On the second call the dll would know to skip the first point because PointCount =1 and would return the 2nd segment from B-C and set PointCount = 2.
On the 3rd call the dll would return C-D and set the PointCount to 0 to indicate the line has been fully processed.
for your reference these are what a SEQ map looks like:
Map Long Name, Short Name, ????
M,Line Name,Colour,Point Count,X1,Y1,Z1,X2,Y2,Z2,X3...
L,Line Name,Colour,Point Count,X1,Y1,X2,Y2,X3,Y3...
P,Point Name,Colour,X,Y
Note colour will either be a name or RGB value in the format #RRGGBB
e.g.
Misty Thicket,Misty Thicket,212,274,593,550,4023,2345
L,line_name,gray,38,-2575,418,-2568,418,-2557,430,-2556,490,-2545,502,-2496,501,-2475,512,-2431,511,-2440,1167,-1898,1158,-1510,1152,-664,1134,-48,1129,-48,648,-98,650,-100,633,-110,632,-110,584,-48,594,-48,139,-102,139,-100,86,-48,85,-48,-90,-26,-91,-26,1129,1248,1167,1252,831,1254,645,1256,455,1258, 271,1261,86,1263,-142,1267,-457,1269,-775,1332,-778,1416,-789,1442,-815
L,line_name,gray,56,1417,-827,1417,-814,1329,-820,1207,-824,1258,-968,1239,-1150,946,-1149,558,-1146,312,-1145,-56,-1143,-455,-1141,-455,-862,-409,-760,-408,-659,-304,-556,-303,-456,-155,-349,-111,-252,-26,-151,-25,-111,-48,-110,-48,-151,-107,-220,-149,-189,-159,-202,-169,-196,-181,-232,-139,-264,-180,-353,-324,-453,-345,-535,-433,-657,-431,-757,-478,-737,-504,-796,-452,-807,-477,-863,-477,-1141,-654,-1144,-1218,-1155,-1660,-1164,-1971,-1170,-2356,-1178,-2387,-683,-2398,-516,-2411,-309,-2424,-102,-2437,107,-2447,275,-2459,474,-2500,481,-2522,480,-2535,467,-2535,408,-2546,396,-2564,396
M,road,red,16,-2353,505,-48,-2353,505,-48,-2250,503,-48,-2177,427,-63,-2143,370,-58,-1867,103,48,-1550,102,29,-1471,200,-5,-1264,400,74,-1149,398,206,-930,165,159,-780,13,59,-662,-1,51,-447,4,32,-371,-104,25,-64,-101,37
M,road,red,8,-649,-2,53,-649,-2,53,-662,-81,26,-909,-94,4,-1061,-192,-17,-1165,-300,19,-1262,-388,103,-1254,-500,104
P,Druid Ring,white,-1826,-498
P,Rivervale,white,-2409,531
P,Goblins,white,415,-1100
P,Goblins,white,1133,-969
P,Runnyeye,white,1212,-777
P,Goblins,white,1089,-324
P,Orcs,white,1092,1020
P,Undead,white,564,308
P,Succor Point,white,0,0
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.