# HG changeset patch # User John Tsiombikas # Date 1400432327 -10800 # Node ID 21319e71117fe3772c162b5482386f48dfd1839d # Parent 07c0ec4a410d25903dcbc203a21c015af1716acc [libs] fixed a few warnings in openctm [goatview] starting animation loading diff -r 07c0ec4a410d -r 21319e71117f goatview/src/goatview.cc --- a/goatview/src/goatview.cc Sun May 18 06:20:20 2014 +0300 +++ b/goatview/src/goatview.cc Sun May 18 19:58:47 2014 +0300 @@ -233,12 +233,26 @@ statusBar()->showMessage("opening scene file"); if(!load_scene(fname.c_str())) { statusBar()->showMessage("failed to load scene file"); + return; } + statusBar()->showMessage("Successfully loaded scene: " + QString(fname)); } void GoatView::open_anim() { - statusBar()->showMessage("opening animation..."); + std::string fname = QFileDialog::getOpenFileName(this, "Open animation file", "", + "Goat3D Animation (*.goatanm);;All Files (*)").toStdString(); + if(fname.empty()) { + statusBar()->showMessage("Abot: No file selected!"); + return; + } + + statusBar()->showMessage("opening animation file"); + if(!load_anim(fname.c_str())) { + statusBar()->showMessage("failed to load animation file"); + return; + } + statusBar()->showMessage("Successfully loaded animation: " + QString(fname)); } diff -r 07c0ec4a410d -r 21319e71117f goatview/src/main.cc --- a/goatview/src/main.cc Sun May 18 06:20:20 2014 +0300 +++ b/goatview/src/main.cc Sun May 18 19:58:47 2014 +0300 @@ -16,7 +16,7 @@ argparse.addPositionalArgument("scene", "scene file to open"); argparse.addOption(QCommandLineOption("a", "add animation file")); - argparse.process(app); + argparse.parse(app.arguments()); const QStringList &args = argparse.positionalArguments(); if(!args.isEmpty()) { diff -r 07c0ec4a410d -r 21319e71117f libs/openctm/openctm.c --- a/libs/openctm/openctm.c Sun May 18 06:20:20 2014 +0300 +++ b/libs/openctm/openctm.c Sun May 18 19:58:47 2014 +0300 @@ -913,7 +913,7 @@ // Get length of string (if empty, do nothing) if(!aFileComment) return; - len = strlen(aFileComment); + len = (int)strlen(aFileComment); if(!len) return; @@ -1005,7 +1005,7 @@ if(aName) { // Get length of string (if empty, do nothing) - len = strlen(aName); + len = (CTMuint)strlen(aName); if(len) { // Copy the string @@ -1024,7 +1024,7 @@ if(aFileName) { // Get length of string (if empty, do nothing) - len = strlen(aFileName); + len = (CTMuint)strlen(aFileName); if(len) { // Copy the string diff -r 07c0ec4a410d -r 21319e71117f libs/openctm/stream.c --- a/libs/openctm/stream.c Sun May 18 06:20:20 2014 +0300 +++ b/libs/openctm/stream.c Sun May 18 19:58:47 2014 +0300 @@ -155,7 +155,7 @@ // Get string length if(aValue) - len = strlen(aValue); + len = (CTMuint)strlen(aValue); else len = 0; @@ -194,7 +194,7 @@ self->mError = CTM_OUT_OF_MEMORY; return CTM_FALSE; } - _ctmStreamRead(self, (void *) packed, packedSize); + _ctmStreamRead(self, (void *) packed, (CTMuint)packedSize); // Allocate memory for interleaved array tmp = (unsigned char *) malloc(aCount * aSize * 4); @@ -374,7 +374,7 @@ self->mError = CTM_OUT_OF_MEMORY; return CTM_FALSE; } - _ctmStreamRead(self, (void *) packed, packedSize); + _ctmStreamRead(self, (void *) packed, (CTMuint)packedSize); // Allocate memory for interleaved array tmp = (unsigned char *) malloc(aCount * aSize * 4); diff -r 07c0ec4a410d -r 21319e71117f src/goat3d_readxml.cc --- a/src/goat3d_readxml.cc Sun May 18 06:20:20 2014 +0300 +++ b/src/goat3d_readxml.cc Sun May 18 19:58:47 2014 +0300 @@ -175,7 +175,7 @@ static const char *read_material_attrib(MaterialAttrib *attr, XMLElement *xml_attr) { - const char *name; + const char *name = 0; XMLElement *elem; if((elem = xml_attr->FirstChildElement("name"))) {