Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 29 Oct 2000
Offline Last Active Feb 24 2014 02:41 PM

Topics I've Started

is it stealing?

13 December 2006 - 07:21 AM

[i suppose this applies to anything, but i'm posting here because it seems more relevant.]

i'm looking over art and modelling forums for ideas for ship graphics for my game. i'm going to end up drawing it all myself, and hopefully i'll wind up with something that looks good.

when you're drawing ideas from others' works, are you obligated to give props.. or is it expected that noone's ideas are ever original?

[RakNet & Dev-C++] HuffmanEncodingTree link errors

21 October 2005 - 06:49 AM

this thread/post is more of a 'quick-fix' for anyone having problems using RakNet with Dev-C++. when i got RakNet and followed their documentation on how to build the thing, i didn't really have much idea about what they were talking about. it turns out that there's a Dev-C++ dev file right at the root of the source tree (oddly enough it was called RakNet.dev). loading that puppy up with Dev-C++ and hitting the Compile button seemed like the obvious thing to do. and great! it worked. with warnings. oh well, i had a brand-spanking new RakNet.a and i was ready to take on the world. well the next step is where the trouble begins. i took their tutorial source 1 and threw it at a new project that included the RakNet include folder in the Project Options. i also blasted libwsock32.a and the RakNet.a file the above block created at the Link Options found in the Project options, and bing! compiled. *crunch* no go! wtf??
../../../../../RakNet/RakNet.a(RakPeer.o)(.text+0x2d29):RakPeer.cpp: undefined reference to `HuffmanEncodingTree::EncodeArray(unsigned char*, int, RakNet::BitStream*)' ../../../../../RakNet/RakNet.a(RakPeer.o)(.text+0x4ab3):RakPeer.cpp: undefined reference to `HuffmanEncodingTree::HuffmanEncodingTree()' ../../../../../RakNet/RakNet.a(RakPeer.o)(.text+0x4b09):RakPeer.cpp: undefined reference to `HuffmanEncodingTree::GenerateFromFrequencyTable(unsigned int*)' ../../../../../RakNet/RakNet.a(RakPeer.o)(.text+0x4b3c):RakPeer.cpp: undefined reference to `HuffmanEncodingTree::HuffmanEncodingTree()' ../../../../../RakNet/RakNet.a(RakPeer.o)(.text+0x4ba7):RakPeer.cpp: undefined reference to `HuffmanEncodingTree::GenerateFromFrequencyTable(unsigned int*)' ../../../../../RakNet/RakNet.a(RakPeer.o)(.text+0x4c21):RakPeer.cpp: undefined reference to `HuffmanEncodingTree::~HuffmanEncodingTree()' ../../../../../RakNet/RakNet.a(RakPeer.o)(.text+0x4c64):RakPeer.cpp: undefined reference to `HuffmanEncodingTree::~HuffmanEncodingTree()' ../../../../../RakNet/RakNet.a(RakPeer.o)(.text+0x825f):RakPeer.cpp: undefined reference to `HuffmanEncodingTree::DecodeArray(unsigned char*, int, RakNet::BitStream*)'
huhwhat? well, it turns out they forgot to add one of the source files, HuffmanEncodingTree.cpp, to the dev file. odd, huh? guess what, that means we gotta do it. so we go back to the first step and load up the RakNet.dev file - and add the cpp to the source tree. then we recompile the library file. oh teh noes~ moer er0rrs!!!11
In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/Queue.h:31, from Source/HuffmanEncodingTree.cpp:47: C:/Dev-Cpp/include/c++/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated. Source/HuffmanEncodingTree.cpp: In member function `void HuffmanEncodingTree::FreeMemory()': Source/HuffmanEncodingTree.cpp:91: error: `Queue' is not a member of `BasicDataStructures' Source/HuffmanEncodingTree.cpp:91: error: expected primary-expression before '*' token Source/HuffmanEncodingTree.cpp:91: error: expected primary-expression before '>' token Source/HuffmanEncodingTree.cpp:91: error: `nodeQueue' undeclared (first use this function) Source/HuffmanEncodingTree.cpp:91: error: (Each undeclared identifier is reported only once for each function it appears in.)
jeez, the problems just keep hitting us upside the head! we got this far on the RakNet forums, and the workaround was to alter the source. well, thats a crap idea - the library is as clean as it gets. the problem turns out to be the order in which dev-c++ (actually mingw/gcc) looks up the stuff in the headers. what, you scream? at the top of the HuffmanEncodingTree.cpp is a line that reads:
#include "Queue.h"
well, there's a file in the old stl called queue.h - but its from old c++ and mingw/gcc doesn't want you to use it. that's what the #warning is going on about. so what's RakNet doing? well, they actually have their own Queue.h file that they were TRYING to use instead, thus the "double quotes" instead of the <pointy brackets>. my fix just involves pointing this #include at the right spot on disk, in my case:
#include "C:\RakNet\Include\Queue.h"
i've sent some pms out to the guys at the RakNet forums, and hopefully they'll get the gcc makefiles to shove the RakNet include directory ahead of the defaults, so it sees their queue.h before it looks up the stl ones. i don't even know if that can even happen or not, i don't know anything THAT complicated. anyone interested in the original posts on the RakNet forums, there you are. just follow the link and go to it. SG [edit: had some problems posting this. looks like the boards don't like lines starting with ../../ but i found a workaround. adding a bold-end html tag at the start of it makes it work.] [edit: gotta look into -Wno-depreciated for a better fix] [Edited by - SteelGolem on October 21, 2005 1:27:24 PM]

[allegro] checking for module init

13 July 2005 - 05:38 PM

lets suppose i have the following class:
#include <allegro.h>

class Monster
	BITMAP* bitmap;
		bitmap = load_bitmap ("monster.bmp", NULL);
		if (bitmap) destroy_bitmap (bitmap);
	void Draw (BITMAP* dest, int x, int y)
		draw_sprite (dest, x, y);

i can think of a bunch of different ways to make a main() that will break with this class. for instance:
#include <allegro.h>

int main (void)
	Monster *monster[3];

	monster[0] = new Monster(); // breaks!

	monster[1] = new Monster(); // breaks again!
	set_gfx_mode (GFX_AUTODETECT, 640, 480, 0, 0);
	monster[2] = new Monster(); // the only one that lives..

	for (int m = 0; m < 3; ++m)
		monster[m].Draw (screen, 0, 0);
	while (!key[KEY_ESC]);

	for (int m = 0; m < 3; ++m)
		if (monster[m]) delete monster[m];

	return 0;

in the first two new monster(); attempts, we make calls to load_bitmap() before we've called set_gfx_mode(). of course i know this, and to avoid it, i usually do all of my allegro init stuff and then start my own init. however, sometimes i'm stupid. sometimes i do things i know i shouldn't, for reasons that are beyond me. maybe i'm too tired. maybe i'm having an airhead day. whatever. in the above case, the code compiles fine. runtime errors explode the program. so why am i bothering you with all of this? well, it occurred to me that maybe there'd be a way for me to check allegro for whether a module's been initted or not, so i can throw exceptions at people when they do stupid things like above. it doesn't have to be limited to the graphic subsystem - if you try to access mouse_x and mouse_y when you haven't installed the timer subsystem or the mouse subsystem or you've forgotten to install BOTH, you're going to have problems. i asked about this over on freenode/#allegro, but i'm not getting any answers. KittyCat mentioned maybe i could use SYSTEM_DRIVER somehow, but looking at allegro/system.h doesn't do anything for me. its not covered in the docs, and i can't seem to find a forum on allegro.sf.net and allegro.cc is down ^_^ i'm going to go test out the above with a screen == NULL test.

Avatar viewing

12 December 2004 - 05:04 AM

After putting a bit of work into creating my avatar and adding it, I find that you can't see it in the profile or while viewing someone's journal. I can understand the journal part a bit - but why not in the profile? Seems like it should be a good place to show up..