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

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

?? am_map.c

?? 游戲類程序源代碼---WinDoom 3D源程序.zip
?? C
?? 第 1 頁 / 共 3 頁
字號:
// 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:  the automap code
//
//-----------------------------------------------------------------------------

static const char rcsid[] = "$Id: am_map.c,v 1.4 1997/02/03 21:24:33 b1 Exp $";

#include <stdio.h>


#include "z_zone.h"
#include "doomdef.h"
#include "st_stuff.h"
#include "p_local.h"
#include "w_wad.h"

#include "m_cheat.h"
#include "i_system.h"

// Needs access to LFB.
#include "v_video.h"

// State.
#include "doomstat.h"
#include "r_state.h"

// Data.
#include "dstrings.h"

#include "am_map.h"

char MsgText[256];
void WriteDebug(char *);

// For use if I do walls with outsides/insides
#define REDS		(256-5*16)
#define REDRANGE	16
#define BLUES		(256-4*16+8)
#define BLUERANGE	8
#define GREENS		(7*16)
#define GREENRANGE	16
#define GRAYS		(6*16)
#define GRAYSRANGE	16
#define BROWNS		(4*16)
#define BROWNRANGE	16
#define YELLOWS		(256-32+7)
#define YELLOWRANGE	1
#define BLACK		0
#define WHITE		(256-47)

// Automap colors
#define BACKGROUND	BLACK
#define YOURCOLORS	WHITE
#define YOURRANGE	0
#define WALLCOLORS	REDS
#define WALLRANGE	REDRANGE
#define TSWALLCOLORS	GRAYS
#define TSWALLRANGE	GRAYSRANGE
#define FDWALLCOLORS	BROWNS
#define FDWALLRANGE	BROWNRANGE
#define CDWALLCOLORS	YELLOWS
#define CDWALLRANGE	YELLOWRANGE
#define THINGCOLORS	GREENS
#define THINGRANGE	GREENRANGE
#define SECRETWALLCOLORS WALLCOLORS
#define SECRETWALLRANGE WALLRANGE
#define GRIDCOLORS	(GRAYS + GRAYSRANGE/2)
#define GRIDRANGE	0
#define XHAIRCOLORS	GRAYS

// drawing stuff
#define	FB		0

#define AM_PANDOWNKEY	KEY_DOWNARROW
#define AM_PANUPKEY	KEY_UPARROW
#define AM_PANRIGHTKEY	KEY_RIGHTARROW
#define AM_PANLEFTKEY	KEY_LEFTARROW
#define AM_ZOOMINKEY	KEY_EQUALS
#define AM_ZOOMOUTKEY	KEY_MINUS
#define AM_STARTKEY	KEY_TAB
#define AM_ENDKEY	KEY_TAB
#define AM_GOBIGKEY	KEY_0
#define AM_FOLLOWKEY	KEY_F
#define AM_GRIDKEY	KEY_G
#define AM_MARKKEY	KEY_M
#define AM_CLEARMARKKEY	KEY_C

#define AM_NUMMARKPOINTS 10

// scale on entry
#define INITSCALEMTOF (.2*FRACUNIT)
// how much the automap moves window per tic in frame-buffer coordinates
// moves 140 pixels in 1 second
#define F_PANINC	4
// how much zoom-in per tic
// goes to 2x in 1 second
#define M_ZOOMIN        ((int) (1.02*FRACUNIT))
// how much zoom-out per tic
// pulls out to 0.5x in 1 second
#define M_ZOOMOUT       ((int) (FRACUNIT/1.02))

// translates between frame-buffer and map distances
#define FTOM(x) FixedMul(((x)<<16),scale_ftom)
#define MTOF(x) (FixedMul((x),scale_mtof)>>16)
// translates between frame-buffer and map coordinates
#define CXMTOF(x)  (f_x + MTOF((x)-m_x))
#define CYMTOF(y)  (f_y + (f_h - MTOF((y)-m_y)))

// the following is crap
#define LINE_NEVERSEE ML_DONTDRAW

typedef struct
{
    int x, y;
} fpoint_t;

typedef struct
{
    fpoint_t a, b;
} fline_t;

typedef struct
{
    fixed_t		x,y;
} mpoint_t;

typedef struct
{
    mpoint_t a, b;
} mline_t;

typedef struct
{
    fixed_t slp, islp;
} islope_t;



