Fix: Use ASCII treeview in assimp-cmd.

pull/4728/head
Kim Kulling 2022-09-16 21:55:14 +02:00
parent 7be7e5d93e
commit e4c77aa4fa
6 changed files with 19 additions and 23 deletions

View File

@ -75,15 +75,10 @@ static const aiImporterDesc desc = {
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
XFileImporter::XFileImporter()
: mBuffer() {
XFileImporter::XFileImporter() : mBuffer() {
// empty
}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
XFileImporter::~XFileImporter() = default;
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
bool XFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool /*checkSig*/) const {

View File

@ -69,7 +69,7 @@ namespace XFile {
class XFileImporter : public BaseImporter {
public:
XFileImporter();
~XFileImporter() override;
~XFileImporter() override = default;
// -------------------------------------------------------------------
/** Returns whether the class can handle the format of the given file.

View File

@ -42,9 +42,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
#include <zlib.h>
# include <zlib.h>
#else
#include "../contrib/zlib/zlib.h"
# include "../contrib/zlib/zlib.h"
#endif
#include <vector>

View File

@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2022, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
@ -68,9 +66,15 @@ const char *TREE_CONTINUE_UTF8 = "\xe2\x94\x82 ";
// this is well supported on pretty much any linux terminal.
// if this causes problems on some platform,
// put an #ifdef to use the ascii version for that platform.
#ifdef _WIN32
const char *TREE_BRANCH = TREE_BRANCH_ASCII;
const char *TREE_STOP = TREE_STOP_ASCII;
const char *TREE_CONTINUE = TREE_CONTINUE_ASCII;
#else
const char *TREE_BRANCH = TREE_BRANCH_UTF8;
const char *TREE_STOP = TREE_STOP_UTF8;
const char *TREE_CONTINUE = TREE_CONTINUE_UTF8;
#endif
// -----------------------------------------------------------------------------------
unsigned int CountNodes(const aiNode *root) {

View File

@ -58,11 +58,12 @@ public:
~ConsoleProgressHandler() override = default;
bool Update(float percentage) override {
std::cout << percentage * 100.0f << " %\n";
std::cout << "\r" << percentage * 100.0f << " %";
return true;
}
};
const char* AICMD_MSG_ABOUT =
constexpr char AICMD_MSG_ABOUT[] =
"------------------------------------------------------ \n"
"Open Asset Import Library (\"Assimp\", https://github.com/assimp/assimp) \n"
" -- Commandline toolchain --\n"
@ -70,7 +71,7 @@ const char* AICMD_MSG_ABOUT =
"Version %i.%i %s%s%s%s%s(GIT commit %x)\n\n";
const char* AICMD_MSG_HELP =
constexpr char AICMD_MSG_HELP[] =
"assimp <verb> <parameters>\n\n"
" verbs:\n"
" \tinfo - Quick file stats\n"
@ -96,8 +97,7 @@ const char* AICMD_MSG_HELP =
// ------------------------------------------------------------------------------
// Application entry point
int main (int argc, char* argv[])
{
int main (int argc, char* argv[]) {
if (argc <= 1) {
printf("assimp: No command specified. Use \'assimp help\' for a detailed command list\n");
return AssimpCmdError::Success;
@ -550,10 +550,7 @@ int ProcessStandardArguments(
}
// ------------------------------------------------------------------------------
int Assimp_TestBatchLoad (
const char* const* params,
unsigned int num)
{
int Assimp_TestBatchLoad(const char* const* params, unsigned int num) {
for(unsigned int i = 0; i < num; ++i) {
globalImporter->ReadFile(params[i],aiProcessPreset_TargetRealtime_MaxQuality);
// we're totally silent. scene destructs automatically.

View File

@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AICMD_MAIN_INCLUDED
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
@ -66,9 +66,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
#include <zlib.h>
# include <zlib.h>
#else
#include <../contrib/zlib/zlib.h>
# include <../contrib/zlib/zlib.h>
#endif