1 #include <irrlicht/irrlicht.h>
8 SCM register_generator(SCM name, SCM proc)
10 printf ("Register: %s\n", scm_to_locale_string(name));
11 scm_call_1(proc, scm_from_int(-1));
12 return SCM_UNSPECIFIED;
15 void init_dungeon_master_module(void *unused)
17 scm_c_define_gsubr("register-generator", 2, 0, 0, (scm_t_subr)register_generator);
18 scm_c_export("register-generator", NULL);
21 void scm_init_dungeon_master_module()
23 scm_c_define_module("dungeon-master", init_dungeon_master_module, NULL);
29 scm_init_dungeon_master_module();
30 scm_primitive_load(scm_from_locale_string("plugins/default/main.scm"));
32 IrrlichtDevice* device =
33 createDevice(EDT_OPENGL,
34 dimension2d<u32>(640, 480), 16,
35 false, false, false, 0);
39 IVideoDriver* driver = device->getVideoDriver();
47 u32 then = device->getTimer()->getTime();
49 const f32 fadeRate = 0.1f;
53 const u32 now = device->getTimer()->getTime();
54 const f32 frameDeltaTime = (f32)(now - then);
57 if (bg_r <= 0.0f) fadeOut = false;
58 else if (bg_r >= 255.0f) fadeOut = true;
62 bg_r -= fadeRate * frameDeltaTime;
63 bg_g -= fadeRate * frameDeltaTime;
64 bg_b -= fadeRate * frameDeltaTime;
68 bg_r += fadeRate * frameDeltaTime;
69 bg_g += fadeRate * frameDeltaTime;
70 bg_b += fadeRate * frameDeltaTime;
74 bg_r = bg_b = bg_g = 0.0f;
75 else if (bg_r >= 255.0f)
76 bg_r = bg_b = bg_g = 255.0f;
78 driver->beginScene(true, true, SColor(255, (u32)bg_r,
79 (u32)bg_g, (u32)bg_b));