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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? r_data.c

?? 游戲類程序源代碼---WinDoom 3D源程序.zip
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
// 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:$
//
// Revision 1.3  1997/01/29 20:10
// DESCRIPTION:
//	Preparation of data for rendering,
//	generation of lookups, caching, retrieval by name.
//
//-----------------------------------------------------------------------------


static const char
rcsid[] = "$Id: r_data.c,v 1.4 1997/02/03 16:47:55 b1 Exp $";

#include "i_system.h"
#include "z_zone.h"

#include "m_swap.h"

#include "w_wad.h"

#include "doomdef.h"
#include "r_local.h"
#include "p_local.h"

#include "doomstat.h"
#include "r_sky.h"

#ifdef LINUX
#include  <alloca.h>
#endif

#define alloca malloc


#include "r_data.h"

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

//
// Graphics.
// DOOM graphics for walls and sprites
// is stored in vertical runs of opaque pixels (posts).
// A column is composed of zero or more posts,
// a patch or sprite is composed of zero or more columns.
// 



//
// Texture definition.
// Each texture is composed of one or more patches,
// with patches being lumps stored in the WAD.
// The lumps are referenced by number, and patched
// into the rectangular texture space using origin
// and possibly other attributes.
//
typedef struct
{
    short	originx;
    short	originy;
    short	patch;
    short	stepdir;
    short	colormap;
} mappatch_t;


//
// Texture definition.
// A DOOM wall texture is a list of patches
// which are to be combined in a predefined order.
//
typedef struct
{
    char		name[8];
    boolean		masked;	
    short		width;
    short		height;
    void		**columndirectory;	// OBSOLETE
    short		patchcount;
    mappatch_t	patches[1];
} maptexture_t;


// A single patch from a texture definition,
//  basically a rectangular area within
//  the texture rectangle.
typedef struct
{
    // Block origin (allways UL),
    // which has allready accounted
    // for the internal origin of the patch.
    int		originx;	
    int		originy;
    int		patch;
} texpatch_t;


// A maptexturedef_t describes a rectangular texture,
//  which is composed of one or more mappatch_t structures
//  that arrange graphic patches.
typedef struct
{
    // Keep name for switch changing, etc.
    char	name[8];		
    short	width;
    short	height;
    
    // All the patches[patchcount]
    //  are drawn back to front into the cached texture.
    short	patchcount;
    texpatch_t	patches[1];		
    
} texture_t;



int		firstflat;
int		lastflat;
int		numflats;

int		firstpatch;
int		lastpatch;
int		numpatches;

int		firstspritelump;
int		lastspritelump;
int		numspritelumps;

int		numtextures;
texture_t**	textures;


int*			texturewidthmask;
// needed for texture pegging
fixed_t*		textureheight;		
int*			texturecompositesize;
short**			texturecolumnlump;
unsigned short**	texturecolumnofs;
byte**			texturecomposite;

// for global animation
int*		flattranslation;
int*		texturetranslation;

// needed for pre rendering
fixed_t*	spritewidth;	
fixed_t*	spriteoffset;
fixed_t*	spritetopoffset;

lighttable_t	*colormaps;


//
// MAPTEXTURE_T CACHING
// When a texture is first needed,
//  it counts the number of composite columns
//  required in the texture and allocates space
//  for a column directory and any new columns.
// The directory will simply point inside other patches
//  if there is only one patch in a given column,
//  but any columns with multiple patches
//  will have new column_ts generated.
//



//
// R_DrawColumnInCache
// Clip and draw a column
//  from a patch into a cached post.
//
void
R_DrawColumnInCache
( column_t*	patch,
  byte*		cache,
  int		originy,
  int		cacheheight )
{
    int		count;
    int		position;
    byte*	source;
    byte*	dest;
	
    dest = (byte *)cache + 3;
	
    while (patch->topdelta != 0xff)
    {
	source = (byte *)patch + 3;
	count = patch->length;
	position = originy + patch->topdelta;

	if (position < 0)
	{
	    count += position;
	    position = 0;
	}

	if (position + count > cacheheight)
	    count = cacheheight - position;

	if (count > 0)
	    memcpy (cache + position, source, count);
		
	patch = (column_t *)(  (byte *)patch + patch->length + 4); 
    }
}



