bin_PROGRAMS = $(top_builddir)/DungeonMaster
-__top_builddir__DungeonMaster_SOURCES = main.cpp mods.cpp paths.cpp
+__top_builddir__DungeonMaster_SOURCES = generators.cpp main.cpp mods.cpp paths.cpp
__top_builddir__DungeonMaster_CPPFLAGS = @GUILE_CFLAGS@
__top_builddir__DungeonMaster_LDFLAGS = @GUILE_LIBS@
#include <dirent.h>
#include <iostream>
#include <libguile.h>
+#include "generators.h"
#include "mods.h"
#include "paths.h"
-SCM register_generator(SCM name, SCM proc)
+
+SCM register_scene_generator(SCM name, SCM type, SCM proc)
{
- printf ("Register: %s\n", scm_to_locale_string(name));
- scm_call_1(proc, scm_from_int(-1));
+ SceneGenerator generator {scm_to_locale_string(name), scm_to_locale_string(type), proc };
+ register_generator(generator);
+ printf ("Register: %s (%s)\n", generator.name.c_str(), generator.type.c_str());
+ //scm_call_1(proc, scm_from_int(-1));
return SCM_UNSPECIFIED;
}
void init_dungeon_master_module(void *unused)
{
- scm_c_define_gsubr("register-generator", 2, 0, 0, (scm_t_subr)register_generator);
- scm_c_export("register-generator", NULL);
+ scm_c_define_gsubr("register-scene-generator", 3, 0, 0, (scm_t_subr)register_scene_generator);
+ scm_c_export("register-scene-generator", NULL);
}
void scm_init_dungeon_master_module()