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 / Passing object id as an element of an array of integer to the function DBSetObjectEffect not working ?

Author
Message
Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 22nd Jul 2012 23:36


The last line inside the for loop is giving a runtime error -

Unhandled exception at 0x77bc15de in my_project.exe: 0xC0000005: Access violation reading location 0x25d83000.

If I use an integer or a single integer variable for the first parameter (objectID) within the function

dbSetObjectEffect(ObjectSpheres[i],lavaShader);

Then no error occurs at run time.

This works in Dark GDK 1.0 - that is passing object id as an element of an array of integer.

Can anybody help please.
Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 23rd Jul 2012 00:01
Pleeeease heeeeeeeeeelp ........ somebody .....
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 23rd Jul 2012 00:04
Quote: "dbCreateObjectSphere(3,160,160);"
This is the auto-assignment problem we've been talking about. You need to do something like
If you've not used "FindFreeObject()" before, here's the one I use


The fastest code is the code never written.
Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 23rd Jul 2012 00:13 Edited at: 23rd Jul 2012 00:15
My Goodness ! Will there be a fix to this ? Or do I have to create a function to check for free ids like you have shown.

What if I manually assign an id as the last parameter like this -

ObjectSpheres[i] = dbCreateObjectSphere(3,160,160,i);

But the manual assignment is not working also ! Still giving runtime errors.

Do I have to use int32_t as the datatype for the array ? Or a simple int will do ?
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 23rd Jul 2012 04:34 Edited at: 23rd Jul 2012 04:34
That will work, but you need to make sure there are no write-overs.
the int32_t is what they use, but regular int works just as well.

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-04-19 21:23:03
Your offset time is: 2024-04-19 21:23:03