Fixed particle colors for real this time.

Worked around a crash (DIV_FIXED by zero) that happens when the Alien level
FERARCO starts.
This commit is contained in:
Steven Fuller 2001-08-12 02:30:17 +00:00 committed by Patryk Obara
parent ae2906ca83
commit de3fda828d
4 changed files with 11 additions and 8 deletions

View file

@ -41,8 +41,7 @@ extern "C" {
/* #define _mbclen strlen */
size_t _mbclen(const unsigned char *s);
//#define RGBA_MAKE(r,g,b,a) (((r) << 24) | ((g) << 16) | ((b) << 8) | (a))
#define RGBA_MAKE(r,g,b,a) ((((unsigned char)a) << 24) | (((unsigned char)b) << 16) | (((unsigned char)g) << 8) | ((unsigned char)r))
#define RGBA_MAKE(r, g, b, a) ((((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
#define MAX_PATH PATH_MAX

View file

@ -442,10 +442,11 @@ int main(int argc, char *argv[])
AvP.CurrentEnv = AvP.StartingEnv = 0; /* are these even used? */
// AvP.PlayerType = I_Alien;
AvP.PlayerType = I_Alien;
SetLevelToLoad(AVP_ENVIRONMENT_FERARCO); /* starting alien level */
AvP.PlayerType = I_Marine;
SetLevelToLoad(AVP_ENVIRONMENT_DERELICT); /* starting marine level */
// AvP.PlayerType = I_Marine;
// SetLevelToLoad(AVP_ENVIRONMENT_DERELICT); /* starting marine level */
// SetLevelToLoad(AVP_ENVIRONMENT_INVASION); /* because the menus aren't implemented */
@ -455,7 +456,7 @@ int main(int argc, char *argv[])
// SetLevelToLoad(AVP_ENVIRONMENT_LEADWORKS_MP); /* multiplayer */
// SetLevelToLoad(AVP_ENVIRONMENT_E3DEMOSP); /* demo level */
// while(AvP_MainMenus()) {
d3d_light_ctrl.ctrl = LCCM_NORMAL;

View file

@ -394,6 +394,8 @@ __asm__("imull %%edx \n\t"
int DIV_FIXED(int a, int b)
{
int retval;
if (b == 0) return 0; /* TODO: debug this! (start with alien on ferarco) */
/*
_asm
{

View file

@ -333,6 +333,7 @@ void D3D_Particle_Output(PARTICLE *particlePtr, RENDERVERTEX *renderVerticesPtr)
{
int r, g, b, a;
/* this should be OK. (ColourComponents was RGBA while RGBA_MAKE is BGRA (little endian) */
r = (particlePtr->Colour >> 0) & 0xFF;
g = (particlePtr->Colour >> 8) & 0xFF;
b = (particlePtr->Colour >> 16) & 0xFF;
@ -355,9 +356,9 @@ void D3D_Particle_Output(PARTICLE *particlePtr, RENDERVERTEX *renderVerticesPtr)
} else {
int r, g, b, a;
r = (particlePtr->Colour >> 0) & 0xFF;
b = (particlePtr->Colour >> 0) & 0xFF;
g = (particlePtr->Colour >> 8) & 0xFF;
b = (particlePtr->Colour >> 16) & 0xFF;
r = (particlePtr->Colour >> 16) & 0xFF;
a = (particlePtr->Colour >> 24) & 0xFF;
glColor4ub(r, g, b, a);