From 3d77fd6a78ece6527581927fd36539e6180a4369 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Fri, 3 Nov 2017 00:54:47 +0300 Subject: Small fix of The DMX OP2 parser --- utils/gen_adldata/file_formats/load_op2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'utils/gen_adldata/file_formats') diff --git a/utils/gen_adldata/file_formats/load_op2.h b/utils/gen_adldata/file_formats/load_op2.h index 1e51563..94f61ed 100644 --- a/utils/gen_adldata/file_formats/load_op2.h +++ b/utils/gen_adldata/file_formats/load_op2.h @@ -82,14 +82,14 @@ static bool LoadDoom(const char *fn, unsigned bank, const char *prefix) int gmno = int(a < 128 ? a : ((a | 128) + 35)); char name2[512]; - sprintf(name2, "%s%c%u", prefix, (gmno < 128 ? 'M' : 'P'), gmno & 127); + std::snprintf(name2, 512, "%s%c%u", prefix, (gmno < 128 ? 'M' : 'P'), gmno & 127); Doom_opl_instr &ins = *(Doom_opl_instr *) &data[offset2]; - insdata tmp[2] = {InsertNoSoundIns(), InsertNoSoundIns()}; + insdata tmp[2] = {MakeNoSoundIns(), MakeNoSoundIns()}; tmp[0].diff = false; tmp[1].diff = true; - for(unsigned index = 0; index < 2; ++index) + for(size_t index = 0; index < 2; ++index) { const Doom_OPL2instrument &src = ins.patchdata[index]; tmp[index].data[0] = src.trem_vibr_1; @@ -116,7 +116,7 @@ static bool LoadDoom(const char *fn, unsigned bank, const char *prefix) tmp[1].finetune -= 12; } - if(!(ins.flags & 4)) + if(!(ins.flags & FL_DOUBLE_VOICE)) { size_t resno = InsertIns(tmp[0], tmp[0], tmp2, std::string(1, '\377') + name, name2); SetBank(bank, (unsigned int)gmno, resno); -- cgit v1.2.3