X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmsdos.c;h=b64b9fab6ea36349c54a43f72d239d2409c1cad9;hb=6b83db8bee17d70c4e89dc3e3b703b7032aa5f27;hp=05948fd9f8ccca1e0373abe93201a92f44604768;hpb=50c422d96b6da2c0412b6bd3763e9d1a029a6014;p=rocksndiamonds.git diff --git a/src/msdos.c b/src/msdos.c index 05948fd9..b64b9fab 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -525,7 +525,7 @@ static BITMAP *Read_PCX_to_AllegroBitmap(char *filename) if ((bitmap = Image_to_AllegroBitmap(image)) == NULL) return NULL; - set_pallete(global_colormap); + set_palette(global_colormap); return bitmap; } @@ -741,14 +741,18 @@ int XPending(Display *display) /* mouse button event */ if (mouse_b != last_mouse_b) { - for (i=1; i<4; i<<=1) + for (i=0; i<3; i++) /* check all three mouse buttons */ { - if ((last_mouse_b & i) != (mouse_b & i)) + int bitmask = (1 << i); + + if ((last_mouse_b & bitmask) != (mouse_b & bitmask)) { + int mapping[3] = { 1, 3, 2 }; + pending_events++; xbutton = (XButtonEvent *)&event_buffer[pending_events]; - xbutton->type = (mouse_b & i ? ButtonPress : ButtonRelease); - xbutton->button = i; + xbutton->type = (mouse_b & bitmask ? ButtonPress : ButtonRelease); + xbutton->button = mapping[i]; xbutton->x = mouse_x - display->screens[display->default_screen].x; xbutton->y = mouse_y - display->screens[display->default_screen].y; } @@ -764,6 +768,50 @@ KeySym XLookupKeysym(XKeyEvent *key_event, int index) return key_event->state; } +int XLookupString(XKeyEvent *key_event, char *buffer, int buffer_size, + KeySym *key, XComposeStatus *compose) +{ + *key = key_event->state; + return 0; +} + +void XSetForeground(Display *display, GC gc, unsigned long pixel) +{ + XGCValues *gcv = (XGCValues *)gc; + + gcv->foreground = pixel; +} + +void XDrawLine(Display *display, Drawable d, GC gc, + int x1, int y1, int x2, int y2) +{ + XGCValues *gcv = (XGCValues *)gc; + boolean mouse_off = FALSE; + + if ((BITMAP *)d == video_bitmap) + { + x1 += display->screens[display->default_screen].x; + y1 += display->screens[display->default_screen].y; + x2 += display->screens[display->default_screen].x; + y2 += display->screens[display->default_screen].y; + freeze_mouse_flag = TRUE; + mouse_off = hide_mouse(display, MIN(x1, x2), MIN(y1, y2), + MAX(x1, x2) - MIN(x1, x2), + MAX(y1, y2) - MIN(y1, y2)); + } + + line((BITMAP *)d, x1, y1, x2, y2, gcv->foreground); + + if (mouse_off) + unhide_mouse(display); + + freeze_mouse_flag = FALSE; +} + +void XDestroyImage(XImage *ximage) +{ +} + void NetworkServer(int port, int serveronly) { Error(ERR_WARN, "networking not supported in DOS version");