/* * Prelude for statement-context fragments in docs/20: runs of CATCH calls * from the galaga frame loop, shown without their scaffolding because the * ATTEMPT protocol is the scaffolding. Same policy as hostcalls.pre. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef enum { GALAGA_SCREEN_TITLE = 0, GALAGA_SCREEN_PLAY, GALAGA_SCREEN_GAMEOVER, GALAGA_SCREEN_VICTORY } galaga_Screen; struct galaga_docs_Game { galaga_Screen screen; float dt; akgl_Actor *player; }; extern struct galaga_docs_Game galaga_game; extern akgl_Actor *galaga_enemy_actors[40]; akerr_ErrorContext AKERR_NOIGNORE *declare_title(void); akerr_ErrorContext AKERR_NOIGNORE *declare_play(void); akerr_ErrorContext AKERR_NOIGNORE *declare_end(void); akerr_ErrorContext AKERR_NOIGNORE *galaga_docs_fragment(void); akerr_ErrorContext AKERR_NOIGNORE *galaga_docs_fragment(void) { PREPARE_ERROR(errctx); SDL_Event event; ATTEMPT {