My adventures in torque land
by Bill Henderson · in Torque Game Engine · 03/11/2002 (9:23 pm) · 14 replies
Hello,
I am now starting to look at the engine code because I wanted to enable the GuiAviBitmapCtrl object for my gui.
so...
As any newb would do I went and started to blindly change things :P
The first thing I changed was line 23 in the guiAviBitmapControl.cc file
It looked like this:
#define ENABLE_AVI_GUI 0
I changed it to this:
#define ENABLE_AVI_GUI 1
guessing it would enable it
After that I tried to compile it and found that there was a problem in the guiAviBitmapControl.h file.
Turns out that on line 11 it had an if statement looking like this:
#if !ENABLE_AVI_GUI || !ENABLE_MPG_GUI
The problem was that it would disable the control anyway because I only enabled AVI and not MPEG.
After commenting out the whole if statement and the code inside it (haha, I love just hacking at the code) I tried to compile again.
Of course I ran into errors, bad errors, and I dont know what they mean. I was hoping that some good soul out there would be able to tell me what they meant, so there they are:
Compiling...
guiAviBitmapCtrl.cc
Linking...
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall GuiAviBitmapCtrl::onKeyDown(struct GuiEvent const &)" (?onKeyDown@GuiAviBitmapCtrl@@UAE_NABUGuiEvent@@@Z)
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GuiAviBitmapCtrl::onMouseDown(struct GuiEvent const &)" (?onMouseDown@GuiAviBitmapCtrl@@UAEXABUGuiEvent@@@Z)
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GuiAviBitmapCtrl::onSleep(void)" (?onSleep@GuiAviBitmapCtrl@@UAEXXZ)
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall GuiAviBitmapCtrl::onWake(void)" (?onWake@GuiAviBitmapCtrl@@UAE_NXZ)
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GuiAviBitmapCtrl::onRender(class Point2I,class RectI const &)" (?onRender@GuiAviBitmapCtrl@@UAEXVPoint2I@@ABVRectI@@@Z)
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: static void __cdecl GuiAviBitmapCtrl::consoleInit(void)" (?consoleInit@GuiAviBitmapCtrl@@SAXXZ)
../example/torqueDemo_DEBUG.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.
torqueDemo_DEBUG.exe - 7 error(s), 0 warning(s)
I am now starting to look at the engine code because I wanted to enable the GuiAviBitmapCtrl object for my gui.
so...
As any newb would do I went and started to blindly change things :P
The first thing I changed was line 23 in the guiAviBitmapControl.cc file
It looked like this:
#define ENABLE_AVI_GUI 0
I changed it to this:
#define ENABLE_AVI_GUI 1
guessing it would enable it
After that I tried to compile it and found that there was a problem in the guiAviBitmapControl.h file.
Turns out that on line 11 it had an if statement looking like this:
#if !ENABLE_AVI_GUI || !ENABLE_MPG_GUI
The problem was that it would disable the control anyway because I only enabled AVI and not MPEG.
After commenting out the whole if statement and the code inside it (haha, I love just hacking at the code) I tried to compile again.
Of course I ran into errors, bad errors, and I dont know what they mean. I was hoping that some good soul out there would be able to tell me what they meant, so there they are:
Compiling...
guiAviBitmapCtrl.cc
Linking...
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall GuiAviBitmapCtrl::onKeyDown(struct GuiEvent const &)" (?onKeyDown@GuiAviBitmapCtrl@@UAE_NABUGuiEvent@@@Z)
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GuiAviBitmapCtrl::onMouseDown(struct GuiEvent const &)" (?onMouseDown@GuiAviBitmapCtrl@@UAEXABUGuiEvent@@@Z)
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GuiAviBitmapCtrl::onSleep(void)" (?onSleep@GuiAviBitmapCtrl@@UAEXXZ)
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall GuiAviBitmapCtrl::onWake(void)" (?onWake@GuiAviBitmapCtrl@@UAE_NXZ)
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GuiAviBitmapCtrl::onRender(class Point2I,class RectI const &)" (?onRender@GuiAviBitmapCtrl@@UAEXVPoint2I@@ABVRectI@@@Z)
guiAviBitmapCtrl.obj : error LNK2001: unresolved external symbol "public: static void __cdecl GuiAviBitmapCtrl::consoleInit(void)" (?consoleInit@GuiAviBitmapCtrl@@SAXXZ)
../example/torqueDemo_DEBUG.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.
torqueDemo_DEBUG.exe - 7 error(s), 0 warning(s)
About the author
#2
I believe the code that played the sound was ripped out and broke it. I just want to see if it is possible to get it to work without sound.
Can anyone see off the top of their heads what went horribly wrong.
All I can tell from the error is that the gui events are messed, which dont have much to do with playing the avi, so I am hoping that I am just missing something stupid relating to the gui side of it and not with actually playing the avi.
Oh and my previous post about all this is here:
http://www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=3245
03/11/2002 (9:36 pm)
I have to start somewhere and I dont mind a challenge even if it means asking for help here and there.I believe the code that played the sound was ripped out and broke it. I just want to see if it is possible to get it to work without sound.
Can anyone see off the top of their heads what went horribly wrong.
All I can tell from the error is that the gui events are messed, which dont have much to do with playing the avi, so I am hoping that I am just missing something stupid relating to the gui side of it and not with actually playing the avi.
Oh and my previous post about all this is here:
http://www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=3245
#3
I found another if statement that needed to be fixed so that both AVI and MPEG diddnt have to be enabled at the same time.
Now that I am in the game I go into the gui editor and add the GuiAviBitmapControl and it crashes. So I manually add it to the gui script file.
It loads fine but when I click on the GuiAviBitmapControl in the Gui editor tree to show its properties it crashes. Once again I am stuck.
I am guessing that the changes to how the gui worked since Tribes 2 has screwed up the GuiAviBitmapControl.
What can I do to fix this?
someone please help!
03/11/2002 (10:28 pm)
OOO, I got past the compile errors.I found another if statement that needed to be fixed so that both AVI and MPEG diddnt have to be enabled at the same time.
Now that I am in the game I go into the gui editor and add the GuiAviBitmapControl and it crashes. So I manually add it to the gui script file.
It loads fine but when I click on the GuiAviBitmapControl in the Gui editor tree to show its properties it crashes. Once again I am stuck.
I am guessing that the changes to how the gui worked since Tribes 2 has screwed up the GuiAviBitmapControl.
What can I do to fix this?
someone please help!
#4
Sorry I've not got the time to help you though.
Good Luck ... you'll need it!
03/12/2002 (1:36 am)
I've got to admire your spirit!Sorry I've not got the time to help you though.
Good Luck ... you'll need it!
#5
You will need to recode more then likely and add in some avi player library or something such as that befor you will get it to work.
03/12/2002 (2:08 am)
I maybe wrong but you'll need a avi library to play a avi file. Its not like they created there own AVI loader and player all in the code. I believe they used smakerplay or something along that lines. Its a library that plays AVI files. Most games use it but it is NOT freeware. I freget the license price for it.You will need to recode more then likely and add in some avi player library or something such as that befor you will get it to work.
#6
- first I suppose you are working under windows
- AVI control uses the windows API to play a video :
- When this is done, you will have to concentrate on :
If you can make an avi file which is consistent with this test, I may help you a little more as I was quite close to ressurect that control ;)
03/12/2002 (3:13 am)
I took a glance to this AVI control last sunday. Here are some comments :- first I suppose you are working under windows
- AVI control uses the windows API to play a video :
// ResourceManager->getPathOf(mAviFilename); rval = AVIFileOpen(&mPFile, mAviFilename, OF_SHARE_DENY_WRITE, 0);You will need it to modify it a little bit as AVIFileOpen expects a windows filename (D:\...)
- When this is done, you will have to concentrate on :
AVIStreamFormatSize(mPAviVideo, 0, (long *) &cb);
if (cb <= sizeof(BITMAPINFOHEADER))
return -1;
rval = AVIStreamReadFormat(mPAviVideo, 0, &biFormat, (long *) &cb);
rval = rval; I was stuck here 'cause my AVI video opened fine, but the format of my AVI file didn't pass this if test; and as I'm not quite familiar with AVI I was unable to make a video file which will be consistent with this test.If you can make an avi file which is consistent with this test, I may help you a little more as I was quite close to ressurect that control ;)
#7
03/12/2002 (9:25 am)
I'm guilty of jumping in here without looking at all the facts (heck, I haven't even built Torque since I licensed it.. been so busy at work), but could it be you can only use an uncompressed AVI with your code, Frank?
#8
Ill post any new findings later
I still think the problem isnt playing the avi itself but lies in the gui side of it.
Frank: How did you get it to not crash when you tried to look at the gui objects properties in the gui editor?
03/12/2002 (10:02 am)
I am going to use the tribes 2 intro avi file to test it.Ill post any new findings later
I still think the problem isnt playing the avi itself but lies in the gui side of it.
Frank: How did you get it to not crash when you tried to look at the gui objects properties in the gui editor?
#9
-Tim aka Spock
03/12/2002 (10:43 am)
Didn't the avi use a special codec? I remember some people had problems with tribes 2 with the avi and all they had to do was play it in media player and a codec would be downloaded for it.-Tim aka Spock
#10
03/12/2002 (10:48 am)
It played it in media player but it has a strong blue tint to it, and it diddnt download a codec.
#11
03/12/2002 (11:46 am)
If I remember right the codec was actually divx.. not sure though.
#12
http://nehe.gamedev.net/tutorials/lesson36.asp
03/12/2002 (11:51 am)
Another thing to look into is this tutorial by NeHe. It covers playing setting up an avi viewing for opengl so it is worth a read, note that this isn't platform independant although I'm sure there has got to be mac and linux libraries that do the same.http://nehe.gamedev.net/tutorials/lesson36.asp
#13
03/12/2002 (11:55 am)
Yeah Robert, I was thinking of posting the NeHe one as well but I think it uses a little Intel ASM to transpose the BGR->RGB. I think he had a little problem with OpenGL cards not supporting BGR format.
#14
So, can anyone figure out why it crashes only when I try to look at the AVI gui objects properties in the gui editor?
03/12/2002 (1:56 pm)
I am not really looking for cross platform right now, I just want to get it working under windows.So, can anyone figure out why it crashes only when I try to look at the AVI gui objects properties in the gui editor?
Torque Owner Matt W
I reccomend not trying to work with this until you learn a bit more about the engine. This is something that folks have been wanting for a few months, but might require some coding of an AVI loader.
Might want to wait on GG to find out if this is a place to start working on. Not sure what broke it, but if you're new to the engine I reccomend not making it your starting place.