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

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

?? raycast.cpp

?? quake 游戲原代碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:

/*********************

Portions of this code taken from Programming Gurus book by Waite Group

Most written for super speed game on '040 by Joshua Glazer
Those portions are Copyright Joshua Glazer c1994

Lightening fast two-level Fixed Point Routines Copyright Joshua Glazer c1994

These routines may be used by one Matthew Howard, but 
credit must be given to Joshua Glazer c1994

**** Yea, well I wrote some nice asm routines for IBM so, you can give Matt Howard -1994
a little credit too! ****

I like writing Joshua Glazer c1994

Violaters of the Copyright law violated by violating this source-code
will be hunted down and castrated (or spayed) by Joshua Glazer c1994

This means you!

Actually, 'This' is a pronoun used to refer to a subject being talked about
which is closer to the speaker than some other object.

Oh Shut Up.

Copyright Joshua Glazer c1994
*********************/

#include "asm.h"
#include "ray.h"
#include "rayrend.h"
#include "raycl.h"
#include "rayvb.h"
#include "assert.h"
#include "globals.h"
#include "fixed.h"
#include <mem.h>
#include "mymem.h"
#include <math.h>
#include "asm.h"
#include "prevarr.h"
#include "voxinter.h"
#include "texconst.h"
#include "scrconf.h"
#include "ldattrib.h"
#include <stdio.h>
#include <stdlib.h>


#define BLACK_COLOR 240  
#define SS_NO_VISIBLE -1
#define SS_VISIBLE 0

#define LOW_WALL 0
#define HIGH_WALL 1
#define MID_WALL 2

#define CLIP
#define CHECK_HIGH_LOW_CLIP_OUT
#define CLIPVERT
#define DO_FLOORS

#define BAR_LENGTH 10
#define RED_COLOR 79

typedef struct WALL_MOVE_INFO {
   MYFIXED top_start, bottom_start;
   MYFIXED top_increment, bottom_increment;
   ptexture texture;
   short type;
   long v_height;
   vb_node * cur_bounds;
} wall_move_info;

typedef struct INTERSECT_STRUCT {
   long distance, xpos;
   MYFIXED increment;
} intersect_struct;

intersect_struct * intersects;

MYFIXED * floor_offsets_x;
MYFIXED * floor_offsets_y;
long v_angle_plus_90;
MYFIXED floor_trans_x, floor_trans_y;
short prev_win_top, prev_win_bottom,
prev_wall_top, prev_wall_bottom, proj_left, proj_right;

short floor_ray, floor_start, floor_end, cur_height_diff;
Byte * floor_texture;
Byte * cur_sky_texture;

sector * Cur_Sec;

long ssetup_count;

void Seg_Setup(wall_move_info & mid_walls);
void Get_Intersects(pvector2 base_v, angle_type angle_diff);
void Draw_Seg(seg * cur_seg);

/*
   Draw_Health
   Draws a bar for player's health
*/

void Draw_Health() {
long the_health=the_player->stats.current_health;
long start_pos=Get_Phys_Screen_Width()*(Get_Phys_Screen_Height()-BAR_LENGTH);
for (short cur_vert=0; cur_vert<BAR_LENGTH; cur_vert++) {
  memset(buff+start_pos+(cur_vert*Get_Phys_Screen_Width()), RED_COLOR, the_health);
}
}
/*
   Win_Bounds_Setup
   Just initializes bounding values before a draw to all 0's for top and
   WINDOW_HEIGHT for bottom
*/

inline void Win_Bounds_Setup()
{
   memset(win_tops, 0, WINDOW_WIDTH * sizeof(short));
   memsetshort(win_bottoms, WINDOW_HEIGHT, WINDOW_WIDTH);
}

/*
   Init_Floor_Values
   Initializes values used for floor drawing
   Notes: None
*/

inline void Init_Floor_Values()
{

   // might as well calculate an angle that is used all the time for drawing floors

   v_angle_plus_90=Get_Angle_Difference(render_view_angle, ANGLE_90);

   floor_trans_x=fixedmult(x_inv_trans, rcos_table[v_angle_plus_90]);
   floor_trans_y=fixedmult(x_inv_trans, rsin_table[v_angle_plus_90]);

   long floor_adder_x=floor_trans_x >> X_TRANS_SHIFT;
   long floor_adder_y=floor_trans_y >> X_TRANS_SHIFT;

   long floor_sum_x=floor_adder_x * (-WINDOW_MIDDLEW);
   long floor_sum_y=floor_adder_y * (-WINDOW_MIDDLEW);

   for (short cur_ray=0; cur_ray < (WINDOW_WIDTH); cur_ray++) {
      floor_offsets_x[cur_ray]=floor_sum_x;
      floor_offsets_y[cur_ray]=floor_sum_y;

      floor_sum_x+=floor_adder_x;
      floor_sum_y+=floor_adder_y;
      }

}

