More work on menus.
This commit is contained in:
parent
ea23e5a1bb
commit
7ef81cbc6e
14 changed files with 405 additions and 219 deletions
|
@ -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];
|
||||
|
|
|
@ -77,7 +77,7 @@ enum AVPMENUGFX_ID
|
|||
typedef struct
|
||||
{
|
||||
char *FilenamePtr;
|
||||
// LPDIRECTDRAWSURFACE ImagePtr;
|
||||
void *ImagePtr;
|
||||
|
||||
AW_BACKUPTEXTUREHANDLE hBackup;
|
||||
int Width;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -311,9 +311,9 @@ int AVP_ChangeDisplayMode
|
|||
and other request modes such as
|
||||
zbuffering.
|
||||
*/
|
||||
|
||||
/*
|
||||
SetVideoMode[VideoMode]();
|
||||
|
||||
*/
|
||||
|
||||
|
||||
return TRUE;
|
||||
|
|
51
src/main.c
51
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();
|
||||
|
|
334
src/menus.c
Normal file
334
src/menus.c
Normal file
|
@ -0,0 +1,334 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#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 <GL/gl.h>
|
||||
|
||||
/* 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"
|
|
@ -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"); */
|
||||
|
|
134
src/stubs.c
134
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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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++ */
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue