some 'fixes', better solution: change to what it was before the neutron fix.

This commit is contained in:
Felix Wallin 2010-10-21 18:14:09 +02:00
parent 24d5ca7d4e
commit fdd3d24031
7 changed files with 747 additions and 742 deletions

View File

@ -30,7 +30,7 @@ powder-64-sse3-opengl: $(SOURCES)
$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 -lGL -lGLU -DOpenGL $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 -lGL -lGLU -DOpenGL
strip $@ strip $@
powder-64-sse3: $(SOURCES) powder-64-sse3: $(SOURCES)
$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 -j3
strip $@ strip $@
mv $@ build mv $@ build
powder-64-sse2: $(SOURCES) powder-64-sse2: $(SOURCES)

0
src/main.c Executable file → Normal file
View File

View File

@ -71,14 +71,11 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr)
if((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL) if((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL)
return 1; return 1;
if(pt==PT_NEUT && (r&0xFF)==PT_GLAS)
return 2;
if(pt==PT_PHOT&&( if(pt==PT_PHOT&&(
(r&0xFF)==PT_GLAS || (r&0xFF)==PT_PHOT || (r&0xFF)==PT_GLAS || (r&0xFF)==PT_PHOT ||
(r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || (r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN ||
(r&0xFF)==PT_GLOW || (r&0xFF)==PT_GLOW || (r&0xFF)==PT_WATR ||
(r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW ||
((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5))) ((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5)))
return 2; return 2;
@ -99,10 +96,12 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr)
return 0; return 0;
if(pt == PT_PHOT) if(pt == PT_PHOT)
return 2; return 0;
if(pt == PT_NEUT) if(pt == PT_NEUT)
return 1; return 1;
if(pt == PT_NEUT && (r&0xFF == PT_WATR||r&0xFF == PT_SLTW ||r&0xFF == PT_DSTW))
return 2;
if((r&0xFF) == PT_NEUT) if((r&0xFF) == PT_NEUT)
return 0; return 0;
@ -131,22 +130,28 @@ int try_move(int i, int x, int y, int nx, int ny)
(pmap[y][x]&0xFF)==PT_BMTL)) (pmap[y][x]&0xFF)==PT_BMTL))
e = 2; e = 2;
if(!e) { if(!e)
if(!legacy_enable && parts[i].type==PT_PHOT) { {
if(!legacy_enable && parts[i].type==PT_PHOT)
{
if((r & 0xFF) == PT_COAL || (r & 0xFF) == PT_BCOL) if((r & 0xFF) == PT_COAL || (r & 0xFF) == PT_BCOL)
parts[r>>8].temp = parts[i].temp; parts[r>>8].temp = parts[i].temp;
if((r & 0xFF) < PT_NUM) if((r & 0xFF) < PT_NUM)
parts[i].temp = parts[r>>8].temp = parts[i].temp = parts[r>>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP);
restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP);
} }
return 0; return 0;
} }
if(e == 2) {
if(e == 2)
{
if(parts[i].type == PT_PHOT && (r&0xFF)==PT_GLOW && !parts[r>>8].life) if(parts[i].type == PT_PHOT && (r&0xFF)==PT_GLOW && !parts[r>>8].life)
if(rand() < RAND_MAX/30) { if(rand() < RAND_MAX/30)
{
parts[r>>8].life = 120; parts[r>>8].life = 120;
create_gain_photon(i); create_gain_photon(i);
} }
if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) {
if(rand() < RAND_MAX/10) if(rand() < RAND_MAX/10)
create_cherenkov_photon(i); create_cherenkov_photon(i);