Added noise overlay (for marine image enhancer).

This commit is contained in:
Steven Fuller 2001-08-12 19:48:15 +00:00 committed by Patryk Obara
parent b6076c656e
commit 3ec3df2e66
5 changed files with 100 additions and 57 deletions

View file

@ -14,7 +14,7 @@ ROOT = main.c mathline.c math.asm net.c render.c opengl.c winapi.c stubs.c stubs
AVP = ai_sight.c avpview.c bh_agun.c bh_ais.c bh_alien.c bh_binsw.c bh_cable.c bh_corpse.c bh_deathvol.c bh_debri.c bh_dummy.c bh_fan.c bh_far.c bh_fhug.c bh_gener.c bh_ldoor.c bh_lift.c bh_light.c bh_lnksw.c bh_ltfx.c bh_marin.c bh_mission.c bh_near.c bh_pargen.c bh_plachier.c bh_plift.c bh_pred.c bh_queen.c bh_rubberduck.c bh_selfdest.c bh_snds.c bh_spcl.c bh_swdor.c bh_track.c bh_types.c bh_videoscreen.c bh_waypt.c bh_weap.c bh_xeno.c bonusabilities.c cconvars.cpp cdtrackselection.cpp cheatmodes.c comp_map.c comp_shp.c consolelog.cpp davehook.cpp deaths.c decal.c detaillevels.c dynamics.c dynblock.c equipmnt.c equiputl.cpp extents.c game.c game_statistics.c gamecmds.cpp gameflow.c gamevars.cpp hmodel.c hud.c inventry.c language.c lighting.c load_shp.c los.c maps.c mempool.c messagehistory.c missions.cpp movement.c paintball.c particle.c pfarlocs.c pheromon.c player.c pmove.c psnd.c psndproj.c pvisible.c savegame.c scream.cpp secstats.c sfx.c stratdef.c targeting.c track.c triggers.c weapons.c
SHAPES = cube.c
SUPPORT = consbind.cpp consbtch.cpp coordstr.cpp daemon.cpp r2base.cpp r2pos666.cpp reflist.cpp refobj.cpp scstring.cpp strtab.cpp strutil.c trig666.cpp wrapstr.cpp
AVPWIN95 = avpchunk.cpp cheat.c chtcodes.cpp d3d_hud.cpp ddplat.cpp endianio.c ffread.cpp ffstdio.cpp gammacontrol.cpp gflwplat.c hierplace.cpp iofocus.cpp jsndsup.cpp kzsort.c langplat.c modcmds.cpp npcsetup.cpp objsetup.cpp pathchnk.cpp platsup.c pldghost.c projload.cpp scrshot.cpp strachnk.cpp system.c usr_io.c vision.c
AVPWIN95 = avpchunk.cpp cheat.c chtcodes.cpp d3d_hud.cpp ddplat.cpp endianio.c ffread.cpp ffstdio.cpp gammacontrol.cpp gflwplat.c hierplace.cpp iofocus.cpp jsndsup.cpp kzsort.c langplat.c modcmds.cpp npcsetup.cpp objsetup.cpp pathchnk.cpp platsup.c pldghost.c progress_bar.cpp projload.cpp scrshot.cpp strachnk.cpp system.c usr_io.c vision.c
FRONTEND = avp_envinfo.c avp_intro.cpp avp_menudata.c
GADGETS = ahudgadg.cpp conscmnd.cpp conssym.cpp consvar.cpp gadget.cpp hudgadg.cpp rootgadg.cpp t_ingadg.cpp teletype.cpp textexp.cpp textin.cpp trepgadg.cpp
WIN95 = animchnk.cpp animobs.cpp awtexld.cpp awbmpld.cpp awiffld.cpp awpnmld.cpp bmpnames.cpp chnkload.cpp chnktexi.cpp chnktype.cpp chunk.cpp chunkpal.cpp db.c debuglog.cpp dummyobjectchunk.cpp enumchnk.cpp enumsch.cpp envchunk.cpp fail.c fragchnk.cpp gsprchnk.cpp hierchnk.cpp huffman.cpp iff.cpp iff_ilbm.cpp ilbm_ext.cpp io.c list_tem.cpp ltchunk.cpp media.cpp mishchnk.cpp obchunk.cpp oechunk.cpp our_mem.c plat_shp.c plspecfn.c shpchunk.cpp sndchunk.cpp sprchunk.cpp string.cpp texio.c toolchnk.cpp txioctrl.cpp wpchunk.cpp zsp.cpp

