3136
Programming / Re: Code problems
« on: August 16, 2011, 01:16:22 pm »The malloc I copied that from Palette::loadDat ... not sure why it's used, I guess it's more C-like which fits SDL, maybe it's from an example in the SDL tutorials?AFIK is no difference between `malloc` and `new` when its used with C structures. i think is better to stick to C++ functions.
paletteShift is always called once and then paletteRestore after that, so currently there are no memory leaks. But you are right, if someone else wants to use this function it should be made a little more foolproof.exactly
About the "mul", I'm not sure how that works, I copied it from the original function Surface::offset, and it seemed to me it still works?probably this function is right, its implementation is bizarre for me.