PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

v0.99 beta available

Hey guys,

You can now download a beta of the 0.99 libraries at the following url:

http://overloaded.pocketmatrix.com/v0.99a - July 15th, 2002.zip

This is a PC only version of the library; EVC workspaces and projects are not included. This is because of some STL issues that we need to resolve; I hope to have 0.99 final ready tomorrow. This shouldn't affect the interfaces, so if you want to move to 0.99 today, feel free to do so.

New in this version:
- Landscape mode
- Window scaling when running in a window (duh)
- Battery monitor
- Surface clipping (sprites)
- Window handle now accessible through Api class
- Tga loading now detects .gz automatically
- Formatted printing
- JPeg loading

Besides this, Jaap spent some time cleaning up the library code. The interfaces are starting to look pretty stable, wich is good; once we release version 1.0 we hope to have a very stable interface.

Have fun, final (including EVC) tomorrow. I hope. :)

- Jacco.
um...page cannot be found
you don't have to say it twice you know :(
I tried the new library and changed some of my code here and there to sync with the format.

One problem, so far:

Is there a reason why Pixel *GetBitmap() is removed from the sprite interface?

It's not a huge problem to me, though I then have to make a lot of renovations...
If you have a sprite with pixel data, I guess you also have a surface that you used to construct the sprite with. You can use that to change pixels.

Note that the sprite NEVER owns a surface. If you construct a sprite using a surface, you need to take care of the recycling of that surface yourself. This used to be a bit unclear in previous versions of the library.
One extra note:
Sprites use an internal table to skip transparent pixels at the left side of the image. This speeds up the process of drawing. This means that you can't randomly change the contents of a bitmap used by a sprite; if changes in the bitmap would change the outline of the sprite, correct drawing of the sprite is not guaranteed.
"Sprites use an internal table to skip transparent pixels at the left side of the image. This speeds up the process of drawing. This means that you can't randomly change the contents of a bitmap used by a sprite; if changes in the bitmap would change the outline of the sprite, correct drawing of the sprite is not guaranteed"

Another reason for const-correctness (which it is right now).

As for D's note:

I guess a

const Pixel* GetPixels() const { return m_Pixels; }

added to the Sprite interface won't hurt.

I'll update it, if you agree. That way you'll only need to change the GetBitmap to GetPixels (which is a better name imho).

D:

How do you like the other changes so far? I hope it wasn't too much trouble changing your application to work with the new library? Considering most of the interface changes come from me, I'd be interested to hear your experiences and wishes!

Best regards,

Jape
Sierra · 17 Jul 2002, 20:26 UTC — changes
Argh, function parameters order have changed ... hope this will not be common on future upgrade =)
True this has happened in some places.

I think the locations where we did it have pretty good rationales. Mostly to improve consisistency, or to simplify interfaces.

I'm sorry. Can you tell me where you experienced problems?

Cheers,

Jape
s9801758 wrote:
True this has happened in some places.

I think the locations where we did it have pretty good rationales. Mostly to improve consisistency, or to simplify interfaces.

I'm sorry. Can you tell me where you experienced problems?


Nah, no sorries =) I understand its still under beta and the most important is to have an stable and rationale api. =)

Some functions that gaved me problems are:

g_Factory->NewSurface (it does not take the compressed parameter nemore)

g_Factory->NewSprite (it does take a new parameter (number of frames))

Sprite->Draw() (It reversed parameters with the buffer to draw).

The upgrade to the new library was really painless, just only these functions. (i'm sorry the xm support did not come at time!) :(

Ah!! I would like to make a little petition O:) Could clayers have an y_screen_offset to draw to? (i don't like to have "full screen" layers, maybe just some at 200 pixels high others at 100 pixels high that are drawn at bottom of screen, not at top).

Cheers,
Sierra
All valid points you give. Just to provide a few rationales for our decisions (so you don't get the impression we're just hammering away on our keyboards :) hehe).

"g_Factory->NewSurface (it does not take the compressed parameter anymore)"

Jup, we've removed that, cause it was useless. The extension given in the URL gives us all the information we need.

So basically we support three extensions right now.

.tga TGA files
.dat Zipped TGA files
.jpg JPEG files

"g_Factory->NewSprite (it does take a new parameter (number of frames))"

Yeah, we have merged the Anim and Sprite classes, resulting in a much cleaner system (IOHO). As a result the sprite constructor now takes the number of arguments.

