Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1:/tmp/cvs-serv17408/network
Modified Files:
uopacket.cpp uopacket.h uotxpackets.cpp
Log Message:
Unicode ToolTips support
Index: uopacket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uopacket.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** uopacket.cpp 11 Sep 2003 12:22:25 -0000 1.37
--- uopacket.cpp 22 Dec 2003 11:01:56 -0000 1.38
***************
*** 485,489 ****
it will be truncated.
*/
! void cUOPacket::setUnicodeString( uint pos, const QString& data, uint maxlen )
{
haveCompressed = false; // changed
--- 485,489 ----
it will be truncated.
*/
! void cUOPacket::setUnicodeString( uint pos, const QString& data, uint maxlen, bool swapbytes )
{
haveCompressed = false; // changed
***************
*** 492,496 ****
for ( uint i = 0; i < length; ++i )
{
! setShort(pos + i * 2, (*(unicodeData + i)).unicode());
}
}
--- 492,505 ----
for ( uint i = 0; i < length; ++i )
{
! if( !swapbytes )
! {
! setShort(pos + i * 2, (*(unicodeData + i)).unicode());
! }
! else
! {
! (*this)[pos + i * 2 + 1] = ( (*(unicodeData + i )).unicode() >> 8 ) & 0xFF;
! (*this)[pos + i * 2] = ( (*(unicodeData + i )).unicode() ) & 0xFF;
! }
!
}
}
Index: uopacket.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uopacket.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** uopacket.h 11 Sep 2003 12:22:25 -0000 1.25
--- uopacket.h 22 Dec 2003 11:01:56 -0000 1.26
***************
*** 71,75 ****
void setInt( uint, uint );
void setShort( uint, ushort );
! void setUnicodeString( uint, const QString&, uint );
void setAsciiString( uint, const char*, uint );
static QCString dump( const QByteArray& );
--- 71,75 ----
void setInt( uint, uint );
void setShort( uint, ushort );
! void setUnicodeString( uint, const QString&, uint, bool swapbytes = false );
void setAsciiString( uint, const char*, uint );
static QCString dump( const QByteArray& );
Index: uotxpackets.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uotxpackets.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -d -r1.71 -r1.72
*** uotxpackets.cpp 23 Jul 2003 22:39:07 -0000 1.71
--- uotxpackets.cpp 22 Dec 2003 11:01:56 -0000 1.72
***************
*** 585,593 ****
setShort( offset + 4, params.length() * 2 );
! for( UINT32 i = 0; i < params.length(); ++i )
! {
! (*this)[offset + 6 + i*2+1] = ( params.unicode()[i].unicode() >> 8 ) & 0xFF;
! (*this)[offset + 6 + i*2] = ( params.unicode()[i].unicode() ) & 0xFF;
! }
// Terminator
--- 585,589 ----
setShort( offset + 4, params.length() * 2 );
! setUnicodeString( offset + 6, params, params.length() * 2, true );
// Terminator
|