Beispiel #1
0
static void dispgge(int x, int cury, int maxy, int clr)
{
	int y;

	cury = cury * 10 / maxy - 1;
	if (cury > 9)
		cury = 9;
	for (y = 0; y <= cury; ++y)
		Vid_PlotPixel(x, y, clr);
	for (; y <= 9; ++y)
		Vid_PlotPixel(x, y, 0);
}
Beispiel #2
0
static inline void drawchar(int x, int y, int c)
{
	unsigned char *p;
	int x2, y2;

	if (c < 0 || c >= 256)
		return;

	p = font_data + c * 8;

	// sdh 27/03/02: use new drawing functions

	for (y2 = 0; y2 < 8; ++y2) {
		int m = 0x80;

		for (x2 = 0; x2 < 8; ++x2) {
			if (p[y2] & m) {
				// sdh 17/10/2001: -1 to y co-ordinate
				// to stop it overwriting the wrong memory

				Vid_PlotPixel
					(x + x2,
					 SCR_HGHT - (y + y2 - 1),
					 cur_color);
			}

			m >>= 1;
		}
	}
}
Beispiel #3
0
void colorscreen(int color)
{
    int x, y;

    for (y=19; y<SCR_HGHT; ++y) {
        for (x=0; x<SCR_WDTH; ++x) {
            Vid_PlotPixel(x, y, color);
        }
    }
}
Beispiel #4
0
static void dispmap()
{
	int x, y, dx, maxh, sx;

	dx = 0;
	sx = SCR_CENTR;

	maxh = 0;
	y = 0;

	// draw ground

	for (x = 0; x < MAX_X; ++x) {

		if (ground[x] > maxh)
			maxh = ground[x];

		++dx;

		if (dx == WRLD_RSX) {
			maxh /= WRLD_RSY;
			if (maxh == y)
				Vid_PlotPixel(sx, maxh, 7);
			else if (maxh > y)
				for (++y; y <= maxh; ++y)
					Vid_PlotPixel(sx, y, 7);
			else
				for (--y; y >= maxh; --y)
					Vid_PlotPixel(sx, y, 7);
			y = maxh;
			Vid_PlotPixel(sx, 0, 11);
			++sx;
			dx = maxh = 0;
		}
	}

	// map border

	maxh = MAX_Y / WRLD_RSY;
	for (y = 0; y <= maxh; ++y) {
		Vid_PlotPixel(SCR_CENTR, y, 11);
		Vid_PlotPixel(sx, y, 11);
	}

	dispmapobjects();

	// border of status bar

	for (x = 0; x < SCR_WDTH; ++x)
		Vid_PlotPixel(x, (SCR_MNSH + 2), 7);
}
Beispiel #5
0
static void dispmapobjects()
{
	OBJECTS *ob;

	for (ob=objtop; ob; ob=ob->ob_next) {
		if (ob->ob_onmap) {
			int x, y;

			x = SCR_CENTR 
			  + ((ob->ob_x + (ob->ob_newsym->w / 2)) / WRLD_RSX);
			y = ((ob->ob_y - (ob->ob_newsym->h / 2)) / WRLD_RSY); 

                        if (y < SCR_MNSH-1) 
    			        Vid_PlotPixel(x, y, ob->ob_clr);
		}
	}
}
Beispiel #6
0
void swgets(char *s, int max)
{
	int or_x = cur_x, or_y = cur_y;
	int erase_len = 0;
	int x, y;

	for (;;) {
		unsigned char c;

		// erase background from previous write

		for (y = 0; y < 8; ++y) {
			for (x = 0; x < erase_len * 8; ++x) {
				Vid_PlotPixel
					(or_x * 8 + x,
					 SCR_HGHT - (or_y * 8 + y), 0);
			}
		}

		cur_x = or_x;
		cur_y = or_y;
		erase_len = (int)strlen(s);
		swputs(s);
		Vid_Update();

		// read next keypress

		while (!(c = swgetc()));

		if (isprint(c) && (int)strlen(s) < max) {
			s[strlen(s) + 1] = '\0';
			s[strlen(s)] = c;
		} else if (c == '\b') {
			// backspace
			s[strlen(s) - 1] = '\0';
		} else if (c == '\n') {
			break;
		}
	}
}