MCPcopy Create free account
hub / github.com/carbonengine/trinity / DecodeMainPickPixel

Function DecodeMainPickPixel

trinity/Eve/EveSpaceScene.cpp:3495–3508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3493namespace
3494{
3495void DecodeMainPickPixel( const void* pBuffer, uint32_t& objId, uint32_t& areaId )
3496{
3497 // helpers: get each channel
3498 uint32_t b = (uint32_t)( *( (unsigned char*)pBuffer + 0 ) );
3499 uint32_t g = (uint32_t)( *( (unsigned char*)pBuffer + 1 ) );
3500 uint32_t r = (uint32_t)( *( (unsigned char*)pBuffer + 2 ) );
3501 uint32_t a = (uint32_t)( *( (unsigned char*)pBuffer + 3 ) );
3502
3503 // put it "together"
3504 objId = ( ( r & 0xff ) << 8 ) | ( g & 0xff );
3505 objId--;
3506 areaId = ( ( b & 0xff ) << 8 ) | ( a & 0xff );
3507 areaId--;
3508}
3509}
3510
3511

Callers 1

PerformPickingMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected