Author Topic: Question regarding EGSL w/ Haiku R1A4.1...  (Read 11138 times)

Luposian

  • Guest
Question regarding EGSL w/ Haiku R1A4.1...
« on: May 31, 2013, 07:03:52 PM »
I am playing Brickmaster and Astrorocks on Haiku R1A4.1 (latest official Alpha release).  There are pink squares behind the ship and asteroids, in Astrorocks. and the brick area of Brickmaster is a pink rectangle behind the bricks.  Any idea what is causing this?

If I were to hazard a guess, based on my limited understanding of graphics, I'd say the area around these objects is supposed to be invisible (like a green-screen in movies), but is being misinterpreted, and therefore showing up.  But as to why pink?  I have no clue.

Were these games written to work in Alpha 4, but the .1 revision changed some graphic aspects?  Hoping someone has some answers.

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #1 on: May 31, 2013, 07:30:54 PM »
Yes, that's always the issue with Haiku. I think Brickmaster is source code only, so try to change the very first scirpt line from
Code: [Select]
screen (800,600,0 ...to
Code: [Select]
screen (800,600,32, ...If this doesn't work try to change the 32 to 24. I can't remember the correct value right now and haven't a Haiku installation nearby. (But it also depends on your desktop resolution).

Luposian

  • Guest
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #2 on: May 31, 2013, 07:40:31 PM »
Yes, that's always the issue with Haiku. I think Brickmaster is source code only, so try to change the very first scirpt line from
Code: [Select]
screen (800,600,0 ...to
Code: [Select]
screen (800,600,32, ...If this doesn't work try to change the 32 to 24. I can't remember the correct value right now and haven't a Haiku installation nearby. (But it also depends on your desktop resolution).

Is there source code for Astrorocks?  If not, there is no way to "fix" it.  I downloaded the binary of Brickmaster, off of Haikuware, but I know I can get the source code for Brickmaster here.

Thanks for the tip.  I will try it out, provided EGSL works as expected, in A4.1.  I know it no longer works in the most recent Haiku nightlies of gcc2hybrid.  :'(

Luposian

  • Guest
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #3 on: May 31, 2013, 08:43:17 PM »
Ok, this is interesting... upon running one of the sample programs in EGSL ("AnimationTest"), everything looks/moves fine, EXCEPT the mouse pointer!  The mouse pointer has a pink square behind it!  I changed the last number on the line you told me to change, from 0 to 32, and then to 24, all with no difference!  The only thing I could otherwise look into, is the mouse pointer .png file, but I can't figure out where that is!  Where is /data/bluepointer.png?  This is strange... so very strange.

Hey, wait a second... upon looking at the bricks.png file in the source code for Brickmaster... the background is pink!  This is the actual color in the .png file!  Is this a mistranslation of the .png file by Haiku R1A4.1 or was this the intended "background" that was supposed to be rendered invisible?  I know .png is supposed to support an "alpha channel" (or something like that, as I recall)... is that pink area supposed to be that?  Something weird is going on.

"Curiouser and curiouser"... as Alice would say.

Luposian

  • Guest
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #4 on: May 31, 2013, 10:16:23 PM »
Ok, I just zipped and sent the entire Brickmaster /data folder to myself and viewed the .png files with Windows 8's Paint.  The selected area around the images are all PINK!  So, it definitely isn't a .png mistranslation or something.  But, then, what is causing the game to display this "extra" information that, obviously, shouldn't be shown?  I'm going to look at Astrorocks for Windows and see what it's data images look like... if THEY are pink, then I know some code is not working in Haiku.

Just downloaded it (Windows version of Astrorocks) and the sections behind the rock and ship .png ARE pink!  But the game plays perfectly, with no pink (and vastly faster, too, but I'm running Haiku R1A4.1 on a Pentium 4 Celeron (single core)).  So... now we have to figure out what is causing the difference... is the source code identical or is the source code for the Windows version different, because the images are the same.

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #5 on: June 01, 2013, 07:10:42 AM »
The pink is called a colourkey. In EGSL you can use any colour as this. So normally it doesn't matter if it's pink, blue or black or anything else. A colour set with colourkey() should be transparent. I'll look at home into the Haiku version. I only had that issue using a wrong colour depth.
Oh, and please, no double posts for the same question ...

lelldorin

  • Guest
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #6 on: June 01, 2013, 10:20:09 AM »
Brickmaster is running on Haiku alpha 3 correctly.

the pink color is good, because you need to use a color for transparency that are not used in any other way into the game, because you can get something more to be tranparency as you wish.

So use a color that are not used in any other place is the correct color :-)... yes and it is like the blueblox (green whatever) into the movie-world.

I will try on Haiku alpha 4 too, i know that i have this problem with the "pick the stick" example of cvirus too.

Greetings Lelldorin

lelldorin

  • Guest
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #7 on: June 01, 2013, 10:41:50 AM »
Hmmm, this is interesting, i have tried Brickmaster and some other Examples on Haiku Alpha 4.1 and now they are running without any graphic failure.

And now tried the binaries from Haikuware: Brickmaster went fine, but Astrorocks has some problems, because then you move the spaceship the sound is broken and the transparency is sometimes not in function (pink screen).

@Luposian: Do you use the Alpha 4 or the Alpha 4.1 of Haiku? it can be a problem with the png librarie of Haiku.
« Last Edit: June 01, 2013, 10:47:45 AM by lelldorin »

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #8 on: June 01, 2013, 02:48:56 PM »
With my installations of Haiku I can not duplicate the error. Look at my attached screenshots, everything works fine.
« Last Edit: June 01, 2013, 02:51:54 PM by Cybermonkey »

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #9 on: June 01, 2013, 02:57:37 PM »
Now try the following code and post a screenshot, please:
Code: [Select]
screen (640,480,32,"Colorkeytest on Haiku")
cls()
colourkey (102,49,113)
test1 = createimage (64,64)
startimagedraw (test1)
colour (102,49,113)
fillbox (0,0,64,64)
colour (255,255,0)
fillcircle (32,32,20)
stopimagedraw()
colourkey (202,49,113)
test2 = createimage (64,64)
startimagedraw (test2)
colour (202,49,113)
fillbox (0,0,64,64)
colour (255,255,0)
fillcircle (32,32,20)
stopimagedraw()

putimage (200,200,test1)
putimage (100,100,test2)
sync()
key=inkey()
closewindow()
(Actually you should only see two yellow circles on a black background ...)

Luposian

  • Guest
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #10 on: June 01, 2013, 03:17:12 PM »
Brickmaster is running on Haiku alpha 3 correctly.

the pink color is good, because you need to use a color for transparency that are not used in any other way into the game, because you can get something more to be tranparency as you wish.

So use a color that are not used in any other place is the correct color :-)... yes and it is like the blueblox (green whatever) into the movie-world.

I will try on Haiku alpha 4 too, i know that i have this problem with the "pick the stick" example of cvirus too.

Greetings Lelldorin

Note I said I am running Haiku R1A4.1, not R1A3.  A lot can change 1.1 versions later.  But thanks for the clarification on the pink in the graphics.  Something isn't hiding it correctly...

Luposian

  • Guest
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #11 on: June 01, 2013, 03:20:32 PM »
With my installations of Haiku I can not duplicate the error. Look at my attached screenshots, everything works fine.

Are you running R1A4.1 (the latest official Alpha release)?  This is the exact version I am running.

Luposian

  • Guest
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #12 on: June 01, 2013, 04:41:32 PM »
Now try the following code and post a screenshot, please:
Code: [Select]
screen (640,480,32,"Colorkeytest on Haiku")
cls()
colourkey (102,49,113)
test1 = createimage (64,64)
startimagedraw (test1)
colour (102,49,113)
fillbox (0,0,64,64)
colour (255,255,0)
fillcircle (32,32,20)
stopimagedraw()
colourkey (202,49,113)
test2 = createimage (64,64)
startimagedraw (test2)
colour (202,49,113)
fillbox (0,0,64,64)
colour (255,255,0)
fillcircle (32,32,20)
stopimagedraw()

putimage (200,200,test1)
putimage (100,100,test2)
sync()
key=inkey()
closewindow()
(Actually you should only see two yellow circles on a black background ...)

It worked.  Don't have time right now to post an image, but I tested this code and it worked.  Took out the colorkey lines and the squares show up.  Now, the question is... why isn't it working in Brickmaster or Astrorocks?  Have you examined every line of code?  Is the Alpha (number) set correctly?  Is the colorkey (x, y, z) set correctly?  There must be a logical explanation.

The only difference is that you're dealing with graphic primitives and not graphic images.  Try using one of the graphic images (with pink) from Brickmaster and see what happens.

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #13 on: June 01, 2013, 04:50:25 PM »
Well, it happened what I posted before: no pink. BTW, I am using the latest release of Haiku Alpha 4.1. Have you donwloaded the games from egsl site or haikuware? If the later on, please try the version from here: http://www.egsl.retrogamecoding.org//pages/showcase.php

lelldorin

  • Guest
Re: Question regarding EGSL w/ Haiku R1A4.1...
« Reply #14 on: June 01, 2013, 10:03:26 PM »
Here a screenshot of the astrorocks version from EGSl Website:

Haiku alpha 3

« Last Edit: June 01, 2013, 10:05:53 PM by lelldorin »