Allegro.cc - Online Community

Allegro.cc Forums » The Depot » OpenLayer 1.9 Released!

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
OpenLayer 1.9 Released!
Carrus85
Member #2,633
August 2002
avatar

Quote:

Is there a CVS repo anywhere?

Um... no. He has yet to put it on CVS AFAIK.

Hrvoje Ban
Member #4,537
April 2004
avatar

Two more things about libz dll: both libz.dll and zlib1.dll are same and are not needed because lib/libz.a is static library. You should also replace allegro library with static version.

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

Alright. I got it to compile. Making a diff now. Is there a CVS repo anywhere?

Nope, seems like I'll have to play with SourceForge a bit. I have to get the web page and the manual there and get the CVS to work. Is there any way to apply the .diff file without CVS, though?

Quote:

Anyways, currently attached are the diff and vcproj files.

Thanks a lot! Could you also send me the .lib files so I could add a Visual C distribution?

Quote:

Two more things about libz dll: both libz.dll and zlib1.dll are same and are not needed because lib/libz.a is static library.

Yeah, but for some reason Glyph Keeper sets the library to use dynamical linking. I should try to disable that, though.

Quote:

You should also replace allegro library with static version.

Maybe, I've always used dynamical linking myself but static linking could be easier for the newcomers.

Quote:

You should only include files with "..." if the file is in the same directory. It seems MSVC doesn't like to search the include paths.

Alright, I'll keep that in mind.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

CGamesPlay
Member #2,559
July 2002
avatar

Try cd'ing to the openlayer directory, and running patch -p1 <file> ;)

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Carrus85
Member #2,633
August 2002
avatar

Quote:

Try cd'ing to the openlayer directory, and running patch -p1 <file>

Assuming you are using linux of course. That just flat out doesn't work without properly downloaded programs in windows... (assuming flad is using windows).

Arvidsson
Member #4,603
May 2004
avatar

Fladimir da Gorf
Member #1,565
October 2001
avatar

Yeah, I'm using Windows so there's no patch -command. The GNU utilities seems to not to have that either...

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Arvidsson
Member #4,603
May 2004
avatar

GNU utilities website said:

The following program versions are covered: ... patch-2.5

Fladimir da Gorf
Member #1,565
October 2001
avatar

Ah OK, I thought I was supposed to use the command prompt thing that came with it.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

CGamesPlay
Member #2,559
July 2002
avatar

He said not using CVS, not not using basic tools like patch ::)

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Evert
Member #794
November 2000
avatar

Quote:

Allegro's angles are CCW negative. Traditional Angles are CCW positive.

Not quite, actually. Allegro's angles are anti-clockwise positive.

the manual said:

Positive increments of the angle will make the sprite rotate clockwise on the screen, as demonstrated by the Allegro example.

Remember that on a computer screen the y coordinate increases downward!

fuzinavl
Member #4,105
December 2003
avatar

1.92 bug: LineStrip: when 2 adjacent control points have the same x or y values, spiking occurs (see attachment)

It would look better if the (highest index) control points were rendered last. The attachment shows an overlap point.

LineStripGradient( *xCoords, *yCoords, numCoords, innerStartCol, innerEndCol, outerStartCol, outerEndCol, float lineWidth = 1.0);Can anyone think of a use for this function other than curved lasers?
You can do something similar by overlapping plain lineStripGradients.

__________________________
fuzinavl@hotmail.com (Pittsburgh)
__http://fuzinavl.tripod.com/__

Hrvoje Ban
Member #4,537
April 2004
avatar

BUG - Building ol::Bitmap from datafile

1#include <OpenLayer.hpp>
2 
3int main()
4{
5 ol::Setup::SetupProgram(false, false, false);
6 ol::Setup::SetupScreen(640, 480, false);
7 
8 DATAFILE *data = load_datafile_object("test.dat", "TEST_BMP");
9 if (!data) { allegro_message("Error #1\n"); return 1; }
10 
11 ol::Bitmap bmp(static_cast<BITMAP *>(data->dat));
12 if (!bmp.IsValid()) { allegro_message("Error #2\n"); return 2; }
13 
14 bmp.Destroy();
15 TRACE("Trying to unload datafile...");
16 unload_datafile_object(data);
17 TRACE("Datafile unloaded.");
18 
19 return 0;
20}
21END_OF_MAIN()

Both OpenLayer and Allegro will try to free bitmap pointer (data->dat) causing Segmentation Fault.

Ron Ofir
Member #2,357
May 2002
avatar

Perhaps there should be a Bitmap(DATAFILE * data, int index) constructor? Or some way to make Destroy() not free the bitmap?

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

Can anyone think of a use for this function other than curved lasers?

Actually a similiar function exists already (the one with the side colors). I'm using that one to make an "afterburner" effect.

Quote:

1.92 bug: LineStrip: when 2 adjacent control points have the same x or y values, spiking occurs (see attachment)

Thanks for that, I already started to wonder why the line strips weren't always rendered correctly.

Quote:

It would look better if the (highest index) control points were rendered last. The attachment shows an overlap point.