//
// The vector graphics for the automap.
//  A line drawing of the player pointing right,
//   starting from the middle.
//
#define R ((8*PLAYERRADIUS)/7)
mline_t player_arrow[] = {
    { { -R+R/8, 0 }, { R, 0 } }, // -----
    { { R, 0 }, { R-R/2, R/4 } },  // ----->
    { { R, 0 }, { R-R/2, -R/4 } },
    { { -R+R/8, 0 }, { -R-R/8, R/4 } }, // >---->
    { { -R+R/8, 0 }, { -R-R/8, -R/4 } },
    { { -R+3*R/8, 0 }, { -R+R/8, R/4 } }, // >>--->
    { { -R+3*R/8, 0 }, { -R+R/8, -R/4 } }
};
#undef R
#define NUMPLYRLINES (sizeof(player_arrow)/sizeof(mline_t))

#define R ((8*PLAYERRADIUS)/7)
mline_t cheat_player_arrow[] = {
    { { -R+R/8, 0 }, { R, 0 } }, // -----
    { { R, 0 }, { R-R/2, R/6 } },  // ----->
    { { R, 0 }, { R-R/2, -R/6 } },
    { { -R+R/8, 0 }, { -R-R/8, R/6 } }, // >----->
    { { -R+R/8, 0 }, { -R-R/8, -R/6 } },
    { { -R+3*R/8, 0 }, { -R+R/8, R/6 } }, // >>----->
    { { -R+3*R/8, 0 }, { -R+R/8, -R/6 } },
    { { -R/2, 0 }, { -R/2, -R/6 } }, // >>-d--->
    { { -R/2, -R/6 }, { -R/2+R/6, -R/6 } },
    { { -R/2+R/6, -R/6 }, { -R/2+R/6, R/4 } },
    { { -R/6, 0 }, { -R/6, -R/6 } }, // >>-dd-->
    { { -R/6, -R/6 }, { 0, -R/6 } },
    { { 0, -R/6 }, { 0, R/4 } },
    { { R/6, R/4 }, { R/6, -R/7 } }, // >>-ddt->
    { { R/6, -R/7 }, { R/6+R/32, -R/7-R/32 } },
    { { R/6+R/32, -R/7-R/32 }, { R/6+R/10, -R/7 } }
};
#undef R
#define NUMCHEATPLYRLINES (sizeof(cheat_player_arrow)/sizeof(mline_t))

#define R (FRACUNIT)
mline_t triangle_guy[] = {
    { { -.867*R, -.5*R }, { .867*R, -.5*R } },
    { { .867*R, -.5*R } , { 0, R } },
    { { 0, R }, { -.867*R, -.5*R } }
};
#undef R
#define NUMTRIANGLEGUYLINES (sizeof(triangle_guy)/sizeof(mline_t))

#define R (FRACUNIT)
mline_t thintriangle_guy[] = {
    { { -.5*R, -.7*R }, { R, 0 } },
    { { R, 0 }, { -.5*R, .7*R } },
    { { -.5*R, .7*R }, { -.5*R, -.7*R } }
};
#undef R
#define NUMTHINTRIANGLEGUYLINES (sizeof(thintriangle_guy)/sizeof(mline_t))




static int 	cheating = 0;
static int 	grid = 0;

static int 	leveljuststarted = 1; 	// kluge until AM_LevelInit() is called

boolean    	automapactive = false;
//static int 	finit_width = SCREENWIDTH;
//static int 	finit_height = SCREENHEIGHT - 32;

// location of window on screen
static int 	f_x;
static int	f_y;

// size of window on screen
static int 	f_w;
static int	f_h;

static int 	lightlev; 		// used for funky strobing effect
// DQ removed fb, want the buffer to be a parameter
//static byte*	fb; 			// pseudo-frame buffer
static int 	amclock;

static mpoint_t m_paninc; // how far the window pans each tic (map coords)
static fixed_t 	mtof_zoommul; // how far the window zooms in each tic (map coords)
static fixed_t 	ftom_zoommul; // how far the window zooms in each tic (fb coords)

static fixed_t 	m_x, m_y;   // LL x,y where the window is on the map (map coords)
static fixed_t 	m_x2, m_y2; // UR x,y where the window is on the map (map coords)

//
// width/height of window on map (map coords)
//
static fixed_t 	m_w;
static fixed_t	m_h;

