亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hu_lib.c

?? 游戲類程序源代碼---WinDoom 3D源程序.zip
?? C
字號:
// Emacs style mode select   -*- C++ -*- 
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// $Log:$
//
// DESCRIPTION:  heads-up text and input code
//
//-----------------------------------------------------------------------------

static const char
rcsid[] = "$Id: hu_lib.c,v 1.3 1997/01/26 07:44:58 b1 Exp $";

#include <ctype.h>

#include "doomdef.h"

#include "v_video.h"
#include "m_swap.h"

#include "hu_lib.h"
#include "r_local.h"
#include "r_draw.h"

// boolean : whether the screen is always erased
#define noterased viewwindowx

extern boolean	automapactive;	// in AM_map.c

void HUlib_init(void)
{
}

void HUlib_clearTextLine(hu_textline_t* t)
{
    t->len = 0;
    t->l[0] = 0;
    t->needsupdate = true;
}

void
HUlib_initTextLine
( hu_textline_t*	t,
  int			x,
  int			y,
  patch_t**		f,
  int			sc )
{
    t->x = x;
    t->y = y;
    t->f = f;
    t->sc = sc;
    HUlib_clearTextLine(t);
}

boolean
HUlib_addCharToTextLine
( hu_textline_t*	t,
  char			ch )
{

    if (t->len == HU_MAXLINELENGTH)
	return false;
    else
    {
	t->l[t->len++] = ch;
	t->l[t->len] = 0;
	t->needsupdate = 4;
	return true;
    }

}

boolean HUlib_delCharFromTextLine(hu_textline_t* t)
{

    if (!t->len) return false;
    else
    {
	t->l[--t->len] = 0;
	t->needsupdate = 4;
	return true;
    }

}

void
HUlib_drawTextLine
( hu_textline_t*	l,
  boolean		drawcursor 
  // DQ start addition
  , int PixelOffset,
  PBUFFER RenderBuffer
  // DQ end addition
  )
{

    int			i;
    int			w;
    int			x;
    unsigned char	c;

    // draw the new stuff
    x = l->x + PixelOffset/*DQ*/;
    for (i=0;i<l->len;i++)
    {
	c = toupper(l->l[i]);
	if (c != ' '
	    && c >= l->sc
	    && c <= '_')
	{
	    w = SHORT(l->f[c - l->sc]->width);
	    if (x+w > SCREENWIDTH)
		break;
	    V_DrawPatchDirect(x, l->y, RenderBuffer/*DQ FG*/, l->f[c - l->sc]);
	    x += w;
	}
	else
	{
	    x += 4;
	    if (x >= SCREENWIDTH)
		break;
	}
    }

    // draw the cursor if requested
    if (drawcursor
	&& x + SHORT(l->f['_' - l->sc]->width) <= SCREENWIDTH)
    {
	V_DrawPatchDirect(x, l->y, RenderBuffer/*DQ FG*/, l->f['_' - l->sc]);
    }
}


// sorta called by HU_Erase and just better darn get things straight
void HUlib_eraseTextLine(hu_textline_t* l, PBUFFER RenderBuffer, PBUFFER BackBuffer)
//void HUlib_eraseTextLine(hu_textline_t* l)	// original line
{
    int			lh;
    int			y;
    //int			yoffset;	// DQ removed this line, due to new prototype of R_VideoErase
    static boolean	lastautomapactive = true;

    // Only erases when NOT in automap and the screen is reduced,
    // and the text must either need updating or refreshing
    // (because of a recent change back from the automap)

    if (!automapactive &&
	viewwindowx && l->needsupdate)
    {
	lh = SHORT(l->f[0]->height) + 1;
	// DQ start addition
	for (y=l->y; y<l->y+lh ; y++)
	// DQ end addition
	//for (y=l->y,yoffset=y*SCREENWIDTH ; y<l->y+lh ; y++,yoffset+=SCREENWIDTH)
	{
	    if (y < viewwindowy || y >= viewwindowy + viewheight)
		 {
			R_VideoErase(y, 0, SCREENWIDTH, RenderBuffer, BackBuffer); // DQ
		//R_VideoErase(yoffset, SCREENWIDTH); // erase entire line
		 }
	    else
	    {
		R_VideoErase(y, 0, viewwindowx, RenderBuffer, BackBuffer); // DQ - erase left border
		R_VideoErase(y, viewwindowx + viewwidth, viewwindowx, RenderBuffer, BackBuffer); // DQ - erase right border
		//R_VideoErase(yoffset, viewwindowx); // erase left border
		//R_VideoErase(yoffset + viewwindowx + viewwidth, viewwindowx);
		// erase right border
	    }
	}
    }

    lastautomapactive = automapactive;
    if (l->needsupdate) l->needsupdate--;

}

