#include "Main.hh"
#include "TitleLayer.hh"
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "../config.h"
#include "version.h"
// 4. YOINKRC (environment)
std::string path("yoinkrc");
- moof::resource::find_path(path);
+ moof::resource::find(path);
#if !defined(_WIN32)
path += ":/etc/yoinkrc";
<< "-"
#endif
<< "gtk "
+#ifndef USE_HOTLOADING
+ << "-"
+#endif
+ << "hotloading "
#ifndef PROFILING_ENABLED
<< "-"
#endif
#include <moof/socket.hh>
+#include <fstream>
+
+class MyAsset
+{
+public:
+ MyAsset(const std::string& path)
+ {
+ moof::log_info("MyAsset loading:", path);
+
+ char buffer[1024];
+
+ std::ifstream stream(path.c_str());
+ stream.getline(buffer, sizeof(buffer));
+ str = buffer;
+ stream.close();
+
+ cool();
+ }
+
+ void cool()
+ {
+ moof::log_info("MyAsset COOL:", str);
+ }
+
+ void groovy()
+ {
+ moof::log_info("MyAsset GROOVY!!!!", str);
+ }
+
+ std::string str;
+};
+
+typedef moof::resource_handle<MyAsset> MyAsset_handle;
+
+class AnotherAsset
+{
+public:
+ AnotherAsset(const std::string& path, double d = 5.0)
+ {
+ moof::log_info("AnotherAsset loading:", path);
+ dude = d;
+ }
+
+
+ void cool()
+ {
+ moof::log_info("AnotherAsset cool", dude);
+ }
+
+ void groovy()
+ {
+ moof::log_info("AnotherAsset GROOVY!!!!", dude);
+ }
+
+ double dude;
+};
+
+
int main(int argc, char* argv[])
{
+ moof::resource::register_type<MyAsset>("mine");
+
+ //moof::resource::add_type<AnotherAsset>("k");
+
+ //{
+ //moof::resource_ptr myAsset = moof::resource::load(assetName,
+ //"prefix", "mine");
+
+ //MyAsset_handle aCopy = myAsset;
+
+ //MyAsset_handle copy2 = moof::resource::load(assetName, "asdfas", "mine");
+
+ ////if (myAsset->check<MyAsset>()) myAsset->get<AnotherAsset>()->cool();
+ //myAsset->get<MyAsset>()->cool();
+ ////myAsset->get<AnotherAsset>()->groovy();
+
+ //aCopy.get()->cool();
+ //copy2.get()->cool();
+
+ //log_info("rsrc ptr:", moof::resource::load(assetName, "", "mine"));
+ //}
+ //log_info("rsrc ptr:", moof::resource::load(assetName, "", "k"));
+ //moof::resource::load(assetName, "", "mine")->get<MyAsset>()->cool();
+
+ ////if (myAsset) myAsset.get()->cool();
+ ////else moof::log_error("asset not obtained...");
+
+ MyAsset_handle myAsset = moof::resource::load("/home/chaz/meh.mine");
+ MyAsset* asset = myAsset.get();
+ if (asset) asset->cool();
+ else moof::log_warning("no asset obtained!!");
+
+ moof::timer reloadTimer(
+ boost::bind(&moof::resource::reload_as_needed),
+ SCALAR(2.0),
+ moof::timer::repeat);
+
+ //for (;;)
+ //{
+ //myAsset.get()->cool();
+ //moof::resource::reload_as_needed();
+ //sleep(1);
+ //}
+
+ //return 0;
+
moof::resolver_task task("4950", "lappy");
task.run();
//return 0;
-
+
if (argc > 1)
{
try
{
std::string iconPath(PACKAGE".png");
- moof::resource::find_path(iconPath);
+ moof::resource::find(iconPath);
moof::image icon(iconPath);
icon.set_as_icon();