edb6377

Members
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

118 Neutral

About edb6377

  • Rank
    Member
  1. Limitations: VC++ 6 and DX7 FPS = 60 (Dither) FPS drops significantly when rendering Alpha Blended Text Any Ideas? Code as below. Called to draw surface with Alpha Blend [CODE] // Alpha mode DXDraw::RGBMASK mask = DXDraw::GetInstance()->GetRGBmask(); DWORD r, g, b, color; // Render a alpha blended for( int y = rc.top; y < rc.bottom; y++ ) { for( int x = 0; x < rc.right; x++ ) { color = pDestStart[ x ]; MergeColor( pimpl->backgroundColor, color ); pDestStart[ x ] = color; } pDestStart += pitch; } [/CODE] Merge Color Code [CODE] // Add the color 1 with the second and divide the result by 2 #define MergeColor( clr1, clr2 )\ r = ( ( clr1 & mask.rMask ) + ( clr2 & mask.rMask ) ) >> 1;\ g = ( ( clr1 & mask.gMask ) + ( clr2 & mask.gMask ) ) >> 1;\ b = ( ( clr1 & mask.bMask ) + ( clr2 & mask.bMask ) ) >> 1;\ color = ( r & mask.rMask ) | ( g & mask.gMask ) | ( b & mask.bMask ); [/CODE]
  2. AUTO_PTR issue.

    I will give another go from clean version to try and port it again.. I actually chose 2005 because i hate 2003 and it was the next iteration. A straight move to 2010 was daunting and i feel will give me more issues than i can handle at once. I figured if i can get it to 2005 correctly then i will move to 2008 and finally to 2010. That way I slowly break up the problem children. To be honest these days everything I create is 2010 and will move as new versions are released but this particular project was an old one that needs to have many major updates. I.e. DX7 etc. So in order to do that I am trying to get my application in a managed way. If in the end its easier to just move all the way to 2010 right off the bat thats fine but I need to look over all the libs i use to make sure they are ready for that.
  3. AUTO_PTR issue.

    So it appears I am going to have to rewrite a whole lot of my code from the vc6 version. It makes use of auto_ptr in this manner all over the place. Even when i got it to compile it started having issues with resetting the value and deleting the value. It wasn't returning what it should in a number of ways.. Once i get it all figured out I will add to this post so others know what I had to do. I tried to use a few different methods to get around the issue by rewriting the memory.h version but that obviously didn't go well. Its hard to troubleshoot until you can actually return the program to working order. Time to start looking through all that great information [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] I couldn't find a simple method or drop in version. It appears its going to be a big rewrite.
  4. Yeah I am just getting ready to test the compile. I have both in there but I commented out my copy and put in the &vBuffer[0]; function We will see how it goes ^^ Thank you
  5. Hmm let me check that out.. I went more the std::copy(lpNewBuffer,lpNewBuffer+nBufferSize,vBuffer.begin()); direction easier to test once you get things to compile
  6. AUTO_PTR issue.

    Wow thank you for the ton of information. I will start soaking that up now. Its good to know I need to start developing a plan for these as I move my code up to current standards and implementation. Thank you much!
  7. So in this conversion this is the only other VC++ 6==>VC++ 2005 issue i keep running into Worked in VC++ 6 [source lang="cpp"]////////////////////////////////////////////////////////////////////////////////////////// void Packet::GetBuffer ////////////////////////////////////////////////////////////////////////////////////////// // Returns the packet's buffer and its size. // ( LPBYTE &lpNewBuffer, // The buffer to put the value to. int &nBufferSize // The size of the buffer. ) ////////////////////////////////////////////////////////////////////////////////////////// { lpNewBuffer = vBuffer.begin(); nBufferSize = vBuffer.size(); } [/source] Now it returns the error error C2440: '=' : cannot convert from 'std::_Vector_iterator<_Ty,_Alloc>' to 'LPBYTE' 1> with 1> [ 1> _Ty=BYTE, 1> _Alloc=std::allocator<BYTE> 1> ] 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Definition of LPBYTE typedef BYTE far *LPBYTE; Using the standard Vector.h from the VC includes. I tried a few things like copy and what not.
  8. AUTO_PTR issue.

    Yeah i will have to look into boost i guess. Worked in VC6 and I find it funny it interesting they didnt consider that with the new includes. I might have to check out BOOST
  9. AUTO_PTR issue.

    map<DWORD, auto_ptr< PacketInterpreter > > interpreters; Is one of the calls its breaking on.
  10. I am having a heck of time converting this one piece of an old VS6 program to VS2005 Error 161 error C2558: class 'std::auto_ptr<_Ty>' : no copy constructor available or copy constructor is declared 'explicit' C:\Program Files\Microsoft Visual Studio 8\VC\include\utility 37 Error 230 error C2558: class 'std::auto_ptr<_Ty>' : no copy constructor available or copy constructor is declared 'explicit' C:\Program Files\Microsoft Visual Studio 8\VC\include\vector 1125 Error 256 error C2558: class 'std::auto_ptr<_Ty>' : no copy constructor available or copy constructor is declared 'explicit' C:\Program Files\Microsoft Visual Studio 8\VC\include\utility 37 Header: (Added // ERROR IS HERE where its breaking) [source lang="cpp"]// utility standard header #pragma once #ifndef _UTILITY_ #define _UTILITY_ #ifndef RC_INVOKED #include <iosfwd> #ifdef _MSC_VER #pragma pack(push,_CRT_PACKING) #pragma warning(push,3) #endif /* _MSC_VER */ _STD_BEGIN // TEMPLATE FUNCTION swap (from <algorithm>) template<class _Ty> inline void swap(_Ty& _Left, _Ty& _Right) { // exchange values stored at _Left and _Right _Ty _Tmp = _Left; _Left = _Right, _Right = _Tmp; } // TEMPLATE STRUCT pair template<class _Ty1, class _Ty2> struct pair { // store a pair of values typedef pair<_Ty1, _Ty2> _Myt; typedef _Ty1 first_type; typedef _Ty2 second_type; pair() : first(_Ty1()), second(_Ty2()) { // construct from defaults } pair(const _Ty1& _Val1, const _Ty2& _Val2) : first(_Val1), second(_Val2) { // construct from specified values // ERROR IS HERE } template<class _Other1, class _Other2> pair(const pair<_Other1, _Other2>& _Right) : first(_Right.first), second(_Right.second) { // construct from compatible pair } void swap(_Myt& _Right) { // exchange contents with _Right std::swap(first, _Right.first); std::swap(second, _Right.second); } _Ty1 first; // the first stored value _Ty2 second; // the second stored value }; // pair TEMPLATE FUNCTIONS template<class _Ty1, class _Ty2> inline bool operator==(const pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) { // test for pair equality return (_Left.first == _Right.first && _Left.second == _Right.second); } template<class _Ty1, class _Ty2> inline bool operator!=(const pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) { // test for pair inequality return (!(_Left == _Right)); } template<class _Ty1, class _Ty2> inline bool operator<(const pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) { // test if _Left < _Right for pairs return (_Left.first < _Right.first || !(_Right.first < _Left.first) && _Left.second < _Right.second); } template<class _Ty1, class _Ty2> inline bool operator>(const pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) { // test if _Left > _Right for pairs return (_Right < _Left); } template<class _Ty1, class _Ty2> inline bool operator<=(const pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) { // test if _Left <= _Right for pairs return (!(_Right < _Left)); } template<class _Ty1, class _Ty2> inline bool operator>=(const pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) { // test if _Left >= _Right for pairs return (!(_Left < _Right)); } template<class _Ty1, class _Ty2> inline pair<_Ty1, _Ty2> make_pair(_Ty1 _Val1, _Ty2 _Val2) { // return pair composed from arguments return (pair<_Ty1, _Ty2>(_Val1, _Val2)); } template<class _Ty1, class _Ty2> inline void swap(pair<_Ty1, _Ty2>& _Left, pair<_Ty1, _Ty2>& _Right) { // swap _Left and _Right pairs _Left.swap(_Right); } // TEMPLATE OPERATORS namespace rel_ops { // nested namespace to hide relational operators from std template<class _Ty> inline bool operator!=(const _Ty& _Left, const _Ty& _Right) { // test for inequality, in terms of equality return (!(_Left == _Right)); } template<class _Ty> inline bool operator>(const _Ty& _Left, const _Ty& _Right) { // test if _Left > _Right, in terms of operator< return (_Right < _Left); } template<class _Ty> inline bool operator<=(const _Ty& _Left, const _Ty& _Right) { // test if _Left <= _Right, in terms of operator< return (!(_Right < _Left)); } template<class _Ty> inline bool operator>=(const _Ty& _Left, const _Ty& _Right) { // test if _Left >= _Right, in terms of operator< return (!(_Left < _Right)); } } _STD_END #ifdef _MSC_VER #pragma warning(pop) #pragma pack(pop) #endif /* _MSC_VER */ #endif /* RC_INVOKED */ #endif /* _UTILITY_ */ /* * Copyright © 1992-2005 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. */ /* * This file is derived from software bearing the following * restrictions: * * Copyright © 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Hewlett-Packard Company makes no representations about the * suitability of this software for any purpose. It is provided * "as is" without express or implied warranty. V4.05:0009 */ [/source]