//
// R_GenerateComposite
// Using the texture definition,
//  the composite texture is created from the patches,
//  and each column is cached.
//
void R_GenerateComposite (int texnum)
{
    byte*		block;
    texture_t*		texture;
    texpatch_t*		patch;	
    patch_t*		realpatch;
    int			x;
    int			x1;
    int			x2;
    int			i;
    column_t*		patchcol;
    short*		collump;
    unsigned short*	colofs;
	
    texture = textures[texnum];

    block = Z_Malloc (texturecompositesize[texnum],
		      PU_STATIC, 
		      &texturecomposite[texnum]);	

    collump = texturecolumnlump[texnum];
    colofs = texturecolumnofs[texnum];
    
    // Composite the columns together.
    patch = texture->patches;
		
    for (i=0 , patch = texture->patches;
	 i<texture->patchcount;
	 i++, patch++)
    {
	realpatch = W_CacheLumpNum (patch->patch, PU_CACHE);
	x1 = patch->originx;
	x2 = x1 + SHORT(realpatch->width);

	if (x1<0)
	    x = 0;
	else
	    x = x1;
	
	if (x2 > texture->width)
	    x2 = texture->width;

	for ( ; x<x2 ; x++)
	{
	    // Column does not have multiple patches?
	    if (collump[x] >= 0)
		continue;
	    
	    patchcol = (column_t *)((byte *)realpatch
				    + LONG(realpatch->columnofs[x-x1]));
	    R_DrawColumnInCache (patchcol,
				 block + colofs[x],
				 patch->originy,
				 texture->height);
	}
						
    }

    // Now that the texture has been built in column cache,
    //  it is purgable from zone memory.
    Z_ChangeTag (block, PU_CACHE);
}



//
// R_GenerateLookup
//
void R_GenerateLookup (int texnum)
{
    texture_t*		texture;
    byte*		patchcount;	// patchcount[texture->width]
    texpatch_t*		patch;	
    patch_t*		realpatch;
    int			x;
    int			x1;
    int			x2;
    int			i;
    short*		collump;
    unsigned short*	colofs;
	
    texture = textures[texnum];

    // Composited texture not created yet.
    texturecomposite[texnum] = 0;
    
    texturecompositesize[texnum] = 0;
    collump = texturecolumnlump[texnum];
    colofs = texturecolumnofs[texnum];
    
    // Now count the number of columns
    //  that are covered by more than one patch.
    // Fill in the lump / offset, so columns
    //  with only a single patch are all done.
    patchcount = (byte *)alloca (texture->width);
    memset (patchcount, 0, texture->width);
    patch = texture->patches;
		
    for (i=0 , patch = texture->patches;
	 i<texture->patchcount;
	 i++, patch++)
    {
	realpatch = W_CacheLumpNum (patch->patch, PU_CACHE);
	x1 = patch->originx;
	x2 = x1 + SHORT(realpatch->width);
	
	if (x1 < 0)
	    x = 0;
	else
	    x = x1;

	if (x2 > texture->width)
	    x2 = texture->width;
	for ( ; x<x2 ; x++)
	{
	    patchcount[x]++;
	    collump[x] = patch->patch;
	    colofs[x] = LONG(realpatch->columnofs[x-x1])+3;
	}
    }
	
    for (x=0 ; x<texture->width ; x++)
    {
	if (!patchcount[x])
	{
	    sprintf (MsgText,"R_GenerateLookup: column without a patch (%s)\n",
		    texture->name);
        WriteDebug(MsgText);
	    return;
	}
	// I_Error ("R_GenerateLookup: column without a patch");
	
	if (patchcount[x] > 1)
	{
	    // Use the cached block.
	    collump[x] = -1;	
	    colofs[x] = texturecompositesize[texnum];
	    
	    if (texturecompositesize[texnum] > 0x10000-texture->height)
	    {
		I_Error ("R_GenerateLookup: texture %i is >64k",
			 texnum);
	    }
	    
	    texturecompositesize[texnum] += texture->height;
	}
    }	
}




