metadata
Wenzel Jakob 2011-09-11 22:56:37 -04:00
commit 8fdda6fba0
9 changed files with 49 additions and 10 deletions

View File

@ -128,6 +128,12 @@
#define SIZE_T_FMT "%zd"
#endif
#if defined(__x86_64__) || defined(_M_X64) || defined(__LP64__) || defined(_LP64) || defined(WIN64)
#define __64BIT__
#else
#define __32BIT__
#endif
#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
#define __LITTLE_ENDIAN__ 1 // Little endian by default
#endif

View File

@ -96,6 +96,9 @@ public:
/// Turn into a string of the form "major.minor.release"
std::string toString() const;
/// Turn into a string of the form "major.minor.release (Architecture)"
std::string toStringComplete() const;
/// Return the major version
inline int getMajorVersion() const { return m_major; }

View File

@ -250,5 +250,27 @@ std::string Version::toString() const {
return formatString("%i.%i.%i", m_major, m_minor, m_release);
}
std::string Version::toStringComplete() const {
std::ostringstream oss;
oss << m_major << "." << m_minor << "." << m_release << " (";
#if defined(__WINDOWS__)
oss << "Windows, ";
#elif defined(__LINUX__)
oss << "Linux, ";
#elif defined(__OSX__)
oss << "Mac OS, ";
#else
oss << "Unknown, ";
#endif
#if defined(__64BIT__)
oss << "64 bit)";
#else
oss << "32 bit)";
#endif
return oss.str();
}
MTS_IMPLEMENT_CLASS(PluginManager, false, Object)
MTS_NAMESPACE_END

View File

@ -39,7 +39,8 @@
using namespace mitsuba;
void help() {
cout << "Mitsuba version " MTS_VERSION ", Copyright (c) " MTS_YEAR " Wenzel Jakob" << endl;
cout << "Mitsuba version " << Version(MTS_VERSION).toStringComplete()
<< ", Copyright (c) " MTS_YEAR " Wenzel Jakob" << endl;
cout << "Usage: mitsuba [options] <One or more scene XML files>" << endl;
cout << "Options/Arguments:" << endl;
cout << " -h Display this help text" << endl << endl;
@ -236,7 +237,8 @@ int mts_main(int argc, char **argv) {
if (!quietMode)
log->addAppender(new StreamAppender(&std::cout));
SLog(EInfo, "Mitsuba version " MTS_VERSION ", Copyright (c) " MTS_YEAR " Wenzel Jakob");
SLog(EInfo, "Mitsuba version %s, Copyright (c) " MTS_YEAR " Wenzel Jakob",
Version(MTS_VERSION).toStringComplete().c_str());
/* Configure the scheduling subsystem */
Scheduler *scheduler = Scheduler::getInstance();

View File

@ -157,7 +157,8 @@ int mts_main(int argc, char **argv) {
break;
case 'h':
default:
cout << "Mitsuba version " MTS_VERSION ", Copyright (c) " MTS_YEAR " Wenzel Jakob" << endl;
cout << "Mitsuba version " << Version(MTS_VERSION).toStringComplete()
<< ", Copyright (c) " MTS_YEAR " Wenzel Jakob" << endl;
cout << "Usage: mtssrv [options]" << endl;
cout << "Options/Arguments:" << endl;
cout << " -h Display this help text" << endl << endl;
@ -203,7 +204,8 @@ int mts_main(int argc, char **argv) {
if (!quietMode)
log->addAppender(new StreamAppender(&std::cout));
SLog(EInfo, "Mitsuba version " MTS_VERSION ", Copyright (c) " MTS_YEAR " Wenzel Jakob");
SLog(EInfo, "Mitsuba version %s, Copyright (c) " MTS_YEAR " Wenzel Jakob",
Version(MTS_VERSION).toStringComplete().c_str());
#if defined(WIN32)
/* Custom handler for Ctrl-C signals */

View File

@ -41,7 +41,8 @@
using namespace mitsuba;
void help() {
cout << "Mitsuba version " MTS_VERSION ", Copyright (c) " MTS_YEAR " Wenzel Jakob" << endl;
cout << "Mitsuba version " << Version(MTS_VERSION).toStringComplete()
<< ", Copyright (c) " MTS_YEAR " Wenzel Jakob" << endl;
cout << "Usage: mtsutil [mtsutil options] <utility name> [arguments]" << endl;
cout << "Options/Arguments:" << endl;
cout << " -h Display this help text" << endl << endl;
@ -209,7 +210,8 @@ int mtsutil(int argc, char **argv) {
if (!quietMode)
log->addAppender(new StreamAppender(&std::cout));
SLog(EInfo, "Mitsuba version " MTS_VERSION ", Copyright (c) " MTS_YEAR " Wenzel Jakob");
SLog(EInfo, "Mitsuba version %s, Copyright (c) " MTS_YEAR " Wenzel Jakob",
Version(MTS_VERSION).toStringComplete().c_str());
/* Configure the scheduling subsystem */
Scheduler *scheduler = Scheduler::getInstance();

View File

@ -75,7 +75,8 @@ MainWindow::MainWindow(QWidget *parent) :
connect(m_consoleAppender, SIGNAL(criticalError(const QString &)),
m_logWidget, SLOT(onCriticalError(const QString &)), Qt::QueuedConnection);
SLog(EInfo, "Mitsuba version " MTS_VERSION ", Copyright (c) " MTS_YEAR " Wenzel Jakob");
SLog(EInfo, "Mitsuba version %s, Copyright (c) " MTS_YEAR " Wenzel Jakob",
Version(MTS_VERSION).toStringComplete().c_str());
m_currentChild = NULL;
ui->setupUi(this);
@ -235,7 +236,7 @@ MainWindow::MainWindow(QWidget *parent) :
data.append(QString("Content-Disposition: form-data; name=\"bugreport\"; filename=\"%1\"\r\n").arg(file.fileName()));
data.append("Content-Type: application/octet-stream\r\n\r\n");
QString header = QString("Bug report from machine \"%1\", user \"%2\", filename \"%3\""
", Mitsuba version " MTS_VERSION).arg(getFQDN().c_str()).arg(username).arg(file.fileName());
", Mitsuba version %4").arg(getFQDN().c_str()).arg(username).arg(file.fileName()).arg(Version(MTS_VERSION).toStringComplete().c_str());
data.append(header + "\r\n");
for (int j=0; j<header.length(); j++)
data.append('=');

View File

@ -34,7 +34,8 @@ void ServerThread::shutdown() {
}
void ServerThread::run() {
SLog(EInfo, "Mitsuba version " MTS_VERSION ", Copyright (c) " MTS_YEAR " Wenzel Jakob");
SLog(EInfo, "Mitsuba version %s, Copyright (c) " MTS_YEAR " Wenzel Jakob",
Version(MTS_VERSION).toStringComplete().c_str());
/* Allocate a socket of the proper type (IPv4/IPv6) */
ref<Scheduler> scheduler = Scheduler::getInstance();
struct addrinfo hints, *servinfo, *p = NULL;

View File

@ -52,8 +52,8 @@ Instance::Instance(Stream *stream, InstanceManager *manager)
void Instance::serialize(Stream *stream, InstanceManager *manager) const {
Shape::serialize(stream, manager);
m_objectToWorld.serialize(stream);
manager->serialize(stream, m_shapeGroup.get());
m_objectToWorld.serialize(stream);
}
void Instance::configure() {