Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

PureGDK / Does enchancements working properly with PureGDK 2.0?

Author
Message
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 3rd Feb 2012 16:37 Edited at: 3rd Feb 2012 16:43
I am trying to test one plugin the Enhancements.

The plugin is installed correctly and I used the
GetModuleHandle_() function to see if my dll is loaded.

The code bellow indicates if you have some of your plugins installed in and recognized by your language (PureBasic).



If the result dll_error is not 0 then you will have one big number this number is the process number in memory address that the dll occupies.

The video clip explains it different , but I found some way to see if my dll is loaded.

The source code "h.Lib-EnhancementPack.pb" file as Mistrel told , contains all source functions in PureBasic syntax.

I created one small zip file and I put one image in.

I tried to load my zip file and the image from inside and I have
an error "File block is invalid or does not exist"

My file block exists and is not invalid. I have used this plugin with DarkBasic Pro and everything works perfectly.

Loading some image from one block.


The followin code creates my file block manualy from code and the code creates the file block and adds the image in.



There is a problem , you can create the blocks , but you can't load them back.

I have and one file with the block and image created.

Attachments

Login to view attachments
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 3rd Feb 2012 18:51
Quote: "If the result dll_error is not 0"


It's supposed to be a hex number if it succeeds. This is the module handle: GetModuleHandle.

Quote: "There is a problem , you can create the blocks , but you can't load them back."


Is a command missing? I did not write this plugin, I only wrapped it.

Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 3rd Feb 2012 23:46 Edited at: 3rd Feb 2012 23:58
Quote: "
Is a command missing? I did not write this plugin, I only wrapped it.
"


It doesn't seems to be missing , but drops invalid or missing block error.

But the block is not missing.

If I open the block without load any image from it it doesn't drop error.

If I try to load some image from it drops error.





I tried to load other image .png , in case .bmp images don't work.

Both image functions drops errors:

Enh_LoadImageFromBlock
Enh_LoadBitmapFromBlock


I have a screenshot of the error message.

I made an extensive research and I tried and
create_block_result=Enh_CreateFileBlock(2,"test.zip")
function and returns 0.
All functions returns 0.
0 means success -1 means fail.
The CreateFileBlock created the test.zip file block I want (Empty).

Attachments

Login to view attachments
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 4th Feb 2012 00:22 Edited at: 4th Feb 2012 00:24
Strange , I tried to load and play ogg sounds , but nothing.
I tried to load wav sound from block again nothing.
Loading sounds with PureGDK load correct and return 1

There is something wrong with the enhancements plugin for PureGDK 2

As I found 0 means fail 1 means success so all have result 0 so all fail.

another strange. I used create_block_result=Enh_CreateFileBlock(2,"test.zip") Function
And created my block but return 0 which means fail.
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 4th Feb 2012 00:30 Edited at: 4th Feb 2012 00:31
I made and another test which proves , the plugin is loaded correct.

I tried to use GetDisplayWidth() and GetDisplayHeight() to receive my dimensions of my desktop resolution.
Returned correct this means the plugin is loaded.



So the plugin have problem.
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 4th Feb 2012 02:50 Edited at: 4th Feb 2012 02:51
It could be that you're using the plugin incorrectly. Try making it work in DBP first to get the syntax right.

There is no difference between the PureGDK function and the DarkBasic Professional one.

Also:

Quote: "And created my block but return 0 which means fail."


This function doesn't return a value.

Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 4th Feb 2012 10:49
I use the plugin correcly , one thing I know, the plugin is not working and have bugs.
I quit the try to use this plugin and I quit and try to use and PureGDK too.

Correct your products first and after 10 years might I will return again.

I will try to find other serious game engine to use free of bugs.

Goodbye.
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 4th Feb 2012 11:27 Edited at: 4th Feb 2012 11:29
If you have a bug report then submit a fully working example in DBP that demonstrates how it should work and explain why it is not doing so in PureGDK.

Unless you can prove that this is a bug and not user error then there is nothing for me to fix.

Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 4th Feb 2012 21:53
This post have an example compiled with DarkBasic pro
And the enhancements plugin is working.
Full source code included with executable example.

Attachments

Login to view attachments
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 4th Feb 2012 21:56
This post have an example compiled with Purebasic
And the enhancements plugin is not working and drops the error.
Full source code included with executable example.

Attachments

Login to view attachments
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 5th Feb 2012 01:19 Edited at: 5th Feb 2012 01:24
I made a typo in the template file for this plugin. The typo just-so-happened to be on the OpenFileBlock function.

See this line in "h.Lib-EnhancementPack.pb":

Quote: "
If Not GDKLoadPtr(@Ptr0,"Enhancements.dll","?OpenFileBlock@@YAXKHK")"


It should be this:

Quote: "
If Not GDKLoadPtr(@Ptr0,"Enhancements.dll","?OpenFileBlock@@YAXKHK@Z")"


I then changed Enh_LoadBitmapFromBlock to Enh_LoadImageFromBlock in your example and the picture of the dog loaded just fine.

This is fixed for the next release.

Also, the last parameter "Key.s" is optional. You don't have to pass a blank string for it.

Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 5th Feb 2012 02:09
I thing it fixed.

There is one function with name:

Enh_LoadSoundFromBlock(FileBlockID, FileName.s, SoundID)
Is not documented in Darkbasic pro manual and is not working in DarkBasic too.

But there is the code in PureBasic version.

Does this work with .ogg or .wav files?

Thank you for the first fix.
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 5th Feb 2012 04:43 Edited at: 5th Feb 2012 04:45
That function calls an export "?LoadSoundFromBlock@@YAXHKH@Z" which doesn't exist. So that function won't work at all.

Plugins map out what functions they have in a string table which I then convert to a template. There may be functions defined in that string table which don't actually exist; such as this case.

The only exports that appear to exist for the "load" type functions are:

Quote: "
Enh_LoadBitmapFromBlock
Enh_LoadImageFromBlock
Enh_LoadObjectFromBlock"


The rest were probably functions that were planned but never implemented.

Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 5th Feb 2012 16:53
So why is there in the source code?
Does the game creators plans to add this function in the future?
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 5th Feb 2012 19:28 Edited at: 5th Feb 2012 19:29
Quote: "So why is there in the source code?"


There are literally thousands of commands and I can't cross-reference every single one of them. If there is an error in the implementation then it will be inherited.

However, PureGDK has the advantage of being able to correct some of these errors. For example, these bugs in the DarkClouds plugin are fixed in PureGDK:

http://forum.thegamecreators.com/?m=forum_view&t=185933&b=15

Quote: "Does the game creators plans to add this function in the future?"


You'll have to ask them.

Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 5th Feb 2012 23:32 Edited at: 5th Feb 2012 23:34
Are you planning to add such a function you , in your PureGDK version of enchancements?

You will have and exlusive special version that will support more functions than the DarkBasic one!

What are all of these @@YAXKHK@Z?

I see them in all functions what do they mean?
And why this little change correct the problem?
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 6th Feb 2012 01:27 Edited at: 6th Feb 2012 01:29
So far , I am making a nice megamix of functions plugins and languages.

For My keyboard Handling for my game , I use PureBasic.
For mouse Handling , I use PureGDK (DarkBasic).
For loading graphics , I use enchancements Plugin.
For drawing fast text and fonts I use D3D Functions Plugin.
For loading fonts and extend resources , I use API calls.
For loading sounds , I use PureBasic vbin_ library and native Purebasic CatchSound functions.
For my 3D objects , I will use DarkBasic Plugins and Function which supported with PureGDK.

I like this megamix and now I can do almost everything.

I will try some extra sprites and effects from PureGDK.

I am very happy and I will inform again for my progress.
I think no one so far ever made any Plugin and Language mix for any game. I use the best parts for both languages in one shell.
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 6th Feb 2012 17:41
Quote: "For My keyboard Handling for my game , I use PureBasic.
For mouse Handling , I use PureGDK (DarkBasic).
For loading graphics , I use enchancements Plugin.
For drawing fast text and fonts I use D3D Functions Plugin.
For loading fonts and extend resources , I use API calls.
For loading sounds , I use PureBasic vbin_ library and native Purebasic CatchSound functions.
For my 3D objects , I will use DarkBasic Plugins and Function which supported with PureGDK."


To me it seems that you'll hit some incompatibilities at one point with this cross selection of libraries. See how it goes.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, PureBasic 4.60 + PureGDK 2.0
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 6th Feb 2012 18:57
So far , I don't have problem.
I will see , during creation of my game and change my engine a little.
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 6th Feb 2012 22:42 Edited at: 6th Feb 2012 22:43
He can use whatever libraries he wants as long as he doesn't try to mix them by passing IDs and data structures between them.

Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 7th Feb 2012 15:14
I use my IDs and my Data , very carefully.

For example for my sound data I use catch sound functions to load them from data files.

LoadSoundfromBlock function is not exist , but vbin_ library will make the job for me perfectly.
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 7th Feb 2012 18:44
You load PGDK sound using CatchSound command? I thought thats impossible.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, PureBasic 4.60 + PureGDK 2.0
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 7th Feb 2012 21:38
I load sounds using catchsound command and I don't play them with PureGDK , I play them with PureBasic sound functions.
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 8th Feb 2012 01:09
Quote: "I load sounds using catchsound command and I don't play them with PureGDK , I play them with PureBasic sound functions. "


Alright thats fine then.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, PureBasic 4.60 + PureGDK 2.0

Login to post a reply

Server time is: 2024-11-17 22:19:03
Your offset time is: 2024-11-17 22:19:03