I've thought about making 1 (number of frames) the default value for this parameter, but decided against it. If anybody gives me a good argument for doing so I can still think it over ofcourse.

"Sprite->Draw() (It reversed parameters with the buffer to draw)."

Jup, this was neccesary cause the target surface now has a default NULL value. When it is NULL we draw to the screen (g_Api->GetSecondary()), and otherwise we draw to the given target.

"i'm sorry the xm support did not come at time!"

We accidentally skipped over this in a recent meeting. I've written it down, and I'll bring it up again tomorrow.

"Could clayers have an y_screen_offset to draw to? (i don't like to have "full screen" layers, maybe just some at 200 pixels high others at 100 pixels high that are drawn at bottom of screen, not at top)."

This is Jacco's part. It seems like a reasonable addition to me, so I assume he'll answer this post tomorrow (when he's online again).

Cheers,

Jape
s9801758 wrote:
All valid points you give. Just to provide a few rationales for our decisions (so you don't get the impression we're just hammering away on our keyboards :) hehe).


Ok! All perfectly understood and reasonable =) Thanks for your explanation =)

s9801758 wrote:
"g_Factory->NewSurface (it does not take the compressed parameter anymore)"

Jup, we've removed that, cause it was useless. The extension given in the URL gives us all the information we need.


Just wondering also, what about resources? Some times is a bit "ugly" to have your graphics or music with files inside directories. Its not a big problem at all, i just like to have all stuff together on my environment =)

s9801758 wrote:
"g_Factory->NewSprite (it does take a new parameter (number of frames))"

Yeah, we have merged the Anim and Sprite classes, resulting in a much cleaner system (IOHO). As a result the sprite constructor now takes the number of arguments.


I have been playing a bit with these tonight ... not sure how it works. I made a gfx with double width and put a second image [[img1][img2]] set the frames to two. But the "NextFrame()" does not seem to work. It only draws the first frame of the image. it's still under development?

s9801758 wrote:
I've thought about making 1 (number of frames) the default value for this parameter, but decided against it. If anybody gives me a good argument for doing so I can still think it over ofcourse.


Once you know that there is a parameter with "number of frames" its not a problem at all =) And thank you a lot for mergin all the anim stuff with that! its A LOT MORE comprensible and usefull now =)))

s9801758 wrote:
"i'm sorry the xm support did not come at time!"

We accidentally skipped over this in a recent meeting. I've written it down, and I'll bring it up again tomorrow.


Woot! Thanks a lot! i only compose with XMs =)

s9801758 wrote:
"Could clayers have an y_screen_offset to draw to? (i don't like to have "full screen" layers, maybe just some at 200 pixels high others at 100 pixels high that are drawn at bottom of screen, not at top)."

This is Jacco's part. It seems like a reasonable addition to me, so I assume he'll answer this post tomorrow (when he's online again).


I have not seen the code, maybe breaks all that spans stuff ... but would be a lot more usefull the layers (if not i'll have to stuck with transparent sprites)


Cheers,
Sierra
I have been playing a bit with these tonight ... not sure how it works. I made a gfx with double width and put a second image [[img1][img2]] set the frames to two. But the "NextFrame()" does not seem to work. It only draws the first frame of the image. it's still under development?


Mmm, that's weird. It's supposed to be working. Hold on, let me take a look at the code.

You did not change any of the animation parameters (animation start, numAnimationFrames, animationType)?

Oh wait, never mind! I found the problem. My mistake.
Give me a few minutes to fix it and I'll give you a new file (we'll post a new library version tomorrow). What's your email address?

Back in a few minutes...


Cheers,

Jape
Okay people, I have a fix here. If you go to:

http://jaap.flipcode.com/temp/

there are two files in there with some important fixes. Just download them and copy them over your current versions (which are located in the Overloaded/Overloaded/DLL/Source directory).

Probably Jacco will upload a fixed library tomorrow or the day after, until then you can use these files.

Sierra: This also fixes the NextFrame() problem.

Cheers,

Jape
s9801758 wrote:
You did not change any of the animation parameters (animation start, numAnimationFrames, animationType)?

Oh wait, never mind! I found the problem. My mistake.
Give me a few minutes to fix it and I'll give you a new file (we'll post a new library version tomorrow). What's your email address?



Cool!!! my e-mail address is sierra @ ya.com. (i hate these spaming robots, just remove spaces)

Thanks for your fast response!! =)
s9801758 wrote:
Okay people, I have a fix here. If you go to:

