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 / my 3d engine

Author
Message
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 18th Mar 2009 09:05 Edited at: 18th Mar 2009 09:08
i am making a simple DarkGDK mod where the users dont have to worry about id's and i am wondering why my engine doesnt work

my files

FranticBasic3D.h:


FranticBasic3D.cpp:


Frantic.h:


and here is my test code:


and this is the error:
c:documents and settingstommy documentsvisual studio 2008projectsfrantic3d testfrantic3d testmain.cpp(8) : error C2664: 'GDKObject::GDKObject(const GDKObject &)' : cannot convert parameter 1 from 'const char [6]' to 'const GDKObject &'

i have no constructor for GDKObject that has the paramater const GDKObject & so idk why it is telling me i do, my only constructor is GDKObject(char* filename).


any help would be appreciated
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 18th Mar 2009 09:57
Well I tried to run it and got several errors, but never the one you got. First of all you need to forward reference 'LoadObject(int id, char* fileName)' because your constructor can't see it. Second, 'return new GDKObject();' doesn't work because you haven't defined a default constructor for your class, but I don't really see the point of this as you will be instantiating the class in order to get to the constructor in the first place. Your 'FindFreeObject()' function doesn't return from all control paths, while this isn't really a problem because you should never come across an instance where the end of the function is reached it's generally better to return at the end, once.

tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 18th Mar 2009 10:22
i changed the code, but i still get errors, heres the code again:

FranticBasic3D.h:


FranticBasic3D.cpp:


and the other file is the same and so is my text code, and i still get the same error, i dont know why?
tneva82
16
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 18th Mar 2009 12:30
Doesn't probably fix it but one thing to fix is that in FreeObj function you should initialise the temp value to zero. Right now it's undefined so when you first time call dbObjextExist(temp)==1 there's no telling what might be result.

Just change it to int temp=0; and atleast that is fixed.

Also not quite sure why you do it like this:

GDKObject::GDKObject(char* filename)
:objid(FindFreeObject())

Never heard of that method. What's wrong with just having it like this:

GDKObject::GDKObject(char* filename)
{
objId=FindFreeObject();
dbLoadObject(filename, objId);
}
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 18th Mar 2009 16:55 Edited at: 18th Mar 2009 16:56
Well i am not going to help you, you ignored my advice to keep all posts about this in the same thread. You are also trying to get us to code it all for you

http://forum.thegamecreators.com/?m=forum_view&t=147016&b=22

http://forum.thegamecreators.com/?m=forum_view&t=147257&b=22

http://forum.thegamecreators.com/?m=forum_view&t=147254&b=22

3 quarters of that is AndrewT's and the other quarter is myne so its not your 3d engine.

tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 19th Mar 2009 07:37
GDKObject::GDKObject(char* filename)
:objid(FindFreeObject())
that format is just to initialize members, and i think its better cuz it seperates initalizing with the loading.

Login to post a reply

Server time is: 2024-11-25 16:51:04
Your offset time is: 2024-11-25 16:51:04