Search found 61 matches

by szdarkhack
Sun Oct 02, 2011 5:45 pm
Forum: Programming Discussion
Topic: Code Cracker Problems
Replies: 9
Views: 2361

Re: Code Cracker Problems

By the time it uses a c[n] it's already > -1. Is that so? Look closely... int i=0; while(i<MAX){ c[i]=-1; [b]// <- All c[] is initialized to -1[/b] i++; } while(!cracked){ r=0; [b]// <- still -1[/b] while(r<f){ [b]// <- hmm, still -1[/b] while(c[r]<AMOUNT){ [b]// <- yeap, STILL -1[/b] code[r]=codex...
by szdarkhack
Sun Oct 02, 2011 3:16 pm
Forum: Programming Discussion
Topic: Code Cracker Problems
Replies: 9
Views: 2361

Re: Code Cracker Problems

You're initializing the entire c[] to -1, and then using that to index into the codex[] array. I'm surprised it didn't crash, but random garbage output should give you the hint that you're out of bounds on some array. Change the initialization to 0, it should fix that. By the way, the debugger is th...
by szdarkhack
Sun Oct 02, 2011 2:23 pm
Forum: Programming Discussion
Topic: Code Cracker Problems
Replies: 9
Views: 2361

Re: Code Cracker Problems

strcmp returns 0 on success, which would be a logical 'false': http://www.cplusplus.com/reference/clibrary/cstring/strcmp/ . Right now your algorithm exits immediately because your 'if' check will pass when the strings are *not* identical. Add an ! in your if and it should work, unless i missed some...
by szdarkhack
Sat Oct 01, 2011 7:26 am
Forum: Programming Discussion
Topic: Textured and untextured quads
Replies: 6
Views: 1476

Re: Textured and untextured quads

Well calling glDisable for textures in the render loop will make me have to enable it again each time, isnt that time-consuming? Actually no, binding the texture is more time consuming than enabling and disabling. Binding sets pointers on you graphics card, it might even move data around. Enabling/...
by szdarkhack
Tue Sep 20, 2011 2:41 am
Forum: Programming Discussion
Topic: DirectX 9 Error.
Replies: 7
Views: 1189

Re: DirectX 9 Error.

DirectX uses Microsoft's COM system, which uses objects. I'm pretty sure you can't use pure C with it, since it requires inheritance, so you should use C++. Why would you prefer pure C anyway though? C++ *can* make your code more readable and easier to debug (if you know how to use it properly).
by szdarkhack
Tue Sep 20, 2011 2:25 am
Forum: Programming Discussion
Topic: Virtual Function Problemo
Replies: 15
Views: 3419

Re: Virtual Function Problemo

If your issue is with a base type destructor, you're probably trying to delete a BaseImage* that actually stores a SWRImage2D. Now I couldn't find that situation in any of the posted code, but if that's the issue, just declare ~BaseImage() as virtual ie: virtual ~BaseImage() {} This causes the comp...
by szdarkhack
Mon Sep 19, 2011 4:25 am
Forum: Programming Discussion
Topic: Virtual Function Problemo
Replies: 15
Views: 3419

Re: Virtual Function Problemo

The only think that could cause something like this would be an incomplete initialization on your object (meaning that the vptr will still be pointing to the base class's vtable and not the derived one's). I cannot imagine why that would happen, though, since even if you don't include it in your ini...
by szdarkhack
Wed Sep 14, 2011 2:48 am
Forum: Programming Discussion
Topic: OpenGL texture disappearing when window is resized
Replies: 5
Views: 1356

Re: OpenGL texture disappearing when window is resized

I'm not sure about your disappearing texture, your resize seems to be ok. Your texturing is wrong, however. The last 2 texCoords should be in the reverse order (according to the vertices you have defined). Does the texture disappear instantly or gradually?
by szdarkhack
Thu Sep 08, 2011 6:22 pm
Forum: Game Development
Topic: [Question] 2D Tiled "on map" house
Replies: 19
Views: 5583

Re: [Question] 2D Tiled "on map" house

This is just a suggestion since i don't know how your tile engine is structured, but here goes: My idea would require a "flags" field and an "id" field for every tile. Your character should get (and store) the id of the tile it's stepping on every time it moves. You should set th...
by szdarkhack
Thu Sep 08, 2011 6:03 pm
Forum: Programming Discussion
Topic: [SOLVED] OpenGL 2D Pixel Scaling Issues
Replies: 10
Views: 1862

Re: [SOLVED] OpenGL 2D Pixel Scaling Issues

Oooh, I see, I wasn't aware of that; I didn't really think about it. Thank you for the explanation, hopefully if someone as stupid as me when it comes to this stuff needs help this will help them out. :lol: Thank you szdarkhack for the explanation, and thank you everyone else who tried to help as w...
by szdarkhack
Thu Sep 08, 2011 8:01 am
Forum: Programming Discussion
Topic: [SOLVED] OpenGL 2D Pixel Scaling Issues
Replies: 10
Views: 1862

Re: [SOLVED] OpenGL 2D Pixel Scaling Issues

I noticed that, as you said, your sprite image is 32x48, and yet in the code you posted you draw to a quad of size 16x32. If that is really the case, then the scaling issue is due to the fact that your sprite's height is 1.5 times its width, while your quad's height is 2 times it's width, thus the s...
by szdarkhack
Thu May 12, 2011 1:08 pm
Forum: Game Development
Topic: Tiling with SDL/OpenGL
Replies: 9
Views: 2845

Re: Tiling with SDL/OpenGL

Well, after giving it some thought, banging my head against the wall for not thinking of using UV manipulation and doing some research, i think i can safely say that using an indexed triangle/quad list is impossible to do without duplicate vertices (which negate the benefit), so i'm going to go with...
by szdarkhack
Wed May 11, 2011 9:35 am
Forum: Game Development
Topic: Tiling with SDL/OpenGL
Replies: 9
Views: 2845

Re: Tiling with SDL/OpenGL

Thanks a lot for the replies :) The idea of binding the tilesheet and playing with the texture coordinates is actually very nice, i will look into it more and try to get a test program up and running. I will post any further issues i might have with this here, although i'm pretty busy this week and ...
by szdarkhack
Wed May 11, 2011 3:36 am
Forum: Game Development
Topic: Tiling with SDL/OpenGL
Replies: 9
Views: 2845

Tiling with SDL/OpenGL

Hello everyone! I've recently started planning the tiling engine for a game i'm developing with some friends. Let me first give you an overview of where i'm going with this. The "look and feel" of the terrain is planned to be in a Zelda style, such as in the masterpiece The Minish Cap, but...
by szdarkhack
Fri May 08, 2009 2:45 am
Forum: Programming Discussion
Topic: [SOLVED]Winsock problem
Replies: 3
Views: 336

Re: [SOLVED]Winsock problem

Also, as your server will have to do a lot of stuff quickly, while most of them block, make sure to use a Thread Pool. In case you're unfamilliar with the term, it just contains a number of threads that the rest of the server can use to call functions asyncronously. There are a few ThreadPool classe...