remove Runtime c++ class
This commit is contained in:
parent
447e4279e7
commit
2f2cec509e
@ -1,5 +1,4 @@
|
|||||||
#include "FontManager.h"
|
#include "FontManager.h"
|
||||||
#include "Runtime.h"
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace jes
|
namespace jes
|
||||||
@ -26,6 +25,9 @@ namespace jes
|
|||||||
|
|
||||||
FontRef FontManager::load_font(const char * fname, size_t size)
|
FontRef FontManager::load_font(const char * fname, size_t size)
|
||||||
{
|
{
|
||||||
|
/* TODO */
|
||||||
|
return NULL;
|
||||||
|
#if 0
|
||||||
PathRef font_path = Runtime::locate(Runtime::FONT, fname);
|
PathRef font_path = Runtime::locate(Runtime::FONT, fname);
|
||||||
if (font_path == NULL)
|
if (font_path == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -35,5 +37,6 @@ namespace jes
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return font;
|
return font;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include "GUI.h"
|
#include "GUI.h"
|
||||||
#include "gl3w.h"
|
#include "gl3w.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "Runtime.h"
|
|
||||||
|
|
||||||
#define WIDTH 500
|
#define WIDTH 500
|
||||||
#define HEIGHT 500
|
#define HEIGHT 500
|
||||||
@ -80,7 +79,11 @@ namespace jes
|
|||||||
|
|
||||||
for (int j = 0; j < 2; j++)
|
for (int j = 0; j < 2; j++)
|
||||||
{
|
{
|
||||||
|
/* TODO */
|
||||||
|
shader_paths[j] = NULL;
|
||||||
|
#if 0
|
||||||
shader_paths[j] = Runtime::locate(Runtime::SHADER, shader_sources[i][j]);
|
shader_paths[j] = Runtime::locate(Runtime::SHADER, shader_sources[i][j]);
|
||||||
|
#endif
|
||||||
if (shader_paths[j] == NULL)
|
if (shader_paths[j] == NULL)
|
||||||
{
|
{
|
||||||
std::cerr << "Could not find shader source " << shader_sources[i][j] << std::endl;
|
std::cerr << "Could not find shader source " << shader_sources[i][j] << std::endl;
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
#include "Runtime.h"
|
|
||||||
|
|
||||||
namespace jes
|
|
||||||
{
|
|
||||||
static const char * const runtime_directories[Runtime::COUNT] = {
|
|
||||||
"fonts",
|
|
||||||
"shaders",
|
|
||||||
};
|
|
||||||
|
|
||||||
PathRef Runtime::locate(int type, const std::string & name)
|
|
||||||
{
|
|
||||||
PathRef path = Core::instance.get_bin_path()->dirname()->dirname()->join("runtime")->join(runtime_directories[type]);
|
|
||||||
PathRef rv = NULL;
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case Runtime::SHADER:
|
|
||||||
rv = path->join(name);
|
|
||||||
break;
|
|
||||||
case Runtime::FONT:
|
|
||||||
{
|
|
||||||
static const char * extensions[] = {
|
|
||||||
"ttf",
|
|
||||||
};
|
|
||||||
std::vector<std::string> dirents = path->dir_entries();
|
|
||||||
for (auto de : dirents)
|
|
||||||
{
|
|
||||||
PathRef test_path = path->join(de)->join(name);
|
|
||||||
if (test_path->exists())
|
|
||||||
return test_path;
|
|
||||||
for (auto ext : extensions)
|
|
||||||
{
|
|
||||||
test_path = test_path->ext(ext);
|
|
||||||
if (test_path->exists())
|
|
||||||
return test_path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((rv != NULL) && (rv->exists()))
|
|
||||||
return rv;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
#ifndef JES_RUNTIME_H
|
|
||||||
#define JES_RUNTIME_H
|
|
||||||
|
|
||||||
#include "Core.h"
|
|
||||||
#include "Path.h"
|
|
||||||
|
|
||||||
namespace jes
|
|
||||||
{
|
|
||||||
class Runtime
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
FONT,
|
|
||||||
SHADER,
|
|
||||||
COUNT,
|
|
||||||
};
|
|
||||||
static PathRef locate(int type, const std::string & name);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
x
Reference in New Issue
Block a user