TITANIC: Further star control class stubs

This commit is contained in:
Paul Gilbert 2016-07-13 20:33:39 -04:00
parent 7b331771ca
commit ce7e2c80d6
15 changed files with 732 additions and 0 deletions

View File

@ -432,6 +432,13 @@ MODULE_OBJS := \
star_control/star_control_sub13.o \
star_control/star_control_sub14.o \
star_control/star_control_sub15.o \
star_control/star_control_sub20.o \
star_control/star_control_sub21.o \
star_control/star_control_sub22.o \
star_control/star_control_sub23.o \
star_control/star_control_sub24.o \
star_control/star_control_sub25.o \
star_control/star_control_sub26.o \
star_control/surface_area.o \
star_control/surface_fader_base.o \
star_control/surface_fader.o \

View File

@ -0,0 +1,144 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "titanic/star_control/star_control_sub20.h"
#include "common/textconsole.h"
namespace Titanic {
CStarControlSub20::CStarControlSub20(void *src) {
_lockCounter = 0;
_dataP = nullptr;
if (src) {
copyFrom1(src);
} else {
_field4 = 0.0;
_field8 = 0.0;
_fieldC = 20.0;
_field10 = 0.0;
_field14 = 50000.0;
_field18 = 1.0;
_field1C = 1.0;
_field20 = 0.0;
}
}
CStarControlSub20::~CStarControlSub20() {
clear();
}
void CStarControlSub20::copyFrom1(void *src) {
error("TODO: CStarControlSub20::copyFrom1");
}
void CStarControlSub20::copyFrom2(void *src) {
error("TODO: CStarControlSub20::copyFrom2");
}
void CStarControlSub20::proc4() {
if (!isLocked() && _field4 < _field14) {
_field8 += _field4;
if (_fieldC == _field8)
_field4 -= _field8;
else
_field4 += _field8;
}
}
void CStarControlSub20::proc5() {
if (!isLocked()) {
_field8 -= _fieldC;
if (_field8 == _field4)
_field4 += _field8;
else
_field4 -= _field8;
if (_field8 < 0.0)
_field8 = 0.0;
}
}
void CStarControlSub20::proc6() {
if (!isLocked())
_field4 = _field14;
}
void CStarControlSub20::proc7() {
if (!isLocked()) {
_field4 = 0.0;
_field8 = 0.0;
}
}
void CStarControlSub20::proc11(CErrorCode *errorCode, void *v2, void *v3) {
if (_field4 > 0.0) {
warning("TODO: CStarControlSub20::proc11");
}
}
void CStarControlSub20::setData(void *data) {
clear();
_dataP = data;
}
void CStarControlSub20::clear() {
if (_dataP) {
delete _dataP;
_dataP = nullptr;
}
}
void CStarControlSub20::load(SimpleFile *file, int val) {
if (!val) {
_field4 = file->readFloat();
_field8 = file->readFloat();
_fieldC = file->readFloat();
_field10 = file->readFloat();
_field14 = file->readFloat();
_field18 = file->readFloat();
_field1C = file->readFloat();
_field20 = file->readFloat();
}
}
void CStarControlSub20::save(SimpleFile *file, int indent) {
file->writeFloatLine(_field4, indent);
file->writeFloatLine(_field8, indent);
file->writeFloatLine(_fieldC, indent);
file->writeFloatLine(_field10, indent);
file->writeFloatLine(_field14, indent);
file->writeFloatLine(_field18, indent);
file->writeFloatLine(_field1C, indent);
file->writeFloatLine(_field20, indent);
}
void CStarControlSub20::incLockCount() {
++_lockCounter;
}
void CStarControlSub20::decLockCount() {
if (_lockCounter > 0)
--_lockCounter;
}
} // End of namespace Titanic

View File

@ -0,0 +1,96 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_STAR_CONTROL_SUB20_H
#define TITANIC_STAR_CONTROL_SUB20_H
#include "titanic/support/simple_file.h"
#include "titanic/star_control/error_code.h"
namespace Titanic {
class CStarControlSub20 {
public:
double _field4;
double _field8;
double _fieldC;
double _field10;
double _field14;
double _field18;
double _field1C;
double _field20;
int _lockCounter;
void *_dataP;
public:
CStarControlSub20(void *src);
virtual ~CStarControlSub20();
virtual void copyFrom1(void *src);
virtual void copyFrom2(void *src);
virtual void proc4();
virtual void proc5();
virtual void proc6();
virtual void proc7();
virtual void proc8() {}
virtual void proc9() {}
virtual void proc10() {}
virtual void proc11(CErrorCode *errorCode, void *v2, void *v3);
/**
* Set the data
*/
virtual void setData(void *data);
/**
* Clear the class
*/
virtual void clear();
/**
* Load the class
*/
virtual void load(SimpleFile *file, int val = 0);
/**
* Save the class
*/
virtual void save(SimpleFile *file, int indent);
/**
* Increment tthe lock counter
*/
void incLockCount();
/**
* Decrement the lock counter
*/
void decLockCount();
/**
* Returns true if the lock counter is non-zero
*/
bool isLocked() const { return _lockCounter > 0; }
};
} // End of namespace Titanic
#endif /* TITANIC_STAR_CONTROL_SUB20_H */

View File

