Cleanings. Mostly indent fixes.

This commit is contained in:
Giulio Camuffo 2011-03-21 17:18:04 +01:00
parent f1420f4704
commit cff70f9fad
15 changed files with 57 additions and 64 deletions

View file

@ -108,6 +108,11 @@ Bitmap::Bitmap(const char *data, int w, int h, const char *fname) : Object() {
g_driver->createBitmap(this);
}
Bitmap::Bitmap() :
Object() {
_data = NULL;
}
void Bitmap::draw() const {
if (_currImage == 0)
return;

View file

@ -37,7 +37,7 @@ public:
// Construct a bitmap from the given data.
Bitmap(const char *filename, const char *data, int len);
Bitmap(const char *data, int width, int height, const char *filename);
Bitmap() : Object() { _data = 0; }
Bitmap();
const char *filename() const { return _fname.c_str(); }

View file

@ -1113,7 +1113,7 @@ void Costume::moveHead() {
if (v.isZero()) {
return;
}
// cout<<_lookAt.x()<<" "<<_lookAt.y()<<" "<<_lookAt.z()<<" "<<v.x()<<" "<<v.y()<<" "<<v.z()<<endl;
float magnitude = sqrt(v.x() * v.x() + v.y() * v.y());
float a = v.x() / magnitude;
float b = v.y() / magnitude;

View file

@ -75,8 +75,6 @@ TextObject::~TextObject() {
}
void TextObject::saveState(SaveGame *state) const {
// state->writeLESint32(_created);
state->writeColor(_fgColor);
state->writeLESint32(_x);
@ -96,8 +94,6 @@ void TextObject::saveState(SaveGame *state) const {
}
bool TextObject::restoreState(SaveGame *state) {
// _created = state->readLESint32();
_fgColor = state->readColor();
_x = state->readLESint32();

View file

@ -39,10 +39,7 @@ void Sector::saveState(SaveGame *savedState) const {
savedState->writeLESint32(_visible);
savedState->writeFloat(_height);
const char *str = _name.c_str();
int32 size = strlen(str);
savedState->writeLESint32(size);
savedState->write(str, size);
savedState->writeString(_name);
for (int i = 0; i < _numVertices + 1; ++i) {
savedState->writeVector3d(_vertices[i]);
@ -58,12 +55,7 @@ bool Sector::restoreState(SaveGame *savedState) {
_visible = savedState->readLESint32();
_height = savedState->readFloat();
int32 size = savedState->readLESint32();
char *str = new char[size+1];
savedState->read(str, size);
str[size]='\0';
_name = str;
delete[] str;
_name = savedState->readString();
_vertices = new Graphics::Vector3d[_numVertices + 1];
for (int i = 0; i < _numVertices + 1; ++i) {