using namespace core;
using namespace video;
-SCM register_generator(SCM name, SCM proc) {
+SCM register_generator(SCM name, SCM proc)
+{
printf ("Register: %s\n", scm_to_locale_string(name));
- scm_call_0(proc);
+ 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);
+}
+
+void scm_init_dungeon_master_module()
+{
+ scm_c_define_module("dungeon-master", init_dungeon_master_module, NULL);
+}
+
int main()
{
scm_init_guile();
- scm_c_define_gsubr("register-generator", 2, 0, 0, (scm_t_subr)register_generator);
+ scm_init_dungeon_master_module();
scm_primitive_load(scm_from_locale_string("plugins/default/main.scm"));
IrrlichtDevice* device =
-(define (hello-world)
- (display "Hello World!")
- (newline))
+(define-module (dungeon-master plugins default)
+ #:use-module ((dungeon-master) #:prefix dm:))
-(register-generator "hello-world" hello-world)
+(define (random-bool)
+ (= (random 2) 1))
+
+(define (city-map-generator patches)
+ "City generator from https://github.com/watabou/TownGeneratorOS/blob/master/Source/com/watabou/towngenerator/building/Model.hx"
+ (when (= patches -1) (set! patches 15))
+ (display "lalala")(newline))
+ ;(build))
+
+(dm:register-generator "city-map-generator" city-map-generator)