home *** CD-ROM | disk | FTP | other *** search
- #include "../../manic.h"
- #include "common.h"
- #include "../gfx.h"
-
- void
- mm_gfx_putpixel (uint_fast16_t x, uint_fast16_t y, uint_fast8_t data)
- {
- ggiPutPixel (vis, x + xoffset, y + yoffset, data);
- }
-
- void
- mm_gfx_putpixel2 (uint_fast16_t x, uint_fast16_t y, uint_fast8_t data)
- {
- ggiPutPixel (vis, x, y, data);
- }
-
- uint_fast8_t
- mm_gfx_getpixel (uint_fast16_t x, uint_fast16_t y)
- {
- ggi_pixel data;
- ggiGetPixel (vis, x + xoffset, y + yoffset, &data);
- return (data);
- }
-
- uint_fast8_t
- mm_gfx_getpixel2 (uint_fast16_t x, uint_fast16_t y)
- {
- ggi_pixel data;
- ggiGetPixel (vis, x, y, &data);
- return (data);
- }
-
- void
- mm_gfx_cls (uint_fast8_t col)
- {
- mm_gfx_fillbox2 (0, 0, scrnwidth, scrnheight, col);
- }
-
- void
- mm_gfx_flush (void)
- {
- mm_gfx_waitvr ();
- ggiFlush (vis);
- }
-
- void
- mm_gfx_waitvr (void)
- {
- usleep (40);
- }
-
- void
- mm_gfx_fillbox (uint_fast16_t xpos, uint_fast16_t ypos,
- uint_fast16_t width, uint_fast16_t height, uint_fast8_t col)
- {
- int_fast16_t x, y;
- int_fast16_t origx = xpos;
-
- for (y = 0; y < height; y++, ypos++) {
- for (x = 0; x < width; x++)
- ggiPutPixel (vis, xpos++ + xoffset, ypos + yoffset, col);
- xpos = origx;
- }
- }
-
- void
- mm_gfx_fillbox2 (uint_fast16_t xpos, uint_fast16_t ypos,
- uint_fast16_t width, uint_fast16_t height, uint_fast8_t col)
- {
- int_fast16_t x, y;
- int_fast16_t origx = xpos;
-
- for (y = 0; y < height; y++, ypos++) {
- for (x = 0; x < width; x++)
- ggiPutPixel (vis, xpos++, ypos, col);
- xpos = origx;
- }
- }
-
- void
- mm_gfx_palset (uint_fast8_t * palette)
- {
- int_fast16_t i;
- ggi_color ggipal[256];
-
- for (i = 0; i < 256; i++) {
- ggipal[i].r = palette[(i * 3)] * 1024;
- ggipal[i].g = palette[(i * 3) + 1] * 1024;
- ggipal[i].b = palette[(i * 3) + 2] * 1024;
- }
- ggiSetPalette (vis, 0, 256, ggipal);
- }
-