01-03-2005, 11:47 AM
I tried compiling using .09b, a program that uses sterling's graphical library. I ended up with this error:
This is what line 87 is on qbgfxmain.bi:
declare function screen stdcall alias "fb_GfxScreen" (ScreenNum as integer) as integer
Oddly, this does not happen with any other version of fb... yet my program will crash inexplicibly no matter what i do. This is what i have so far in my program.
There could most definately be something wrong with the code, considering i copied and pasted it the subroutine from another program, which could mean invalid variables. However, i think i may of weeded them all out...
Code:
gfxmain.bi(87): error 4: Duplicated definition On Line: 87
This is what line 87 is on qbgfxmain.bi:
declare function screen stdcall alias "fb_GfxScreen" (ScreenNum as integer) as integer
Oddly, this does not happen with any other version of fb... yet my program will crash inexplicibly no matter what i do. This is what i have so far in my program.
Code:
declare sub loadmap2 (filename$)
'$dynamic
' $include: "qbgfx4fb.bi"
screen 13
'----------------
'----------------**Tiles & sprites**-----------------------
redim shared npcsprite(1,1) as integer 'holds the npc sprites.
redim shared tiles(1) as integer 'holds the tiles.
redim shared objectsprites(1,1) as integer 'holds the object sprites.
redim shared npcfiles(1) as string 'holds the names of all the npc filenames.
DIM SHARED tileset(4) AS STRING 'holds the tile filenames: up to four tilesets.
'----------------**Map Layers**----------------------------
redim shared maplayer(1,1) as integer 'this holds the base layer.
redim shared mapoverlayer(1,1) as integer 'holds the roof/high wall layer.
redim shared mapobjectlayer(1,1) as integer 'holds map object layer.
redim shared mapcollayer(1,1) as integer 'this holds the map collision layer.
redim shared mapname as string 'holds the map filename.
'-----------------**Palette stuff**---------------------------
redim shared pal(1) as integer 'this holds the palette.
redim shared palname as string 'this holds the palette name.
dim shared palput as string 'this also holds the palette name... change later.
'------------------**Map Variables**---------------------------
redim shared mapx, mapy as single 'map height, width.
redim shared screen_height, screen_width as integer 'max screen height and width
TYPE maptype Field=1
wid AS INTEGER 'width of map
height AS INTEGER 'height of map
pwid AS INTEGER 'width of map in pixels
pheight AS INTEGER 'height of map in pixels
pal AS STRING * 1 'palette name of map
tileset AS STRING * 1 'tilesets names of map
script AS STRING * 1 'name of map script
mapname AS STRING * 1 'name of map itself.
END TYPE
DIM SHARED layerset(3) AS INTEGER
DIM SHARED numsets(4) AS INTEGER
dim shared map as maptype
loadmap2 "map3.map"
SUB loadmap2 (filename$)
FOR y = 1 TO 4
numsets(y) = 0
NEXT
REDIM tiletile(1) AS INTEGER
REDIM tiletileindex(1) AS INTEGER
REDIM tiletile2(1) AS INTEGER
REDIM tiletile3(1) AS INTEGER
REDIM tiletile2index(1) AS INTEGER
REDIM tiletile3index(1) AS INTEGER
REDIM tiletile4(1) AS INTEGER
REDIM tiletile4index(1) AS INTEGER
filenum = FREEFILE
OPEN filename$ FOR BINARY AS #filenum
GET #filenum, , map.wid
GET #filenum, , map.height
GET #filenum, , templength
palput = SPACE$(templength)
GET #filenum, , palput
GET #filenum, , activetilesets
FOR y = 1 TO activetilesets
GET #filenum, , til
GET #filenum, , templength
tileset(til) = SPACE$(templength)
GET #filenum, , tileset(til)
numsets(til) = 1
NEXT
REDIM maplayer(map.wid, map.height) AS INTEGER
REDIM mapoverlayer(map.wid, map.height) AS INTEGER
REDIM mapobjectlayer(map.wid, map.height) AS INTEGER
REDIM mapcollayer(map.wid, map.height) AS INTEGER
GET #filenum, , layerset(1)
GET #filenum, , layerset(2)
GET #filenum, , layerset(3)
FOR y = 0 TO map.height
FOR x = 0 TO map.wid
GET #filenum, , maplayer(x, y)
NEXT x, y
FOR y = 0 TO map.height
FOR x = 0 TO map.wid
GET #filenum, , mapoverlayer(x, y)
NEXT x, y
FOR y = 0 TO map.height
FOR x = 0 TO map.wid
GET #filenum, , mapcollayer(x, y)
NEXT x, y
FOR y = 0 TO map.height
FOR x = 0 TO map.wid
GET #filenum, , mapobjectlayer(x, y)
NEXT x, y
CLOSE #filenum
END SUB
There could most definately be something wrong with the code, considering i copied and pasted it the subroutine from another program, which could mean invalid variables. However, i think i may of weeded them all out...
Jumping Jahoolipers!