diff --git a/Makefile b/Makefile index ee49255..409f9d5 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ LDLIBS += -L/usr/X11R6/lib -lX11 -lXext -lGL `sdl-config --libs` -lopenal -lm AFLAGS = -g -w+macro-params -w+orphan-labels -w+number-overflow -ROOT = main.c mathline.c math.asm render.c opengl.c openal.c winapi.c stubs.c frustum.c kshape.c map.c maths.c md5.c mem3dc.c mem3dcpp.cpp module.c morph.c object.c shpanim.c sphere.c tables.c vdb.c version.c +ROOT = main.c mathline.c math.asm render.c opengl.c menus.c openal.c winapi.c stubs.c frustum.c kshape.c map.c maths.c md5.c mem3dc.c mem3dcpp.cpp module.c morph.c object.c shpanim.c sphere.c tables.c vdb.c version.c 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 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 indexfnt.cpp r2base.cpp r2pos666.cpp reflist.cpp refobj.cpp rentrntq.cpp scstring.cpp strtab.cpp strutil.c trig666.cpp wrapstr.cpp diff --git a/README b/README index 91ae4be..c220433 100644 --- a/README +++ b/README @@ -41,7 +41,8 @@ windows/vmware (read below to find out why), or download the AvP Alien demo. If you are wanting to run the Alien demo (the installer is an .exe but you can just use unzip to extract the files from the .exe), add -DALIEN_DEMO to CFLAGS (the one that's uncommented). Rename all game files lowercase. -Be sure to install the latest OpenAL (http://www.openal.org) CVS. +Be sure to install nasm (0.98) and the latest OpenAL (http://www.openal.org) +CVS. If you have the regular edition, add -DREGULAR_EDITION to CFLAGS. @@ -56,14 +57,10 @@ text is incorrect/missing). The source code that was released only works with Aliens vs Predator Gold. -In the future I'd like this port to support Gold, Regular and the three -demos. Plus, I am told that the Regular edition does seem to work by -renaming a file or two. +In the future I'd like this port to support Gold, Regular and the Alien +demo. (The Marine and Predator demos are a bit older and might not work.) -Unless someone feels strongly about it, I probably will decide not to support -save games (save games were added in the gold edition). - At least with the Gold edition, a number of files are encoded on the CD. So you would need to install the game in Windows (VMware works also) in order diff --git a/TODO b/TODO index dfb799b..974b9d6 100644 --- a/TODO +++ b/TODO @@ -1,17 +1,20 @@ [DONE] [08/24/01] Finish OpenGL code. [DONE] [08/26/01] Fix sound code. * Menus. +* Debug "pure virtual method called" * Proper file loading/saving (ignore case, search certain directories) and config handling (~/.avp/{ge, re, ad, md, pd}/?) * Command line options. * CD Audio. * Joystick support. +* Save/Load Game support. * Revisit sound code. * Try to get demos and regular edition to work. * See what FOX/Rebellion has to say (if anything) about redistribution of the demos and if its possible to create an installer for regular/gold edition CDs. * Do something with the ingame movies. Might just leave as-is. +* Possible Idea: implement demos? * See if the build process can be made easier for those who download the source. * Write documentation. diff --git a/src/avp/win95/frontend/avp_menugfx.cpp b/src/avp/win95/frontend/avp_menugfx.cpp index 3d16379..407d1d9 100644 --- a/src/avp/win95/frontend/avp_menugfx.cpp +++ b/src/avp/win95/frontend/avp_menugfx.cpp @@ -4,8 +4,7 @@ #include "tallfont.hpp" #include "strtab.hpp" -#include "awTexLd.h" -#include "alt_tab.h" +#include "awtexld.h" #include "chnktexi.h" #include "hud_layout.h" @@ -19,10 +18,10 @@ extern void D3D_RenderHUDString(char *stringPtr,int x,int y,int colour); extern "C" { -#include "AvP_Menus.h" +#include "avp_menus.h" extern unsigned char *ScreenBuffer; extern long BackBufferPitch; -extern DDPIXELFORMAT DisplayPixelFormat; +/* extern DDPIXELFORMAT DisplayPixelFormat; */ extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock; char AAFontWidths[256]; diff --git a/src/avp/win95/frontend/avp_menugfx.hpp b/src/avp/win95/frontend/avp_menugfx.hpp index e8d9a23..53ea5b6 100644 --- a/src/avp/win95/frontend/avp_menugfx.hpp +++ b/src/avp/win95/frontend/avp_menugfx.hpp @@ -77,7 +77,7 @@ enum AVPMENUGFX_ID typedef struct { char *FilenamePtr; -// LPDIRECTDRAWSURFACE ImagePtr; + void *ImagePtr; AW_BACKUPTEXTUREHANDLE hBackup; int Width; diff --git a/src/avp/win95/platsup.c b/src/avp/win95/platsup.c index b6dfa77..edf58bf 100644 --- a/src/avp/win95/platsup.c +++ b/src/avp/win95/platsup.c @@ -24,7 +24,6 @@ extern int InputMode; extern unsigned char KeyboardInput[]; extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock; -extern void (*SetVideoMode[]) (void); extern unsigned char *ScreenBuffer; extern unsigned char KeyASCII; diff --git a/src/avp/win95/system.c b/src/avp/win95/system.c index d6fcfdd..d0b6b7d 100644 --- a/src/avp/win95/system.c +++ b/src/avp/win95/system.c @@ -311,9 +311,9 @@ int AVP_ChangeDisplayMode and other request modes such as zbuffering. */ - +/* SetVideoMode[VideoMode](); - +*/ return TRUE; diff --git a/src/main.c b/src/main.c index 153eba0..e1a838c 100644 --- a/src/main.c +++ b/src/main.c @@ -23,8 +23,8 @@ #include "cdtrackselection.h" #include "gammacontrol.h" -#define MyWidth 1024 -#define MyHeight 768 +#define MyWidth 800 +#define MyHeight 600 char LevelName[] = {"predbit6\0QuiteALongNameActually"}; /* the real way to load levels */ @@ -65,15 +65,10 @@ PROCESSORTYPES ReadProcessorType() return PType_PentiumMMX; } -int InitialiseWindowsSystem() +int SetVideoMode(int Width, int Height) { ScanDrawMode = ScanDrawD3DHardwareRGB; GotMouse = 1; - - if (SDL_Init(SDL_INIT_VIDEO) < 0) { - fprintf(stderr, "SDL Init failed: %s\n", SDL_GetError()); - exit(EXIT_FAILURE); - } SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); @@ -81,7 +76,10 @@ int InitialiseWindowsSystem() SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - if ((surface = SDL_SetVideoMode(MyWidth, MyHeight, 0, SDL_OPENGL)) == NULL) { + if (surface != NULL) + SDL_FreeSurface(surface); + + if ((surface = SDL_SetVideoMode(Width, Height, 0, SDL_OPENGL)) == NULL) { fprintf(stderr, "SDL SetVideoMode failed: %s\n", SDL_GetError()); SDL_Quit(); exit(EXIT_FAILURE); @@ -98,7 +96,7 @@ int InitialiseWindowsSystem() // SDL_WM_GrabInput(SDL_GRAB_ON); // SDL_ShowCursor(0); - glViewport(0, 0, MyWidth, MyHeight); + glViewport(0, 0, Width, Height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -119,6 +117,22 @@ int InitialiseWindowsSystem() glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + ScreenDescriptorBlock.SDB_Width = Width; + ScreenDescriptorBlock.SDB_Height = Height; + ScreenDescriptorBlock.SDB_CentreX = Width/2; + ScreenDescriptorBlock.SDB_CentreY = Height/2; + ScreenDescriptorBlock.SDB_ProjX = Width/2; + ScreenDescriptorBlock.SDB_ProjY = Height/2; + ScreenDescriptorBlock.SDB_ClipLeft = 0; + ScreenDescriptorBlock.SDB_ClipRight = Width; + ScreenDescriptorBlock.SDB_ClipUp = 0; + ScreenDescriptorBlock.SDB_ClipDown = Height; + + return 0; +} + +int InitialiseWindowsSystem() +{ return 0; } @@ -542,6 +556,11 @@ int main(int argc, char *argv[]) int menusActive = 0; int thisLevelHasBeenCompleted = 0; + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + fprintf(stderr, "SDL Init failed: %s\n", SDL_GetError()); + exit(EXIT_FAILURE); + } + LoadCDTrackList(); SetFastRandom(); @@ -562,6 +581,8 @@ int main(int argc, char *argv[]) #endif InitGame(); + SetVideoMode(640, 480); + InitialVideoMode(); /* Env_List can probably be removed */ @@ -639,11 +660,15 @@ int main(int argc, char *argv[]) #endif + + while(AvP_MainMenus()) { d3d_light_ctrl.ctrl = LCCM_NORMAL; d3d_overlay_ctrl.ctrl = OCCM_NORMAL; + SetVideoMode(MyWidth, MyHeight); +#if 0 /* this was in windows SetGameVideoMode: */ ScreenDescriptorBlock.SDB_Width = MyWidth; ScreenDescriptorBlock.SDB_Height = MyHeight; @@ -655,8 +680,7 @@ while(AvP_MainMenus()) { ScreenDescriptorBlock.SDB_ClipRight = MyWidth; ScreenDescriptorBlock.SDB_ClipUp = 0; ScreenDescriptorBlock.SDB_ClipDown = MyHeight; - - // GetCorrectDirectDrawObject(); +#endif InitialiseGammaSettings(RequestedGammaSetting); @@ -796,7 +820,8 @@ while(AvP_MainMenus()) { } ClearMemoryPool(); - + + SetVideoMode(640, 480); } SoundSys_StopAll(); diff --git a/src/menus.c b/src/menus.c new file mode 100644 index 0000000..a249edc --- /dev/null +++ b/src/menus.c @@ -0,0 +1,334 @@ +#include +#include +#include + +#include "fixer.h" + +#include "strtab.hpp" + +#include "awtexld.h" +#include "chnktexi.h" +#include "hud_layout.h" + +#include "avp_menus.h" + +#define UseLocalAssert Yes +#include "ourasert.h" +#include "ffstdio.h" + +#include + +/* char AAFontWidths[256]; */ + +extern int AAFontImageNumber; + +AVPMENUGFX AvPMenuGfxStorage[MAX_NO_OF_AVPMENUGFXS] = +{ + {"Menus\\fractal.rim"}, + {"Common\\aa_font.rim"},// Warning! Texture from common used + + {"Menus\\copyright.rim"}, + + {"Menus\\FIandRD.rim"}, + {"Menus\\presents.rim"}, + {"Menus\\AliensVPredator.rim"}, + + {"Menus\\sliderbar.rim"},//AVPMENUGFX_SLIDERBAR, + {"Menus\\slider.rim"},//AVPMENUGFX_SLIDER, + + {"Menus\\starfield.rim"}, + {"Menus\\aliens.rim"}, + {"Menus\\Alien.rim"}, + {"Menus\\Marine.rim"}, + {"Menus\\Predator.rim"}, + + {"Menus\\glowy_left.rim"}, + {"Menus\\glowy_middle.rim"}, + {"Menus\\glowy_right.rim"}, + + // Marine level + {"Menus\\MarineEpisode1.rim"}, + {"Menus\\MarineEpisode2.rim"}, + {"Menus\\MarineEpisode3.rim"}, + {"Menus\\MarineEpisode4.rim"}, + {"Menus\\MarineEpisode5.rim"}, + {"Menus\\MarineEpisode6.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + + // Predator level + {"Menus\\PredatorEpisode1.rim"}, + {"Menus\\PredatorEpisode2.rim"}, + {"Menus\\PredatorEpisode3.rim"}, + {"Menus\\PredatorEpisode4.rim"}, + {"Menus\\PredatorEpisode5.rim"}, + {"Menus\\PredatorEpisode5.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + + // Alien level + {"Menus\\AlienEpisode2.rim"}, + {"Menus\\AlienEpisode4.rim"}, + {"Menus\\AlienEpisode1.rim"}, + {"Menus\\AlienEpisode3.rim"}, + {"Menus\\AlienEpisode5.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + {"Menus\\bonus.rim"}, + + // Splash screens + #if MARINE_DEMO + {"MarineSplash\\splash00.rim"}, + {"MarineSplash\\splash01.rim"}, + {"MarineSplash\\splash02.rim"}, + {"MarineSplash\\splash03.rim"}, + {"MarineSplash\\splash04.rim"}, + {"MarineSplash\\splash05.rim"}, + #elif ALIEN_DEMO + {"AlienSplash\\splash00.rim"}, + {"AlienSplash\\splash01.rim"}, + {"AlienSplash\\splash02.rim"}, + {"AlienSplash\\splash03.rim"}, + {"AlienSplash\\splash04.rim"}, + {"AlienSplash\\splash05.rim"}, + #else + {"PredatorSplash\\splash00.rim"}, + {"PredatorSplash\\splash01.rim"}, + {"PredatorSplash\\splash02.rim"}, + {"PredatorSplash\\splash03.rim"}, + {"PredatorSplash\\splash04.rim"}, + {"PredatorSplash\\splash05.rim"}, + #endif +}; + +int LengthOfMenuText(char *textPtr) +{ + fprintf(stderr, "LengthOfMenuText(%s)\n", textPtr); + + return 0; +} + +int RenderMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) +{ + fprintf(stderr, "RenderMenuText(%s, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format); + return Hardware_RenderSmallMenuText(textPtr, x, y, alpha, format); +/* + fprintf(stderr, "RenderMenuText(%s, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format); + + return 0; +*/ +} + +int RenderMenuText_Clipped(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int topY, int bottomY) +{ + fprintf(stderr, "RenderMenuText_Clipped(%s, %d, %d, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format, topY, bottomY); + + return 0; +} + +int RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) +{ + return Hardware_RenderSmallMenuText(textPtr, x, y, alpha, format); +/* + fprintf(stderr, "RenderSmallMenuText(%s, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format); + + return 0; +*/ +} + +int RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue) +{ + return Hardware_RenderSmallMenuText_Coloured(textPtr, x, y, alpha, format, red, green, blue); +/* + fprintf(stderr, "RenderSmallMenuText_Coloured(%s, %d, %d, %d, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format, red, green, blue); + + return 0; +*/ +} + +void RenderKeyConfigRectangle(int alpha) +{ + void Hardware_RenderKeyConfigRectangle(int alpha); + Hardware_RenderKeyConfigRectangle(alpha); +/* + fprintf(stderr, "RenderKeyConfigRectangle(%d)\n", alpha); +*/ +} + +void RenderHighlightRectangle(int x1, int y1, int x2, int y2, int r, int g, int b) +{ + void Hardware_RenderHighlightRectangle(int x1,int y1,int x2,int y2,int r, int g, int b); + Hardware_RenderHighlightRectangle(x1, y1, x2, y2, r, g, b); +/* + fprintf(stderr, "RenderHighlightRectangle(%d, %d, %d, %d, %d, %d, %d)\n", x1, y1, x2, y2, r, g, b); +*/ +} + +void RenderSmallFontString_Wrapped(char *textPtr,RECT* area,int alpha,int* output_x,int* output_y) +{ + fprintf(stderr, "RenderSmallFontString_Wrapped(%s, %p, %d, %p, %p)\n", textPtr, area, alpha, output_x, output_y); +} + +void LoadAvPMenuGfx(enum AVPMENUGFX_ID menuGfxID) +{ + AVPMENUGFX *gfxPtr; + char buffer[100]; + unsigned int fastFileLength; + void const *pFastFileData; + + GLOBALASSERT(menuGfxID < MAX_NO_OF_AVPMENUGFXS); + + gfxPtr = &AvPMenuGfxStorage[menuGfxID]; + + /* TODO: make sure this doesn't cause a leak */ + InitialiseTextures(); + CL_GetImageFileName(buffer, 100, gfxPtr->FilenamePtr, LIO_RELATIVEPATH); + + pFastFileData = ffreadbuf(buffer, &fastFileLength); + + if (pFastFileData) { + gfxPtr->ImagePtr = AwCreateSurface( + "pxfXY", + pFastFileData, + fastFileLength, + AW_TLF_TRANSP|AW_TLF_CHROMAKEY, + &(gfxPtr->Width), + &(gfxPtr->Height) + ); + } else { + gfxPtr->ImagePtr = AwCreateSurface( + "sfXY", + buffer, + AW_TLF_TRANSP|AW_TLF_CHROMAKEY, + &(gfxPtr->Width), + &(gfxPtr->Height) + ); + } + + GLOBALASSERT(gfxPtr->ImagePtr); + GLOBALASSERT(gfxPtr->Width>0); + GLOBALASSERT(gfxPtr->Height>0); + + gfxPtr->hBackup = 0; +} + +static void ReleaseAvPMenuGfx(enum AVPMENUGFX_ID menuGfxID) +{ + AVPMENUGFX *gfxPtr; + + GLOBALASSERT(menuGfxID < MAX_NO_OF_AVPMENUGFXS); + + + gfxPtr = &AvPMenuGfxStorage[menuGfxID]; + + GLOBALASSERT(gfxPtr); + GLOBALASSERT(gfxPtr->ImagePtr); + + ReleaseDDSurface(gfxPtr->ImagePtr); + + gfxPtr->ImagePtr = NULL; +} + +void LoadAllAvPMenuGfx() +{ + int i; + + for (i = 0; i < AVPMENUGFX_WINNER_SCREEN; i++) { + LoadAvPMenuGfx(i); + } + + AAFontImageNumber = CL_LoadImageOnce("Common\\aa_font.RIM",LIO_D3DTEXTURE|LIO_RELATIVEPATH|LIO_RESTORABLE); + + /* + TODO: load Fonts + TODO: Create cloud texture + TODO: Calculate AA font table? + */ + + fprintf(stderr, "LoadAllAvPMenuGfx()\n"); +} + +void LoadAllSplashScreenGfx() +{ + int i; + + for (i = AVPMENUGFX_SPLASH_SCREEN1; i < MAX_NO_OF_AVPMENUGFXS; i++) { + LoadAvPMenuGfx(i); + } +} + +void InitialiseMenuGfx() +{ + int i; + + for (i = 0; i < MAX_NO_OF_AVPMENUGFXS; i++) { + AvPMenuGfxStorage[i].ImagePtr = NULL; + } + + glDisable(GL_BLEND); + glDisable(GL_DEPTH_TEST); + glEnable(GL_TEXTURE_2D); + + glClear(GL_COLOR_BUFFER_BIT); +} + +void ReleaseAllAvPMenuGfx() +{ + int i; + + for (i = 0; i < MAX_NO_OF_AVPMENUGFXS; i++) { + if (AvPMenuGfxStorage[i].ImagePtr) { + ReleaseAvPMenuGfx(i); + } + } + + /* + TODO: Unload fonts + */ + fprintf(stderr, "ReleaseAllAvPMenuGfx()\n"); +} + +void DrawAvPMenuGfx(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format) +{ + fprintf(stderr, "DrawAvPMenuGfx(%d, %d, %d, %d, %d)\n", menuGfxID, topleftX, topleftY, alpha, format); +} + +void DrawAvPMenuGfx_CrossFade(enum AVPMENUGFX_ID menuGfxID,enum AVPMENUGFX_ID menuGfxID2,int alpha) +{ + fprintf(stderr, "DrawAvPMenuGfx_CrossFade(%d, %d, %d)\n", menuGfxID, menuGfxID2, alpha); +} + +void DrawAvPMenuGfx_Faded(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format) +{ + fprintf(stderr, "DrawAvPMenuGfx_Faded(%d, %d, %d, %d, %d)\n", menuGfxID, topleftX, topleftY, alpha, format); +} + +void DrawAvPMenuGfx_Clipped(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format, int topY, int bottomY) +{ + fprintf(stderr, "DrawAvPMenuGfx_Clipped(%d, %d, %d, %d, %d, %d, %d)\n", menuGfxID, topleftX, topleftY, alpha, format, topY, bottomY); +} + +int HeightOfMenuGfx(enum AVPMENUGFX_ID menuGfxID) +{ + return AvPMenuGfxStorage[menuGfxID].Height; +} + +void FadedScreen(int alpha) +{ + fprintf(stderr, "FadedScreen(%d)\n", alpha); +} + +void ClearScreenToBlack() +{ + fprintf(stderr, "ClearScreenToBlack()\n"); +} + +#include "aafont.h" diff --git a/src/openal.c b/src/openal.c index 6440e57..ee40968 100644 --- a/src/openal.c +++ b/src/openal.c @@ -730,7 +730,7 @@ void PlatSetEnviroment(unsigned int env_index, float reverb_mix) void UpdateSoundFrequencies() { extern int SoundSwitchedOn; - extern int TimeScale; +/* extern int TimeScale; */ int i; /* printf("FREQ UpdateSoundFreqncies()\n"); */ diff --git a/src/stubs.c b/src/stubs.c index deafc33..a762868 100644 --- a/src/stubs.c +++ b/src/stubs.c @@ -196,138 +196,6 @@ void ATRemoveTexture(void * pTexture) } -/* avp_menugfx.cpp */ -/* char AAFontWidths[256]; */ -AVPMENUGFX AvPMenuGfxStorage[MAX_NO_OF_AVPMENUGFXS]; /* TODO: this is initialized in avp_menugfx.cpp */ - -void InitialiseMenuGfx() -{ - fprintf(stderr, "InitialiseMenuGfx()\n"); -} - -void LoadAllAvPMenuGfx() -{ - fprintf(stderr, "LoadAllAvPMenuGfx()\n"); -} - -void ReleaseAllAvPMenuGfx() -{ - fprintf(stderr, "ReleaseAllAvPMenuGfx()\n"); -} - -void FadedScreen(int alpha) -{ - fprintf(stderr, "FadedScreen(%d)\n", alpha); -} - -void ClearScreenToBlack() -{ - fprintf(stderr, "ClearScreenToBlack()\n"); -} - -void LoadAllSplashScreenGfx() -{ - fprintf(stderr, "LoadAllSplashScreenGfx()\n"); -} - -void LoadAvPMenuGfx(enum AVPMENUGFX_ID menuGfxID) -{ - fprintf(stderr, "LoadAvPMenuGfx(%d)\n", menuGfxID); -} - -void DrawAvPMenuGfx(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format) -{ - fprintf(stderr, "DrawAvPMenuGfx(%d, %d, %d, %d, %d)\n", menuGfxID, topleftX, topleftY, alpha, format); -} - -void DrawAvPMenuGfx_CrossFade(enum AVPMENUGFX_ID menuGfxID,enum AVPMENUGFX_ID menuGfxID2,int alpha) -{ - fprintf(stderr, "DrawAvPMenuGfx_CrossFade(%d, %d, %d)\n", menuGfxID, menuGfxID2, alpha); -} - -void DrawAvPMenuGfx_Faded(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format) -{ - fprintf(stderr, "DrawAvPMenuGfx_Faded(%d, %d, %d, %d, %d)\n", menuGfxID, topleftX, topleftY, alpha, format); -} - -void DrawAvPMenuGfx_Clipped(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format, int topY, int bottomY) -{ - fprintf(stderr, "DrawAvPMenuGfx_Clipped(%d, %d, %d, %d, %d, %d, %d)\n", menuGfxID, topleftX, topleftY, alpha, format, topY, bottomY); -} - -int RenderMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) -{ - fprintf(stderr, "RenderMenuText(%s, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format); - - return 0; -} - -int RenderMenuText_Clipped(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int topY, int bottomY) -{ - fprintf(stderr, "RenderMenuText_Clipped(%s, %d, %d, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format, topY, bottomY); - - return 0; -} - -int RenderSmallMenuText(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format) -{ -/* - return Hardware_RenderSmallMenuText(textPtr, x, y, alpha, format); -*/ - fprintf(stderr, "RenderSmallMenuText(%s, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format); - - return 0; -} - -int RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue) -{ -/* - return Hardware_RenderSmallMenuText_Coloured(textPtr, x, y, alpha, format, red, green, blue); -*/ - fprintf(stderr, "RenderSmallMenuText_Coloured(%s, %d, %d, %d, %d, %d, %d, %d)\n", textPtr, x, y, alpha, format, red, green, blue); - - return 0; -} - -void RenderSmallFontString_Wrapped(char *textPtr,RECT* area,int alpha,int* output_x,int* output_y) -{ - fprintf(stderr, "RenderSmallFontString_Wrapped(%s, %p, %d, %p, %p)\n", textPtr, area, alpha, output_x, output_y); -} - -void RenderKeyConfigRectangle(int alpha) -{ - void Hardware_RenderKeyConfigRectangle(int alpha); - Hardware_RenderKeyConfigRectangle(alpha); -/* - fprintf(stderr, "RenderKeyConfigRectangle(%d)\n", alpha); -*/ -} - -void RenderHighlightRectangle(int x1,int y1,int x2,int y2, int r, int g, int b) -{ - void Hardware_RenderHighlightRectangle(int x1,int y1,int x2,int y2,int r, int g, int b); - Hardware_RenderHighlightRectangle(x1, y1, x2, y2, r, g, b); -/* - fprintf(stderr, "RenderHighlightRectangle(%d, %d, %d, %d, %d, %d, %d)\n", x1, y1, x2, y2, r, g, b); -*/ -} - -int LengthOfMenuText(char *textPtr) -{ - fprintf(stderr, "LengthOfMenuText(%s)\n", textPtr); - - return 0; -} - -int HeightOfMenuGfx(enum AVPMENUGFX_ID menuGfxID) -{ - fprintf(stderr, "HeightOfMenuGfx(%d)\n", menuGfxID); - - return 0; -} - - - /* avpreg.cpp */ char *AvpCDPath = 0; @@ -565,5 +433,3 @@ void dx_line_log(int line, char const * file) { fprintf(stderr, "dx_line_log: %s/%d\n", file, line); } - -#include "aafont.h" diff --git a/src/win95/awtexld.cpp b/src/win95/awtexld.cpp index eb2a34d..3394374 100644 --- a/src/win95/awtexld.cpp +++ b/src/win95/awtexld.cpp @@ -2149,6 +2149,20 @@ DDSurface * AwCreateSurface(char const * _argFormatS, ...) using namespace AwTl; + /* Just convert the texture to 32bpp */ + pixelFormat.palettizedB = 0; + + pixelFormat.alphaB = 1; + pixelFormat.validB = 1; + pixelFormat.bitsPerPixel = 32; + pixelFormat.redLeftShift = 0; + pixelFormat.greenLeftShift = 8; + pixelFormat.blueLeftShift = 16; + pixelFormat.redRightShift = 0; + pixelFormat.greenRightShift = 0; + pixelFormat.blueRightShift = 0; + pixelFormat.dwRGBAlphaBitMask = 0xFF000000; + va_list ap; va_start(ap,_argFormatS); CreateTextureParms parms; diff --git a/src/win95/awtexld.h b/src/win95/awtexld.h index 9e5eb3f..51266e0 100644 --- a/src/win95/awtexld.h +++ b/src/win95/awtexld.h @@ -103,11 +103,13 @@ struct AwCreateGraphicRegion { unsigned left, top, right, bottom; /* rectangle to cut from the original image */ unsigned width, height; /* width and height of the resulting surface or texture */ +#if 0 union /* DDSurface or D3DTexture pointer depending on the context used */ { DDSurface * pSurface; /* Direct Draw Surface object pointer */ D3DTexture * pTexture; /* Direct 3D Texture object pointer */ }; +#endif }; /* typedef to save typing 'struct' when not using C++ */ diff --git a/src/win95/io.c b/src/win95/io.c index bd63c83..a021f34 100644 --- a/src/win95/io.c +++ b/src/win95/io.c @@ -443,61 +443,10 @@ int NearestColour(int rs, int gs, int bs, unsigned char *palette) } - - - - - - - - /*************************************************************************/ /*************************************************************************/ - - - -/* - - PC Video Mode Array Functions - -*/ - - -#define m320diag (378 + 6) - - - - - -/* - - PC Video Mode Function Arrays - -*/ - -void (*SetVideoMode[]) (void) = { - -0 - -}; - - - - - - - - - - - - - - - - /* Initialise System and System Variables @@ -1797,12 +1746,10 @@ int ChangeDisplayModes(HINSTANCE hInst, int nCmd, obviously... FIXME!!! */ - /* test only!!! */ - #if 0 - chdir("d:\3dc"); - #endif +/* SetVideoMode[VideoMode](); +*/ /* Lose all the textures and reload the