PocketMatrix forums

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

Download PF_0_8_1 bugfixes

The Frog starting new life so I decided to post here zip with bugfixes of PocketFrog 0.8.1 in rasterizer.cpp and game.cpp it also includes Jason Elmore's (aka fast_rx) Alpha blitting code previously posted on this forum.

This will fix the following bugs:

Clipping bug in DrawLine and GameSuspend/GameResume bug. Small fix, but all-in-one package ;)

Maybe it fixes some other bugs I already fixed in this files but fogot to mention.

Hope Thierry wouldn't mind I posted these files here.

>Ben

P.S. Don't forget to recompile the libs!
Attachments:
PF_0_8_1_bugfix.zip (12 KB)
This is the second version, it contains all the previous and one additional fix. Thanks to fast_rx it eliminates unwanted behaviour of your game running on background (not active).

It saves a lot of CPU by just sleeping while running on background.

:idea: Users of PocketFrog_0_7_x :idea: could also download this file. After downloading just look in game.cpp lines 179&180.
Those two lines should be added to your src\framework\game.cpp, in my case after the line 211.
Lines 431 & 439 from the game.cpp of this package will also make your life easier.

Hope you find it useful ;)
Attachments:
PF_0_8_1_bugfix_2.zip (12 KB)
Very nice! Also it can be good idea post not only bugfixes but improvements too. For example i remember FillPoly function of PF is VERY slow. Maybe anyone can optimise it?
I abolutely don't mind you reporting/submitting fixes. I will take a look and integrate your changes to the code branch.
This package contains all the previous bugfixes and improvements and the following new.
This time I killed some drawing bugs:

1.The DrawVLine(...) drew 1 additional pixel at the bottom.
2.The DrawRect(...) redrew 2 pixels at the upper left and at the lower left.
3.The DrawRect(...) drew the rect with incorrect dimensions (+1 pixel for height and +1 pixel for width).

The following instructions are for the users of the previous versions of PF (non 0_8_1):

Users of PocketFrog_0_7_x could also download this fix.
Please look into the algo2d.h, line 443 of this package and replace the line in your src\internal\algo2d.h with this line (in 0_7_0 it is line 365).

Now take a look at rasterizer.cpp from this package. Lines 561, 562, 563 & 564. Replace lines in src\rasterizer.cpp (in 0_7_0 674 to 677 lines) with them.

Have a nice lib recompilation ;)
Attachments:
PF_0_8_1_bugfix_3.zip (16 KB)
DaGGeR wrote:Very nice! Also it can be good idea post not only bugfixes but improvements too. For example i remember FillPoly function of PF is VERY slow. Maybe anyone can optimise it?


I think bugfixes.zip's already have the newer version of FillPoly ;), because it is commented with:
Code:
// Added 6/10/2003 by Frank W. Zammetti
// Original function code written by Frank Zammetti,
// modifications and optimizations done by Andreas Hedström
#define POINT_UNDEFINED -16000
void Rasterizer::FillPoly( const Point vertex_vector[], int vertex_cnt, Pixel color )
Conan · 03 Aug 2005, 12:55 UTC — getting an error re: I2DRasterizer when I try to build lib
I downloaded the current latest PF & HAL and added the version 3 sources above. When I try to build PocketFrog I get one error:-
BlitAlpha' : is not a member of 'I2DRasterizer'
see declaration of 'I2DRasterizer'
This is to do with the enhancements I guess and I suppose my raster2d.h is not up to date?

