Mail Archives: djgpp/1999/08/15/09:26:51
maybe there is something wrong with my netscape, but I see a lot of file://k in
the end,
which is weird...that should give you a lot of parse errors
Chewbaklava wrote:
> i was creating a program that would let you create 24x24 bitmaps and it was
> all working good until i quit for the day. this morning i got up, and it
> didn't compile as it did the night before.
>
> whenever i compile it, it gives me a HUGE list of "parse error before " for
> practically every line. maybe i'm an idiot and am just missing something
> REALLY little, like a semi-colon or something.
>
> anyway, the code -
>
> #include <stdio.h>
> #include <stdlib.h>
>
> #include "allegro.h"
>
> BITMAP *bmp;
> BITMAP *sub;
> BITMAP *poo;
> PALETTE pal;
> int c = 0;
> int k, x, y;
>
> void drawscreen()
> {
> int i, a;
> clear(bmp);
> show_mouse(screen);
>
> for (a = 0; a < 10; a++)
> {
> for (i = 0; i < 256; i++)
> }
> putpixel(bmp, i, a, i);
> }
> }
> circlefill(bmp, 250, 50, 30, c);
>
> putpixel(bmp, c-1, 11, 15);
> putpixel(bmp, c+1, 11, 15);
> putpixel(bmp, c-2, 12, 15);
> putpixel(bmp, c+2, 12, 15);
> for (a = 10; a < 20; a++)
> {
> putpixel(bmp, c, a, 15);
> }
>
> stretch_blit(sub, bmp, 0, 0, 24, 24, 50, 50, 146, 146);
> blit(sub, bmp, 0, 0, 240, 140, 24, 24);
> rect(bmp, 49, 49, 196, 196, 15);
> blit(bmp, screen, 0, 0, 0, 0, 320, 200);
> }
>
> int main()
> {
> int k;
>
> allegro_init();
> set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
> install_keyboard();
> install_mouse();
> install_timer();
> clear_keybuf();
> poo = load_bitmap("pal.pcx", pal);
>
> sub = create_bitmap(24, 24);
> bmp = create_bitmap(320, 200);
> set_pallete(pal);
> clear(sub);
> clear_to_color(bmp, 1);
>
> while (!key[KEY_ESC])
> {
> drawscreen();
> file://k = readkey();
> file://k = k >> 8;
>
> if (key[KEY_LEFT]) {c = c - 1;}
> if (key[KEY_RIGHT]) {c = c + 1;}
> if (c > 255) {c = 255;}
> if (c < 0) {c = 0;}
>
> file://if (mouse_b & 1)
> file://{
> file://if ((mouse_x > 50) && (mouse_y > 50))
> file://{
> file://if ((mouse_x < 132) && (mouse_y > 132))
> file://{
> file://x = mouse_x;
> file://y =
> };
>
> return;
> }
- Raw text -