void
HUlib_initSText
( hu_stext_t*	s,
  int		x,
  int		y,
  int		h,
  patch_t**	font,
  int		startchar,
  boolean*	on )
{

    int i;

    s->h = h;
    s->on = on;
    s->laston = true;
    s->cl = 0;
    for (i=0;i<h;i++)
	HUlib_initTextLine(&s->l[i],
			   x, y - i*(SHORT(font[0]->height)+1),
			   font, startchar);

}

void HUlib_addLineToSText(hu_stext_t* s)
{

    int i;

    // add a clear line
    if (++s->cl == s->h)
	s->cl = 0;
    HUlib_clearTextLine(&s->l[s->cl]);

    // everything needs updating
    for (i=0 ; i<s->h ; i++)
	s->l[i].needsupdate = 4;

}

void
HUlib_addMessageToSText
( hu_stext_t*	s,
  char*		prefix,
  char*		msg )
{
    HUlib_addLineToSText(s);
    if (prefix)
	while (*prefix)
	    HUlib_addCharToTextLine(&s->l[s->cl], *(prefix++));

    while (*msg)
	HUlib_addCharToTextLine(&s->l[s->cl], *(msg++));
}

// DQ start addition
void HUlib_drawSText(hu_stext_t* s, int PixelOffset, PBUFFER RenderBuffer)
// DQ end addition
//void HUlib_drawSText(hu_stext_t* s)
{
    int i, idx;
    hu_textline_t *l;

    if (!*s->on)
	return; // if not on, don't draw

    // draw everything
    for (i=0 ; i<s->h ; i++)
    {
	idx = s->cl - i;
	if (idx < 0)
	    idx += s->h; // handle queue of lines
	
	l = &s->l[idx];

	// need a decision made here on whether to skip the draw
	HUlib_drawTextLine(l, false, PixelOffset/*DQ*/, RenderBuffer/*DQ*/); // no cursor, please
    }

}

void HUlib_eraseSText(hu_stext_t* s, PBUFFER RenderBuffer, PBUFFER BackBuffer) // DQ
//void HUlib_eraseSText(hu_stext_t* s)
{

    int i;

    for (i=0 ; i<s->h ; i++)
    {
	if (s->laston && !*s->on)
	    s->l[i].needsupdate = 4;
	HUlib_eraseTextLine(&s->l[i], RenderBuffer/*DQ*/, BackBuffer/*DQ*/);
    }
    s->laston = *s->on;

}

void
HUlib_initIText
( hu_itext_t*	it,
  int		x,
  int		y,
  patch_t**	font,
  int		startchar,
  boolean*	on )
{
    it->lm = 0; // default left margin is start of text
    it->on = on;
    it->laston = true;
    HUlib_initTextLine(&it->l, x, y, font, startchar);
}


// The following deletion routines adhere to the left margin restriction
void HUlib_delCharFromIText(hu_itext_t* it)
{
    if (it->l.len != it->lm)
	HUlib_delCharFromTextLine(&it->l);
}

void HUlib_eraseLineFromIText(hu_itext_t* it)
{
    while (it->lm != it->l.len)
	HUlib_delCharFromTextLine(&it->l);
}

// Resets left margin as well
void HUlib_resetIText(hu_itext_t* it)
{
    it->lm = 0;
    HUlib_clearTextLine(&it->l);
}