Can anyone clear this up?
My fault :oops:. Hadn't included the raster2d.h & cpp, They also(as rasterizer.cpp) contain alpha blitting code. I'll look if there are any other changes in other files, and post the fixed version.
Thank you, Ian. And sorry for such a thing.
Thanks to Conan, this verison now includes all old and two new files I fogot to include in ALL previous versions of bugfix.
These files contain alphablit code.
Without these files (their modifications) you should fail to recompile the PF libs. If you succeed then this fix isn't necessary to you, because you probably already have them.
Attachments:
PF_0_8_1_bugfix_4.zip (19 KB)
Thanks, got these. The PF library builds fine now. I get a linker error when I try to build the plasma sample so I'm going to have to go through the project setup locations to see what I've missed
Linking...
PocketFrog_x86_Debug.lib(rasterizer.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall Frog::Internal::Raster2D::BlitAlpha(class PHAL::Surface &,class Frog::Rect const &,class PHAL::Surface const &,class PHAL::Surface
const &,class Frog::Rect const &)" (?BlitAlpha@Raster2D@Internal@Frog@@UAEXAAVSurface@PHAL@@ABVRect@3@ABV45@21@Z)
PocketFrog_x86_Debug.lib(rasterizer.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall Frog::Internal::AlphaRaster2D::BlitAlpha(class PHAL::Surface &,class Frog::Rect const &,class PHAL::Surface const &,class PHAL::Sur
face const &,class Frog::Rect const &)" (?BlitAlpha@AlphaRaster2D@Internal@Frog@@UAEXAAVSurface@PHAL@@ABVRect@3@ABV45@21@Z)
PocketFrog_x86_Debug.lib(rasterizer.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall Frog::Internal::GenericRaster2D::BlitAlpha(class PHAL::Surface &,class Frog::Rect const &,class PHAL::Surface const &,class PHAL::S
urface const &,class Frog::Rect const &)" (?BlitAlpha@GenericRaster2D@Internal@Frog@@UAEXAAVSurface@PHAL@@ABVRect@3@ABV45@21@Z)
Debug/Blit.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Conan wrote:
error LNK2001: unresolved external symbol "public: virtual void __thiscall Frog::Internal::Raster2D::BlitAlpha(...)

error LNK2001: unresolved external symbol "public: virtual void __thiscall Frog::Internal::AlphaRaster2D::BlitAlpha(...)

error LNK2001: unresolved external symbol "public: virtual void __thiscall Frog::Internal::GenericRaster2D::BlitAlpha


What I see from your output.
Compiler tells that unlike there should be Raster2D::BlitAlpha and other functions, but you haven't got them.
It happens in rasterizer.obj -> the rasterizer.h includes raster2d.h where all these functions declared.
But it cannot find them.

But they are in raster2d.cpp(in bugfix_4) so if you rebuilt your libs there shouldn't be such an error. Please, make sure you replaced the old raster2d.cpp (there should be functions: Raster2D::BlitAlpha and others in there) and recompiled the libs(your Debug lib) using "Rebuild All" instead of Build x.lib.

This error could happen only if your compiler haven't compiled the new version of raster2d.cpp and hadn't included in your Debug.lib.
As I understand, compiler tells you that these functions declared in your *.h (in raster2d.h) files but there are no functions in rasterizer.obj(new raster2d.cpp hadn't been recompiled and included in your new lib)
BigBen,

In case you didn't see it, there's a thread about an error (and fix) with my alphablit code when using blending

http://www.pocketmatrix.com/forums/view ... 776#263776

Maybe you can get that into the next bugfix release.
Thanks to fast_rx :) this bugfix contains two fixes for AlphaRaster2D::BlitAlpha in raster2d.cpp.

For users of previous versions of PF(non PHal) - open raster2d.cpp from this bugfix package; then find(ctrl-F), type "error" and you will find two lines that should be pasted into your old raster2d.cpp(if it already contain alphablit functions).

P.S. If you find this constant bugfix updates disturbing (since you need to rebuild all your lib files each time) you can wait until you would like to package setup.exe for your game. So come to this post and download the most recent bugfix. :wink:
Attachments:
PF_0_8_1_bugfix_5.zip (20 KB)
Conan · 08 Aug 2005, 09:43 UTC — Do a rebuild all when rebuilding the PocketFrog library
Remember to select rebuild all to ensure that all the bugfix files are included in the library. (I was tripped up by this one as I was just doing a build & was not getting the correct output.)
Thanks to Dyn this bugfix eliminates memory leaks in rasterizer:
dyn wrote:I have found leaks in rasterizer in PF.
m_alphaRaster created in SetBlending(uint8_t alpha) and m_genericRaster created in SetPixelShader( PixelShader* shader ), but none of them is deleted after...

more about leaks here: http://www.pocketmatrix.com/forums/viewtopic.php?p=264938

If you want to look for changes:
Ctrl-F "bugfix_6" in rasterizer.h & cpp or
Lines 131, 132 in rasterizer.h
Lines 96,97,101,123,124,128 in rasterizer.cpp

You can also find the original commented code in this bugfix package.

As always this package also contains all previous bugfixes and improvements :wink:
Attachments:
PF_0_8_1_bugfix_6.zip (20 KB)
Link is dead, is there any way to get the bug_fix?
Thanks to Chris Edwards, I was able to reupload the PF_0_8_1_bugfix_6.zip.

You can also download older bugfixes now.