fix float output

This commit is contained in:
xensik 2021-05-13 18:58:28 +02:00
parent 3cc43c7ae9
commit 7fd69dc70c
7 changed files with 28 additions and 7 deletions

View File

@ -169,7 +169,10 @@ void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst)
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>())); inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
break; break;
case opcode::OP_GetFloat: case opcode::OP_GetFloat:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); {
auto val = script_->read<float>();
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
}
break; break;
case opcode::OP_GetVector: case opcode::OP_GetVector:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); inst->data.push_back(utils::string::va("%g", script_->read<float>()));

View File

@ -169,7 +169,10 @@ void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst)
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>())); inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
break; break;
case opcode::OP_GetFloat: case opcode::OP_GetFloat:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); {
auto val = script_->read<float>();
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
}
break; break;
case opcode::OP_GetVector: case opcode::OP_GetVector:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); inst->data.push_back(utils::string::va("%g", script_->read<float>()));

View File

@ -165,7 +165,10 @@ void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst)
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>())); inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
break; break;
case opcode::OP_GetFloat: case opcode::OP_GetFloat:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); {
auto val = script_->read<float>();
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
}
break; break;
case opcode::OP_GetVector: case opcode::OP_GetVector:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); inst->data.push_back(utils::string::va("%g", script_->read<float>()));

View File

@ -167,7 +167,10 @@ void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst)
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>())); inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
break; break;
case opcode::OP_GetFloat: case opcode::OP_GetFloat:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); {
auto val = script_->read<float>();
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
}
break; break;
case opcode::OP_GetVector: case opcode::OP_GetVector:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); inst->data.push_back(utils::string::va("%g", script_->read<float>()));

View File

@ -167,7 +167,10 @@ void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst)
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>())); inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
break; break;
case opcode::OP_GetFloat: case opcode::OP_GetFloat:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); {
auto val = script_->read<float>();
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
}
break; break;
case opcode::OP_GetVector: case opcode::OP_GetVector:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); inst->data.push_back(utils::string::va("%g", script_->read<float>()));

View File

@ -168,7 +168,10 @@ void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst)
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>())); inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
break; break;
case opcode::OP_GetFloat: case opcode::OP_GetFloat:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); {
auto val = script_->read<float>();
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
}
break; break;
case opcode::OP_GetVector: case opcode::OP_GetVector:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); inst->data.push_back(utils::string::va("%g", script_->read<float>()));

View File

@ -169,7 +169,10 @@ void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst)
inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>())); inst->data.push_back(utils::string::va("%i", script_->read<std::int32_t>()));
break; break;
case opcode::OP_GetFloat: case opcode::OP_GetFloat:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); {
auto val = script_->read<float>();
inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : ""));
}
break; break;
case opcode::OP_GetVector: case opcode::OP_GetVector:
inst->data.push_back(utils::string::va("%g", script_->read<float>())); inst->data.push_back(utils::string::va("%g", script_->read<float>()));