From 1a6a8b52f7aa4e2da6f4c34a0c743c760b8cfd99 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 20 Nov 2016 15:16:41 -0500 Subject: Port of Simon Tatham's Puzzle Collection Original revision: 5123b1bf68777ffa86e651f178046b26a87cf2d9 MIT Licensed. Some games still crash and others are unplayable due to issues with controls. Still need a "real" polygon filling algorithm. Currently builds one plugin per puzzle (about 40 in total, around 100K each on ARM), but can easily be made to build a single monolithic overlay (800K or so on ARM). The following games are at least partially broken for various reasons, and have been disabled on this commit: Cube: failed assertion with "Icosahedron" setting Keen: input issues Mines: weird stuff happens on target Palisade: input issues Solo: input issues, occasional crash on target Towers: input issues Undead: input issues Unequal: input and drawing issues (concave polys) Untangle: input issues Features left to do: - In-game help system - Figure out the weird bugs Change-Id: I7c69b6860ab115f973c8d76799502e9bb3d52368 --- apps/plugins/puzzles/nullfe.c | 69 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 apps/plugins/puzzles/nullfe.c (limited to 'apps/plugins/puzzles/nullfe.c') diff --git a/apps/plugins/puzzles/nullfe.c b/apps/plugins/puzzles/nullfe.c new file mode 100644 index 0000000000..4c9975b90e --- /dev/null +++ b/apps/plugins/puzzles/nullfe.c @@ -0,0 +1,69 @@ +/* + * nullfe.c: Null front-end code containing a bunch of boring stub + * functions. Used to ensure successful linking when building the + * various stand-alone solver binaries. + */ + +#include + +#include "puzzles.h" + +void frontend_default_colour(frontend *fe, float *output) {} +void draw_text(drawing *dr, int x, int y, int fonttype, int fontsize, + int align, int colour, char *text) {} +void draw_rect(drawing *dr, int x, int y, int w, int h, int colour) {} +void draw_line(drawing *dr, int x1, int y1, int x2, int y2, int colour) {} +void draw_thick_line(drawing *dr, float thickness, + float x1, float y1, float x2, float y2, int colour) {} +void draw_polygon(drawing *dr, int *coords, int npoints, + int fillcolour, int outlinecolour) {} +void draw_circle(drawing *dr, int cx, int cy, int radius, + int fillcolour, int outlinecolour) {} +char *text_fallback(drawing *dr, const char *const *strings, int nstrings) +{ return dupstr(strings[0]); } +void clip(drawing *dr, int x, int y, int w, int h) {} +void unclip(drawing *dr) {} +void start_draw(drawing *dr) {} +void draw_update(drawing *dr, int x, int y, int w, int h) {} +void end_draw(drawing *dr) {} +blitter *blitter_new(drawing *dr, int w, int h) {return NULL;} +void blitter_free(drawing *dr, blitter *bl) {} +void blitter_save(drawing *dr, blitter *bl, int x, int y) {} +void blitter_load(drawing *dr, blitter *bl, int x, int y) {} +int print_mono_colour(drawing *dr, int grey) { return 0; } +int print_grey_colour(drawing *dr, float grey) { return 0; } +int print_hatched_colour(drawing *dr, int hatch) { return 0; } +int print_rgb_mono_colour(drawing *dr, float r, float g, float b, int grey) +{ return 0; } +int print_rgb_grey_colour(drawing *dr, float r, float g, float b, float grey) +{ return 0; } +int print_rgb_hatched_colour(drawing *dr, float r, float g, float b, int hatch) +{ return 0; } +void print_line_width(drawing *dr, int width) {} +void print_line_dotted(drawing *dr, int dotted) {} +void midend_supersede_game_desc(midend *me, char *desc, char *privdesc) {} +void status_bar(drawing *dr, char *text) {} + +void fatal(char *fmt, ...) +{ + va_list ap; + + fprintf(stderr, "fatal error: "); + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + + fprintf(stderr, "\n"); + exit(1); +} + +#ifdef DEBUGGING +void debug_printf(char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vfprintf(stdout, fmt, ap); + va_end(ap); +} +#endif -- cgit v1.2.3