Implement asset loading for kraken_convert

This commit is contained in:
Kearwood Kip Gilbert
2019-07-18 00:00:08 -07:00
parent cc62f34e4e
commit 200536bf21
3 changed files with 26 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ class Context::impl
public: public:
impl(); impl();
~impl(); ~impl();
bool loadResource(const char* szPath);
private: private:
KRContext mContext; KRContext mContext;
@@ -35,6 +36,18 @@ Context::~Context()
delete mImpl; delete mImpl;
} }
bool Context::loadResource(const char* szPath)
{
return mImpl->loadResource(szPath);
}
bool Context::impl::loadResource(const char* szPath)
{
mContext.loadResource(szPath);
// TODO: update KRContext::loadResource to return success/fail boolean
return true;
}
Context::impl::impl() Context::impl::impl()
{ {

View File

@@ -38,6 +38,7 @@ class Context
class impl; class impl;
public: public:
static Context* Get(); static Context* Get();
bool loadResource(const char* szPath);
private: private:
Context(); Context();
~Context(); ~Context();

View File

@@ -1,9 +1,21 @@
#include "main.h" #include "main.h"
#include <stdio.h> #include <stdio.h>
#include "kraken.h"
using namespace kraken;
int main( int argc, char *argv[] ) int main( int argc, char *argv[] )
{ {
Context* context = Context::Get();
for (int i = 0; i < argc; i++) {
char *arg = argv[i];
if (arg[0] != '-') {
context->loadResource(arg);
}
}
printf("Kraken Convert\n"); printf("Kraken Convert\n");
return 0; return 0;
} }