MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / LoadSprites

Function LoadSprites

TombEngine/Specific/level.cpp:1892–1935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1890}
1891
1892void LoadSprites()
1893{
1894 int spriteCount = ReadCount();
1895 g_Level.Sprites.resize(spriteCount);
1896
1897 TENLog("Sprite count: " + std::to_string(spriteCount), LogLevel::Info);
1898
1899 for (int i = 0; i < spriteCount; i++)
1900 {
1901 auto* spr = &g_Level.Sprites[i];
1902 spr->tile = ReadInt32();
1903 spr->x1 = ReadFloat();
1904 spr->y1 = ReadFloat();
1905 spr->x2 = ReadFloat();
1906 spr->y2 = ReadFloat();
1907 spr->x3 = ReadFloat();
1908 spr->y3 = ReadFloat();
1909 spr->x4 = ReadFloat();
1910 spr->y4 = ReadFloat();
1911 }
1912
1913 int spriteSeqCount = ReadCount();
1914
1915 TENLog("Sprite sequence count: " + std::to_string(spriteSeqCount), LogLevel::Info);
1916
1917 for (int i = 0; i < spriteSeqCount; i++)
1918 {
1919 int spriteID = ReadInt32();
1920 short negLength = ReadInt16();
1921 short offset = ReadInt16();
1922 if (spriteID >= ID_NUMBER_OBJECTS)
1923 {
1924 Statics[spriteID - ID_NUMBER_OBJECTS].meshNumber = offset;
1925 }
1926 else
1927 {
1928 Objects[spriteID].nmeshes = negLength;
1929 Objects[spriteID].meshIndex = offset;
1930 Objects[spriteID].loaded = true;
1931
1932 SpriteSequencesIds.push_back(spriteID);
1933 }
1934 }
1935}
1936
1937void GetCarriedItems()
1938{

Callers 1

LoadLevelFunction · 0.85

Calls 8

ReadCountFunction · 0.85
TENLogFunction · 0.85
to_stringFunction · 0.85
ReadInt32Function · 0.85
ReadFloatFunction · 0.85
ReadInt16Function · 0.85
resizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected