[QUOTE=Swebonny;22348776]That's pretty awesome, now I want to make a similar one. Put it's going to be a prisoner, not a puppy.[/QUOTE]
Thanks! I used [url]http://www.ai-junkie.com/architecture/state_driven/tut_state1.html[/url] from ai junkie to help. The tutorial is in C++ (or C?) but everything explained so it's easy enough to convert to a language of choice.
[IMG]http://anyhub.net/file/screen01.png[/IMG]
Working on my first game in SFML.
Jesus christ I've been brutally and repeatedly raped by this problem with my engine. I want to be able to move an object from one layer to another, but it seems my design is completely incapable of it. Just spent two hours trying to implement an idea I had, but it had like three glaring and seemingly unsolvable problems. Of course, I [i]could[/i] solve them, but it would turn my program into a hacky waste of hard drive space.
[editline]01:28PM[/editline]
I'm not ready to give up, but I'm completely at loss as to how I move forward.
[QUOTE=ryandaniels;22352177]Jesus christ I've been brutally and repeatedly raped by this problem with my engine. I want to be able to move an object from one layer to another, but it seems my design is completely incapable of it. Just spent two hours trying to implement an idea I had, but it had like three glaring and seemingly unsolvable problems. Of course, I [i]could[/i] solve them, but it would turn my program into a hacky waste of hard drive space.
[editline]01:28PM[/editline]
I'm not ready to give up, but I'm completely at loss as to how I move forward.[/QUOTE]
In that situation I usually always just make a copy of my code in a different folder then tear it to pieces on the copied version until I get something that works. I tear that fucker to shreds and do what I like risk free. When I'm happy with it, I port it back to the original.
Yeah that was sorta what I was doing, although I still came out without any solutions. I was able to reverse it, so at least I don't have a mess to clean up.
I'm thinking I'll just have to find a way to avoid this until I come up with a better idea (which most likely will mean major re-writes)
[QUOTE=CarlBooth;22353058]In that situation I usually always just make a copy of my code in a different folder then tear it to pieces on the copied version until I get something that works. I tear that fucker to shreds and do what I like risk free. When I'm happy with it, I port it back to the original.[/QUOTE]
This is why people who say VCS's are useless in single person projects are wrong.
Rewriting my CHook class from basically scratch. Already coming out a lot nicer. I still want to get rid of microsoft shit detours but I am stuck with it for now.
Anyways, question about boost::shared_ptr
Can you do
shared_ptr<int> num = new int();
Or is it
shared_ptr<int> num = shared_ptr<int>(new int());
[QUOTE=high;22355271]Rewriting my CHook class from basically scratch. Already coming out a lot nicer. I still want to get rid of microsoft shit detours but I am stuck with it for now.
Anyways, question about boost::shared_ptr
Can you do
shared_ptr<int> num = new int();
Or is it
shared_ptr<int> num = shared_ptr<int>(new int());[/QUOTE]
Either works, because the constructor isn't explicit.
-snip- apparently I am wrong
Keep getting a fucking linker error damn it.
1>GameRun.obj : error LNK2019: unresolved external symbol "bool __cdecl DirectXInit(struct HWND__ *,int,int)" (?DirectXInit@@YA_NPAUHWND__@@HH@Z) referenced in function "bool __cdecl Game_Init(struct HWND__ *)" (?Game_Init@@YA_NPAUHWND__@@@Z)
Can't find whats causing it.
Arghh, Visual Studio won't work. I would love it if I could install Linux on my laptop and use Vim but I can't because Arch doesn't boot correctly on my laptop.
[QUOTE=high;22355271]
Can you do
shared_ptr<int> num = new int();
Or is it
shared_ptr<int> num = shared_ptr<int>(new int());[/QUOTE]
The second one.
[editline]07:58PM[/editline]
[QUOTE=jA_cOp;22355508]Either works, because the constructor isn't explicit.[/QUOTE]
No:
[code]
template<class Y> explicit shared_ptr(Y * p);
[/code]
[QUOTE=darkrei9n;22356435]Keep getting a fucking linker error damn it.
1>GameRun.obj : error LNK2019: unresolved external symbol "bool __cdecl DirectXInit(struct HWND__ *,int,int)" (?DirectXInit@@YA_NPAUHWND__@@HH@Z) referenced in function "bool __cdecl Game_Init(struct HWND__ *)" (?Game_Init@@YA_NPAUHWND__@@@Z)
Can't find whats causing it.[/QUOTE]
Where is DirectXInit declared and where is it defined? Is it defined in a CPP file or a DLL/LIB? Are you using templates anywhere?
[QUOTE=shill le 2nd;22357139]Where is DirectXInit declared and where is it defined? Is it defined in a CPP file or a DLL/LIB? Are you using templates anywhere?[/QUOTE]
It is defined in a CPP file as.
[cpp]
bool DirectXInit(HWND window)
{
d3d = Direct3DCreate9(D3D_SDK_VERSION);
if(d3d == NULL)
{
MessageBox(window, "Error initializing DirectX!", "ERROR!", MB_OK);
return 0;
}
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = false;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
d3dpp.BackBufferCount = 1;
d3dpp.BackBufferWidth = SCREENW;
d3dpp.BackBufferHeight = SCREENH;
d3dpp.hDeviceWindow = window;
d3d->CreateDevice(
D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
window,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,
&d3ddev);
if(d3ddev == NULL)
{
MessageBox(window, "Error Creating DX DEVICE!!!", "Error", MB_OK);
return 0;
}
return true;
}
[/cpp]
Hmm, it looks like that function has a different signature than the one you're trying to use (the one you pasted only takes an HWND, but the linker is looking for one that takes an HWND and two ints). I don't know why that kind of mistake would make it all the way to the linker though.
Those two INTs are defined elsewhere as constants. Eventually I'll move them over to a menu option but until then, they are constants.
What do you mean, "defined elsewhere"? Do you mean that the function prototype has default variables? If so, you still have to include the ints in the function signature.
If they're global, then take them out of the function call.
Either way, the signatures [b]must[/b] match.
Oh wow. That was the issue. Thanks. Well fuck. I got stuck in a loop and I can't close the fucking thing. Whenever I press OK on the message box that pops up saying everything initialized okay it reopens the message box.
[QUOTE=blankthemuffin;22354989]This is why people who say VCS's are useless in single person projects are wrong.[/QUOTE]
VCS's with [i]branching[/i]
You can use Visual SourceSafe but good luck trying to get branching to work. (Hint: You can't! It doesn't have branching!)
[QUOTE=nullsquared;22357059]
No:
[code]
template<class Y> explicit shared_ptr(Y * p);
[/code][/QUOTE]
I was sure it was not marked explicit to allow for these kinds of situations, weird.
Just love these linker errors.
Another one.
GameRun.obj : error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > test" (?test@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
I think I know why its happening but don't know how to fix it. How would I output a integer using DrawText?
[QUOTE=Chandler;22357864]VCS's with [i]branching[/i]
You can use Visual SourceSafe but good luck trying to get branching to work. (Hint: You can't! It doesn't have branching!)[/QUOTE]
By VCS I really meant a good DVCS like Git or Mercurial or Bazaar.
[QUOTE=jA_cOp;22358547]I was sure it was not marked explicit to allow for these kinds of situations, weird.[/QUOTE]
Why would you be doing "shared_ptr<int> num = new int();" in the first place?
Having some problems with objective-c.
I load an array full of strings, and then I refresh the table view. The table view shows 3 rows at a time, and when I scroll is crashes.
I am not asking for help, just putting it out there.
Anyways, AnyHub Mobile is going great! I am trying to plan out version 1.5. Hopefully a July release, if I am lucky.
[QUOTE=shill le 2nd;22359309]Why would you be doing "shared_ptr<int> num = new int();" in the first place?[/QUOTE]
Why not?
Why not just do shared_ptr<int> num(new int);??
smoke variables erry day
[QUOTE=shill le 2nd;22360797]Why not just do shared_ptr<int> num(new int);??[/QUOTE]
Sure, that works too, and within the limits of explicit.
[QUOTE=Parakon;22360971]smoke variables erry day[/QUOTE]
I don't like smoking variables. I don't know what's going in to my body. I'd much rather play it safe and smoke constants. (I hear some people even smoke pointers, but that shit is crazy. Smoke a null one and bam, you're dead.)
[QUOTE=Parakon;22360971]smoke variables erry day[/QUOTE]
:cop: :350:
EVERY ITERATION I'M HUSTLIN'
Sorry, you need to Log In to post a reply to this thread.