some 'fixes', better solution: change to what it was before the neutron fix.
This commit is contained in:
parent
24d5ca7d4e
commit
fdd3d24031
2
Makefile
2
Makefile
@ -30,7 +30,7 @@ powder-64-sse3-opengl: $(SOURCES)
|
||||
$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 -lGL -lGLU -DOpenGL
|
||||
strip $@
|
||||
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 $@
|
||||
mv $@ build
|
||||
powder-64-sse2: $(SOURCES)
|
||||
|
@ -888,7 +888,7 @@ int drawtextwrap(pixel *vid, int x, int y, int w, const char *s, int r, int g, i
|
||||
}
|
||||
else
|
||||
{
|
||||
if(x-cw>=w){
|
||||
if(x-cw>=w) {
|
||||
x = sx;
|
||||
rw = 0;
|
||||
y+=FONT_H+2;
|
||||
@ -2137,7 +2137,7 @@ void draw_parts(pixel *vid)
|
||||
}
|
||||
if(cmode == 4&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_HFLM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH&&t!=PT_SMKE&&t!=PT_WTRV&&!(t==PT_FIRW&&parts[i].tmp==3))
|
||||
{
|
||||
if(t==PT_PHOT){
|
||||
if(t==PT_PHOT) {
|
||||
cg = 0;
|
||||
cb = 0;
|
||||
cr = 0;
|
||||
|
@ -2197,7 +2197,7 @@ int search_ui(pixel *vid_buf)
|
||||
|
||||
if((b && !bq && mp!=-1 && !st && !uih) || do_open==1)
|
||||
{
|
||||
if(open_ui(vid_buf, search_ids[mp], search_dates[mp]?search_dates[mp]:NULL)==1){
|
||||
if(open_ui(vid_buf, search_ids[mp], search_dates[mp]?search_dates[mp]:NULL)==1) {
|
||||
goto finish;
|
||||
}
|
||||
/*
|
||||
@ -2619,7 +2619,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date)
|
||||
if(status_2 == 200)
|
||||
{
|
||||
info_ready = info_parse(info_data, info);
|
||||
if(info_ready==-1){
|
||||
if(info_ready==-1) {
|
||||
error_ui(vid_buf, 0, "Not found");
|
||||
break;
|
||||
}
|
||||
@ -2630,12 +2630,12 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date)
|
||||
http_2 = NULL;
|
||||
}
|
||||
|
||||
if(data_ready && !hasdrawnthumb){
|
||||
if(data_ready && !hasdrawnthumb) {
|
||||
draw_image(vid_buf, save_pic, 51, 51, thumb_w, thumb_h, 255);
|
||||
hasdrawnthumb = 1;
|
||||
memcpy(old_vid, vid_buf, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE);
|
||||
}
|
||||
if(info_ready && !hasdrawninfo){
|
||||
if(info_ready && !hasdrawninfo) {
|
||||
//drawtext(vid_buf, 2, 2, info->name, 255, 255, 255, 255);
|
||||
cix = drawtext(vid_buf, 60, (YRES/2)+60, info->name, 255, 255, 255, 255);
|
||||
cix = drawtext(vid_buf, 60, (YRES/2)+72, "Author:", 255, 255, 255, 155);
|
||||
@ -2645,7 +2645,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date)
|
||||
drawtextwrap(vid_buf, 62, (YRES/2)+86, (XRES/2)-24, info->description, 255, 255, 255, 200);
|
||||
|
||||
ccy = 0;
|
||||
for(cc=0;cc<info->comment_count;cc++){
|
||||
for(cc=0; cc<info->comment_count; cc++) {
|
||||
drawtext(vid_buf, 60+(XRES/2)+1, ccy+60, info->commentauthors[cc], 255, 255, 255, 255);
|
||||
ccy += 12;
|
||||
ccy += drawtextwrap(vid_buf, 60+(XRES/2)+1, ccy+60, XRES+BARSIZE-100-((XRES/2)+1)-20, info->comments[cc], 255, 255, 255, 185);
|
||||
@ -2657,11 +2657,11 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date)
|
||||
memcpy(old_vid, vid_buf, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE);
|
||||
}
|
||||
|
||||
if(queue_open){
|
||||
if(info_ready && data_ready){
|
||||
if(queue_open) {
|
||||
if(info_ready && data_ready) {
|
||||
// Do Open!
|
||||
status = parse_save(data, data_size, 1, 0, 0);
|
||||
if(!status){
|
||||
if(!status) {
|
||||
//if(svf_last)
|
||||
//free(svf_last);
|
||||
svf_last = data;
|
||||
@ -2705,53 +2705,53 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date)
|
||||
}
|
||||
|
||||
//Open Button
|
||||
if(sdl_key==SDLK_RETURN){
|
||||
if(sdl_key==SDLK_RETURN) {
|
||||
queue_open = 1;
|
||||
}
|
||||
drawrect(vid_buf, 70, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 255);
|
||||
drawtext(vid_buf, 93, YRES+MENUSIZE-63, "Open", 255, 255, 255, 255);
|
||||
drawtext(vid_buf, 78, YRES+MENUSIZE-64, "\x81", 255, 255, 255, 255);
|
||||
if(mx > 70 && mx < 70+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50){
|
||||
if(mx > 70 && mx < 70+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50) {
|
||||
fillrect(vid_buf, 70, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40);
|
||||
if(b && !bq){
|
||||
if(b && !bq) {
|
||||
queue_open = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//Fav Button
|
||||
if(svf_login){
|
||||
if(svf_login) {
|
||||
drawrect(vid_buf, 140, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 255);
|
||||
drawtext(vid_buf, 162, YRES+MENUSIZE-63, "Fav.", 255, 255, 255, 255);
|
||||
drawtext(vid_buf, 147, YRES+MENUSIZE-64, "\xCC", 255, 255, 255, 255);
|
||||
if(mx > 140 && mx < 140+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50){
|
||||
if(mx > 140 && mx < 140+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50) {
|
||||
fillrect(vid_buf, 140, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40);
|
||||
if(b && !bq){
|
||||
if(b && !bq) {
|
||||
//Button Clicked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Report Button
|
||||
if(svf_login){
|
||||
if(svf_login) {
|
||||
drawrect(vid_buf, 210, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 255);
|
||||
drawtext(vid_buf, 228, YRES+MENUSIZE-63, "Report", 255, 255, 255, 255);
|
||||
drawtext(vid_buf, 218, YRES+MENUSIZE-63, "!", 255, 255, 255, 255);
|
||||
if(mx > 210 && mx < 210+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50){
|
||||
if(mx > 210 && mx < 210+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50) {
|
||||
fillrect(vid_buf, 210, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40);
|
||||
if(b && !bq){
|
||||
if(b && !bq) {
|
||||
//Button Clicked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Delete Button
|
||||
if(authoritah){
|
||||
if(authoritah) {
|
||||
drawrect(vid_buf, 280, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 255);
|
||||
drawtext(vid_buf, 298, YRES+MENUSIZE-63, "Delete", 255, 255, 255, 255);
|
||||
drawtext(vid_buf, 286, YRES+MENUSIZE-64, "\xAA", 255, 255, 255, 255);
|
||||
if(mx > 280 && mx < 280+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50){
|
||||
if(mx > 280 && mx < 280+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50) {
|
||||
fillrect(vid_buf, 280, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40);
|
||||
if(b && !bq){
|
||||
if(b && !bq) {
|
||||
//Button Clicked
|
||||
}
|
||||
}
|
||||
@ -2856,7 +2856,7 @@ int info_parse(char *info_data, save_info *info)
|
||||
}
|
||||
else if(!strncmp(info_data, "COMMENT ", 8))
|
||||
{
|
||||
if(info->comment_count>=6){
|
||||
if(info->comment_count>=6) {
|
||||
info_data = p;
|
||||
continue;
|
||||
} else {
|
||||
@ -2870,7 +2870,7 @@ int info_parse(char *info_data, save_info *info)
|
||||
}
|
||||
info_data = p;
|
||||
}
|
||||
if(j>=8){
|
||||
if(j>=8) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
|
2
src/main.c
Executable file → Normal file
2
src/main.c
Executable file → Normal file
@ -507,7 +507,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
||||
if(p >= size)
|
||||
goto corrupt;
|
||||
j=d[p++];
|
||||
if(j >= PT_NUM){
|
||||
if(j >= PT_NUM) {
|
||||
//TODO: Possibly some server side translation
|
||||
j = PT_DUST;//goto corrupt;
|
||||
}
|
||||
|
53
src/powder.c
53
src/powder.c
@ -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)
|
||||
return 1;
|
||||
|
||||
if(pt==PT_NEUT && (r&0xFF)==PT_GLAS)
|
||||
return 2;
|
||||
|
||||
if(pt==PT_PHOT&&(
|
||||
(r&0xFF)==PT_GLAS || (r&0xFF)==PT_PHOT ||
|
||||
(r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN ||
|
||||
(r&0xFF)==PT_GLOW ||
|
||||
(r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW ||
|
||||
(r&0xFF)==PT_GLOW || (r&0xFF)==PT_WATR ||
|
||||
(r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW ||
|
||||
((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5)))
|
||||
return 2;
|
||||
|
||||
@ -99,10 +96,12 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr)
|
||||
return 0;
|
||||
|
||||
if(pt == PT_PHOT)
|
||||
return 2;
|
||||
|
||||
return 0;
|
||||
if(pt == PT_NEUT)
|
||||
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)
|
||||
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))
|
||||
e = 2;
|
||||
|
||||
if(!e) {
|
||||
if(!legacy_enable && parts[i].type==PT_PHOT) {
|
||||
if(!e)
|
||||
{
|
||||
if(!legacy_enable && parts[i].type==PT_PHOT)
|
||||
{
|
||||
if((r & 0xFF) == PT_COAL || (r & 0xFF) == PT_BCOL)
|
||||
parts[r>>8].temp = parts[i].temp;
|
||||
|
||||
if((r & 0xFF) < PT_NUM)
|
||||
parts[i].temp = parts[r>>8].temp =
|
||||
restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP);
|
||||
parts[i].temp = parts[r>>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if(e == 2) {
|
||||
|
||||
if(e == 2)
|
||||
{
|
||||
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;
|
||||
create_gain_photon(i);
|
||||
}
|
||||
|
||||
if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) {
|
||||
if(rand() < RAND_MAX/10)
|
||||
create_cherenkov_photon(i);
|
||||
@ -1288,8 +1293,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(t==PT_BMTL){
|
||||
if(parts[i].tmp>1){
|
||||
else if(t==PT_BMTL) {
|
||||
if(parts[i].tmp>1) {
|
||||
parts[i].tmp--;
|
||||
for(nx=-1; nx<2; nx++)
|
||||
for(ny=-1; ny<2; ny++)
|
||||
@ -1305,13 +1310,13 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
parts[r>>8].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100;
|
||||
}
|
||||
}
|
||||
} else if(parts[i].tmp==1 && 1>rand()%1000){
|
||||
} else if(parts[i].tmp==1 && 1>rand()%1000) {
|
||||
parts[i].tmp = 0;
|
||||
t = parts[i].type = PT_BRMT;
|
||||
}
|
||||
}
|
||||
|
||||
else if(t==PT_IRON){
|
||||
else if(t==PT_IRON) {
|
||||
for(nx=-1; nx<2; nx++)
|
||||
for(ny=-1; ny<2; ny++)
|
||||
if(x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES && (nx || ny))
|
||||
@ -1332,7 +1337,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if((t==PT_SPRK||parts[i].type==PT_SPRK) && parts[i].ctype==PT_IRON){
|
||||
else if((t==PT_SPRK||parts[i].type==PT_SPRK) && parts[i].ctype==PT_IRON) {
|
||||
for(nx=-1; nx<2; nx++)
|
||||
for(ny=-1; ny<2; ny++)
|
||||
if(x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES && (nx || ny))
|
||||
@ -1777,7 +1782,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(t==PT_MORT){
|
||||
else if(t==PT_MORT) {
|
||||
create_part(-1, x, y-1, PT_SMKE);
|
||||
}
|
||||
else if(t==PT_LCRY)
|
||||
@ -2641,12 +2646,12 @@ killed:
|
||||
(pmap[y+ny][x+nx]&0xFF)!=PT_STKM &&
|
||||
(pmap[y+ny][x+nx]&0xFF)!=0xFF)
|
||||
parts[i].ctype = pmap[y+ny][x+nx]&0xFF;
|
||||
if(parts[i].ctype && parts[i].life==10){
|
||||
if(parts[i].ctype==PT_PHOT){
|
||||
for(nx=-1; nx<2; nx++){
|
||||
for(ny=-1; ny<2; ny++){
|
||||
if(parts[i].ctype && parts[i].life==10) {
|
||||
if(parts[i].ctype==PT_PHOT) {
|
||||
for(nx=-1; nx<2; nx++) {
|
||||
for(ny=-1; ny<2; ny++) {
|
||||
r = create_part(-1, x+nx, y+ny, parts[i].ctype);
|
||||
if(r!=-1){
|
||||
if(r!=-1) {
|
||||
parts[r].vx = nx*3;
|
||||
parts[r].vy = ny*3;
|
||||
}
|
||||
|
Reference in New Issue
Block a user