"stcycl 01, 01; We write code to memory without skips/overwrite");
dsm_mem.push_back("");
dsm_mem.push_back("unpack[mr] S_8, 4, *; Flags");
for(inti=0;i<face_count;i++){
dsm_mem.push_back(".byte 0x10; stock");
dsm_mem.push_back(".byte 0x10; stock");
dsm_mem.push_back(".byte 0x20; draw triangle");
}
dsm_mem.push_back(".EndUnpack");
dsm_mem.push_back("");
dsm_mem.push_back("stcol 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000; We set garbage data to 1(float) so even if nothing is referenced game doesn't go crazy");
//TODO: Stop hardcode Header size(5type-line exist) and Vert/Array
//h3: 1 not because 1 value but 1 array of 4, padding needs to be
//checked!
dsm.close();
line=".int "+std::to_string(face_count*3)+", 4, "+std::to_string(4+(face_count*3)+vertex_count)+", "+std::to_string(int(4+(face_count*3)+vertex_count+ceil(float(bones.size())/4)))+"; Number of u+v+flag+index, their offset, offset of vertex affiliation header, offset of mat definition(end)";
dsm_mem[tmpheader]=line;
dsm_mem[tmpheader+1]=".int 0, 0, 0, 0; Nobody care about vertices merging and colors";
line=".int "+std::to_string(vertex_count)+", "+std::to_string(4+(face_count*3))+", 0, "+std::to_string(bones.size())+"; Number of vertices, their offset, reserved and number of array attribution";