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.

Dark GDK / Level editor ported from darkbasic professional to darkgdk

Author
Message
Berserk
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location:
Posted: 19th Dec 2009 13:07
Hello everyone. I ported my level editor for my game "letters" to C++ and DarkGDK, because it has stopped working properly in dbpro after adding a "text" command somewhere.
When such command has been removed, the problem has sticked there and so I ported the entyre code.
By the way, even if the code commands and structure are the same as in dbpro, the executable crashes on startup and I don't know why.
Here is the full source for my level editor, and I attach the needed media files.


Thanks in advance for any help.

Bye, Berserk.
.

Bye, Berserk.
.

Attachments

Login to view attachments
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th Dec 2009 17:10
Any error messages?
Berserk
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location:
Posted: 19th Dec 2009 20:11
No, just a crash and a window with wich I should send an error notification to microsoft...

Bye, Berserk.
.
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 19th Dec 2009 22:25
ok, heres a list of problems i can see and that came up
1 - you have a tri for loop system, i don't think that work very well
2 - another tri for loop system
3 - the while loop is no a do while but a while ( LoopGDK ( ) )
( i think there a reason why thats there )
4 - memory access problem.'0xC0000005: Access violation reading location 0x00000000.' <- to do with the images

did you run this in debug or release mode?

well their 4 things i pick out.

it looks very promising

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Berserk
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location:
Posted: 20th Dec 2009 20:18
The 2 tri-loop systems are there because I have images with 9x3 tiles each, 6 images in total.
So I have to cycle for each image, for 1 to 3 and for 1 to 9.
I misunderstood what did you mean with your phrase:"the while loop is no a do while but a while ( LoopGDK ( ) )": can you explain it better?
For the images, I guess you tryed the code. Is the problem in the path or where? In dbpro everything was fine even when specifyng a folder before the filename, maybe in darkgdk this is not allowed.

By the way, thanks.

Bye, Berserk.
.

Bye, Berserk.
.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 20th Dec 2009 22:10 Edited at: 20th Dec 2009 22:11
Your problem lies here:



a=0, b=0, c=0, num=500 <-- For some reason, num becomes random after dbPasteImage(197 + a, 0, 0); executes.

So that line comes out to:
dbGetImage(num, -32, -32, 0, 0);

Which throws an unexpected memory read error.

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;
Berserk
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location:
Posted: 21st Dec 2009 10:47
I see, thanks. So I have to check out the num variable. Maybe because num is initialized to 0, in dbpro it's possible to get images starting from 1. (in fact in dbpro num was initiaziled to 1).
Thanks again, I'll double-check.

Bye, Berserk.
.

Bye, Berserk.
.

Login to post a reply

Server time is: 2024-10-01 20:22:50
Your offset time is: 2024-10-01 20:22:50