/*
   Start_Tex
   Marks starts of texture lines on rows from "start" up to but not including "end at x position "ray"
   Notes: Assumes floor_texture already points to the floor texture to draw
*/
                       
inline void Start_Tex() {
   short row;

   for (row=floor_start; row<floor_end; row++) {
      tex_mark_table[row]=floor_ray;
      }

}


/*
   Finish_Tex
   Draws the previously marked floor textures on rows from "start" up to but no including "end"
   Ends lines at "ray"
   Notes: Assumes floor_texture already points to the floor texture to draw
*/

inline void Finish_Tex() {

 
   short row, start_ray;
   long tempLight;
   MYFIXED distance_fixed;
   floor_run_info * cur_floor_run;

   for (row=floor_start; row<floor_end; row++) {

      start_ray=tex_mark_table[row];

      if (floor_ray<=start_ray)
         continue;

      if (floor_run_count>=MAX_FLOOR_RUNS)
         break;

      cur_floor_run=floor_runs+floor_run_count;
      floor_run_count++;

      // Set row to draw on

      cur_floor_run->screen_y=row;

      // Get starting x and width of texture

      cur_floor_run->scale=(short)(floor_ray-start_ray);

      cur_floor_run->screen_x=start_ray;

      // Get distance to floor

      distance_fixed=cur_height_diff *distance_table[row];
      Assert(distance_fixed < 0, "Negative floor row distance");

      // Get map starting positions

      cur_floor_run->map_x=fixedmult(rcos_table[render_view_angle] + 
        floor_offsets_x[start_ray], distance_fixed)+(render_x);
      cur_floor_run->map_y=fixedmult(rsin_table[render_view_angle] +
        floor_offsets_y[start_ray], distance_fixed)+(render_y);

      // Get increments by multiplying the increment along the  actual line by sin & cos of line angle

      cur_floor_run->x_inc=fixedmult(distance_fixed,
         floor_trans_x) >> X_TRANS_SHIFT;
      cur_floor_run->y_inc=fixedmult(distance_fixed,
         floor_trans_y) >> X_TRANS_SHIFT;

      // do light calculation
      // In getting the light value, we take into account that distance_fixed
      // is a fixed point number and add to the right shift the fixed point conversion
      // number

      tempLight=(SecLight(Cur_Sec)-
         (distance_fixed >> (SHIFT+SecLTSpeed(Cur_Sec))) );
      if (tempLight<0) tempLight=0;
      if (tempLight>MAX_LIGHT) tempLight=MAX_LIGHT;

      Assert(((tempLight <0) || (tempLight >MAX_LIGHT)), "Bad Lighting Value");
      cur_floor_run->light=pal_table[tempLight];

       cur_floor_run->texture=floor_texture;

   } /* endfor */
}


/*
  Draw_Sky_Column
  Draws one column of the sky texture from "top" down to but not including "bottom"
  Notes: This is a hack. Code is cryptic. Should be improved upon. For example, it should
  not require that sky texture be length of screen. Requires a theoretical
  understanding of screen rays intersecting a circle on the horizon that I don't have
*/

inline void Draw_Sky_Column()
{

   // Was the programmer such an idiot that he tried to draw column of length 0?
   if (floor_start>=floor_end)
      return;

   if (wall_run_count>=MAX_WALL_RUNS) {
      return;
   } /* endif */
   wall_run_info * cur_wall_run=wall_runs+wall_run_count;
   wall_run_count++;

   // Setup the render constants, pretty standard
   cur_wall_run->bound_val=SKY_HEIGHT-1;
   cur_wall_run->texture=cur_sky_texture;
   cur_wall_run->ray=floor_ray;
   cur_wall_run->top=floor_start;
   cur_wall_run->scale=floor_end-floor_start;
   cur_wall_run->clip=floor_start << SLIVER_SHIFT;
   cur_wall_run->light=pal_table[MAX_LIGHT];
   cur_wall_run->increment=SLIVER_ONE;
   cur_wall_run->width_shift=SKY_SHIFT;

   // Do a whole lot of stupid calculations to get the column in the texture to draw

   long temp_column;

   long temp_ray=floor_ray*HORIZ_VIEW_RANGE/WINDOW_WIDTH;
   long tempAngle;
   if (temp_ray<(HORIZ_VIEW_RANGE>>1))
      tempAngle=temp_ray;
   else tempAngle=Get_Angle_Difference(HORIZ_VIEW_RANGE, temp_ray);
   MYFIXED tempdiv=fixeddiv(tan_table[tempAngle],
        tan_table[HORIZ_VIEW_RANGE>>1]);
   tempdiv=convtoLONG((HORIZ_VIEW_RANGE>>1)*tempdiv);
   if (temp_ray>=(HORIZ_VIEW_RANGE>>1))
      tempdiv=HORIZ_VIEW_RANGE-tempdiv;
   // div by 2 to stretch out backround a little
   temp_column=(((HORIZ_VIEW_RANGE>>1)-tempdiv)+(render_view_angle));
  
   if (temp_column<0) {
      cur_wall_run->column=SKY_WIDTH-((-temp_column) % SKY_WIDTH);
   } else {
      cur_wall_run->column=temp_column % SKY_WIDTH;
   } /* endif */

}