http://jaap.flipcode.com/temp/

Sierra: This also fixes the NextFrame() problem.



Woot! Thats fast =) Thanks a lot Jape! =)
I'll try it right now.

Sierra,
Ah well, don't need your email-addy no more, cause I've already uploaded it to my website. But thanks anyway.

Fast responses? I'm just waiting till my laundry is done so I can finally go to bed :) hehe.

Cheers,

Jape
s9801758 wrote:
Ah well, don't need your email-addy no more, cause I've already uploaded it to my website. But thanks anyway.

Fast responses? I'm just waiting till my laundry is done so I can finally go to bed :) hehe.


Lol! Ok, works flawlessly now!!! =)))) It is implemented just as i was going to do it =)

Thanks again and happy laundry =)
Sierra
Oh now I see, well I did think about just having the surface with the sprite. At first I thought you guys copy the surface to sprite's pixel ptr. Ok, it's not a major problem. I just have to remember to release the surface along with the sprite...

As for changing the arguments, I'm real happy with it. Especially for automatic ".gz" detection and not having to change the surface target of fonts.

Also, the sprite finally has frames.

I'm going to see if I can get my game to work with the new version.
Ok, great, it now compiles and link...

but then it fails to find a section inside a loaded ini file. I'm sure the path works because I tested it (with fullpath). I'm totally clueless.

Code:

IniFile* ini = GetFactory()->NewIniFile( "ini/game.ini");
char s[256];
ini->GetStringValue( "main", "font", s );//asserts here (section does not exist)
Are you sure the game.ini has an actual section called [main]?

Can you email me your game.ini so I can test it myself? You can reach me at J.Suter@NO_SPAMstudent.utwente.nl with the NO_SPAM removed.

Cheers,

Jape
I solved it...I'm using the stlport for my stuff and I guess for some reason it conflicts with the Overloaded library. I'm not quite sure why but it sounds reasonable.

new problem, I'm unable to load compressed tga files anymore :P

I tried the uncompress version and it works. Did you guys change something?

The problem is that the loader is getting wrong data. I looked at the code for loading the image and all the tga data loaded were bogus. Such as width and height of image being huge.

I use gzip to compress them with compression level at max. I'm going to try re-compressing the image and see if it works. Other than that, I can try jpeg.
some surface memory leaks :(

I tried the caverunner demo and when I exit I get 3 surface "memory leaks".

I spent a lot of time trying to find all possible memory leaks in my game. And yes there are a couple, but it's all gone now.

Then at the end I checked some of the default game states and I found out that the surface of the font is not deleted.

Also, it would be nice to have the clip window of a surface defaulted to it's whole area.

I still can't get the compressed tga to work...
New problem, I'm unable to load compressed tga files anymore. I tried the uncompress version and it works. Did you guys change something?


Are you sure your compressed images end in the .dat extension? We didn't change anything about the actual loaders and decompression so I'm at a loss what your problem could be. You have make to sure your file end in a .dat extension though. If that doesn't fix your problem, please send me a compressed .tga file and I'll see what happens on my own computer. Thanks. (Btw, the address is J.Suter@NO_SPAMstudent.utwente.nl (with the NO_SPAM removed)).

I use gzip to compress them with compression level at max. I'm going to try re-compressing the image and see if it works. Other than that, I can try jpeg.


Allright, but for simple graphics compressed TGAs work much better. I'll be fixing the problem for sure, don't worry. I suggest that until that time you continue using uncompressed .tga files.

I tried the caverunner demo and when I exit I get 3 surface "memory leaks".

I spent a lot of time trying to find all possible memory leaks in my game. And yes there are a couple, but it's all gone now.

Then at the end I checked some of the default game states and I found out that the surface of the font is not deleted.


Jup, I'm very sorry you had to spend time on our problems. I already found those leaks myself but didn't get around to fixing them. I'm not the one responsible for those leaks (humtiedumtiedum, :) hehe), but I'll be passing it along to a certain person and will tell him to fix it.

Also, it would be nice to have the clip window of a surface defaulted.


Reiner, can you take a look at this?

Cheers all,

Jape
Woops, forgot to login. That last message came from me.

Cheers,

Jape
Also, it would be nice to have the clip window of a surface defaulted


as far is I know, this is the case :)


Rhino
ah that explains, I have my extension as '.gz'.

Ok it works now.
Sorry, flexibility on one side, takes away flexibility on another....

Ah well :).

Cheers,

Jape