changes
This commit is contained in:
parent
f5743da6e8
commit
636a9921a2
|
@ -597,7 +597,7 @@ class DivEngine {
|
|||
bool loadDMF(unsigned char* file, size_t len);
|
||||
bool loadFur(unsigned char* file, size_t len, int variantID=0);
|
||||
bool loadMod(unsigned char* file, size_t len);
|
||||
bool loadS3M(unsigned char* file, size_t len, bool opl2=false);
|
||||
bool loadS3M(unsigned char* file, size_t len);
|
||||
bool loadXM(unsigned char* file, size_t len);
|
||||
bool loadIT(unsigned char* file, size_t len);
|
||||
bool loadFTM(unsigned char* file, size_t len, bool dnft, bool dnftSig, bool eft);
|
||||
|
@ -689,7 +689,7 @@ class DivEngine {
|
|||
void createNew(const char* description, String sysName, bool inBase64=true);
|
||||
void createNewFromDefaults();
|
||||
// load a file.
|
||||
bool load(unsigned char* f, size_t length, const char* nameHint=NULL, bool s3mOPL2=false);
|
||||
bool load(unsigned char* f, size_t length, const char* nameHint=NULL);
|
||||
// play a binary command stream.
|
||||
bool playStream(unsigned char* f, size_t length);
|
||||
// get the playing stream.
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include "fileOpsCommon.h"
|
||||
|
||||
bool DivEngine::load(unsigned char* f, size_t slen, const char* nameHint, bool s3mOPL2) {
|
||||
bool DivEngine::load(unsigned char* f, size_t slen, const char* nameHint) {
|
||||
unsigned char* file;
|
||||
size_t len;
|
||||
if (slen<21) {
|
||||
|
@ -158,7 +158,7 @@ bool DivEngine::load(unsigned char* f, size_t slen, const char* nameHint, bool s
|
|||
return loadIT(file,len);
|
||||
} else if (len>=48) {
|
||||
if (memcmp(&file[0x2c],DIV_S3M_MAGIC,4)==0) {
|
||||
return loadS3M(file,len,s3mOPL2);
|
||||
return loadS3M(file,len);
|
||||
} else if (memcmp(file,DIV_XM_MAGIC,17)==0) {
|
||||
return loadXM(file,len);
|
||||
}
|
||||
|
|
|
@ -48,9 +48,10 @@ static void readSbiOpData(sbi_t& sbi, SafeReader& reader) {
|
|||
sbi.FeedConnect = reader.readC();
|
||||
}
|
||||
|
||||
bool DivEngine::loadS3M(unsigned char* file, size_t len, bool opl2) {
|
||||
bool DivEngine::loadS3M(unsigned char* file, size_t len) {
|
||||
struct InvalidHeaderException {};
|
||||
bool success=false;
|
||||
bool opl2=!getConfInt("s3mOPL3",0);
|
||||
char magic[4]={0,0,0,0};
|
||||
SafeReader reader=SafeReader(file,len);
|
||||
warnings="";
|
||||
|
|
|
@ -2417,7 +2417,7 @@ int FurnaceGUI::load(String path) {
|
|||
return 1;
|
||||
}
|
||||
fclose(f);
|
||||
if (!e->load(file,(size_t)len,path.c_str(),settings.OPL2s3mImport)) {
|
||||
if (!e->load(file,(size_t)len,path.c_str())) {
|
||||
lastError=e->getLastError();
|
||||
logE("could not open file!");
|
||||
return 1;
|
||||
|
@ -4110,7 +4110,7 @@ bool FurnaceGUI::loop() {
|
|||
if (!tutorial.introPlayed || settings.alwaysPlayIntro==3 || (settings.alwaysPlayIntro==2 && curFileName.empty())) {
|
||||
unsigned char* introTemp=new unsigned char[intro_fur_len];
|
||||
memcpy(introTemp,intro_fur,intro_fur_len);
|
||||
e->load(introTemp,intro_fur_len,NULL,settings.OPL2s3mImport);
|
||||
e->load(introTemp,intro_fur_len);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1958,7 +1958,7 @@ class FurnaceGUI {
|
|||
unsigned int maxUndoSteps;
|
||||
float vibrationStrength;
|
||||
int vibrationLength;
|
||||
bool OPL2s3mImport;
|
||||
int s3mOPL3;
|
||||
String mainFontPath;
|
||||
String headFontPath;
|
||||
String patFontPath;
|
||||
|
@ -2215,7 +2215,7 @@ class FurnaceGUI {
|
|||
maxUndoSteps(100),
|
||||
vibrationStrength(0.5f),
|
||||
vibrationLength(20),
|
||||
OPL2s3mImport(false),
|
||||
s3mOPL3(0),
|
||||
mainFontPath(""),
|
||||
headFontPath(""),
|
||||
patFontPath(""),
|
||||
|
|
|
@ -1254,11 +1254,11 @@ void FurnaceGUI::drawSettings() {
|
|||
}
|
||||
popDestColor();
|
||||
|
||||
// SUBSECTION CONFIGURATION
|
||||
CONFIG_SUBSECTION(_("Modules import"));
|
||||
bool s3mOPL2B=settings.OPL2s3mImport;
|
||||
if (ImGui::Checkbox(_("Use OPL2 instead of OPL3 for .s3m modules import"),&s3mOPL2B)) {
|
||||
settings.OPL2s3mImport=s3mOPL2B;
|
||||
// SUBSECTION IMPORT
|
||||
CONFIG_SUBSECTION(_("Import"));
|
||||
bool s3mOPL3B=settings.s3mOPL3;
|
||||
if (ImGui::Checkbox(_("Use OPL3 instead of OPL2 for S3M import"),&s3mOPL3B)) {
|
||||
settings.s3mOPL3=s3mOPL3B;
|
||||
settingsChanged=true;
|
||||
}
|
||||
|
||||
|
@ -4754,7 +4754,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
|||
settings.vibrationStrength=conf.getFloat("vibrationStrength",0.5f);
|
||||
settings.vibrationLength=conf.getInt("vibrationLength",20);
|
||||
|
||||
settings.OPL2s3mImport=conf.getBool("OPL2s3mImport",false);
|
||||
settings.s3mOPL3=conf.getInt("s3mOPL3",0);
|
||||
|
||||
settings.backupEnable=conf.getInt("backupEnable",1);
|
||||
settings.backupInterval=conf.getInt("backupInterval",30);
|
||||
|
@ -5268,6 +5268,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
|||
clampSetting(settings.backupMaxCopies,1,100);
|
||||
clampSetting(settings.autoFillSave,0,1);
|
||||
clampSetting(settings.autoMacroStepSize,0,1);
|
||||
clampSetting(settings.s3mOPL3,0,1);
|
||||
|
||||
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
|
||||
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
|
||||
|
@ -5341,7 +5342,7 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
|||
conf.set("vibrationStrength",settings.vibrationStrength);
|
||||
conf.set("vibrationLength",settings.vibrationLength);
|
||||
|
||||
conf.set("OPL2s3mImport",settings.OPL2s3mImport);
|
||||
conf.set("s3mOPL3",settings.s3mOPL3);
|
||||
|
||||
conf.set("backupEnable",settings.backupEnable);
|
||||
conf.set("backupInterval",settings.backupInterval);
|
||||
|
|
Loading…
Reference in a new issue