Well, I always use it the other way around. Just flip your arrays and colors and it's fine.

Quote:

Both OpenLayer and Allegro will try to free bitmap pointer (data->dat) causing Segmentation Fault.

OK, now I've made the Bitmap to not to try to free any Allegro BITMAP it's given.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

CGamesPlay
Member #2,559
July 2002
avatar

Well, Fladimir, I got it compiled. And it works. 1.47 megs of fun, available for your pleasure at [url http://cgamesplay.com/files/openlayer.zip].

Now, why do i only get a half frame per second?

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

Well, Fladimir, I got it compiled. And it works. 1.47 megs of fun, available for your pleasure at

Thanks a lot!

Quote:

Now, why do i only get a half frame per second?

Bad drivers I guess so that it uses software rendering instead of the graphics card? Could you try updating your drivers? You should be getting at least a few hundred of FPS in the demo...

EDIT: Ps.
http://crystalstorm.ath.cx/Shot4Small.jpg
(The image works only when the server is online)

I think I'll have to improve the look of the radar, though. Any suggestions?

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Steve Terry
Member #1,989
March 2002
avatar

Radar looks good, where are all the little dots... oh and the green bar should be more prominent, maybe a single color.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

Fladimir da Gorf
Member #1,565
October 2001
avatar

Eh? Is there a problem with the image loading or something?

Also CGamesPlay, could you also change the Install.txt to show how you can install the package for MSVC (If all the .lib files are in the Libs-folder)? Thanks in advance!

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

CGamesPlay
Member #2,559
July 2002
avatar

- Link your projects with (gcc): -lol -lglyph -lfreetype -lloadpng -lpng -lz -lagl -lalleg
                                 -luser32 -lgdi32 -lglu32-lopengl32
                                 (All linker commands should be in a single line)
                         (MSVC): alleg.lib ol.lib agl.lib user32.lib gdi32.lib opengl32.lib
                                 glyph.lib freetype.lib glu32.lib loadpng.lib libpng.lib zlib.lib

Easiest thing I've done all day :)

Updating my drivers fixed the problem, now it runs nicely. About 60 FPS.

Can't get the ball to go up though, and it likes to shoot to the left, and are the physics dependant on the framerate (if I move the paddle up too much the ball goes through it, maybe)?

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Edward Sheets
Member #4,734
June 2004
avatar

I get 60 FPS too with WindowsXP Pentium4 and a GeForceMX4000. So I assume this is because of Vsync since my lcd monitor refresh rate is 60hz. It might be useful to have a DisableVsync() function so we could at least test the potential FPS...

---

Note: carving a pentagram on the top of a container of spoiled yogurt does not summon a yogurt demon. -Kikaru

Tobi Vollebregt
Member #1,031
March 2001

At least with nvidia drivers you should be able to turn vsync off somewhere in the drivers configuration.

But I agree, a function to turn off vsync would be nice.

________________________________________
website || Zipfile reader @ Allegro Wiki || Download zipfile reader

Edward Sheets
Member #4,734
June 2004
avatar

I noticed Demo.cpp still #includes <loadpng.h>

There's no need to include the loadpng header anymore, right?

---

Note: carving a pentagram on the top of a container of spoiled yogurt does not summon a yogurt demon. -Kikaru

Zaphos
Member #1,468
August 2001

Quote:

are the physics dependant on the framerate (if I move the paddle up too much the ball goes through it, maybe)?

Indeed it seems that way.

      // Does the ball hit the paddle? //
      if( ballYPos >= paddleYPos && ballYPos < paddleYPos + paddle.Height()
          && ballXPos >= paddleXPos
          && ballXPos <= paddleXPos + paddle.Width() ) {

This will break if the framerate is such that the ball speed is faster than expected. A quick fix would be:

      // Does the ball hit the paddle? //
      if( ballYPos >= paddleYPos && lastBallYPos < paddleYPos + paddle.Height()
          && ballXPos >= paddleXPos
          && ballXPos <= paddleXPos + paddle.Width() ) {

This does demonstrate the benefits of the 'standard' allegro method of framerate control, which simplifies testing as you know the behavior will be exactly the same at all framerates, not just similar. With a solution like the OpenLayer-encouraged one, all collision checks should really check the whole line of possible positions, as it is no longer correct to make assumptions about the maximum movement speed of anything.

fuzinavl
Member #4,105
December 2003
avatar

Quote:

Actually a similiar function exists already (the one with the side colors). I'm using that one to make an "afterburner" effect.

A symmetrical outerStartColor and outerEndColor would look better. I'd replace the left/right color function with that. Then the outercolors could get a gradient too. ;)
Inner (1.0,0.7,0.7,1.0) to (1.0,1.0,1.0,0.3) //pink to smoke
outer (0.0,0.0,1.0,0.5) to (1.0,1.0,1.0,0.0) //half blue aura fades away

__________________________
fuzinavl@hotmail.com (Pittsburgh)
__http://fuzinavl.tripod.com/__

 1   2   3 


Go to: