June 16, 2009

The story of... C++ calling conventions, Google and needed informations...



I was googling a long time about C++ calling conventions and that what happens there in detail.
MSDN is almost always the first station to stop by. They have good references, but often they aren't really detailled, so I have something for you. (Found it per Google..... *cough*)

So I found this interesting blog, with a lot of interesting stuff in there:

Nyaneve - Adventures in Windows debugging and reverse engineering

and nice review about Windows calling conventions up there (yeah, its detailled!):

http://www.nynaeve.net/?p=66

So thx to Ken Johnson aka. Skywing sharing this nice blog and informations with us :)

dllmain(...) + usage of delete operator = argh!


Since its beginning, the G2Ext Starter (CMD/GUI) had a problem with loading the g2ext.dll. I was always wondering why?

With some infos about errors-while-loading-dlls from NicoDE, I finally managed to fix the bug.

Never use the delete [object] operator in a dllmain function. Never! Or anything else what could make the dllmain fail.

Here is some good doc about best practice in DLLs (even if its from MS... its useful):
Best Practice in DLLs (@ microsoft.com)

June 14, 2009

Quick news...^^


I think screens say more than anything^^

Aaaaand: Current release builds are now being given to chosen testers. If you want to get involved in our "testing-program" just drop a message to DaDummy.

May 12, 2009

Legal or not - That is the question...

...that lots of people have been bugging DaDummy and me about, so we just went to PiranhaBytes and JoWood and asked for allowance. And then... the unimaginable! We got the allowance from PB and JoWood!
Yeah! No more being-bugged about legality stuff!

Man, I'd really like to have a Guinness about that!
But I have none... D:

By the way: If you still think that this project is not really legal and/or just want to make a drama, then drop a private message for DaDummy at the World of Gothic forum!

Parser interaction


As you all know, we're doing quite devious and sadistic things with Gothic's engine, but.... wow... we managed to make Gothic register a external script function, which can actually be used. *weeeeee*

G2Ext + zCWorldPerFrameCallback = *weee*


After playing a bit with Gothic's "per frame callback"-system, I implemented added a wrapper for the zCWorldPerFrame callback system into G2Ext. No more hooks (and their stupid limitations) needed to perform any actions in the main loop!
You just register your function in to the callback system and you're done! G2Ext does all the annoying stuff with zCWorldPerFrameCallback for you.^^

Lets make a short example:

// foobar() is the function which shall be registered
// and called each rendering cycle
void __stdcall foobar(void* world, void* camera)
{
MessageBox(0, L"hello world :)", 0, 0);
};

// a random init function which will be called at program start
void init(void)
{
// Register callback to function "foobar"
g_callback->registerPerFrameCallback("foobar", &foobar);
// Globally turn on rendering callbacks
g_callback->enableCallbacks();
};

// a random shutdown function which will be called when the program
// is being closed
void shutdown(void)
{
// remove "foobar" from the callback list
g_callback->unregisterPerFrameCallback("foobar");
// globally disable callbacks
g_callback->disableCallbacks();
};

By the way: callbacks can be registered at any time.

Another example for callback usage is on-screen output:

void __stdcall Callback(void* World, void* Camera)
{
// Get the zCView instance
zCView* screen = (zCView*)GetScreen();
// Create a zSTRING (actually a wrapped std::basic_string.....)
// with text
// Oh, how i hate zSTRINGS! They caused so much trouble...
zSTRING text("G2Ext Pre Alpha");
// Print everything on screen (x, y, text)
screen->Print(200, 200, text);
};

A shot on the new starter


The new starter has been finished so far and it works^^
At the moment, it doesnt have many features, but its planned to give it at least the same functionality as the GothicStarter by Nico.

If you're interested in G2Ext and want to participate in our project or contribute something to it, drop a private message to DaDummy at the World of Gothic forum.