⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 raywidth.cpp

📁 Demo Source for a doom like engine using raycasting and voxel
💻 CPP
字号:
#include "ray.h"
#include "globals.h"
#include "raywidth.h"
#include "fixed.h"
#include "scrconf.h"
#include "asm.h"
#include "voxinter.h"
#include "slopes.h"

#define MIN_WINDOW_WIDTH 20
#define MAX_HORIZ_FOV ANGLE_90
#define MIN_HORIZ_FOV ANGLE_15

extern void Build_Movement_Table();

void Setup_Horiz_Window_Change();

void Set_Window_Width(short width) {
// Sets width of window

   // is it legal?
   if ((width > Get_Phys_Screen_Width())||(width <= MIN_WINDOW_WIDTH))
      return;

   WINDOW_WIDTH=width;
   WINDOW_MIDDLEW=width/2;
   
   //setup the new window
   Setup_Horiz_Window_Change();
}

void Set_Horiz_FOV(angle_type horiz_angle) {
// routine to set horiz FOV

   // is it legal?
   if ((horiz_angle>MAX_HORIZ_FOV) || (horiz_angle<=MIN_HORIZ_FOV))
      return;
   HORIZ_VIEW_RANGE=horiz_angle;

   // setup the new window
   Setup_Horiz_Window_Change();
}

void Setup_Horiz_Window_Change() {
   clearBuff();
   SCALE_FACTOR=fixeddiv(WINDOW_MIDDLEW, tan_table[HORIZ_VIEW_RANGE>>1]);
   Build_Movement_Table();
   Recalc_Slope_Table();
   V_Recalc_Length();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -