Search found 34 matches

by Amarant
Mon Feb 02, 2009 4:48 pm
Forum: Programming Discussion
Topic: Some SDL Issues
Replies: 29
Views: 2515

Re: Some SDL Issues

1) I'm not sure how best to describe this, and I can't seem to catch it to take a screenshot of it, but when the sprites move across the screen, sometimes the rows of pixels are out of alignment, and it flickers a bit, sort of like scan lines are being drawn over it. Does anybody know what causes t...
by Amarant
Thu Jan 29, 2009 1:48 pm
Forum: General Gaming
Topic: LittleBIGPlanet Logic
Replies: 12
Views: 1333

Re: LittleBIGPlanet Logic

I never realized from watching gameplay videos how similar this is to garrys mod.
by Amarant
Thu Jan 29, 2009 9:14 am
Forum: Programming Discussion
Topic: Resource managing in OpenGL
Replies: 5
Views: 668

Re: Resource managing in OpenGL

First of, there is no such thing as CPU space. CPU usage is measured over time and 50% CPU usage means that 50% of the time the CPU spends executing anything is spent on your program. So I don't think this has anything to do with OpenGL or something that's wrong with your program. You're probably ju...
by Amarant
Sun Jan 11, 2009 7:28 am
Forum: Programming Discussion
Topic: RESOLVED:segfault error; help please?
Replies: 2
Views: 386

Re: segfault error; help please?

The 'controller' pointer has probably not been initialized. But to sidestep that problem you could just have this: class inputClass { private: SDL_Joystick* joystick; myController controller; // value instead of pointer public: inputClass(); ~inputClass(); void updateStates(); myController* getState...
by Amarant
Sat Dec 06, 2008 6:39 pm
Forum: Programming Discussion
Topic: Something I bet you didnt know you could do with pointers #2
Replies: 26
Views: 2506

Re: Something I bet you didnt know you could do with pointers #2

I don't see what you're saying. What's not portable about it?
by Amarant
Sat Dec 06, 2008 6:20 pm
Forum: Programming Discussion
Topic: Something I bet you didnt know you could do with pointers #2
Replies: 26
Views: 2506

Re: Something I bet you didnt know you could do with pointers #2

i mean im not trying to say anything bad. but malloc(n) is such a bad programming practice. you would lose a job programming like that. (type*)malloc(n*sizeof(type)); I think you should reread the example, because inside the swap function there's no information about the type. I do agree the n para...
by Amarant
Mon Dec 01, 2008 3:50 pm
Forum: Programming Discussion
Topic: phyzills update
Replies: 73
Views: 8270

Re: phyzills update

Phyzills Phyzilz or Phyzillz?
by Amarant
Tue Nov 25, 2008 12:08 pm
Forum: Programming Discussion
Topic: Loading Maps..
Replies: 4
Views: 643

Re: Loading Maps..

Here's a website on creating a dynamically allocated multidimensional array http://www.eskimo.com/~scs/cclass/int/sx9b.html < it's from the Guides & Resources Topic. The method described on that website could however be overkill. What I usually end up doing is creating a flat array like this: in...
by Amarant
Thu Nov 20, 2008 5:16 pm
Forum: General/Off-Topic
Topic: Are you a programmer at heart?
Replies: 16
Views: 1022

Re: Are you a programmer at heart?

I thought it was a pretty cool game. It even supports recursive functions 8-). Didn't use recursion to complete a level though. i dont thing it supports recursion, recursive functions can stop. if you did something recursive in that it be an infinite loop. (i think, i didnt look at it indepth) Hmm,...
by Amarant
Thu Nov 20, 2008 3:09 pm
Forum: General/Off-Topic
Topic: Are you a programmer at heart?
Replies: 16
Views: 1022

Re: Are you a programmer at heart?

I thought it was a pretty cool game. It even supports recursive functions 8-).
Didn't use recursion to complete a level though.
by Amarant
Fri Nov 14, 2008 12:48 pm
Forum: Programming Discussion
Topic: BITWISE challenge
Replies: 16
Views: 1385

Re: BITWISE challenge

did you know that it fliped the bits before you wrote the program. and do you know what 2's compliment it? how about little and big endian? these are all very interesting fundamental concepts of CS Yes, I didn't just randomly try operators to see which one worked. 2's complement is the way negative...
by Amarant
Thu Nov 13, 2008 1:04 pm
Forum: Programming Discussion
Topic: BITWISE challenge
Replies: 16
Views: 1385

Re: BITWISE challenge

It's the 'One's Complement Operator' and it flips all the bits in the integer, not sure what happens with negative numbers though. So I wrote a little program to find out what is does with negative numbers. And it really does flip every bit: one's complement of -3: ~11111111111111111111111111111101 ...
by Amarant
Thu Nov 13, 2008 12:42 pm
Forum: Programming Discussion
Topic: BITWISE challenge
Replies: 16
Views: 1385

Re: BITWISE challenge

Like this?

Code: Select all

int math_floor(int value)
{
    return value & ~1;
}

int math_ceil(int value)
{
    return (value & ~1) + 1;
}
by Amarant
Thu Nov 13, 2008 12:14 pm
Forum: Programming Discussion
Topic: BITWISE challenge
Replies: 16
Views: 1385

Re: BITWISE challenge

Is the channel supposed to have a variable width?
by Amarant
Fri Nov 07, 2008 6:04 pm
Forum: Programming Discussion
Topic: Something that might help you.
Replies: 7
Views: 1177

Re: Something that might help you.

True, and that's why I said it had 'basically' the same functionality and not 'exactly' the same functionality.