Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Flawe

Pages: 1 [2]
16
General / Overloaded global operator new
« on: January 18, 2010, 11:43:50 pm »
Here you go, here are my prototypes

Code: [Select]

INLINE void* operator new( size_t size ) throw();
INLINE void operator delete( void* ptr ) throw();
INLINE void* operator new( size_t size, const std::nothrow_t& nothrow );
INLINE void operator delete( void* ptr, const std::nothrow_t& nothrow );
INLINE void* operator new[]( size_t size ) throw();
INLINE void operator delete[]( void* ptr ) throw();
INLINE void* operator new[]( size_t size, const std::nothrow_t& nothrow );
INLINE void operator delete[]( void* ptr, const std::nothrow_t& nothrow );


I do memory tracking yes and the pointer is not allocated with my memory manager, it's from a completely different memory space. I'm working on isolating the behavior so I can step through it.

17
General / Overloaded global operator new
« on: January 18, 2010, 11:25:17 pm »
I have the respective delete for each of the new above. I didn't post them as it's quite obvious what prototype they have?

The functions are defined exactly as the standard implementation provided by c++.

18
General / Overloaded global operator new
« on: January 18, 2010, 09:38:50 pm »
These are the ones I have:

Code: [Select]

INLINE void* operator new( size_t size ) throw();
INLINE void* operator new( size_t size, const std::nothrow_t& nothrow );
INLINE void* operator new[]( size_t size ) throw();
INLINE void* operator new[]( size_t size, const std::nothrow_t& nothrow  );

19
General / Overloaded global operator new
« on: January 18, 2010, 02:18:02 am »
I've implemented my own memory management and so I've overloaded the global operator new/delete/new[]/delete[] and malloc/free/etc...

My problem is, when I create a Shape like this:

Code: [Select]
sf::Shape shape = sf::Shape::Circle( ... );

The following happens (and these are my best guesses based on the call stack):
1. sf::Shape::operator= is called with the newly create shape.
2. std::vector<sf::Shape::Point,std::allocator<sf::Shape::Point> >::operator= is called.
3. std::allocator<sf::Shape::Point>::deallocate is called, which in turn calls global operator delete.

This is were the problem hits. The global operator delete is called, which is intercepted by my implementation of the operator. That's all good, except for the fact that the pointer to be freed wasn't allocated by my operator new. I have no idea where that memory comes from and why it's not deleted with the correct method (respective to how it was allocated).

Anyway ideas what I could have missed?

20
Graphics / Transparent image on top of cleared screen
« on: December 31, 2009, 04:38:19 pm »
Yeah, you're right, it does work as expected. I just had a bug in my code...thanks!

21
Graphics / Transparent image on top of cleared screen
« on: December 31, 2009, 04:23:31 pm »
Thanks for the fast reply, let me extract it from the code base...

22
Graphics / Transparent image on top of cleared screen
« on: December 31, 2009, 03:47:57 pm »
I'm trying to fade an image from 0 alpha to full alpha on top of an empty, cleared screen. The image never fades. Does the alpha not get blended with the background color?

23
Graphics / pngs on top of pngs removes alpha
« on: May 18, 2008, 10:36:33 pm »
Never mind, I did some freaky stuff with the pixels during the rendering :)

24
Graphics / pngs on top of pngs removes alpha
« on: May 18, 2008, 08:06:18 pm »
Sometimes when I draw two different pngs on top of each other the alpha is removed and I get ugly jagged edges, while drawing the pngs on the empty background draws them correctly.

Note that full alpha pixels are drawn correctly all the time, but the pixels where I have color and the alpha is less than 255 seem to be boosted up to have 255 alpha. Anyone got a clue why this happens when the pngs intersect?

Cheers

Pages: 1 [2]
anything