/*
   Close_Textures
   Finishes up whatever textures were running in a given visible section
   Notes: Uses proj_right and the "prev" globals
*/

inline void Close_Textures(short closing_ray)
{

long floor_height_diff=render_z-Cur_Sec->floor_height;
long ceil_height_diff=Cur_Sec->ceil_height-render_z;

floor_ray=closing_ray;

floor_texture=Get_Floor_Texture(Cur_Sec->ceil_tex);
floor_start=prev_win_top; floor_end=prev_wall_top;

if ( ceil_height_diff>0 && floor_texture!=cur_sky_texture ) {
   Finish_Tex();
} /* endif */

floor_texture=Get_Floor_Texture(Cur_Sec->floor_tex);
floor_start=prev_wall_bottom; floor_end=prev_win_bottom;

if ( floor_height_diff>0 && floor_texture!=cur_sky_texture ) {
   Finish_Tex();
} /* endif */

}

/*
   SegVisible
   Decides if a seg is (a) visible and (b) facing you
*/

inline BOOL SegVisible(seg * cur_seg)
{
long x1, x2, y1, y2;
pvector2 v1, v2;
v1=Vector_List+cur_seg->v[0];
v2=Vector_List+cur_seg->v[1];
x1=v1->x;
x2=v2->x;
y1=v1->y;
y2=v2->y;
if ( fixedmult((x1-x2),(render_y-(y2<<SHIFT))) >= fixedmult((y1-y2),(render_x-(x2<<SHIFT))) ) {
   return TRUE;
} else {
   return FALSE;
} /* endif */
}

/////////////////////////////////////////////////////////////////////////////

/*
   Ray_Caster
   The all powerful function that renders the screen
   Notes: Well, it isn't really all powerful. After all, it's just a routine,
   not some sort of diety. It dosen't even do that much, just calls other routines
*/