void
HUlib_addPrefixToIText
( hu_itext_t*	it,
  char*		str )
{
    while (*str)
	HUlib_addCharToTextLine(&it->l, *(str++));
    it->lm = it->l.len;
}

// wrapper function for handling general keyed input.
// returns true if it ate the key
boolean HUlib_keyInIText( hu_itext_t *it, unsigned char ch)
   {
    if (ch >= ' ' && ch <= '_')
        HUlib_addCharToTextLine(&it->l, (char) ch);
    else
    if (ch == KEY_BACKSPACE)
        HUlib_delCharFromIText(it);
    else
    if (ch != KEY_ENTER)
        return false; // did not eat key

    return true; // ate the key
   }

// DQ start addition
void HUlib_drawIText(hu_itext_t* it, int PixelOffset, PBUFFER RenderBuffer)
// DQ end addition
//void HUlib_drawIText(hu_itext_t* it)
{

    hu_textline_t *l = &it->l;

    if (!*it->on)
	return;
    HUlib_drawTextLine(l, true, PixelOffset/*DQ*/, RenderBuffer/*DQ*/); // draw the line w/ cursor

}

void HUlib_eraseIText(hu_itext_t* it, PBUFFER RenderBuffer, PBUFFER BackBuffer)
//void HUlib_eraseIText(hu_itext_t* it)
{
    if (it->laston && !*it->on)
	it->l.needsupdate = 4;
    HUlib_eraseTextLine(&it->l, RenderBuffer/*DQ*/, BackBuffer/*DQ*/);
    it->laston = *it->on;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99精品国产麻豆婷婷洗澡| 亚洲国产一区在线观看| 欧美日韩国产小视频在线观看| 色婷婷亚洲婷婷| 91在线视频免费观看| av不卡在线观看| 日本高清成人免费播放| 精品视频免费在线| 欧美一级淫片007| 精品久久人人做人人爰| 久久一区二区三区国产精品| 国产日韩欧美精品电影三级在线| 国产午夜精品福利| 国产精品高清亚洲| 亚洲综合色视频| 日韩精品视频网| 国产在线不卡一卡二卡三卡四卡| 大胆欧美人体老妇| 91网站最新网址| 欧美午夜一区二区三区免费大片| 欧美二区在线观看| 亚洲色图清纯唯美| 亚洲综合丝袜美腿| 麻豆精品蜜桃视频网站| 成人成人成人在线视频| 91黄色免费网站| 精品国精品国产| 中文字幕字幕中文在线中不卡视频| 亚洲电影一区二区三区| 免费成人结看片| 91小视频免费观看| 精品国产乱码久久| 亚洲激情av在线| 国产一区二区剧情av在线| 在线亚洲人成电影网站色www| 91精品办公室少妇高潮对白| 日韩精品最新网址| 专区另类欧美日韩| 精品一区二区三区免费观看| 91在线国产观看| 2021国产精品久久精品| 亚洲一区在线播放| 粉嫩久久99精品久久久久久夜| 欧美日韩久久不卡| 国产精品欧美一区喷水| 麻豆国产一区二区| 26uuu亚洲| 午夜精品福利一区二区三区av| 激情综合色播激情啊| 欧美日韩成人在线| 亚洲精品网站在线观看| 国产·精品毛片| 欧美不卡激情三级在线观看| 亚洲一区二区美女| bt欧美亚洲午夜电影天堂| 精品国产伦一区二区三区观看方式 | 欧美女孩性生活视频| 久久久久久久久伊人| 麻豆精品在线视频| 91精品欧美一区二区三区综合在| 久久久精品天堂| 国产一区视频导航| 日韩精品一区国产麻豆| 五月天久久比比资源色| 欧美亚洲另类激情小说| 亚洲美女视频一区| 色婷婷亚洲综合| 亚洲精品国久久99热| 色婷婷亚洲精品| 一级特黄大欧美久久久| 日本高清成人免费播放| 一区二区久久久久| 在线观看欧美日本| 亚洲一级电影视频| 欧美蜜桃一区二区三区| 日本亚洲天堂网| 欧美一区二区三区婷婷月色| 奇米综合一区二区三区精品视频| 欧美久久一区二区| 免费成人美女在线观看| 精品99999| 成人免费看片app下载| 国产精品嫩草影院com| 不卡在线观看av| 亚洲精品国久久99热| 91成人免费网站| 同产精品九九九| 精品久久久久久亚洲综合网| 国产风韵犹存在线视精品| 国产精品每日更新在线播放网址| 成人18精品视频| 亚洲国产成人av网| 日韩欧美在线一区二区三区| 狠狠色丁香久久婷婷综合_中| 国产日韩欧美一区二区三区乱码| 99精品久久99久久久久| 亚洲第一综合色| 欧美不卡视频一区| 91丨porny丨国产| 五月激情六月综合| 久久精品水蜜桃av综合天堂| aaa亚洲精品| 青青草91视频| 自拍偷自拍亚洲精品播放| 欧美系列日韩一区| 国产夫妻精品视频| 亚洲一区二区综合| 久久色成人在线| 欧美日韩国产综合久久| 国产精品中文欧美| 亚洲伊人色欲综合网| 久久久久久久久99精品| 在线观看中文字幕不卡| 国产一区二区在线电影| 亚洲日穴在线视频| 久久蜜桃一区二区| 欧美日韩国产区一| 99久精品国产| 国产精品综合视频| 蜜乳av一区二区三区| 亚洲欧美韩国综合色| 久久婷婷国产综合精品青草| 色播五月激情综合网| 国产91清纯白嫩初高中在线观看| 亚洲bdsm女犯bdsm网站| 亚洲欧洲无码一区二区三区| 欧美大片在线观看| 欧美高清精品3d| 99国产精品久久久| 懂色av一区二区三区免费观看| 奇米一区二区三区av| 亚洲高清免费在线| 亚洲欧洲一区二区三区| 久久精品欧美日韩精品 | 国产一区在线不卡| 日欧美一区二区| 亚洲一区二区在线免费看| 国产日韩欧美综合在线| 欧美xxxx在线观看| 日韩视频一区二区三区在线播放| 欧美亚洲国产一区二区三区| 本田岬高潮一区二区三区| 国产一区二区网址| 精品一区二区三区日韩| 喷水一区二区三区| 日韩高清在线电影| 日日骚欧美日韩| 日韩高清不卡一区二区三区| 亚洲精品自拍动漫在线| 亚洲欧美色图小说| 亚洲精品视频自拍| 亚洲精品乱码久久久久久| 椎名由奈av一区二区三区| ㊣最新国产の精品bt伙计久久| 亚洲国产精品传媒在线观看| 久久色在线视频| 中文字幕精品一区二区三区精品| 国产日韩欧美综合在线| 国产精品久久二区二区| 日韩一区有码在线| 亚洲一区二区免费视频| 午夜欧美视频在线观看| 奇米777欧美一区二区| 九一久久久久久| 国产99久久久国产精品潘金网站| 国产69精品久久777的优势| av亚洲精华国产精华精华| 在线观看亚洲成人| 日韩亚洲欧美综合| 国产日产亚洲精品系列| 亚洲色大成网站www久久九九| 亚洲精品中文字幕乱码三区| 午夜视频久久久久久| 久久国产精品区| 成人白浆超碰人人人人| 欧美优质美女网站| 久久综合资源网| 中文幕一区二区三区久久蜜桃| 伊人一区二区三区| 麻豆精品视频在线| 成人av午夜电影| 欧美麻豆精品久久久久久| 精品国产凹凸成av人网站| 成人免费一区二区三区在线观看| 亚洲6080在线| 国产精品69毛片高清亚洲| 欧美在线制服丝袜| 精品国产一区二区三区四区四| 国产精品免费网站在线观看| 亚洲电影一级片| 成人精品在线视频观看| 在线成人av网站| 椎名由奈av一区二区三区| 蜜桃91丨九色丨蝌蚪91桃色| 色综合久久久久综合体| 精品国产乱码久久久久久牛牛| 日韩理论在线观看| 久久草av在线| 777a∨成人精品桃花网| 亚洲天天做日日做天天谢日日欢 |