2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-15 10:54:18 +00:00

Compare commits

..

6 Commits

Author SHA1 Message Date
73895318e9 Change Huru 'nullptr' to NULL in plMipmap.cpp 2019-11-21 14:48:53 -07:00
3a62c231d2 Merge H-uru GIT PR356:
Adam Johnson committed 48ad646 on 15 Jan 17
Manually merge #356 Merge remote-tracking branch 'deledrius/plMipmap_png'
2019-11-21 13:54:54 -07:00
8418dd54a5 Merge in H'Uru/Plasma PR 533 (PR#47) 2019-10-26 10:07:33 -06:00
4ab5fe5fed Merge rarified/gameserverportfix (PR#43)
Add Doxygen work directory to .hgignore
2019-10-26 10:05:52 -06:00
0d518e3465 Merged branch to PR #42 including login hash from mdeforest 2019-03-31 16:31:06 -06:00
92e95d5a99 Add function NetCliAuthGetCurrentConnPort() to plNglGame to provide current Auth
server port to Game client connection code.

For use where non-default port is being used for Auth/Game servers.
2019-03-16 14:34:19 -06:00
8 changed files with 51 additions and 9 deletions

View File

@ -13,4 +13,6 @@ syntax: regexp
^MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/external/render/
^MOULOpenSourceClientPlugin/Plasma20/test/
^MOULOpenSourceClientPlugin/Plasma20/tools/
^MOULOpenSourceClientPlugin/Plasma20/Doxy/
^MOULOpenSourceClientPlugin/StaticSDKs/
^patch/

View File

@ -113,7 +113,8 @@ UInt32 plBitmap::Read( hsStream *s )
fFlags = s->ReadSwap16();
fCompressionType = s->ReadByte();
if(( fCompressionType == kUncompressed )||( fCompressionType == kJPEGCompression ))
if( fCompressionType == kUncompressed || fCompressionType == kJPEGCompression ||
fCompressionType == kPNGCompression )
{
fUncompressedInfo.fType = s->ReadByte();
read++;
@ -145,7 +146,8 @@ UInt32 plBitmap::Write( hsStream *s )
s->WriteSwap16( fFlags );
s->WriteByte( fCompressionType );
if(( fCompressionType == kUncompressed )||(fCompressionType == kJPEGCompression ))
if( fCompressionType == kUncompressed || fCompressionType == kJPEGCompression ||
fCompressionType == kPNGCompression )
{
s->WriteByte( fUncompressedInfo.fType );
written++;

View File

@ -104,7 +104,8 @@ class plBitmap : public hsKeyedObject
{
kUncompressed = 0x0,
kDirectXCompression = 0x1,
kJPEGCompression = 0x2
kJPEGCompression = 0x2,
kPNGCompression = 0x3
};
struct DirectXInfo

View File

@ -60,6 +60,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "../plPipeline/hsGDeviceRef.h"
#include "plProfile.h"
#include "../plJPEG/plJPEG.h"
#include "plPNG.h"
plProfile_CreateMemCounter("Mipmaps", "Memory", MemMipmaps);
@ -122,11 +123,8 @@ void plMipmap::Create( UInt32 width, UInt32 height, unsigned config, UInt8 numLe
}
fCompressionType = compType;
if( compType == kUncompressed )
{
fUncompressedInfo.fType = format;
}
else if( compType == kJPEGCompression )
if( compType == kUncompressed || compType == kJPEGCompression ||
compType == kPNGCompression )
{
fUncompressedInfo.fType = format;
}
@ -269,6 +267,10 @@ UInt32 plMipmap::Read( hsStream *s )
case kJPEGCompression:
IReadJPEGImage( s );
break;
case kPNGCompression:
IReadPNGImage( s );
break;
default:
hsAssert( false, "Unknown compression type in plMipmap::Read()" );
@ -309,6 +311,10 @@ UInt32 plMipmap::Write( hsStream *s )
IWriteJPEGImage( s );
break;
case kPNGCompression:
IWritePNGImage( s );
break;
default:
hsAssert( false, "Unknown compression type in plMipmap::Read()" );
return totalWritten;
@ -576,6 +582,23 @@ void plMipmap::IWriteJPEGImage( hsStream *stream )
delete alpha;
}
void plMipmap::IReadPNGImage(hsStream* stream)
{
plMipmap* temp = NULL;
temp = plPNG::Instance().ReadFromStream(stream);
if (temp) {
CopyFrom(temp);
delete temp;
}
}
void plMipmap::IWritePNGImage(hsStream* stream)
{
plPNG::Instance().WriteToStream(stream, this);
}
//// GetLevelSize /////////////////////////////////////////////////////////////
// Get the size of a single mipmap level (0 is the largest)
@ -613,6 +636,7 @@ void plMipmap::IBuildLevelSizes()
case kUncompressed:
case kJPEGCompression:
case kPNGCompression:
fLevelSizes[ level ] = height * rowBytes;
break;
@ -1586,6 +1610,7 @@ void plMipmap::CopyFrom( const plMipmap *source )
break;
case kUncompressed:
case kJPEGCompression:
case kPNGCompression:
fUncompressedInfo.fType = source->fUncompressedInfo.fType;
break;
default:

View File

@ -310,6 +310,8 @@ class plMipmap : public plBitmap
void IWriteRLEImage( hsStream *stream, plMipmap *mipmap );
void IReadJPEGImage( hsStream *stream );
void IWriteJPEGImage( hsStream *stream );
void IReadPNGImage( hsStream *stream );
void IWritePNGImage( hsStream *stream );
void IBuildLevelSizes();
void IColorLevel( UInt8 level, const UInt8 *colorMask );

View File

@ -5215,6 +5215,15 @@ void NetCliAuthStartConnect (
}
}
//============================================================================
unsigned NetCliAuthGetCurrentConnPort() {
unsigned port;
s_critsect.Enter();
port = NetAddressGetPort(s_active->addr);
s_critsect.Leave();
return port;
}
//============================================================================
bool NetCliAuthQueryConnected () {

View File

@ -66,6 +66,7 @@ void NetCliAuthStartConnect (
);
bool NetCliAuthQueryConnected ();
void NetCliAuthAutoReconnectEnable (bool enable); // is enabled by default
unsigned NetCliAuthGetCurrentConnPort(); // for Game Server socket port
// Called after the auth/client connection is encrypted
typedef void (*FNetCliAuthConnectCallback)();

View File

@ -743,7 +743,7 @@ void NetCliGameStartConnect (
const NetAddressNode & node
) {
NetAddress addr;
NetAddressFromNode(node, kNetDefaultClientPort, &addr);
NetAddressFromNode(node, NetCliAuthGetCurrentConnPort(), &addr);
Connect(addr);
}