mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 12:11:25 +00:00
- use FileWriter for 'writemidi' CCMD.
This commit is contained in:
parent
1af42b3d50
commit
8d26760671
1 changed files with 3 additions and 4 deletions
|
@ -803,18 +803,17 @@ CCMD (writemidi)
|
|||
}
|
||||
|
||||
TArray<uint8_t> midi;
|
||||
FILE *f;
|
||||
bool success;
|
||||
|
||||
static_cast<MIDIStreamer *>(currSong)->CreateSMF(midi, 1);
|
||||
f = fopen(argv[1], "wb");
|
||||
auto f = FileWriter::Open(argv[1]);
|
||||
if (f == NULL)
|
||||
{
|
||||
Printf("Could not open %s.\n", argv[1]);
|
||||
return;
|
||||
}
|
||||
success = (fwrite(&midi[0], 1, midi.Size(), f) == (size_t)midi.Size());
|
||||
fclose (f);
|
||||
success = (f->Write(&midi[0], midi.Size()) == (size_t)midi.Size());
|
||||
delete f;
|
||||
|
||||
if (!success)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue