port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

56
evoke-64k/ev10/music.h Normal file
View File

@@ -0,0 +1,56 @@
#pragma once
#ifdef EXTRACODE
#include <fstream>
#endif
#ifdef MUSICLOAD
#include "defines.h"
#include <stdio.h>
#include <windows.h>
unsigned char pLoadSong[ 65536 * 8 ];
bool loadMusic()
{
OFSTRUCT File;
HFILE file= OpenFile( "song/song.v2m",
&File, //&fileInfo,
OF_READ );
HANDLE handle= (HANDLE)file;
if( handle == NULL )
{
return false;
}
DWORD dwRead;
BOOL bRead= ReadFile( handle,
pLoadSong,
65536 * 8,
&dwRead,
NULL );
#ifdef CREATE_HEADER
std::ofstream ofs( "musicdata.h" );
ofs << "static unsigned char pSong[]= " << "\n";
ofs << "{\n";
if( dwRead > 0 )
{
unsigned char* pData= (unsigned char*)&(pLoadSong);
for( int j= 0; j < (int)dwRead; ++j )
{
char pcSpecial[ 1024 ];
sprintf_s( pcSpecial,
1024,
"\t%d,\n",
(int)pData[ j ] );
ofs << pcSpecial;
}
}
ofs << "};\n";
ofs << "\n";
#endif
return true;
}
#endif