Why dont these pictures load properly?

Discuss any general programming issues here
Post Reply
Bugala
Posts: 1180
Joined: Sun Feb 14, 2010 7:11 pm

Why dont these pictures load properly?

Post by Bugala »

Here are 3 different pictures:
http://dl.dropbox.com/u/3375468/b.png
http://dl.dropbox.com/u/3375468/b.jpg
http://dl.dropbox.com/u/3375468/b-2.png


I have two different programs that do the following:

program 1 is tile maker
program 2 is mapeditor


Here is what happens in program 1 (tile editor):
FileRequest(file$)
LoadBrush(1, file$)

Then make Animation frame by frame to size (95x95) with animstream commands ie:
WriteAnimFrame...
FinishAnimStream(1)




Then comes the program 2:

This one
LoadAnim(1, "b.anim")

then

displayanimframe(1)

and afterwards between REPEAT and UNTIL

NextFrame(1, x, y, 1)




To put this thing short. There shouldnt be anything wrong with the program because When i have tried loading some pictures and single colored example tiles, it worked just like it was supposed.

But when i try to load these specific b.png, b.jpg, b-2.png pictures, it shows either black or nothing. I dont know if its nothing or black, since the background is black.


Original picture that was made is the b.png.

I tried to change it into jpg in hopes it had fixed the problem, i also tried coloring it with more colors and saving it as b-2.png, but none of these helped.


Is this WINUAE problem only, or is there something wrong with the pictures, and how can i make these pictures so that they actually work?
jalih
Posts: 276
Joined: Fri Jun 18, 2010 8:08 pm
Location: Finland

Re: Why dont these pictures load properly?

Post by jalih »

Any particular reason for using animstream?

I usually just save all animation frames in one picture and save all x -or y-co-ordinate frame offsets in a table. Using a frame counter variable and a timer, it's easy to handle animating by hand...
Bugala
Posts: 1180
Joined: Sun Feb 14, 2010 7:11 pm

Re: Why dont these pictures load properly?

Post by Bugala »

Interesting idea, but in this case using Animation is easier.

If you wish to look better, heres the current sources and windows exes of my map editor and tileset maker:
http://dl.dropbox.com/u/3375468/mapeditor.exe
http://dl.dropbox.com/u/3375468/mapeditor.hws
http://dl.dropbox.com/u/3375468/Speedga ... pedito.hwd
http://dl.dropbox.com/u/3375468/Speedga ... _Win32.exe

They are not very informative and they crash if you do something you are not supposed to do, since this is not meant to be publicly released (although i have nothing against if someone wants to spread it) but are simply meant for one specific project.

The designer project is supposed to have that mapeditor inside itself too, but currently it doesnt work properly from there.

If you wish to use mapeditor, you need to make folder "tilesets" and then copy or create using tileset maker 3 different Animations and name them "empty.tileset", "height.tileset" and "ojectsandcharacters.tileset" since those it will try to load at beginning.


Tileset maker code is spread into 3 different parts. I am telling these from memory, so i might fail to remember commands correctly:

First is "Create a new tileset":

Code: Select all

file$ = StringRequest("name of tileset")
BeginAnimStream(1, file$)
next is "Add Tile":

Code: Select all

file$ = FileRequest("Load a 96x96 picture")
LoadBrush(1, file$)
WriteAnimFrame(1, 1)
And as last comes "Save Tileset"

Code: Select all

FinishAnimStream(1)

Then in addition to these there is also "Add new tiles to existing tileset" (= Load Tileset):

Code: Select all

file$ = FileRequest("Choose a tileset")
LoadAnim(2, file$)
numberofanimframes = GetAttribute(#ANIM, 2, #NUMBEROFFRAMES)
BeginAnimStream(1, file$)
For n = 1 to numberofanimframe
   getanimframe(1, 2, n)   (= to brush 1, from anim 2, number n)
   WriteAnimFrame(1,1)
next

So there are only very few lines of code there in total to handle the whole thing and its simple enough for non programming graphic artist to use.

With your system there would need to be this table and picture loaded everytime in addition to just one anim file making it more difficult to handle since then you need to move two files everytime to new folder if necessary to move them around which will make it, not much, but slightly more confusing to artis anyway.

But i think your system could be much speedier in execution.
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Why dont these pictures load properly?

Post by airsoftsoftwair »

Please produce a very small code excerpt that shows the problem, then I might be able to help you.
Bugala
Posts: 1180
Joined: Sun Feb 14, 2010 7:11 pm

Re: Why dont these pictures load properly?

Post by Bugala »

Im not going to do now, but i might do it in following week or something since this isnt the first time png pictures are giving me some strange trouble in way that other one works and other one doesnt for no ovious reason at all.
Bugala
Posts: 1180
Joined: Sun Feb 14, 2010 7:11 pm

Re: Why dont these pictures load properly?

Post by Bugala »

Ah, I think i finally found the problem, will tell better when i get checked it really is that, for there are still some strange things in this.
Bugala
Posts: 1180
Joined: Sun Feb 14, 2010 7:11 pm

Re: Why dont these pictures load properly?

Post by Bugala »

Okay. So the problem was that when i changed the numbers from 64 to 128, i accidentally wiped hald of previous line and instead of using Width and Height, i went on to use X and Y...

Thats why i thought it worked before etc. since i didnt realise i had changed that one line since it happened accidentally. Especially since the place i edited inside Hollywood Designer actually didnt have more than just 3 lines of code...
Post Reply