@ -0,0 +1,144 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "titanic/star_control/star_control_sub20.h"
#include "common/textconsole.h"
namespace Titanic {
CStarControlSub20::CStarControlSub20(void *src) {
_lockCounter = 0;
_dataP = nullptr;
if (src) {
copyFrom1(src);
} else {
_field4 = 0.0;
_field8 = 0.0;
_fieldC = 20.0;
_field10 = 0.0;
_field14 = 50000.0;
_field18 = 1.0;
_field1C = 1.0;
_field20 = 0.0;
}
}
CStarControlSub20::~CStarControlSub20() {
clear();
}
void CStarControlSub20::copyFrom1(void *src) {
error("TODO: CStarControlSub20::copyFrom1");
}
void CStarControlSub20::copyFrom2(void *src) {
error("TODO: CStarControlSub20::copyFrom2");
}
void CStarControlSub20::proc4() {
if (!isLocked() && _field4 < _field14) {
_field8 += _field4;
if (_fieldC == _field8)
_field4 -= _field8;
else
_field4 += _field8;
}
}
void CStarControlSub20::proc5() {
if (!isLocked()) {
_field8 -= _fieldC;
if (_field8 == _field4)
_field4 += _field8;
else
_field4 -= _field8;
if (_field8 < 0.0)
_field8 = 0.0;
}
}
void CStarControlSub20::proc6() {
if (!isLocked())
_field4 = _field14;
}
void CStarControlSub20::proc7() {
if (!isLocked()) {
_field4 = 0.0;
_field8 = 0.0;
}
}
void CStarControlSub20::proc11(CErrorCode *errorCode, void *v2, void *v3) {
if (_field4 > 0.0) {
warning("TODO: CStarControlSub20::proc11");
}
}
void CStarControlSub20::setData(void *data) {
clear();
_dataP = data;
}
void CStarControlSub20::clear() {
if (_dataP) {
delete _dataP;
_dataP = nullptr;
}
}
void CStarControlSub20::load(SimpleFile *file, int val) {
if (!val) {
_field4 = file->readFloat();
_field8 = file->readFloat();
_fieldC = file->readFloat();
_field10 = file->readFloat();
_field14 = file->readFloat();
_field18 = file->readFloat();
_field1C = file->readFloat();
_field20 = file->readFloat();
}
}
void CStarControlSub20::save(SimpleFile *file, int indent) {
file->writeFloatLine(_field4, indent);
file->writeFloatLine(_field8, indent);
file->writeFloatLine(_fieldC, indent);
file->writeFloatLine(_field10, indent);
file->writeFloatLine(_field14, indent);
file->writeFloatLine(_field18, indent);
file->writeFloatLine(_field1C, indent);
file->writeFloatLine(_field20, indent);
}
void CStarControlSub20::incLockCount() {
++_lockCounter;
}
void CStarControlSub20::decLockCount() {
if (_lockCounter > 0)
--_lockCounter;
}
} // End of namespace Titanic

View File

@ -0,0 +1,35 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_STAR_CONTROL_SUB21_H
#define TITANIC_STAR_CONTROL_SUB21_H
#include "titanic/star_control/star_control_sub20.h"
namespace Titanic {
class CStarControlSub21 : public CStarControlSub20 {
};
} // End of namespace Titanic
#endif /* TITANIC_STAR_CONTROL_SUB21_H */

View File

@ -0,0 +1,28 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "titanic/star_control/star_control_sub22.h"
#include "common/textconsole.h"
namespace Titanic {
} // End of namespace Titanic

View File

@ -0,0 +1,33 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_STAR_CONTROL_SUB22_H
#define TITANIC_STAR_CONTROL_SUB22_H
namespace Titanic {
class CStarControlSub22 {
};
} // End of namespace Titanic
#endif /* TITANIC_STAR_CONTROL_SUB22_H */

View File

@ -0,0 +1,28 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "titanic/star_control/star_control_sub23.h"
#include "common/textconsole.h"
namespace Titanic {
} // End of namespace Titanic

View File

@ -0,0 +1,33 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_STAR_CONTROL_SUB23_H
#define TITANIC_STAR_CONTROL_SUB23_H
namespace Titanic {
class CStarControlSub23 {
};
} // End of namespace Titanic
#endif /* TITANIC_STAR_CONTROL_SUB23_H */

View File

@ -0,0 +1,29 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "titanic/star_control/star_control_sub24.h"
#include "common/textconsole.h"
namespace Titanic {
} // End of namespace Titanic

View File

@ -0,0 +1,33 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_STAR_CONTROL_SUB24_H
#define TITANIC_STAR_CONTROL_SUB24_H
namespace Titanic {
class CStarControlSub24 {
};
} // End of namespace Titanic
#endif /* TITANIC_STAR_CONTROL_SUB24_H */

View File

@ -0,0 +1,28 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "titanic/star_control/star_control_sub25.h"
#include "common/textconsole.h"
namespace Titanic {
} // End of namespace Titanic

View File

@ -0,0 +1,33 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_STAR_CONTROL_SUB25_H
#define TITANIC_STAR_CONTROL_SUB25_H
namespace Titanic {
class CStarControlSub25 {
};
} // End of namespace Titanic
#endif /* TITANIC_STAR_CONTROL_SUB25_H */

View File

@ -0,0 +1,28 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "titanic/star_control/star_control_sub26.h"
#include "common/textconsole.h"
namespace Titanic {
} // End of namespace Titanic

View File

@ -0,0 +1,33 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_STAR_CONTROL_SUB26_H
#define TITANIC_STAR_CONTROL_SUB26_H
namespace Titanic {
class CStarControlSub26 {
};
} // End of namespace Titanic
#endif /* TITANIC_STAR_CONTROL_SUB26_H */