Constant Story "-"; Constant Headline "-"; Serial "080525"; Release 0; Constant GG_MAPWIN_ROCK 210; Global gg_mapwin = 0; Global gg_musicchan = 0; Include "Parser"; Include "VerbLib"; Include "infglk.h"; [ InitGlkWindow winrock; switch (winrock) { GG_STATUSWIN_ROCK: rtrue; } rfalse; ]; !------------------------------------------------------------------------------- ! Routines sympas !------------------------------------------------------------------------------- [Attend; KeyCharPrimitive(); ]; [Affiche k graph_width graph_height; if (gg_mapwin) {} else { gg_mapwin = glk_window_open(gg_mainwin, (winmethod_Left+winmethod_Proportional),100, wintype_Graphics, GG_MAPWIN_ROCK); } !glk_image_draw(gg_mapwin, k, imagealign_InlineCenter, 0); glk_window_get_size(gg_mapwin, gg_arguments, gg_arguments+WORDSIZE); graph_width = gg_arguments-->0; graph_height = gg_arguments-->1; glk_image_draw_scaled(gg_mapwin, k, 0, 0,graph_width,graph_height); ]; [Joue k; if (gg_musicchan) {} else { gg_musicchan = glk_schannel_create(0); } glk_schannel_play_ext(gg_musicchan, k, 1, 0); ]; [ IdentifyGlkObject phase type ref rock res id; res = res; id = id; ! <- These are just warning squashers if (phase == 0) { ! Zero out references to our objects. gg_mapwin = 0; } if (phase == 1) { ! Reset our windows, streams and filerefs. switch (type) { 0: switch (rock) { GG_MAPWIN_ROCK: gg_mapwin = ref; } 1: ! stream 2: ! fileref } } if (phase == 2) { ! Update our objects. ! RedrawMapInMapWindow(); ! Or do anything you like... } return; ]; [ HandleGlkEvent ev context abortres newcmd cmdlen; switch (ev-->0) { evtype_MouseInput: glk_request_mouse_event(gg_mapwin); if (ev-->2 >= 0 && ev-->2 < 1000 && ev-->3 >= 0 && ev-->3 < 1000) { glk_cancel_line_event(gg_mainwin, 0); newcmd = "n"; cmdlen = PrintAnyToArray(abortres+WORDSIZE, INPUT_BUFFER_LEN-WORDSIZE, newcmd); abortres-->0 = cmdlen; return 2; } if (ev-->2 >= 1 && ev-->2 < 2 && ev-->3 >= 1 && ev-->3 < 2) { glk_cancel_line_event(gg_mainwin, 0); newcmd = "choix2"; cmdlen = PrintAnyToArray(abortres+WORDSIZE, INPUT_BUFFER_LEN-WORDSIZE, newcmd); abortres-->0 = cmdlen; return 2; } } ]; !------------------------------------------------------------------------------- ! Lieux - Stockage !------------------------------------------------------------------------------- Object nil "-"; !------------------------------------------------------------------------------- ! Lieux !------------------------------------------------------------------------------- Object start "-" with description [;Affiche(1);print "-";], n_to start2, has scenery; Object start2 "-" with description [;Affiche(2);print "-";], n_to start, has scenery; !------------------------------------------------------------------------------- ! Core !------------------------------------------------------------------------------- [Initialise; lookmode = 2; gg_mapwin = glk_window_open(gg_mainwin, (winmethod_Left+winmethod_Proportional),100, wintype_Graphics, GG_MAPWIN_ROCK); give player light; !glk_image_draw(gg_mapwin, 1, imagealign_InlineCenter, 0); glk_request_mouse_event(gg_mapwin); PlayerTo(start); ]; Include "FrenchG";