//
// R_GetColumn
//
byte*
R_GetColumn
( int		tex,
  int		col )
{
    int		lump;
    int		ofs;
	
    col &= texturewidthmask[tex];
    lump = texturecolumnlump[tex][col];
    ofs = texturecolumnofs[tex][col];
    
    if (lump > 0)
	return (byte *)W_CacheLumpNum(lump,PU_CACHE)+ofs;

    if (!texturecomposite[tex])
	R_GenerateComposite (tex);

    return texturecomposite[tex] + ofs;
}




//
// R_InitTextures
// Initializes the texture list
//  with the textures from the world map.
//
void R_InitTextures (void)
{
    maptexture_t*	mtexture;
    texture_t*		texture;
    mappatch_t*		mpatch;
    texpatch_t*		patch;

    int			i;
    int			j;

    int*		maptex;
    int*		maptex2;
    int*		maptex1;
    
    char		name[9];
    char*		names;
    char*		name_p;
    
    int*		patchlookup;
    
    int			totalwidth;
    int			nummappatches;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
1区2区3区国产精品| 一区二区久久久久久| 91福利精品视频| 久久成人av少妇免费| 中文字幕一区二区三区蜜月| 日韩一级大片在线| 欧美在线免费播放| 高潮精品一区videoshd| 日本欧美肥老太交大片| 亚洲自拍偷拍九九九| 国产亚洲综合性久久久影院| 日韩一区二区三区三四区视频在线观看| 色综合一个色综合亚洲| 成人性生交大片免费看中文| 国产一区二区三区国产| 午夜久久久久久| 又紧又大又爽精品一区二区| 国产精品灌醉下药二区| 2021久久国产精品不只是精品| 欧美色倩网站大全免费| 色先锋资源久久综合| 不卡欧美aaaaa| 国产夫妻精品视频| 久久9热精品视频| 三级在线观看一区二区| 亚洲国产人成综合网站| 亚洲激情图片小说视频| 亚洲人成精品久久久久| 国产精品久久久久久妇女6080| 久久久久久久久久久久久女国产乱| 欧美一区二区三区成人| 欧美高清视频不卡网| 在线亚洲+欧美+日本专区| 日本丰满少妇一区二区三区| 91在线视频免费观看| 91亚洲大成网污www| 91麻豆自制传媒国产之光| 大陆成人av片| 99久久伊人精品| av激情成人网| 色婷婷一区二区| 欧美中文字幕一区二区三区亚洲| 日本韩国一区二区三区视频| 色综合久久综合网欧美综合网| 99久久婷婷国产综合精品电影| 成人黄色一级视频| k8久久久一区二区三区 | 精品写真视频在线观看| 免费人成在线不卡| 韩国成人在线视频| 国产剧情一区在线| 成人av手机在线观看| 97久久精品人人做人人爽| 在线一区二区三区四区五区| 欧美日韩国产成人在线免费| 日韩免费视频一区| 久久精品男人天堂av| 成人免费在线视频| 亚洲一区二区美女| 久久国产剧场电影| 北条麻妃一区二区三区| 91麻豆精品秘密| 欧美精品在线视频| 久久精品欧美一区二区三区不卡 | 精品久久久网站| 久久亚洲一级片| 国产精品短视频| 婷婷开心激情综合| 国模娜娜一区二区三区| 97久久超碰国产精品电影| 欧美日韩一区二区三区四区五区 | 日韩在线一二三区| 精品一区二区三区香蕉蜜桃| 国产+成+人+亚洲欧洲自线| www.亚洲人| 欧美一区二区视频在线观看2022| 国产亚洲综合在线| 一区二区免费视频| 久久精品av麻豆的观看方式| 成人黄页毛片网站| 宅男在线国产精品| 中文字幕第一页久久| 亚洲线精品一区二区三区八戒| 久久成人免费网| 色婷婷久久久久swag精品 | 一区二区三区中文字幕| 开心九九激情九九欧美日韩精美视频电影| 丁香激情综合五月| 91精品国产91久久久久久最新毛片| 国产精品嫩草久久久久| 日韩成人伦理电影在线观看| 成人网页在线观看| 欧美一区二区黄| 18成人在线视频| 国产在线不卡视频| 欧美日韩你懂的| 一区免费观看视频| 精品亚洲aⅴ乱码一区二区三区| 欧美综合在线视频| 欧美激情一区二区三区在线| 午夜精品久久久久久久久久久| www.亚洲色图| 2024国产精品| 日本不卡免费在线视频| 在线一区二区观看| 最新久久zyz资源站| 国产毛片一区二区| 91精品国产高清一区二区三区 | 亚洲国产精品高清| 捆绑调教美女网站视频一区| 欧美综合天天夜夜久久| 中文字幕在线一区| 国产精品亚洲专一区二区三区| 91精品国产色综合久久不卡蜜臀| 亚洲精品国产精华液| 99在线精品视频| 国产欧美日韩激情| 国产精品影视网| 久久一留热品黄| 久热成人在线视频| 日韩午夜小视频| 免费看日韩精品| 欧美一二区视频| 天堂在线亚洲视频| 欧美喷潮久久久xxxxx| 亚洲一区二区在线播放相泽| 色综合天天视频在线观看| 中文字幕亚洲成人| www.亚洲色图.com| 国产精品视频免费看| 国产成人精品影院| 国产欧美日韩在线| 成人免费高清视频| 国产精品进线69影院| 99re这里都是精品| 亚洲丝袜自拍清纯另类| 色诱亚洲精品久久久久久| 亚洲男人的天堂一区二区| 色哟哟日韩精品| 一区二区三区四区不卡在线| 91久久精品午夜一区二区| 有码一区二区三区| 欧美三级中文字| 日本午夜精品视频在线观看| 欧美大胆人体bbbb| 精品一区二区三区香蕉蜜桃| 久久伊99综合婷婷久久伊| 国产成人免费视频精品含羞草妖精| 久久综合给合久久狠狠狠97色69| 国产成人亚洲综合a∨婷婷| 国产欧美日韩视频在线观看| 99re这里都是精品| 亚洲国产另类精品专区| 91精品久久久久久蜜臀| 韩国理伦片一区二区三区在线播放| 久久这里只精品最新地址| 成人午夜电影网站| 亚洲午夜羞羞片| 欧美成人精品3d动漫h| 国产美女久久久久| 亚洲另类中文字| 91精品国产综合久久久久久久| 久久91精品久久久久久秒播| 欧美精彩视频一区二区三区| 欧洲一区二区av| 精品午夜久久福利影院| 欧美国产精品专区| 欧美艳星brazzers| 韩国成人福利片在线播放| 18成人在线观看| 日韩欧美一区二区三区在线| 国产+成+人+亚洲欧洲自线| 亚洲国产精品一区二区久久恐怖片| 日韩欧美视频一区| 99久久精品国产网站| 日韩成人一级片| 亚洲欧洲精品一区二区三区不卡| 欧美美女一区二区在线观看| 丰满白嫩尤物一区二区| 亚洲午夜电影在线观看| 久久精品亚洲麻豆av一区二区| 91九色02白丝porn| 国内精品国产三级国产a久久| 亚洲日本在线天堂| 久久综合九色综合97婷婷女人 | 国产在线播放一区三区四| 亚洲免费在线看| 日韩精品一区二区三区中文精品| 97久久精品人人做人人爽50路| 久久精品国产澳门| 亚洲一卡二卡三卡四卡五卡| 国产无一区二区| 91精品综合久久久久久| 一本久久精品一区二区 | 欧美日韩在线免费视频| 国产精品综合网| 蜜臀av一区二区| 午夜av电影一区| 亚洲手机成人高清视频| 久久精品亚洲麻豆av一区二区|