Implement asset loading for kraken_convert
This commit is contained in:
@@ -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()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user