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 */ /* #define _mbclen strlen */
size_t _mbclen(const unsigned char *s); 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) ((((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
#define RGBA_MAKE(r,g,b,a) ((((unsigned char)a) << 24) | (((unsigned char)b) << 16) | (((unsigned char)g) << 8) | ((unsigned char)r))
#define MAX_PATH PATH_MAX #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.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; // AvP.PlayerType = I_Marine;
SetLevelToLoad(AVP_ENVIRONMENT_DERELICT); /* starting marine level */ // SetLevelToLoad(AVP_ENVIRONMENT_DERELICT); /* starting marine level */
// SetLevelToLoad(AVP_ENVIRONMENT_INVASION); /* because the menus aren't implemented */ // SetLevelToLoad(AVP_ENVIRONMENT_INVASION); /* because the menus aren't implemented */

View file

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

View file

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