03-23-2006, 12:52 PM
03-23-2006, 12:52 PM
03-23-2006, 01:50 PM
Here:
Uses Rellib.
You may want to tweak it a little bit because the tilesize it saves to is 30 x 30.
Vars to play with are STX,STY (the tile dimensions) and the for loop max values.
Uses Rellib.
Code:
DEFINT A-Z
'This File Does the converting of BMP tiles to pp256 format
'using the palette specified.
'you may have to edit the damn thing :*)
'$INCLUDE: 'Rellib.BI'
'$DYNAMIC
CLS
SCREEN 13
DIM SHARED PAL AS STRING * 768
Path$ = "C:\Images\Temp\"
Filer$ = "FF6chrs6.Pcx"
C = RelLoadPCX(VIDEO, 0, 0, Path$ + Filer$, PAL, TRUE)
FOR Y = 0 TO 199
FOR X = 0 TO 319
IF POINT(X, Y) = 106 THEN
PSET (X, Y), 175
END IF
NEXT X
NEXT Y
stx = 30
sty = 30
Size = RelSize(0, 0, stx-1,sty-1)
MaxSize = (Size * 60)
DIM BMPS(MaxSize) AS INTEGER
sy = 12
sx = 11
Offset = 0
FOR X = sx TO 300 STEP stx
FOR Y = sy TO 170 STEP sty
GET (X, Y)-STEP(stx - 1, sty - 1), BMPS((Offset * Size))
LINE (X, Y)-STEP(stx - 1, sty - 1), 255, B
Offset = Offset + 1
NEXT Y
NEXT X
'END
Leng& = MaxSize& * 2&
DEF SEG = VARSEG(BMPS(0))
BSAVE Path$ + "ArkWalk1.Put", VARPTR(BMPS(0)), UBOUND(BMPS) * 2&
DEF SEG
C$ = INPUT$(1)
CLS
SCREEN 0
WIDTH 80
END
You may want to tweak it a little bit because the tilesize it saves to is 30 x 30.
Vars to play with are STX,STY (the tile dimensions) and the for loop max values.
03-23-2006, 05:52 PM
Thanks, hope it works! 8)
03-23-2006, 06:06 PM
...and hey... where can I download Rellib? It wasn't included when I downloaded FreeBASIC... :roll:
03-23-2006, 06:08 PM
Rellib is a qb library. It wont work with FreeBASIC.
03-23-2006, 06:58 PM
I get an Illegal function call here:
It's silly maybe, but I haven't been coding for years so I need a little kick-start to get me going again...
Here's the dimensions of my sprites/tiles: 20x16
The BMP's dimensions is: 320x128
I also changed this:
To this:
Code:
sy = 12
sx = 11
Offset = 0
FOR X = sx TO 300 STEP stx
FOR Y = sy TO 170 STEP sty
GET (X, Y)-STEP(stx - 1, sty - 1), BMPS((Offset * Size)) ---- HERE
LINE (X, Y)-STEP(stx - 1, sty - 1), 255, B
Offset = Offset + 1
NEXT Y
NEXT X
It's silly maybe, but I haven't been coding for years so I need a little kick-start to get me going again...
Here's the dimensions of my sprites/tiles: 20x16
The BMP's dimensions is: 320x128
I also changed this:
Code:
FOR Y = 0 TO 199
FOR X = 0 TO 319
IF POINT(X, Y) = 106 THEN
PSET (X, Y), 175
END IF
NEXT X
NEXT Y
To this:
Code:
FOR Y = 0 TO 127
FOR X = 0 TO 319
IF POINT(X, Y) = 106 THEN
PSET (X, Y), 175
END IF
NEXT X
NEXT Y
03-25-2006, 05:39 PM
Is there maybe anyone who wanna help me out with this one?
03-26-2006, 12:53 AM
Make sure you dim the array large enough to hold the data for all of the sprites. It looks like that could be the problem.