Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Making mod loader actually work.
  • Loading branch information
MainMemory committed Apr 28, 2015
1 parent f00edae commit 4319de7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions SKCModLoader/SKCModLoader.h
Expand Up @@ -249,10 +249,10 @@ struct PLC

struct LoadBlock
{
uint8_t PLC1, PLC2;
uint16_t PLC1, PLC2;
const void *TilesPrimary;
const void *TilesSecondary;
uint8_t Pal1, Pal2;
uint16_t Pal1, Pal2;
const void *BlocksPrimary;
const void *BlocksSecondary;
const void *ChunksPrimary;
Expand Down
8 changes: 5 additions & 3 deletions SKCModLoader/dllmain.cpp
Expand Up @@ -314,8 +314,8 @@ static void ProcessLevelINI(const IniGroup *group, const wstring &mod_dir)
LoadBlock *lb = &LevelLoadBlock[li];
if (group->hasKeyNonEmpty("plc1"))
{
lb->PLC1 = (uint8_t)group->getIntRadix("plc1", 16);
lb->PLC2 = (uint8_t)group->getIntRadix("plc2", 16, lb->PLC1);
lb->PLC1 = (uint16_t)group->getIntRadix("plc1", 16);
lb->PLC2 = (uint16_t)group->getIntRadix("plc2", 16, lb->PLC1);
}
if (group->hasKeyNonEmpty("tiles1"))
{
Expand Down Expand Up @@ -650,15 +650,17 @@ extern "C" __declspec(dllexport) void *GetMidiInterface()
{
HMODULE midimodule = LoadLibrary(_T("MIDIOUT_orig.DLL"));
if (midimodule)
{
InitMods();
return ((void *(*)())GetProcAddress(midimodule, "GetMidiInterface"))();
}
else
{
MessageBox(NULL, L"MIDIOUT_orig.dll could not be loaded!\n\n"
L"S&KC will now proceed to abruptly exit.",
L"S&KC Mod Loader", MB_ICONERROR);
ExitProcess(1);
}
InitMods();
}

/**
Expand Down

0 comments on commit 4319de7

Please sign in to comment.