// based on level size
static fixed_t 	min_x;
static fixed_t	min_y; 
static fixed_t 	max_x;
static fixed_t  max_y;

static fixed_t 	max_w; // max_x-min_x,
static fixed_t  max_h; // max_y-min_y

// based on player size
static fixed_t 	min_w;
static fixed_t  min_h;


static fixed_t 	min_scale_mtof; // used to tell when to stop zooming out
static fixed_t 	max_scale_mtof; // used to tell when to stop zooming in

// old stuff for recovery later
static fixed_t old_m_w, old_m_h;
static fixed_t old_m_x, old_m_y;

// old location used by the Follower routine
static mpoint_t f_oldloc;

// used by MTOF to scale from map-to-frame-buffer coords
static fixed_t scale_mtof = INITSCALEMTOF;
// used by FTOM to scale from frame-buffer-to-map coords (=1/scale_mtof)
static fixed_t scale_ftom;

static player_t *plr; // the player represented by an arrow

static patch_t *marknums[10]; // numbers used for marking by the automap
static mpoint_t markpoints[AM_NUMMARKPOINTS]; // where the points are
static int markpointnum = 0; // next point to be assigned

static int followplayer = 1; // specifies whether to follow the player around

static unsigned char cheat_amap_seq[] = { 0xb2, 0x26, 0x26, 0x2e, 0xff };
static cheatseq_t cheat_amap = { cheat_amap_seq, 0 };

static boolean stopped = true;

extern boolean viewactive;
//extern byte screens[][SCREENWIDTH*SCREENHEIGHT];

void
V_MarkRect
( int	x,
  int	y,
  int	width,
  int	height );

// Calculates the slope and slope according to the x-axis of a line
// segment in map coordinates (with the upright y-axis n' all) so
// that it can be used with the brain-dead drawing stuff.

void
AM_getIslope
( mline_t*	ml,
  islope_t*	is )
{
    int dx, dy;

    dy = ml->a.y - ml->b.y;
    dx = ml->b.x - ml->a.x;
    if (!dy) is->islp = (dx<0?-MAXINT:MAXINT);
    else is->islp = FixedDiv(dx, dy);
    if (!dx) is->slp = (dy<0?-MAXINT:MAXINT);
    else is->slp = FixedDiv(dy, dx);

}

//
//
//
void AM_activateNewScale(void)
{
    m_x += m_w/2;
    m_y += m_h/2;
    m_w = FTOM(f_w);
    m_h = FTOM(f_h);
    m_x -= m_w/2;
    m_y -= m_h/2;
    m_x2 = m_x + m_w;
    m_y2 = m_y + m_h;
}

//
//
//
void AM_saveScaleAndLoc(void)
{
    old_m_x = m_x;
    old_m_y = m_y;
    old_m_w = m_w;
    old_m_h = m_h;
}

//
//
//
void AM_restoreScaleAndLoc(void)
{

    m_w = old_m_w;
    m_h = old_m_h;
    if (!followplayer)
    {
	m_x = old_m_x;
	m_y = old_m_y;
    } else {
	m_x = plr->mo->x - m_w/2;
	m_y = plr->mo->y - m_h/2;
    }
    m_x2 = m_x + m_w;
    m_y2 = m_y + m_h;

    // Change the scaling multipliers
    scale_mtof = FixedDiv(f_w<<FRACBITS, m_w);
    scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
}

//
// adds a marker at the current location
//
void AM_addMark(void)
{
    markpoints[markpointnum].x = m_x + m_w/2;
    markpoints[markpointnum].y = m_y + m_h/2;
    markpointnum = (markpointnum + 1) % AM_NUMMARKPOINTS;

}

