ldtypes.cpp

Sat, 16 Mar 2013 01:32:47 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sat, 16 Mar 2013 01:32:47 +0200
changeset 13
3955ff2a7d72
parent 11
323390a03294
child 14
6d9d8efae2f8
permissions
-rw-r--r--

Added logf function to write to message log. Write warnings of unparsable files into the message log.

#include "common.h"
#include "ldtypes.h"
#include "io.h"

const char* g_saObjTypeNames[] = {
	"unidentified",
	"unknown",
	"empty",
	"comment",
	"subfile",
	"line",
	"triangle",
	"quadrilateral",
	"condline",
	"vector",
	"vertex",
};

// =============================================================================
// LDObject constructors
LDObject::LDObject () {
	
}

LDGibberish::LDGibberish () {
	
}

LDGibberish::LDGibberish (str _zContent, str _zReason) {
	zContent = _zContent;
	zReason = _zReason;
}

LDEmpty::LDEmpty () {
	
}

LDComment::LDComment () {
	
}

LDSubfile::LDSubfile () {
	
}

LDLine::LDLine () {
	
}

LDTriangle::LDTriangle () {
	
}

LDQuad::LDQuad () {
	
}

LDCondLine::LDCondLine () {
	
}

LDVector::LDVector () {
	
}

LDVertex::LDVertex () {
	
}

ulong LDObject::getIndex () {
	if (!g_CurrentFile)
		return -1u;
	
	// TODO: shouldn't rely on g_CurrentFile
	for (ulong i = 0; i < g_CurrentFile->objects.size(); ++i) {
		if (g_CurrentFile->objects[i] == this)
			return i;
	}
	
	return -1u;
}

mercurial