View file

@ -13,7 +13,7 @@ extern "C"
{
#include "language.h"
extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock;
extern LPDIRECTDRAWSURFACE lpDDSBack; // DirectDraw back surface
//extern LPDIRECTDRAWSURFACE lpDDSBack; // DirectDraw back surface
extern int DebouncedGotAnyKey;
extern void MinimalNetCollectMessages(void);
@ -50,7 +50,8 @@ RECT LoadingBarFull_SrcRect;
void Start_Progress_Bar()
{
AAFontImageNumber = CL_LoadImageOnce("Common\\aa_font.RIM",LIO_D3DTEXTURE|LIO_RELATIVEPATH|LIO_RESTORABLE);
#if 0 /* TODO: disabled for port */
/* load other graphics */
{
char buffer[100];
@ -113,7 +114,7 @@ void Start_Progress_Bar()
}
}
DDSurface* image=0;
//set progress bar dimensions
BarLeft=ScreenDescriptorBlock.SDB_Width/6;
BarRight=(ScreenDescriptorBlock.SDB_Width*5)/6;
@ -150,19 +151,8 @@ void Start_Progress_Bar()
0
);
}
#if 0
if(image)
{
//draw background image
lpDDSBack->Blt(0,image,0,DDBLT_WAIT,0);
}
else
{
//failed to load background graphic , make do with black background
ColourFillBackBuffer(0);
}
#endif
// RenderGrabbedScreen();
#endif
//draw initial progress bar
LoadingBarEmpty_SrcRect.left=0;
@ -178,13 +168,10 @@ void Start_Progress_Bar()
for (int i=0; i<2; i++)
{
ColourFillBackBuffer(0);
#if 0 /* TODO: disabled for port */
if (LoadingBarEmpty) lpDDSBack->Blt(&LoadingBarEmpty_DestRect,LoadingBarEmpty,&LoadingBarEmpty_SrcRect,DDBLT_WAIT,0);
#if SOFTWARE_RENDERER
FlushSoftwareZBuffer();
#else
#endif
FlushD3DZBuffer();
#endif
ThisFramesRenderingHasBegun();
@ -195,6 +182,7 @@ void Start_Progress_Bar()
FlipBuffers();
}
#if 0 /* TODO: disabled for port */
if(image)
{
ReleaseDDSurface(image);
@ -203,6 +191,7 @@ void Start_Progress_Bar()
{
ReleaseDDSurface(LoadingBarEmpty);
}
#endif
CurrentPosition=0;
@ -225,7 +214,9 @@ void Set_Progress_Bar_Position(int pos)
LoadingBarFull_DestRect.top=(ScreenDescriptorBlock.SDB_Height *11)/12;
LoadingBarFull_DestRect.bottom=ScreenDescriptorBlock.SDB_Height-1;
#if 0 /* TODO: disabled for port */
if (LoadingBarFull) lpDDSBack->Blt(&LoadingBarFull_DestRect,LoadingBarFull,&LoadingBarFull_SrcRect,DDBLT_WAIT,0);
#endif
FlipBuffers();
/*
@ -243,7 +234,9 @@ void Set_Progress_Bar_Position(int pos)
{
//time to check our messages
LastSendTime=time;
#if 0 /* TODO: disabled for port */
MinimalNetCollectMessages();
#endif
//send messages , mainly needed so that the host will send the game description
//allowing people to join while the host is loading
NetSendMessages();
@ -274,6 +267,7 @@ void Game_Has_Loaded(void)
// FlipBuffers();
#if 0 /* TODO: disabled for port */
ColourFillBackBufferQuad
(
0,
@ -282,7 +276,7 @@ void Game_Has_Loaded(void)
ScreenDescriptorBlock.SDB_Width-1,
ScreenDescriptorBlock.SDB_Height-1
);
#endif
if (f)
{
LoadingBarFull_SrcRect.left=0;
@ -295,8 +289,10 @@ void Game_Has_Loaded(void)
int h = MUL_FIXED((ScreenDescriptorBlock.SDB_Height)/24,ONE_FIXED-f);
LoadingBarFull_DestRect.top=(ScreenDescriptorBlock.SDB_Height *11)/12+h;
LoadingBarFull_DestRect.bottom=ScreenDescriptorBlock.SDB_Height-1-h;
#if 0 /* TODO: disabled for port */
if (LoadingBarFull) lpDDSBack->Blt(&LoadingBarFull_DestRect,LoadingBarFull,&LoadingBarFull_SrcRect,DDBLT_WAIT,0);
#endif
f-=NormalFrameTime;
if (f<0) f=0;
}
@ -318,7 +314,9 @@ void Game_Has_Loaded(void)
/* If in a network game then we may as well check the network messages while waiting*/
if(AvP.Network != I_No_Network)
{
#if 0 /* TODO: disabled for port */
MinimalNetCollectMessages();
#endif
//send messages , mainly needed so that the host will send the game description
//allowing people to join while the host is loading
NetSendMessages();
@ -330,11 +328,12 @@ void Game_Has_Loaded(void)
FadingGameInAfterLoading=ONE_FIXED;
#if 0 /* TODO: disabled for port */
if (LoadingBarFull)
{
ReleaseDDSurface(LoadingBarFull);
}
#endif
}

View file

@ -357,9 +357,12 @@ void CheckForWindowsMessages()
void InGameFlipBuffers()
{
#if 1
SDL_GL_SwapBuffers();
#endif
}
void FlipBuffers()
{
SDL_GL_SwapBuffers();
}
void ThisFramesRenderingHasBegun()
@ -383,9 +386,8 @@ void ThisFramesRenderingHasFinished()
int ExitWindowsSystem()
{
#if 1
SDL_Quit();
#endif
return 0;
}
@ -446,16 +448,16 @@ int main(int argc, char *argv[])
AvP.CurrentEnv = AvP.StartingEnv = 0; /* are these even used? */
AvP.PlayerType = I_Alien;
SetLevelToLoad(AVP_ENVIRONMENT_FERARCO); /* starting alien level */
// AvP.PlayerType = I_Alien;
// SetLevelToLoad(AVP_ENVIRONMENT_FERARCO); /* starting alien level */
// AvP.PlayerType = I_Marine;
AvP.PlayerType = I_Marine;
// SetLevelToLoad(AVP_ENVIRONMENT_DERELICT); /* starting marine level */
// AvP.PlayerType = I_Predator;
// SetLevelToLoad(AVP_ENVIRONMENT_WATERFALL); /* starting predator level */
// SetLevelToLoad(AVP_ENVIRONMENT_LEADWORKS_MP); /* multiplayer */
SetLevelToLoad(AVP_ENVIRONMENT_LEADWORKS_MP); /* multiplayer */
// SetLevelToLoad(AVP_ENVIRONMENT_E3DEMOSP); /* demo level */
@ -497,8 +499,8 @@ int main(int argc, char *argv[])
/* ScanImagesForFMVs(); NOT YET */
ResetFrameCounter();
/* Game_Has_Loaded(); NOT YET */
Game_Has_Loaded();
ResetFrameCounter();

View file

@ -27,6 +27,7 @@ extern VIEWDESCRIPTORBLOCK *Global_VDB_Ptr;
extern unsigned char GammaValues[256];
extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock;
extern int SpecialFXImageNumber;
extern int StaticImageNumber;
static D3DTexture *CurrTextureHandle;
@ -603,6 +604,69 @@ void D3D_PredatorThermalVisionPolygon_Output(POLYHEADER *inputPolyPtr, RENDERVER
glEnd();
}
void DrawNoiseOverlay(int tr)
{
GLfloat x[4], y[4], s[4], t[4], u, v;
int r, g, b;
D3DTexture *tex;
int size;
r = 255;
g = 255;
b = 255;
size = 256;
tex = ImageHeaderArray[StaticImageNumber].D3DTexture;
CheckTranslucencyModeIsCorrect(TRANSLUCENCY_GLOWING);
// CheckFilteringModeIsCorrect(FILTERING_BILINEAR_ON);
CheckBoundTextureIsCorrect(tex->id);
// CheckDepthFuncIsCorrect(GL_ALWAYS);
glDepthFunc(GL_ALWAYS);
u = FastRandom()&255;
v = FastRandom()&255;
x[0] = -1.0f;
y[0] = -1.0f;
s[0] = u / 256.0f;
t[0] = v / 256.0f;
x[1] = 1.0f;
y[1] = -1.0f;
s[1] = (u + size) / 256.0f;
t[1] = v / 256.0f;
x[2] = 1.0f;
y[2] = 1.0f;
s[2] = (u + size) / 256.0f;
t[2] = (v + size) / 256.0f;
x[3] = -1.0f;
y[3] = 1.0f;
s[3] = u / 256.0f;
t[3] = (v + size) / 256.0f;
SelectPolygonBeginType(3); /* triangles */
glColor4ub(r, g, b, tr);
glTexCoord2f(s[0], t[0]);
glVertex3f(x[0], y[0], 1.0f);
glTexCoord2f(s[1], t[1]);
glVertex3f(x[1], y[1], 1.0f);
glTexCoord2f(s[3], t[3]);
glVertex3f(x[3], y[3], 1.0f);
glTexCoord2f(s[1], t[1]);
glVertex3f(x[1], y[1], 1.0f);
glTexCoord2f(s[2], t[2]);
glVertex3f(x[2], y[2], 1.0f);
glTexCoord2f(s[3], t[3]);
glVertex3f(x[3], y[3], 1.0f);
glEnd();
glDepthFunc(GL_LEQUAL);
}
void D3D_PredatorScreenInversionOverlay()
{
CheckTranslucencyModeIsCorrect(TRANSLUCENCY_DARKENINGCOLOUR);

View file

@ -85,18 +85,6 @@ void CheckCDVolume()
}
/* progress_bar.cpp */
void Start_Progress_Bar()
{
fprintf(stderr, "Start_Progress_Bar()\n");
}
void Set_Progress_Bar_Position(int pos)
{
fprintf(stderr, "Set_Progress_Bar_Position(%d)\n", pos);
}
/* smacker.c */
int FmvColourRed;
int FmvColourGreen;
@ -409,11 +397,6 @@ void InitForceField()
fprintf(stderr, "InitForceField()\n");
}
void DrawNoiseOverlay(int t)
{
fprintf(stderr, "DrawNoiseOverlay(%d)\n", t);
}
void DrawScanlinesOverlay(float level)
{
fprintf(stderr, "DrawScanlinesOverlay(%f)\n", level);
@ -562,11 +545,6 @@ void D3D_BackdropPolygon_Output(POLYHEADER *inputPolyPtr,RENDERVERTEX *renderVer
long BackBufferPitch;
int VideoModeColourDepth;
void FlipBuffers()
{
fprintf(stderr, "FlipBuffers()\n");
}
int ChangePalette (unsigned char* NewPalette)
{
fprintf(stderr, "ChangePalette(%p)\n", NewPalette);