void Ray_Caster(long x, long y, long z, long view_angle)
{

ssetup_count=0;

// setup rendering constants
render_x=x; render_y=y; render_z=z; render_view_angle=view_angle;

// setup constants for floor drawing

Init_Floor_Values();

// save the current frame of the sky animation 
// (we will say that sky texture cannot change while rendering)

cur_sky_texture=sky_texture->images[sky_texture->cur_image];

// Initialize the clipping structures

Win_Bounds_Setup();
VB_InitList();

// Set starting wall & floor run count to 0

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩不卡在线| 国产一区二区三区精品视频| 欧美亚洲综合另类| 亚洲成av人片一区二区| 欧美久久久久久蜜桃| 麻豆91小视频| 国产精品网站在线观看| 一本久道中文字幕精品亚洲嫩| 亚洲一二三专区| 欧美成人官网二区| 成人激情小说网站| 亚洲成人自拍偷拍| 26uuu国产一区二区三区| 懂色av中文字幕一区二区三区 | 欧美一级黄色片| 久久99精品国产麻豆不卡| 欧美高清一级片在线观看| 色综合久久88色综合天天| 日韩成人午夜电影| 国产精品污网站| 91精品国产色综合久久不卡电影 | 日本一区二区电影| 日本韩国欧美一区| 精品一区二区成人精品| 国产精品每日更新| 69堂精品视频| 不卡的看片网站| 日韩福利电影在线| ●精品国产综合乱码久久久久| 欧美视频精品在线观看| 国产老女人精品毛片久久| 亚洲男帅同性gay1069| 欧美成人精品高清在线播放| 91年精品国产| 国产综合色精品一区二区三区| 亚洲精品免费播放| 久久久久99精品一区| 欧美日韩国产在线观看| 成人高清免费观看| 久久av中文字幕片| 亚洲一级二级三级在线免费观看| 久久久www成人免费无遮挡大片| 欧洲av一区二区嗯嗯嗯啊| 国产精品亚洲一区二区三区妖精 | 欧美亚洲国产一区二区三区| 国产自产2019最新不卡| 亚洲成人av电影在线| 日韩美女精品在线| 久久久精品综合| 欧美一区二区三区色| 色琪琪一区二区三区亚洲区| 国产suv一区二区三区88区| 日本欧美大码aⅴ在线播放| 亚洲精品乱码久久久久久日本蜜臀| 精品国产91亚洲一区二区三区婷婷 | 欧美一区二区三区喷汁尤物| 色伊人久久综合中文字幕| 高清不卡一区二区在线| 久久成人久久爱| 日韩1区2区日韩1区2区| 丝袜诱惑亚洲看片| 亚洲无人区一区| 亚洲综合一区二区三区| 一区二区三区在线播| 亚洲图片你懂的| 亚洲欧美在线观看| 国产精品久久久久久久午夜片| 久久久久久久精| 日本一区免费视频| 欧美激情艳妇裸体舞| 久久久99精品久久| 久久久综合精品| 中文字幕乱码一区二区免费| 久久精品人人爽人人爽| 国产亚洲一本大道中文在线| 久久久影视传媒| 国产视频一区在线播放| 欧美极品美女视频| 亚洲欧洲色图综合| 亚洲免费在线电影| 一区二区三区国产| 天堂va蜜桃一区二区三区漫画版| 午夜精品影院在线观看| 三级欧美韩日大片在线看| 日韩二区在线观看| 极品销魂美女一区二区三区| 加勒比av一区二区| 成人app软件下载大全免费| 99免费精品视频| 色婷婷狠狠综合| 欧美日韩不卡一区二区| 日韩一级黄色大片| 久久久久久久久一| 亚洲男人的天堂av| 日韩影视精彩在线| 国产乱码精品一区二区三| www.日韩精品| 7777精品伊人久久久大香线蕉最新版| 欧美一区二区视频在线观看| 久久久噜噜噜久噜久久综合| 天天综合天天做天天综合| 奇米色一区二区| 国产成人精品综合在线观看| 91麻豆福利精品推荐| 欧美日韩久久久| 国产亚洲综合性久久久影院| 亚洲日本va在线观看| 午夜精品爽啪视频| 国产在线播放一区| 色欧美片视频在线观看在线视频| 欧美精品欧美精品系列| 国产亚洲一本大道中文在线| 亚洲人成小说网站色在线| 日韩黄色一级片| caoporm超碰国产精品| 欧美精品vⅰdeose4hd| 国产无一区二区| 亚洲午夜久久久| 国产精品一区二区久激情瑜伽 | 国产精品天干天干在线综合| 亚洲图片一区二区| 国产成人精品免费| 777奇米四色成人影色区| 亚洲欧洲色图综合| 国产精品99久久久久久久vr| 在线免费观看不卡av| 国产亚洲精品精华液| 天堂午夜影视日韩欧美一区二区| 国产白丝精品91爽爽久久| 91精品国产欧美一区二区成人| 国产精品久久久一本精品| 美女视频黄a大片欧美| 日本精品视频一区二区三区| 久久久美女艺术照精彩视频福利播放| 亚洲国产精品久久不卡毛片| 成人深夜福利app| 精品国产91乱码一区二区三区| 亚洲成a人片在线观看中文| 国产成人免费视频网站高清观看视频| 欧美久久久久久久久| 亚洲色图一区二区三区| 国产精品18久久久久久久久| 欧美福利视频一区| 一区二区成人在线视频| eeuss鲁片一区二区三区在线看| 日韩欧美一区电影| 亚洲第一主播视频| 日本乱码高清不卡字幕| 中文字幕一区二区三区不卡| 国产精品一卡二| 26uuu久久天堂性欧美| 久久精品72免费观看| 这里是久久伊人| 五月天网站亚洲| 欧美日韩黄色一区二区| 亚洲国产综合在线| 在线观看91视频| 亚洲激情图片qvod| 日本高清免费不卡视频| 亚洲色大成网站www久久九九| 成人午夜激情视频| 亚洲国产精品精华液ab| 国产成人免费视频网站| 中文一区在线播放| 成人小视频在线观看| 国产精品全国免费观看高清| 成人亚洲精品久久久久软件| 国产精品―色哟哟| 92精品国产成人观看免费| 亚洲欧美另类图片小说| 一本大道久久a久久精二百| 亚洲伦在线观看| 欧美午夜寂寞影院| 视频一区视频二区在线观看| 欧美精品第1页| 极品少妇一区二区| 中文字幕高清不卡| 色综合中文字幕| 亚洲v日本v欧美v久久精品| 欧美另类z0zxhd电影| 美女看a上一区| 久久久久久久久一| 91美女蜜桃在线| 亚洲成人一二三| 日韩久久免费av| 成人免费看视频| 亚洲综合成人网| 日韩无一区二区| 福利91精品一区二区三区| 亚洲人成网站在线| 日韩一区二区三区视频| 国产一区二区福利| 亚洲美女精品一区| 日韩一区二区精品在线观看| 国产精品自拍在线| 亚洲欧美色图小说| 欧美一区二区福利在线| 国产成a人无v码亚洲福利| 亚洲综合激情小说| 久久婷婷国产综合国色天香|