资源简介
国外网站找到的雷神之锤源码 雷神之锤源码
quake2 quake2
aaa
代码片段和文件信息
/*
Copyright (C) 1997-2001 Id Software Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License or (at your option) any later version.
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not write to the Free Software
Foundation Inc. 59 Temple Place - Suite 330 Boston MA 02111-1307 USA.
*/
#include “client.h“
typedef struct
{
byte *data;
int count;
} cblock_t;
typedef struct
{
qboolean restart_sound;
int s_rate;
int s_width;
int s_channels;
int width;
int height;
byte *pic;
byte *pic_pending;
// order 1 huffman stuff
int *hnodes1; // [256][256][2];
int numhnodes1[256];
int h_used[512];
int h_count[512];
} cinematics_t;
cinematics_t cin;
/*
=================================================================
PCX LOADING
=================================================================
*/
/*
==============
SCR_LoadPCX
==============
*/
void SCR_LoadPCX (char *filename byte **pic byte **palette int *width int *height)
{
byte *raw;
pcx_t *pcx;
int x y;
int len;
int dataByte runLength;
byte *out *pix;
*pic = NULL;
//
// load the file
//
len = FS_LoadFile (filename (void **)&raw);
if (!raw)
return; // Com_Printf (“Bad pcx file %s\n“ filename);
//
// parse the PCX file
//
pcx = (pcx_t *)raw;
raw = &pcx->data;
if (pcx->manufacturer != 0x0a
|| pcx->version != 5
|| pcx->encoding != 1
|| pcx->bits_per_pixel != 8
|| pcx->xmax >= 640
|| pcx->ymax >= 480)
{
Com_Printf (“Bad pcx file %s\n“ filename);
return;
}
out = Z_Malloc ( (pcx->ymax+1) * (pcx->xmax+1) );
*pic = out;
pix = out;
if (palette)
{
*palette = Z_Malloc(768);
memcpy (*palette (byte *)pcx + len - 768 768);
}
if (width)
*width = pcx->xmax+1;
if (height)
*height = pcx->ymax+1;
for (y=0 ; y<=pcx->ymax ; y++ pix += pcx->xmax+1)
{
for (x=0 ; x<=pcx->xmax ; )
{
dataByte = *raw++;
if((dataByte & 0xC0) == 0xC0)
{
runLength = dataByte & 0x3F;
dataByte = *raw++;
}
else
runLength = 1;
while(runLength-- > 0)
pix[x++] = dataByte;
}
}
if ( raw - (byte *)pcx > len)
{
Com_Printf (“PCX file %s was malformed“ filename);
Z_Free (*pic);
*pic = NULL;
}
FS_FreeFile (pcx);
}
//=============================================================
/*
==================
SCR_StopCinematic
==================
*/
void SCR_StopCinematic (void)
{
cl.cinematictime = 0; // done
if (cin.p
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1284 2001-12-22 16:32 quake2\readme.txt
文件 14969 2001-12-22 16:32 quake2\gnu.txt
文件 5556 2001-12-22 19:54 quake2\quake2-3.21\3.15_Changes.txt
文件 6727 2001-12-22 19:54 quake2\quake2-3.21\3.16_Changes.txt
文件 8761 2001-12-22 19:54 quake2\quake2-3.21\3.17_Changes.txt
文件 3358 2001-12-22 19:54 quake2\quake2-3.21\3.18_changes.txt
文件 3660 2001-10-02 14:10 quake2\quake2-3.21\3.19_Changes.txt
文件 4327 2001-10-02 14:10 quake2\quake2-3.21\3.20_Changes.txt
文件 4810 2001-12-22 20:24 quake2\quake2-3.21\3.21_Changes.txt
文件 8971 2001-12-22 20:07 quake2\quake2-3.21\changes.txt
文件 14969 2001-12-22 16:32 quake2\quake2-3.21\gnu.txt
文件 10950 2001-12-22 16:32 quake2\quake2-3.21\joystick.txt
文件 10452 2001-10-02 14:10 quake2\quake2-3.21\makefile
文件 41698 2001-12-22 19:36 quake2\quake2-3.21\quake2.dsp
文件 1558 2001-12-22 19:37 quake2\quake2-3.21\quake2.dsw
文件 1284 2001-12-22 16:32 quake2\quake2-3.21\readme.txt
文件 10852 2001-10-02 14:10 quake2\quake2-3.21\client\adivtab.h
文件 6476 2001-12-22 16:32 quake2\quake2-3.21\client\anorms.h
文件 1954 2001-10-02 14:10 quake2\quake2-3.21\client\asm_i386.h
文件 2233 2001-10-02 14:10 quake2\quake2-3.21\client\block16.h
文件 2183 2001-10-02 14:10 quake2\quake2-3.21\client\block8.h
文件 952 2001-12-22 16:32 quake2\quake2-3.21\client\cdaudio.h
文件 13473 2001-12-22 16:32 quake2\quake2-3.21\client\cl_cin.c
文件 39957 2001-12-22 16:32 quake2\quake2-3.21\client\cl_ents.c
文件 51749 2001-12-22 16:32 quake2\quake2-3.21\client\cl_fx.c
文件 13685 2001-12-22 16:32 quake2\quake2-3.21\client\cl_input.c
文件 2981 2001-12-22 16:32 quake2\quake2-3.21\client\cl_inv.c
文件 41849 2001-12-22 16:32 quake2\quake2-3.21\client\cl_main.c
文件 26384 2001-12-22 16:32 quake2\quake2-3.21\client\cl_newfx.c
文件 19316 2001-12-22 16:32 quake2\quake2-3.21\client\cl_parse.c
............此处省略346个文件信息
- 上一篇:博客《word常规模板设置》配套模板
- 下一篇:蓝牙控制单片机开关
评论
共有 条评论