//
// Determines bounding box of all vertices,
// sets global variables controlling zoom range.
//
void AM_findMinMaxBoundaries(void)
{
    int i;
    fixed_t a;
    fixed_t b;

    min_x = min_y =  MAXINT;
    max_x = max_y =  MININT;
  
    for (i=0;i<numvertexes;i++)
    {
	if (vertexes[i].x < min_x)
	    min_x = vertexes[i].x;
	else if (vertexes[i].x > max_x)
	    max_x = vertexes[i].x;
    
	if (vertexes[i].y < min_y)
	    min_y = vertexes[i].y;
	else if (vertexes[i].y > max_y)
	    max_y = vertexes[i].y;
    }
  
    max_w = max_x - min_x;
    max_h = max_y - min_y;

//    sprintf(MsgText, "max_x,max_y = %d,%d : min_x,min_y = %d,%d\n",
//            max_x>>FRACBITS, max_y>>FRACBITS, min_x>>FRACBITS, min_y>>FRACBITS);
//    WriteDebug(MsgText);

    min_w = 2*PLAYERRADIUS; // const? never changed?
    min_h = 2*PLAYERRADIUS;

//    sprintf(MsgText, "max_w,max_h = %d,%d: min_w,min_h %d,%d\n",
//            max_w>>FRACBITS, max_h>>FRACBITS, min_w>>FRACBITS, min_h>>FRACBITS);
//    WriteDebug(MsgText);

    a = FixedDiv(f_w<<FRACBITS, max_w);
    b = FixedDiv(f_h<<FRACBITS, max_h);
//    sprintf(MsgText, "a = %d, b = %d\n", a, b);
//    WriteDebug(MsgText);
  
    min_scale_mtof = a < b ? a : b;
    max_scale_mtof = FixedDiv(f_h<<FRACBITS, 2*PLAYERRADIUS);
//    sprintf(MsgText, "min_scale_mtof = %d, max_scale_mtof = %d\n", min_scale_mtof, max_scale_mtof);
//    WriteDebug(MsgText);

}


//
//
//
void AM_changeWindowLoc(void)
{
    if (m_paninc.x || m_paninc.y)
    {
	followplayer = 0;
	f_oldloc.x = MAXINT;
    }

    m_x += m_paninc.x;
    m_y += m_paninc.y;

    if (m_x + m_w/2 > max_x)
	m_x = max_x - m_w/2;
    else if (m_x + m_w/2 < min_x)
	m_x = min_x - m_w/2;
  
    if (m_y + m_h/2 > max_y)
	m_y = max_y - m_h/2;
    else if (m_y + m_h/2 < min_y)
	m_y = min_y - m_h/2;

    m_x2 = m_x + m_w;
    m_y2 = m_y + m_h;
}


