MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / StoreSequence

Method StoreSequence

Source/Compiler.cpp:1100–1129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1098}
1099
1100int CCompiler::StoreSequence(const CSequence &Seq, const stChunkLabel &label) // // //
1101{
1102 CChunk &Chunk = CreateChunk(label); // // //
1103
1104 // Store the sequence
1105 int iItemCount = Seq.GetItemCount();
1106 int iLoopPoint = Seq.GetLoopPoint();
1107 int iReleasePoint = Seq.GetReleasePoint();
1108 int iSetting = Seq.GetSetting();
1109
1110 if (iReleasePoint != -1)
1111 iReleasePoint += 1;
1112 else
1113 iReleasePoint = 0;
1114
1115 if (iLoopPoint > iItemCount)
1116 iLoopPoint = -1;
1117
1118 Chunk.StoreByte((unsigned char)iItemCount);
1119 Chunk.StoreByte((unsigned char)iLoopPoint);
1120 Chunk.StoreByte((unsigned char)iReleasePoint);
1121 Chunk.StoreByte((unsigned char)iSetting);
1122
1123 for (int i = 0; i < iItemCount; ++i) {
1124 Chunk.StoreByte(Seq.GetItem(i));
1125 }
1126
1127 // Return size of this chunk
1128 return iItemCount + 4;
1129}
1130
1131// Instruments
1132

Callers

nothing calls this directly

Calls 6

GetLoopPointMethod · 0.80
GetReleasePointMethod · 0.80
GetSettingMethod · 0.80
StoreByteMethod · 0.80
GetItemMethod · 0.80
GetItemCountMethod · 0.45

Tested by

no test coverage detected