Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- class MODSampleData {
- private:
- int Tune;
- int Volume;
- } MODSampleData;
- class MODSample {
- private:
- char SampleName [23];
- int SampleLength;
- MODSampleData * SampleData;
- } MODSample;
- class MODFile {
- private:
- char MODName [21];
- char Filepath;
- int ChannelCount;
- int SampleCount;
- int PatternCount;
- int PatternSequence [128];
- int SongLength;
- MODSample Samples [31];
- public:
- MODFile();
- void LoadFile(char fpath) {
- int i;
- Filepath = fpath;
- fstream myMOD;
- myMOD.open(&fpath, ios::in | ios::binary);
- //read in song name
- myMOD.read(MODName, 20);
- MODName[20] = '\0';
- //read in all 31 samples
- //samples are a class MODSample (see below)
- for (i = 0; i < 31; i++) {
- myMOD.read(Samples[0].SampleName, 22);
- Samples[0].SampleName[22] = '\0';
- };
- };
- } MODFile;
- 1>------ Build started: Project: MODFile, Configuration: Debug Win32 ------
- 1> mod.cpp
- 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(15): error C2143: syntax error : missing ';' before '*'
- 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
- 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
- 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(28): error C2146: syntax error : missing ';' before identifier 'Samples'
- 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(28): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
- 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(28): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
- 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(42): error C2065: 'Samples' : undeclared identifier
- 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(42): error C2228: left of '.SampleName' must have class/struct/union
- 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(43): error C2065: 'Samples' : undeclared identifier
- 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(43): error C2228: left of '.SampleName' must have class/struct/union
- ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement