Imported kball_final_src_16dec2004.tar.gz
[kball.git] / src / ui_misc.cpp
blob6acaebcf7a162e90fd06dbe6a2b94ed387a374c2
1 // ------------------------------------------------------------------
2 // ui_misc.cpp
3 // ------------------------------------------------------------------
4 // This are some miscellaneous helper functions, mainly used by the kernel UI interface
5 // ------------------------------------------------------------------
6 // Developed By Kronoman - Copyright (c) 2004
7 // In loving memory of my father
8 // ------------------------------------------------------------------
10 #include "ui_misc.h"
12 // ------------------------------------------------------------------
13 // does a cheap interlaced darkening of bmp
14 // ------------------------------------------------------------------
15 void ui_misc_dark_bmp(BITMAP *bmp)
17 for (int yi = 0; yi < SCREEN_H; yi+=2)
18 hline(bmp,0,yi,SCREEN_W,makecol(0,0,0));
21 // ------------------------------------------------------------------
22 // text in color of ct with shadow in color of cs
23 // ------------------------------------------------------------------
24 void ui_misc_text_out_shadow(BITMAP *bmp, FONT *f, const char *s, int x, int y, int cs, int ct)
26 textout_centre_ex(bmp,f,s,x+3,y+3,cs,-1);
27 textout_centre_ex(bmp,f,s,x,y,ct,-1);
31 // ------------------------------------------------------------------
32 // waits for input from user, like key/mouse/joystick
33 // this DON'T PUT the message, just waits!
34 // ------------------------------------------------------------------
35 void ui_misc_wait_for_input()
37 rest(250);
39 clear_keybuf();
41 while ((!keypressed()) && (!mouse_b) && (!joy[0].button[0].b))
43 poll_joystick();
44 if (keyboard_needs_poll()) poll_keyboard();
45 if (mouse_needs_poll()) poll_mouse();
46 };
48 clear_keybuf();
50 rest(250);