[QUOTE=Chris220;26884784][cpp](*i)->up = true[/cpp]
If I understand what you're asking
Basically you deference the iterator pointer to get the centity pointer at that position, then use the pointer operator to set the value of .up to true
.. If that makes any sense. I'm bad at wording these things[/QUOTE]
It does make sense, thanks.
Can someone explain to me why Visual C++ 2010 can only compile my project once and requires a cleanup after that?
First compile:
[code]1>------ Build started: Project: oogl, Configuration: Debug Win32 ------
1> Window.cpp
1> oogl.vcxproj -> C:\Users\Overv\Desktop\OOGL\build\vc2010\..\..\bin\oogl-d.lib
2>------ Build started: Project: window, Configuration: Debug Win32 ------
2> window.cpp
2> window.vcxproj -> C:\Users\Overv\Desktop\OOGL\build\vc2010\..\..\samples\bin\window-d.exe
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========[/code]
When I press build (or F7) again:
[code]1>------ Build started: Project: oogl, Configuration: Debug Win32 ------
1> oogl.vcxproj -> C:\Users\Overv\Desktop\OOGL\build\vc2010\..\..\bin\oogl-d.lib
2>------ Build started: Project: window, Configuration: Debug Win32 ------
2>window.obj : error LNK2019: unresolved external symbol "public: __thiscall GL::Window::Window(unsigned int,unsigned int,int,int,char const *,unsigned int)" (??0Window@GL@@QAE@IIHHPBDI@Z) referenced in function _main
2>C:\Users\Overv\Desktop\OOGL\build\vc2010\..\..\samples\bin\window-d.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========[/code]
It also manages to compile code that intellisense can't find:
[img]http://www.imgdumper.nl/uploads3/4d12b1ed6dc42/4d12b1ed6bd05-derp.gif[/img]
:frog:
This only happens with the release configuration even though both the debug and release configuration use [b]exactly[/b] the same include and library paths. What I dislike most about this is that I never have problems like this with VS2008.
Ive got Visual C# 2008 Express, as well as XNA installed in it. Now where do I learn? :P
I want to use XNA with C# to create 2D games, so is there any website that specializes in teaching that?
I'm using gcc to compile LuaGlut, and I have all the necessary files (lua.h, glut.h, etc.) in the directory, yet it still errors about them being non-existent. :saddowns:
What's going on?
[QUOTE=Overv;26892134]This only happens with the release configuration even though both the debug and release configuration use [b]exactly[/b] the same include and library paths. What I dislike most about this is that I never have problems like this with VS2008.[/QUOTE]
For this massive project, I used Magick++. I had the same issue where it wouldn't compile in Debug.
Well, I managed to fix the compiling issue, but Intellisense still cries when I switch to release configuration. Not that much of a problem I guess.
How do I find out if a child class is a child and not a parent? So say I have a function like this:
[cpp]bool childchecker(parent)[/cpp] How would I find out if the class is a derivation or not? So if I put in childchecker(child) it would say true and if I put in childchecker(parent) it would say false.
Not a very efficient way of doing it but if you know what classes are goint to be passed you could make it check for a function or variable that only one of themm has
[QUOTE=WTF Nuke;26895256]How do I find out if a child class is a child and not a parent? So say I have a function like this:
[cpp]bool childchecker(parent)[/cpp] How would I find out if the class is a derivation or not? So if I put in childchecker(child) it would say true and if I put in childchecker(parent) it would say false.[/QUOTE]
If you need to know the exact type, why upcast it?
Anyway, you can find out via the typeid-operator or dynamic_cast.
I'm using Eclipse 3.5 because the Android ADT plugin doesn't work with 3.6. How do I get EGit installed when there is no "Marketplace" in 3.5? It's really starting to frustrate me.
[editline]23rd December 2010[/editline]
Oh, maybe I could just compile it myself against 3.5...
oh wait, I need EGit to checkout EGit to Eclipse to compile :suicide:
[editline]23rd December 2010[/editline]
found something on github, but for 3.3/3.4
[editline]23rd December 2010[/editline]
Well, never mind me... I just figured out the latest Android ADT plugin works under 3.6, which has the marketplace, which is a requirement for EGit.
Problem solved! :v:
I have a proposition for somebody. These guys at this thread need some help making a Zune HD GBA emulator.
[url]http://www.zuneboards.com/forums/download-openzdk-applications/50744-hd-visualboy-zune-0-1-2-gb-gbc-emulator-92.html[/url]
If anybody could help them, it would be great because a lot of people are looking forward to a emulator like this. Some are even willing to pay (as stated in the thread, directs to another thread)
Heres some downloaded source files.
[url]http://dl.dropbox.com/u/6686974/VbaM...urce-0.1.2.zip[/url]
I don't know anything about programming or developing these emulators and apps so I am going to go ahead and assume somebody here can help them out. Its already capable of playing GBC games with sound (although a little unstable) so its not a clean start.
I tried scraping TF2item's recipes page and learned the hard way that (1) the webkit inspector's Source sanitizes and makes the HTML a lot more cleaner and (2) the HTML there is *not* very clean.
How come when I pass this in the constructor:[cpp] entitymanager->addentity(this);[/cpp]
To this function:[cpp]void centitymanager::addentity(centity * entity){
entities.push_back(entity);
}[/cpp]
I get this: List iterator not dereferencable.
Or is it because of something else? BTW it's a list of pointers, and I heard those are bad sometimes.
Probably because of something else. What's the code where you dereference said iterator?
It's quite long, so here's the pastebin :[url]http://pastebin.com/yu2HXPnh[/url]
You access i after doing entities.erase(i);; you probably meant i = entities.erase(i);.
And you should check right after reassigning i, since you're doing (*i)->move(t); and i might be entities.end().
I would also prefer a while-loop, since that for-loop looks like you're missing the incrementation and for a while-loop I think it's more common to see an incrementation inside the body. Purely aesthetically change though.
[editline]23rd December 2010[/editline]
Also, the compiler probably optimizes it, but it'd still look more beautiful if you assign **i to a centity&.
[QUOTE=ZeekyHBomb;26913418]You access i after doing entities.erase(i);; you probably meant i = entities.erase(i);.
And you should check right after reassigning i, since you're doing (*i)->move(t); and i might be entities.end().
I would also prefer a while-loop, since that for-loop looks like you're missing the incrementation and for a while-loop I think it's more common to see an incrementation inside the body. Purely aesthetically change though.
[editline]23rd December 2010[/editline]
Also, the compiler probably optimizes it, but it'd still look more beautiful if you assign **i to a centity&.[/QUOTE]
Thanks a lot for this and all the past help, really appreciate it. I understand everything except for this part:"Also, the compiler probably optimizes it, but it'd still look more beautiful if you assign **i to a centity&." Which function is that?
I mean the compiler will probably just keep the memory instead of dereferencing the iterator again and again.
You could just assign the centity-instance to a reference and use that though.
[QUOTE=ZeekyHBomb;26913943]I mean the compiler will probably just keep the memory instead of dereferencing the iterator again and again.
You could just assign the centity-instance to a reference and use that though.[/QUOTE]
Oh ok I see.
So I finally installed wxPython, after studying Python for a while. However, it does not appear to have installed correctly. Here is the code:
[code]
class test(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,id,'Frame aka window', size=(300,200))
if __name__=='__main__':
app=wx.PySimpleApp()
frame=test(parent=None,id=-1)
frame.show()
app.MainLoop()
[/code]
Error message:
[highlight]Traceback (most recent call last):
File "C:\Python27\test.py", line 1, in <module>
class test(wx.Frame):
NameError: name 'wx' is not defined[/highlight]
did you import wx?
I've spent a day and a half just getting my git server to be able to do a remote clone. I spent 30 minutes re-writing all eclipse project settings because apparently mv doesn't copy over things that start with .
And now it seems like running branch inside the repo directory just changes some string value from "master" to "test" and back. (When I try to import with Eclipse / EGit, I can only see one branch, which changes from the last time I run "git branch -m <oldName> <newName>"
if I can figure out how to actually have more than one branch that changes names and also figure out how this pulling changes from each other system works, I'll go ahead and switch to git. Otherwise, SVN is good enough considering all I have to do to get it to work with eclipse is:
[code]svnadmin create /path/to/repo
add all the users/passwords to /path/to/repo/conf/passwd
change 1 or 2 settings in /path/to/repo/conf/svnserve.conf
edit 2 settings in /etc/conf.d/svnserve
/etc/rc.d/svnserve start[/code]
It took me all of 15 minutes to set up a private SVN server with passwords, and another 10 to look up subclipse and figure it out.
It's taken me a day just to get a server set up, mainly because no one knows what "git daemon" is and all I ever see is gitorious or GES. AFAIK there's no daemon I can run through /etc/rc.conf, I can't figure out how to set up a password, and branching seemingly does nothing.
Okay, not to happy right now.
I have this code, Does what I want except it stops user input.
I'm fairly certain I need to put in in a separate thread, but that seem like more work than the actual code is. So I was hoping there was another way. I need to know kinda soon, I would like to get this and some more done before I go to bed in about 3 and a half hours.
[code]
while (GetNext == false)
{
GetNext = NextBlock;
}
[/code]
oh yea, its c#
[QUOTE=redsoxrock;26918030]Okay, not to happy right now.
I have this code, Does what I want except it stops user input.
I'm fairly certain I need to put in in a separate thread, but that seem like more work than the actual code is. So I was hoping there was another way. I need to know kinda soon, I would like to get this and some more done before I go to bed in about 3 and a half hours.
[code]
while (GetNext == false)
{
GetNext = NextBlock;
}
[/code][/QUOTE]
What the hell are you asking us? What's not working, and post some code that isn't working, because we have no idea what that code is meant to do.
[QUOTE=redsoxrock;26918030]Okay, not to happy right now.
I have this code, Does what I want except it stops user input.
I'm fairly certain I need to put in in a separate thread, but that seem like more work than the actual code is. So I was hoping there was another way. I need to know kinda soon, I would like to get this and some more done before I go to bed in about 3 and a half hours.
[code]
while (GetNext == false)
{
GetNext = NextBlock;
}
[/code]
oh yea, its c#[/QUOTE]
I'm taking a wild guess here, since there's barely any information, but I would say change the while to an if and put it inside your gameloop (if it's even a game).
Ok, GetNext is false, when get next is true, my do loop re-runs.
[code]
do
{
blocktype1 = (byte)rand.Next(1, 8);
block = new Block(draw, blocktype1, 5, 0);
timer.Enabled = true;
GetNext = block.NextBlock;
GameOver = block.GameDone;
//while (GetNext == false)
//{
// GetNext = block.NextBlock;
//}
}
while (GetNext == true);
[/code]
when the while loop is commented out, GetNext is never true and it goes through 1, mainly a new block is not made.
When the while loop isn't commented out, the application fezzes as it continuously does it, but what is does do is create a new block.
Ok, I guess the real problem is I need to create the block whenever the loop finishes, but it only works correctly when creating the block is out of the loop
I'm getting started with SFML and I'm trying to compile it with the Code::Blocks workspace file they provided but whenever I try to compile sfml-window as a dll. I get this error [IMG]http://i287.photobucket.com/albums/ll138/awfa3/error.png[/IMG]
Help please?
You have to compile sfml-system first on all four build targets.
Am I missing something obvious about static variables, or what the hell is going on here?
[cpp]
// ScriptCom.hpp
namespace ScriptCom {
static unsigned char Error = 0;
unsigned char GetError();
};
// ScriptCom.cpp
unsigned char ScriptCom::GetError() {
return ScriptCom::Error;
}
// Main.cpp
#include "ScriptCom.hpp"
// <<Code wherein ScriptCom::Error is set to 20 internally.>>
printf( "Error: %d, %d\n", ScriptCom::Error, ScriptCom::GetError() );
// Output: "Error: 0, 20" [/cpp]
How can those two be different when ScriptCom::Error is static?
You are including ScriptCom.hpp into Main.cpp and ScriptCom.cpp. Error in Main.cpp and ScriptCom.cpp are 2 separate variables.
Sorry, you need to Log In to post a reply to this thread.