allora, mi spiego meglio, pensavo fosse un errore piu' semplice :
il sort deve mettere in ordine le texture in base all'altezza e poi larghezza della texture, ma questo lo capisci meglio di me , percio'
posto una parte del codice:
codice:
typedef std::map <FORMAT, TTexture2DPtrVector > TNewFormatMap;
typedef std::vector<Texture2D *> TTexture2DPtrVector;//texture2d ha il width e l'height
TNewFormatMap::iterator fmSort;
for ( fmSort = formatMap.begin(); fmSort != formatMap.end(); ++fmSort)
std::sort( (*fmSort).second.begin(), (*fmSort).second.end(), Texture2DGreater() );
valori che generano l'eccezione:
s1->GetHeight() = 1024
s2->GetHeight = 512
s1->GetWidth() = 512;
s2->GetWidth() = 1024;
o
s1->GetHeight() = 128
s2->GetHeight = 64
s1->GetWidth() = 128;
s2->GetWidth() = 256;
da notare che in base ai dati sopra
s1->GetHeight()* s1->GetWidth() == s2->GetHeight()* s2->GetWidth()
puo' essere true per due combinazioni diverse.
eccezione
codice:
typedef struct _TEXTURE2DGREATER
{
bool operator()(Texture2D const *s1, Texture2D const *s2) const
{
int h1 = s1->GetHeight();
int h2 = s2->GetHeight();
int w1 = s1->GetWidth();
int w2 = s2->GetWidth();
if (s1->GetHeight()* s1->GetWidth() > s2->GetHeight()* s2->GetWidth())
return true;
else if ( (s1->GetHeight() > s2->GetHeight())
&& (s1->GetHeight()* s1->GetWidth() == s2->GetHeight()* s2->GetWidth()))
return true;//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!errore
else if ( (s1->GetWidth() > s2->GetWidth())
&& (s1->GetHeight()* s1->GetWidth() == s2->GetHeight()* s2->GetWidth()))
return true;
else
return false;
}
} Texture2DGreater;
codice:
//codice eccezione
template<class _Pr, class _Ty1, class _Ty2> inline
bool __CLRCALL_OR_CDECL _Debug_lt_pred(_Pr _Pred, _Ty1& _Left, _Ty2& _Right,
const wchar_t *_Where, unsigned int _Line)
{ // test if _Pred(_Left, _Right) and _Pred is strict weak ordering
if (!_Pred(_Left, _Right))
return (false);
else if (_Pred(_Right, _Left))
_DEBUG_ERROR2("invalid operator<", _Where, _Line);////errore!!!!!!!!!!
return (true);
}
grazie e scusa per non aver postato tutto.