//
//
//
void AM_initVariables(void)
{
    int pnum;
    static event_t st_notify = { ev_keyup, AM_MSGENTERED };

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品成人在线| 久久色视频免费观看| 亚洲欧美电影院| 99精品视频在线播放观看| 国产精品久久久久久久第一福利| 成人黄色小视频在线观看| 中文字幕在线一区免费| 91在线码无精品| 亚洲成人资源网| 91精品国产91久久久久久最新毛片 | 精品捆绑美女sm三区| 国产精品主播直播| 亚洲欧美日韩电影| 欧美一区二区二区| 国产伦精品一区二区三区视频青涩 | 一区二区三区四区精品在线视频 | 亚洲一区在线视频观看| 欧美一级午夜免费电影| 丁香一区二区三区| 亚洲国产色一区| 精品毛片乱码1区2区3区| 本田岬高潮一区二区三区| 一区二区三区在线观看欧美| 91精品综合久久久久久| 成人免费视频视频在线观看免费| 一区二区三区美女视频| 精品美女一区二区三区| 色又黄又爽网站www久久| 免费成人深夜小野草| 亚洲欧洲日产国码二区| 日韩一区二区在线观看视频播放| 国产福利91精品| 三级成人在线视频| 中文字幕一区二区三区不卡在线| 51精品久久久久久久蜜臀| 国v精品久久久网| 日韩电影网1区2区| 国产精品成人免费在线| 欧美videos大乳护士334| 94-欧美-setu| 国产一区中文字幕| 日韩成人一级大片| 亚洲精品视频免费观看| 久久一区二区三区四区| 欧美喷潮久久久xxxxx| 粉嫩13p一区二区三区| 蜜臀av一区二区| 亚洲高清视频中文字幕| 国产精品乱码一区二区三区软件| 欧美一级久久久久久久大片| 91视频在线看| 成人午夜在线免费| 精品一区二区免费看| 日韩黄色免费网站| 亚洲午夜久久久久久久久电影网| 国产欧美一区二区三区在线看蜜臀| 欧美一级黄色录像| 欧美人与性动xxxx| 国产精品白丝在线| 欧美国产日韩a欧美在线观看| 欧美一区二区三区四区在线观看| 91国模大尺度私拍在线视频| 风流少妇一区二区| 国产一区91精品张津瑜| 精品一区二区三区免费| 久久国产免费看| 美女网站色91| 老司机免费视频一区二区 | 久久精品国内一区二区三区| 亚洲一区二区精品视频| 亚洲另类春色国产| 亚洲精品一二三区| 曰韩精品一区二区| 亚洲乱码国产乱码精品精98午夜| 专区另类欧美日韩| 亚洲视频网在线直播| 亚洲天堂精品在线观看| 国产精品久久久久永久免费观看| 日本一区二区三区国色天香 | 91免费国产视频网站| 成人av免费网站| 成人app软件下载大全免费| 国产成人av资源| 成人av在线播放网址| 成人av午夜影院| 一本色道**综合亚洲精品蜜桃冫| 91浏览器在线视频| 欧美在线短视频| 欧美一区二区三区的| 欧美一三区三区四区免费在线看| 亚洲午夜精品17c| 奇米在线7777在线精品| 精品中文字幕一区二区| 国产成人综合在线| 99久久精品国产麻豆演员表| 在线观看视频一区二区 | 国产一区二区精品久久91| 国产精品一区二区免费不卡 | 欧美国产一区在线| 亚洲人123区| 免费在线看成人av| 国产一区二区日韩精品| 99久久精品免费看| 欧美男男青年gay1069videost| 日韩一区二区三区视频在线观看| 久久综合久久综合亚洲| 中文字幕欧美三区| 亚洲五月六月丁香激情| 91精品国产高清一区二区三区| 精品久久久久香蕉网| 国产精品视频免费看| 亚洲国产精品精华液网站| 久久69国产一区二区蜜臀| 99在线精品观看| 欧美一区二区三区免费大片| 日本一区二区久久| 亚洲成人精品影院| 国产乱码精品一区二区三区五月婷| 91免费看片在线观看| 日韩欧美亚洲一区二区| 国产精品初高中害羞小美女文| 视频一区中文字幕| 99久久国产免费看| 精品久久久久99| 伊人开心综合网| 国产v综合v亚洲欧| 91麻豆精品国产91久久久久久 | 亚洲精品免费在线| 久久精品久久久精品美女| 色噜噜狠狠一区二区三区果冻| 欧美精品一区二区高清在线观看| 夜夜精品浪潮av一区二区三区| 国产一区二区91| 日韩一级视频免费观看在线| 樱花草国产18久久久久| 国产高清在线精品| 日韩一级高清毛片| 亚洲国产一区二区在线播放| 成人免费高清视频| 日日摸夜夜添夜夜添亚洲女人| 成人app在线| 久久综合久久99| 日韩国产成人精品| 欧洲一区在线观看| 亚洲婷婷综合色高清在线| 国产在线精品免费| 日韩一区二区三区三四区视频在线观看 | 亚洲三级在线播放| 国产99久久久国产精品潘金网站| 欧美一区二区三区四区五区| 亚洲一区二区在线观看视频 | av资源网一区| 日本一区二区三区国色天香| 国模一区二区三区白浆| 日韩三级高清在线| 日韩成人一级片| 91精品在线一区二区| 手机精品视频在线观看| 欧美精品色一区二区三区| 亚洲免费观看高清在线观看| aaa亚洲精品一二三区| 欧美国产1区2区| 成人毛片在线观看| 欧美国产日韩亚洲一区| 国产成人久久精品77777最新版本| 日韩免费性生活视频播放| 久久精品理论片| 亚洲精品在线一区二区| 精品一二三四在线| 精品裸体舞一区二区三区| 国产一区欧美一区| 蜜臀av国产精品久久久久| 日韩一区二区高清| 精品在线播放午夜| 久久久久久黄色| 成人avav影音| 一级特黄大欧美久久久| 在线亚洲欧美专区二区| 亚洲成人1区2区| 欧美一级二级在线观看| 激情亚洲综合在线| 欧美国产禁国产网站cc| 91丨国产丨九色丨pron| 亚洲午夜羞羞片| 日韩欧美高清在线| 国产一区不卡视频| 亚洲欧洲日韩女同| 欧美日韩一二区| 美女视频一区二区| 亚洲国产岛国毛片在线| 在线观看不卡视频| 捆绑调教美女网站视频一区| 久久精品一区二区三区av| 9l国产精品久久久久麻豆| 亚洲h在线观看| 精品对白一区国产伦| 99久久综合99久久综合网站| 亚洲自拍偷拍综合| 欧美成人激情免费网| 99久久亚洲一区二区三区青草|