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

Method Resize

trinity/Tr2ImpostorManager.cpp:40–55  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Resizes the atlas. Invalidates all texcoords and creates new free texcoords. Arguments: width - Atlas width height - Atlas height itemWidth - Billboard width itemHeight - Billboard height --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

38// itemHeight - Billboard height
39// --------------------------------------------------------------------------------------
40void Tr2ImpostorManager::ImpostorAtlas::Resize( uint32_t width, uint32_t height, uint32_t itemWidth, uint32_t itemHeight )
41{
42 m_free.clear();
43
44 uint32_t xCount = width / itemWidth;
45 uint32_t yCount = height / itemHeight;
46 m_free.reserve( xCount * yCount );
47 for( uint32_t j = 0; j < yCount; ++j )
48 {
49 for( uint32_t i = 0; i < xCount; ++i )
50 {
51
52 m_free.push_back( Vector2_16( float( i * itemWidth + 0.5f ) / width, float( j * itemHeight + 0.5f ) / height ) );
53 }
54 }
55}
56
57// --------------------------------------------------------------------------------------
58// Description:

Callers 1

ResetMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected