Skip to content

adjust missing NO_PACKING and MODPLUG_NO_FILESAVE ifdefs: #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/libmodplug/sndfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -666,14 +666,16 @@ class MODPLUG_EXPORT CSoundFile
BOOL SaveS3M(LPCSTR lpszFileName, UINT nPacking=0);
BOOL SaveMod(LPCSTR lpszFileName, UINT nPacking=0);
BOOL SaveIT(LPCSTR lpszFileName, UINT nPacking=0);
#endif // MODPLUG_NO_FILESAVE
// MOD Convert function
UINT GetBestSaveFormat() const;
UINT GetSaveFormats() const;
#endif
// MOD Convert function
void ConvertModCommand(MODCOMMAND *) const;
void S3MConvert(MODCOMMAND *m, BOOL bIT) const;
#ifndef MODPLUG_NO_FILESAVE
void S3MSaveConvert(UINT *pcmd, UINT *pprm, BOOL bIT) const;
WORD ModSaveCommand(const MODCOMMAND *m, BOOL bXM) const;
#endif

public:
// Real-time sound functions
Expand Down Expand Up @@ -759,8 +761,11 @@ class MODPLUG_EXPORT CSoundFile
BOOL IsValidBackwardJump(UINT nStartOrder, UINT nStartRow, UINT nJumpOrder, UINT nJumpRow) const;
// Read/Write sample functions
signed char GetDeltaValue(signed char prev, UINT n) const { return (signed char)(prev + CompressionTable[n & 0x0F]); }
#if !(defined(MODPLUG_NO_FILESAVE)||defined(NO_PACKING))
UINT PackSample(int &sample, int next);
BOOL CanPackSample(LPSTR pSample, UINT nLen, UINT nPacking, BYTE *result=NULL);
#endif // NO_FILESAVE, NO_PACKING

UINT ReadSample(MODINSTRUMENT *pIns, UINT nFlags, LPCSTR pMemFile, DWORD dwMemLength);
BOOL DestroySample(UINT nSample);
BOOL DestroyInstrument(UINT nInstr);
Expand Down
2 changes: 2 additions & 0 deletions src/libmodplug/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/* disable AGC and FILESAVE for all targets for uniformity. */
#define NO_AGC
#define MODPLUG_NO_FILESAVE
/*#define NO_PACKING*/
/*#define NO_FILTER */

#ifdef _WIN32

Expand Down
2 changes: 2 additions & 0 deletions src/load_mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ void CSoundFile::ConvertModCommand(MODCOMMAND *m) const
}


#ifndef MODPLUG_NO_FILESAVE
WORD CSoundFile::ModSaveCommand(const MODCOMMAND *m, BOOL bXM) const
//------------------------------------------------------------------
{
Expand Down Expand Up @@ -144,6 +145,7 @@ WORD CSoundFile::ModSaveCommand(const MODCOMMAND *m, BOOL bXM) const
}
return (WORD)((command << 8) | (param));
}
#endif // MODPLUG_NO_FILESAVE


#pragma pack(1)
Expand Down
2 changes: 2 additions & 0 deletions src/load_s3m.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void CSoundFile::S3MConvert(MODCOMMAND *m, BOOL bIT) const
}


#ifndef MODPLUG_NO_FILESAVE
void CSoundFile::S3MSaveConvert(UINT *pcmd, UINT *pprm, BOOL bIT) const
//---------------------------------------------------------------------
{
Expand Down Expand Up @@ -182,6 +183,7 @@ void CSoundFile::S3MSaveConvert(UINT *pcmd, UINT *pprm, BOOL bIT) const
*pcmd = command;
*pprm = param;
}
#endif // MODPLUG_NO_FILESAVE

static DWORD boundInput(DWORD input, DWORD smin, DWORD smax)
{
Expand Down
7 changes: 4 additions & 3 deletions src/sndfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ void CSoundFile::LoopPattern(int nPat, int nRow)
}


#ifndef MODPLUG_NO_FILESAVE
UINT CSoundFile::GetBestSaveFormat() const
//----------------------------------------
{
Expand All @@ -764,7 +765,6 @@ UINT CSoundFile::GetBestSaveFormat() const
return MOD_TYPE_IT;
}


UINT CSoundFile::GetSaveFormats() const
//-------------------------------------
{
Expand All @@ -783,6 +783,7 @@ UINT CSoundFile::GetSaveFormats() const
}
return n;
}
#endif // MODPLUG_NO_FILESAVE


UINT CSoundFile::GetSampleName(UINT nSample,LPSTR s) const
Expand Down Expand Up @@ -814,6 +815,8 @@ UINT CSoundFile::GetInstrumentName(UINT nInstr,LPSTR s) const
}


#ifndef MODPLUG_NO_FILESAVE

#ifndef NO_PACKING
UINT CSoundFile::PackSample(int &sample, int next)
//------------------------------------------------
Expand Down Expand Up @@ -874,8 +877,6 @@ BOOL CSoundFile::CanPackSample(LPSTR pSample, UINT nLen, UINT nPacking, BYTE *re
}
#endif // NO_PACKING

#ifndef MODPLUG_NO_FILESAVE

UINT CSoundFile::WriteSample(FILE *f, MODINSTRUMENT *pins, UINT nFlags, UINT nMaxLen)
//-----------------------------------------------------------------------------------
{
Expand Down