Commit f731c88d authored by Steven Fuller's avatar Steven Fuller

Removed more unused code.

vi_null.c: Added stub version of video/input code
parent 81ab1d53
...@@ -39,6 +39,7 @@ savegames until they are fixed to not use pointers ...@@ -39,6 +39,7 @@ savegames until they are fixed to not use pointers
* menu code is a mess, always does things differently than the rest of the * menu code is a mess, always does things differently than the rest of the
code, it really needs to be cleaned up code, it really needs to be cleaned up
* id_ca.c cache code: fix/readd/rewrite the "garbage collection" system? * id_ca.c cache code: fix/readd/rewrite the "garbage collection" system?
* rewrite id_ca.c: uniform memory handling system
* clean up header files, especially wl_def.h, where some declarations aren't * clean up header files, especially wl_def.h, where some declarations aren't
in the right place in the right place
* every structure that is read/written must be PACKED, with datatypes * every structure that is read/written must be PACKED, with datatypes
...@@ -69,9 +70,6 @@ function with same parameters, only difference is the name) ...@@ -69,9 +70,6 @@ function with same parameters, only difference is the name)
* look for places where gfx needs to be redrawn, like back to game etc * look for places where gfx needs to be redrawn, like back to game etc
* fizzlefade is hackish, stipple buf would work ok in opengl, maybe only * fizzlefade is hackish, stipple buf would work ok in opengl, maybe only
update once per frame or such... update once per frame or such...
and where is that stray pixel coming from (during fizzlefade with largest
window size, for example) in svgalib -- is that another bug with my geforce?
no idea how to do fizzlefade in TrueColor X
* check filehandling (ex, file missing, bad file type, and such) * check filehandling (ex, file missing, bad file type, and such)
PlayDemoFromFile specifically PlayDemoFromFile specifically
* make sure all infinite loops are found (looping around Keyboard) * make sure all infinite loops are found (looping around Keyboard)
...@@ -81,8 +79,7 @@ same with the spear of destiny animation part of ending ...@@ -81,8 +79,7 @@ same with the spear of destiny animation part of ending
* move all references to gfxbuf to vi_* only (gl will need this anyway, * move all references to gfxbuf to vi_* only (gl will need this anyway,
since it would replace id_vh, (parts of) wl_draw, wl_scale) since it would replace id_vh, (parts of) wl_draw, wl_scale)
by putting in code from id_vh (either by using Plot or just copying it in) by putting in code from id_vh (either by using Plot or just copying it in)
we can stop the large conversion before each UpdateScreen we can mostly stop the large conversion before each UpdateScreen
but palette fades will still need it!
* the higher depths are a hack since a palette lookup has to be done * the higher depths are a hack since a palette lookup has to be done
for every byte when transferring to the pixmap, palette fades require a for every byte when transferring to the pixmap, palette fades require a
screen update screen update
......
This diff is collapsed.
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
#define NUMMAPS 60 #define NUMMAPS 60
#define MAPPLANES 2 #define MAPPLANES 2
//===========================================================================
typedef struct typedef struct
{ {
long planestart[3]; long planestart[3];
...@@ -16,7 +14,7 @@ typedef struct ...@@ -16,7 +14,7 @@ typedef struct
char name[16]; char name[16];
} PACKED maptype; } PACKED maptype;
//=========================================================================== /* ======================================================================== */
extern int mapon; extern int mapon;
...@@ -33,7 +31,7 @@ extern char extension[5], ...@@ -33,7 +31,7 @@ extern char extension[5],
aheadname[10], aheadname[10],
afilename[10]; afilename[10];
//=========================================================================== /* ======================================================================== */
boolean CA_FarRead(int handle, byte *dest, long length); boolean CA_FarRead(int handle, byte *dest, long length);
boolean CA_FarWrite(int handle, byte *source, long length); boolean CA_FarWrite(int handle, byte *source, long length);
...@@ -55,14 +53,6 @@ void CA_UnCacheGrChunk(int chunk); ...@@ -55,14 +53,6 @@ void CA_UnCacheGrChunk(int chunk);
void CA_UpLevel(); void CA_UpLevel();
void CA_DownLevel(); void CA_DownLevel();
/*
void CA_ClearMarks();
void CA_ClearAllMarks();
#define CA_MarkGrChunk(chunk) grneeded[chunk]|=ca_levelbit
void CA_CacheMarks();
*/
void CA_CacheScreen(int chunk); void CA_CacheScreen(int chunk);
...@@ -84,23 +74,19 @@ typedef struct { ...@@ -84,23 +74,19 @@ typedef struct {
longword offset; // Offset of chunk into file longword offset; // Offset of chunk into file
word length; // Length of the chunk word length; // Length of the chunk
memptr addr; memptr addr;
longword lastHit; // Last frame number of hit
} PageListStruct; } PageListStruct;
extern word ChunksInFile, PMSpriteStart, PMSoundStart; extern word ChunksInFile, PMSpriteStart, PMSoundStart;
extern PageListStruct *PMPages; extern PageListStruct *PMPages;
#define PM_GetSoundPage(v) PM_GetPage(PMSoundStart + (v)) #define PM_GetSoundPage(v) PM_GetPage(PMSoundStart + (v))
#define PM_GetSpritePage(v) PM_GetPage(PMSpriteStart + (v)) #define PM_GetSpritePage(v) PM_GetPage(PMSpriteStart + (v))
void PM_Startup(void), void PM_Startup();
PM_Shutdown(void), void PM_Shutdown();
PM_Reset(void), void PM_Preload(boolean (*update)(word current,word total));
PM_Preload(boolean (*update)(word current,word total)),
PM_NextFrame(void),
PM_SetMainPurge(int level);
memptr PM_GetPageAddress(int pagenum), PM_GetPage(int pagenum); memptr PM_GetPage(int pagenum);
#endif #endif
...@@ -37,12 +37,10 @@ typedef bool boolean; ...@@ -37,12 +37,10 @@ typedef bool boolean;
#define PACKED __attribute__((packed)) #define PACKED __attribute__((packed))
#define LONGLONG long long #define LONGLONG long long
#define O_BINARY 0
#ifdef __cplusplus #ifdef __cplusplus
typedef bool boolean; typedef bool boolean;
#else #else
typedef enum {false,true} boolean; typedef enum { false, true } boolean;
#endif #endif
#endif #endif
...@@ -58,6 +56,10 @@ typedef enum {false,true} boolean; ...@@ -58,6 +56,10 @@ typedef enum {false,true} boolean;
#include <sys/types.h> #include <sys/types.h>
#include <math.h> #include <math.h>
#ifndef O_BINARY
#define O_BINARY 0
#endif
#include "misc.h" #include "misc.h"
#include "version.h" #include "version.h"
...@@ -87,9 +89,9 @@ typedef enum {false,true} boolean; ...@@ -87,9 +89,9 @@ typedef enum {false,true} boolean;
/* ---------------- */ /* ---------------- */
typedef unsigned char byte; typedef unsigned char byte;
typedef unsigned short int word; typedef unsigned short int word;
typedef unsigned long longword; typedef unsigned long longword;
typedef long fixed; typedef long fixed;
typedef void * memptr; typedef void * memptr;
...@@ -118,13 +120,13 @@ void Quit(char *error); ...@@ -118,13 +120,13 @@ void Quit(char *error);
#undef PI #undef PI
#define PI 3.141592657 #define PI 3.141592657
#define MAXTICS 10 #define MAXTICS 10
#define DEMOTICS 4 #define DEMOTICS 4
extern unsigned mapwidth,mapheight,tics; extern unsigned mapwidth, mapheight, tics;
extern byte fontcolor,backcolor; extern byte fontcolor, backcolor;
#define SETFONTCOLOR(f,b) fontcolor=f;backcolor=b; #define SETFONTCOLOR(f, b) { fontcolor = f; backcolor = b; }
#endif #endif
This diff is collapsed.
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
============================================================================= =============================================================================
*/ */
#define MOVESCALE 150l #define MOVESCALE 150
#define BACKMOVESCALE 100l #define BACKMOVESCALE 100
#define ANGLESCALE 20 #define ANGLESCALE 20
/* /*
...@@ -43,17 +43,16 @@ objtype *LastAttacker; ...@@ -43,17 +43,16 @@ objtype *LastAttacker;
*/ */
void T_Player (objtype *ob); void T_Player(objtype *ob);
void T_Attack (objtype *ob); void T_Attack(objtype *ob);
statetype s_player = {false,0,0,T_Player,NULL,NULL}; statetype s_player = {false,0,0,T_Player,NULL,NULL};
statetype s_attack = {false,0,0,T_Attack,NULL,NULL}; statetype s_attack = {false,0,0,T_Attack,NULL,NULL};
struct atkinf struct atkinf
{ {
char tics,attack,frame; // attack is 1 for gun, 2 for knife char tics, attack, frame; // attack is 1 for gun, 2 for knife
} static attackinfo[4][14] = } static attackinfo[4][14] =
{ {
{ {6,0,1},{6,2,2},{6,0,3},{6,-1,4} }, { {6,0,1},{6,2,2},{6,0,3},{6,-1,4} },
{ {6,0,1},{6,1,2},{6,0,3},{6,-1,4} }, { {6,0,1},{6,1,2},{6,0,3},{6,-1,4} },
...@@ -217,25 +216,22 @@ void StatusDrawPic(unsigned x, unsigned y, unsigned picnum) ...@@ -217,25 +216,22 @@ void StatusDrawPic(unsigned x, unsigned y, unsigned picnum)
================== ==================
*/ */
void DrawFace (void) void DrawFace()
{ {
if (gamestate.health) if (gamestate.health) {
{
#ifdef SPEAR #ifdef SPEAR
if (godmode) if (godmode)
StatusDrawPic (17,4,GODMODEFACE1PIC+gamestate.faceframe); StatusDrawPic(17,4,GODMODEFACE1PIC+gamestate.faceframe);
else else
#endif #endif
StatusDrawPic (17,4,FACE1APIC+3*((100-gamestate.health)/16)+gamestate.faceframe); StatusDrawPic (17,4,FACE1APIC+3*((100-gamestate.health)/16)+gamestate.faceframe);
} } else {
else
{
#ifndef SPEAR #ifndef SPEAR
if (LastAttacker->obclass == needleobj) if (LastAttacker->obclass == needleobj)
StatusDrawPic (17,4,MUTANTBJPIC); StatusDrawPic(17,4,MUTANTBJPIC);
else else
#endif #endif
StatusDrawPic (17,4,FACE8APIC); StatusDrawPic (17,4,FACE8APIC);
} }
} }
...@@ -334,7 +330,7 @@ void DrawHealth (void) ...@@ -334,7 +330,7 @@ void DrawHealth (void)
=============== ===============
*/ */
void TakeDamage (int points,objtype *attacker) void TakeDamage(int points, objtype *attacker)
{ {
LastAttacker = attacker; LastAttacker = attacker;
......
...@@ -546,13 +546,6 @@ void CacheLayoutGraphics (void) ...@@ -546,13 +546,6 @@ void CacheLayoutGraphics (void)
numpages++; numpages++;
if (ch == 'E') // end of file, so load graphics and return if (ch == 'E') // end of file, so load graphics and return
{ {
/*
CA_MarkGrChunk(H_TOPWINDOWPIC);
CA_MarkGrChunk(H_LEFTWINDOWPIC);
CA_MarkGrChunk(H_RIGHTWINDOWPIC);
CA_MarkGrChunk(H_BOTTOMINFOPIC);
CA_CacheMarks ();
*/
CA_CacheGrChunk(H_TOPWINDOWPIC); CA_CacheGrChunk(H_TOPWINDOWPIC);
CA_CacheGrChunk(H_LEFTWINDOWPIC); CA_CacheGrChunk(H_LEFTWINDOWPIC);
CA_CacheGrChunk(H_RIGHTWINDOWPIC); CA_CacheGrChunk(H_RIGHTWINDOWPIC);
...@@ -564,13 +557,11 @@ void CacheLayoutGraphics (void) ...@@ -564,13 +557,11 @@ void CacheLayoutGraphics (void)
if (ch == 'G') // draw graphic command, so mark graphics if (ch == 'G') // draw graphic command, so mark graphics
{ {
ParsePicCommand (); ParsePicCommand ();
/* CA_MarkGrChunk (picnum); */
CA_CacheGrChunk(picnum); CA_CacheGrChunk(picnum);
} }
if (ch == 'T') // timed draw graphic command, so mark graphics if (ch == 'T') // timed draw graphic command, so mark graphics
{ {
ParseTimedCommand (); ParseTimedCommand ();
/* CA_MarkGrChunk (picnum); */
CA_CacheGrChunk(picnum); CA_CacheGrChunk(picnum);
} }
} }
...@@ -599,7 +590,6 @@ void ShowArticle(char *article) ...@@ -599,7 +590,6 @@ void ShowArticle(char *article)
text = article; text = article;
oldfontnumber = fontnumber; oldfontnumber = fontnumber;
fontnumber = 0; fontnumber = 0;
/* CA_MarkGrChunk(STARTFONT); */
CA_CacheGrChunk(STARTFONT); CA_CacheGrChunk(STARTFONT);
VW_Bar (0,0,320,200,BACKCOLOR); VW_Bar (0,0,320,200,BACKCOLOR);
CacheLayoutGraphics (); CacheLayoutGraphics ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment