Merge remote-tracking branch 'origin/next' into pitch-roll

This commit is contained in:
lachablock 2021-05-22 17:14:33 +10:00
commit 350d94b4e0
260 changed files with 2248 additions and 1724 deletions

View file

@ -1,4 +1,4 @@
version: 2.2.8.{branch}-{build} version: 2.2.9.{branch}-{build}
os: MinGW os: MinGW
environment: environment:

2
dep/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
#All folders
*.d

2
dep/FreeBSD/SDL/Debug/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/FreeBSD/SDL/Release/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Linux/SDL/Debug/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Linux/SDL/Release/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Linux64/SDL/Debug/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Linux64/SDL/Release/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/MasterClient/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/MasterServer/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Mingw/Debug/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Mingw/Release/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Mingw/SDL/Debug/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Mingw/SDL/Release/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Mingw64/Debug/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Mingw64/Release/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Mingw64/SDL/Debug/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/Mingw64/SDL/Release/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/SDL/Release/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/VC/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/VC9/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/cygwin/Debug/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/cygwin/Release/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

2
dep/dummy/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# DON'T REMOVE
# This keeps the folder from disappearing

View file

@ -640,6 +640,24 @@ linedeftypes
prefix = "(63)"; prefix = "(63)";
} }
97
{
title = "Apply Tag to Front Sector";
prefix = "(97)";
}
98
{
title = "Apply Tag to Back Sector";
prefix = "(98)";
}
99
{
title = "Apply Tag to Front and Back Sectors";
prefix = "(99)";
}
540 540
{ {
title = "Floor Friction"; title = "Floor Friction";
@ -746,13 +764,13 @@ linedeftypes
20 20
{ {
title = "First Line"; title = "PolyObject First Line";
prefix = "(20)"; prefix = "(20)";
} }
22 22
{ {
title = "Parameters"; title = "PolyObject Parameters";
prefix = "(22)"; prefix = "(22)";
flags8text = "[3] Set translucency by X offset"; flags8text = "[3] Set translucency by X offset";
flags32text = "[5] Render outer sides only"; flags32text = "[5] Render outer sides only";
@ -765,19 +783,19 @@ linedeftypes
30 30
{ {
title = "Waving Flag"; title = "PolyObject Waving Flag";
prefix = "(30)"; prefix = "(30)";
} }
31 31
{ {
title = "Displacement by Front Sector"; title = "Move PolyObject by Front Sector Displacement";
prefix = "(31)"; prefix = "(31)";
} }
32 32
{ {
title = "Angular Displacement by Front Sector"; title = "Rotate PolyObject by Front Sector Displacement";
prefix = "(32)"; prefix = "(32)";
flags64text = "[6] Don't turn players"; flags64text = "[6] Don't turn players";
flags512text = "[9] Turn all objects"; flags512text = "[9] Turn all objects";
@ -2498,35 +2516,35 @@ linedeftypes
480 480
{ {
title = "Door Slide"; title = "PolyObject Door Slide";
prefix = "(480)"; prefix = "(480)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
} }
481 481
{ {
title = "Door Swing"; title = "PolyObject Door Swing";
prefix = "(481)"; prefix = "(481)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
} }
482 482
{ {
title = "Move"; title = "Move PolyObject";
prefix = "(482)"; prefix = "(482)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
} }
483 483
{ {
title = "Move, Override"; title = "Move PolyObject, Override";
prefix = "(483)"; prefix = "(483)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
} }
484 484
{ {
title = "Rotate Right"; title = "Rotate PolyObject Right";
prefix = "(484)"; prefix = "(484)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags64text = "[6] Don't turn players"; flags64text = "[6] Don't turn players";
@ -2535,7 +2553,7 @@ linedeftypes
485 485
{ {
title = "Rotate Right, Override"; title = "Rotate PolyObject Right, Override";
prefix = "(485)"; prefix = "(485)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags64text = "[6] Don't turn players"; flags64text = "[6] Don't turn players";
@ -2544,7 +2562,7 @@ linedeftypes
486 486
{ {
title = "Rotate Left"; title = "Rotate PolyObject Left";
prefix = "(486)"; prefix = "(486)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags64text = "[6] Don't turn players"; flags64text = "[6] Don't turn players";
@ -2553,7 +2571,7 @@ linedeftypes
487 487
{ {
title = "Rotate Left, Override"; title = "Rotate PolyObject Left, Override";
prefix = "(487)"; prefix = "(487)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags64text = "[6] Don't turn players"; flags64text = "[6] Don't turn players";
@ -2562,7 +2580,7 @@ linedeftypes
488 488
{ {
title = "Move by Waypoints"; title = "Move PolyObject by Waypoints";
prefix = "(488)"; prefix = "(488)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags32text = "[5] Reverse order"; flags32text = "[5] Reverse order";
@ -2573,7 +2591,7 @@ linedeftypes
489 489
{ {
title = "Turn Invisible, Intangible"; title = "Turn PolyObject Invisible, Intangible";
prefix = "(489)"; prefix = "(489)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags64text = "[6] Only invisible"; flags64text = "[6] Only invisible";
@ -2581,7 +2599,7 @@ linedeftypes
490 490
{ {
title = "Turn Visible, Tangible"; title = "Turn PolyObject Visible, Tangible";
prefix = "(490)"; prefix = "(490)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags64text = "[6] Only visible"; flags64text = "[6] Only visible";
@ -2589,7 +2607,7 @@ linedeftypes
491 491
{ {
title = "Set Translucency"; title = "Set PolyObject Translucency";
prefix = "(491)"; prefix = "(491)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags16text = "[4] Set raw alpha by Front X"; flags16text = "[4] Set raw alpha by Front X";
@ -2598,7 +2616,7 @@ linedeftypes
492 492
{ {
title = "Fade Translucency"; title = "Fade PolyObject Translucency";
prefix = "(492)"; prefix = "(492)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags16text = "[4] Set raw alpha by Front X"; flags16text = "[4] Set raw alpha by Front X";
@ -3059,6 +3077,78 @@ linedeftypes
slopeargs = 3; slopeargs = 3;
} }
723
{
title = "Copy Backside Floor Slope from Line Tag";
prefix = "(720)";
slope = "copy";
slopeargs = 4;
}
724
{
title = "Copy Backside Ceiling Slope from Line Tag";
prefix = "(721)";
slope = "copy";
slopeargs = 8;
}
725
{
title = "Copy Backside Floor and Ceiling Slope from Line Tag";
prefix = "(722)";
slope = "copy";
slopeargs = 12;
}
730
{
title = "Copy Frontside Floor Slope to Backside";
prefix = "(730)";
slope = "copy";
copyslopeargs = 1;
}
731
{
title = "Copy Frontside Ceiling Slope to Backside";
prefix = "(731)";
slope = "copy";
copyslopeargs = 4;
}
732
{
title = "Copy Frontside Floor and Ceiling Slope to Backside";
prefix = "(732)";
slope = "copy";
copyslopeargs = 5;
}
733
{
title = "Copy Backside Floor Slope to Frontside";
prefix = "(733)";
slope = "copy";
copyslopeargs = 2;
}
734
{
title = "Copy Backside Ceiling Slope to Frontside";
prefix = "(734)";
slope = "copy";
copyslopeargs = 8;
}
735
{
title = "Copy Backside Floor and Ceiling Slope to Frontside";
prefix = "(735)";
slope = "copy";
copyslopeargs = 10;
}
799 799
{ {
title = "Set Tagged Dynamic Slope Vertex to Front Sector Height"; title = "Set Tagged Dynamic Slope Vertex to Front Sector Height";
@ -3393,6 +3483,7 @@ thingtypes
width = 8; width = 8;
height = 28; height = 28;
angletext = "Jump strength"; angletext = "Jump strength";
fixedrotation = 1;
} }
103 103
{ {
@ -3431,6 +3522,7 @@ thingtypes
width = 12; width = 12;
height = 64; height = 64;
angletext = "Firing delay"; angletext = "Firing delay";
fixedrotation = 1;
} }
122 122
{ {
@ -3547,9 +3639,10 @@ thingtypes
{ {
title = "Pterabyte Spawner"; title = "Pterabyte Spawner";
sprite = "PTERA2A8"; sprite = "PTERA2A8";
width = 16; width = 24;
height = 16; height = 48;
parametertext = "No. Pterabytes"; parametertext = "Spawns +1";
arrow = 0;
} }
136 136
{ {
@ -3771,6 +3864,7 @@ thingtypes
height = 16; height = 16;
sprite = "internal:capsule"; sprite = "internal:capsule";
angletext = "Tag"; angletext = "Tag";
fixedrotation = 1;
} }
292 292
{ {
@ -3781,11 +3875,13 @@ thingtypes
flags8text = "[8] Sea Egg shooting point"; flags8text = "[8] Sea Egg shooting point";
sprite = "internal:eggmanway"; sprite = "internal:eggmanway";
angletext = "No. (Sea Egg)"; angletext = "No. (Sea Egg)";
fixedrotation = 1;
flagsvaluetext = "No. (Brak)"; flagsvaluetext = "No. (Brak)";
parametertext = "Next"; parametertext = "Next";
} }
293 293
{ {
arrow = 0;
title = "Metal Sonic Gather Point"; title = "Metal Sonic Gather Point";
sprite = "internal:metal"; sprite = "internal:metal";
width = 8; width = 8;
@ -3793,6 +3889,7 @@ thingtypes
} }
294 294
{ {
arrow = 0;
title = "Fang Waypoint"; title = "Fang Waypoint";
flags8text = "[8] Center waypoint"; flags8text = "[8] Center waypoint";
sprite = "internal:eggmanway"; sprite = "internal:eggmanway";
@ -3820,79 +3917,79 @@ thingtypes
301 301
{ {
title = "Bounce Ring"; title = "Bounce Ring";
sprite = "internal:RNGBA0"; sprite = "RNGBA0";
} }
302 302
{ {
title = "Rail Ring"; title = "Rail Ring";
sprite = "internal:RNGRA0"; sprite = "RNGRA0";
} }
303 303
{ {
title = "Infinity Ring"; title = "Infinity Ring";
sprite = "internal:RNGIA0"; sprite = "RNGIA0";
} }
304 304
{ {
title = "Automatic Ring"; title = "Automatic Ring";
sprite = "internal:RNGAA0"; sprite = "RNGAA0";
} }
305 305
{ {
title = "Explosion Ring"; title = "Explosion Ring";
sprite = "internal:RNGEA0"; sprite = "RNGEA0";
} }
306 306
{ {
title = "Scatter Ring"; title = "Scatter Ring";
sprite = "internal:RNGSA0"; sprite = "RNGSA0";
} }
307 307
{ {
title = "Grenade Ring"; title = "Grenade Ring";
sprite = "internal:RNGGA0"; sprite = "RNGGA0";
} }
308 308
{ {
title = "CTF Team Ring (Red)"; title = "CTF Team Ring (Red)";
sprite = "internal:RRNGA0"; sprite = "internal:TRNGA0r";
width = 16; width = 16;
} }
309 309
{ {
title = "CTF Team Ring (Blue)"; title = "CTF Team Ring (Blue)";
sprite = "internal:BRNGA0"; sprite = "internal:TRNGA0b";
width = 16; width = 16;
} }
330 330
{ {
title = "Bounce Ring Panel"; title = "Bounce Ring Panel";
sprite = "internal:PIKBA0"; sprite = "PIKBA0";
} }
331 331
{ {
title = "Rail Ring Panel"; title = "Rail Ring Panel";
sprite = "internal:PIKRA0"; sprite = "PIKRA0";
} }
332 332
{ {
title = "Automatic Ring Panel"; title = "Automatic Ring Panel";
sprite = "internal:PIKAA0"; sprite = "PIKAA0";
} }
333 333
{ {
title = "Explosion Ring Panel"; title = "Explosion Ring Panel";
sprite = "internal:PIKEA0"; sprite = "PIKEA0";
} }
334 334
{ {
title = "Scatter Ring Panel"; title = "Scatter Ring Panel";
sprite = "internal:PIKSA0"; sprite = "PIKSA0";
} }
335 335
{ {
title = "Grenade Ring Panel"; title = "Grenade Ring Panel";
sprite = "internal:PIKGA0"; sprite = "PIKGA0";
} }
} }
@ -3986,6 +4083,7 @@ thingtypes
flags8height = 24; flags8height = 24;
flags8text = "[8] Float"; flags8text = "[8] Float";
angletext = "Tag"; angletext = "Tag";
fixedrotation = 1;
} }
} }
@ -4000,6 +4098,7 @@ thingtypes
flags4text = "[4] Random (Strong)"; flags4text = "[4] Random (Strong)";
flags8text = "[8] Random (Weak)"; flags8text = "[8] Random (Weak)";
angletext = "Tag"; angletext = "Tag";
fixedrotation = 1;
400 400
{ {
@ -4131,6 +4230,7 @@ thingtypes
height = 44; height = 44;
flags1text = "[1] Run linedef executor on pop"; flags1text = "[1] Run linedef executor on pop";
angletext = "Tag"; angletext = "Tag";
fixedrotation = 1;
431 431
{ {
@ -4228,6 +4328,7 @@ thingtypes
height = 128; height = 128;
flags4text = "[4] Respawn at center"; flags4text = "[4] Respawn at center";
angletext = "Angle/Order"; angletext = "Angle/Order";
fixedrotation = 1;
parametertext = "Order"; parametertext = "Order";
} }
520 520
@ -4259,7 +4360,7 @@ thingtypes
flags1text = "[1] Start retracted"; flags1text = "[1] Start retracted";
flags4text = "[4] Retractable"; flags4text = "[4] Retractable";
flags8text = "[8] Intangible"; flags8text = "[8] Intangible";
parametertext = "Initial delay"; parametertext = "Start delay";
} }
523 523
{ {
@ -4271,7 +4372,8 @@ thingtypes
flags4text = "[4] Retractable"; flags4text = "[4] Retractable";
flags8text = "[8] Intangible"; flags8text = "[8] Intangible";
angletext = "Retraction interval"; angletext = "Retraction interval";
parametertext = "Initial delay"; fixedrotation = 1;
parametertext = "Start delay";
} }
1130 1130
{ {
@ -4320,6 +4422,7 @@ thingtypes
flags4text = "[4] Invisible"; flags4text = "[4] Invisible";
flags8text = "[8] No distance check"; flags8text = "[8] No distance check";
angletext = "Lift height"; angletext = "Lift height";
fixedrotation = 1;
} }
541 541
{ {
@ -4335,6 +4438,7 @@ thingtypes
width = 32; width = 32;
height = 64; height = 64;
angletext = "Strength"; angletext = "Strength";
fixedrotation = 1;
} }
543 543
{ {
@ -4344,6 +4448,7 @@ thingtypes
height = 64; height = 64;
flags8text = "[8] Respawn"; flags8text = "[8] Respawn";
angletext = "Color"; angletext = "Color";
fixedrotation = 1;
} }
550 550
{ {
@ -4617,6 +4722,9 @@ thingtypes
title = "Slope Vertex"; title = "Slope Vertex";
sprite = "internal:vertexslope"; sprite = "internal:vertexslope";
angletext = "Tag"; angletext = "Tag";
fixedrotation = 1;
parametertext = "Absolute?";
flagsvaluetext = "Absolute Z";
} }
751 751
@ -4638,6 +4746,7 @@ thingtypes
title = "Zoom Tube Waypoint"; title = "Zoom Tube Waypoint";
sprite = "internal:zoom"; sprite = "internal:zoom";
angletext = "Order"; angletext = "Order";
fixedrotation = 1;
} }
754 754
@ -4647,6 +4756,7 @@ thingtypes
flags8text = "[8] Push using XYZ"; flags8text = "[8] Push using XYZ";
sprite = "GWLGA0"; sprite = "GWLGA0";
angletext = "Radius"; angletext = "Radius";
fixedrotation = 1;
} }
755 755
{ {
@ -4655,6 +4765,7 @@ thingtypes
flags8text = "[8] Pull using XYZ"; flags8text = "[8] Pull using XYZ";
sprite = "GWLRA0"; sprite = "GWLRA0";
angletext = "Radius"; angletext = "Radius";
fixedrotation = 1;
} }
756 756
{ {
@ -4663,6 +4774,7 @@ thingtypes
width = 32; width = 32;
height = 16; height = 16;
angletext = "Tag"; angletext = "Tag";
fixedrotation = 1;
} }
757 757
{ {
@ -4671,6 +4783,7 @@ thingtypes
width = 8; width = 8;
height = 16; height = 16;
angletext = "Tag"; angletext = "Tag";
fixedrotation = 1;
} }
758 758
{ {
@ -4681,21 +4794,24 @@ thingtypes
{ {
title = "PolyObject Anchor"; title = "PolyObject Anchor";
sprite = "internal:polyanchor"; sprite = "internal:polyanchor";
angletext = "ID"; angletext = "Tag";
fixedrotation = 1;
} }
761 761
{ {
title = "PolyObject Spawn Point"; title = "PolyObject Spawn Point";
sprite = "internal:polycenter"; sprite = "internal:polycenter";
angletext = "ID"; angletext = "Tag";
fixedrotation = 1;
} }
762 762
{ {
title = "PolyObject Spawn Point (Crush)"; title = "PolyObject Spawn Point (Crush)";
sprite = "internal:polycentercrush"; sprite = "internal:polycentercrush";
angletext = "ID"; angletext = "Tag";
fixedrotation = 1;
} }
780 780
{ {
@ -4703,6 +4819,7 @@ thingtypes
sprite = "internal:skyb"; sprite = "internal:skyb";
flags4text = "[4] In-map centerpoint"; flags4text = "[4] In-map centerpoint";
parametertext = "ID"; parametertext = "ID";
fixedrotation = 1;
} }
} }
@ -4897,6 +5014,7 @@ thingtypes
height = 16; height = 16;
hangs = 1; hangs = 1;
angletext = "Dripping interval"; angletext = "Dripping interval";
fixedrotation = 1;
} }
1003 1003
{ {
@ -4953,7 +5071,7 @@ thingtypes
1011 1011
{ {
title = "Stalagmite (DSZ2)"; title = "Stalagmite (DSZ2)";
sprite = "DSTGA0"; sprite = "DSTGB0";
width = 8; width = 8;
height = 116; height = 116;
flags4text = "[4] Double size"; flags4text = "[4] Double size";
@ -5038,6 +5156,8 @@ thingtypes
flags4text = "[4] No sounds"; flags4text = "[4] No sounds";
flags8text = "[8] Double size"; flags8text = "[8] Double size";
angletext = "Tag"; angletext = "Tag";
parametertext = "Spokes";
fixedrotation = 1;
} }
1105 1105
{ {
@ -5048,6 +5168,8 @@ thingtypes
flags4text = "[4] No sounds"; flags4text = "[4] No sounds";
flags8text = "[8] Double size"; flags8text = "[8] Double size";
angletext = "Tag"; angletext = "Tag";
parametertext = "Spokes";
fixedrotation = 1;
} }
1106 1106
{ {
@ -5058,6 +5180,8 @@ thingtypes
flags4text = "[4] No sounds"; flags4text = "[4] No sounds";
flags8text = "[8] Red spring"; flags8text = "[8] Red spring";
angletext = "Tag"; angletext = "Tag";
parametertext = "Spokes";
fixedrotation = 1;
} }
1107 1107
{ {
@ -5067,6 +5191,8 @@ thingtypes
height = 34; height = 34;
flags8text = "[8] Double size"; flags8text = "[8] Double size";
angletext = "Tag"; angletext = "Tag";
parametertext = "Spokes";
fixedrotation = 1;
} }
1108 1108
{ {
@ -5086,6 +5212,8 @@ thingtypes
flags4text = "[4] No sounds"; flags4text = "[4] No sounds";
flags8text = "[8] Double size"; flags8text = "[8] Double size";
angletext = "Tag"; angletext = "Tag";
parametertext = "Spokes";
fixedrotation = 1;
} }
1110 1110
{ {
@ -5095,6 +5223,8 @@ thingtypes
height = 34; height = 34;
flags4text = "[4] No sounds"; flags4text = "[4] No sounds";
angletext = "Tag"; angletext = "Tag";
parametertext = "Spokes";
fixedrotation = 1;
} }
1111 1111
{ {
@ -5224,6 +5354,7 @@ thingtypes
sprite = "EGR1A1"; sprite = "EGR1A1";
width = 20; width = 20;
height = 72; height = 72;
arrow = 1;
} }
1128 1128
{ {
@ -5272,6 +5403,7 @@ thingtypes
width = 8; width = 8;
height = 16; height = 16;
angletext = "Tag"; angletext = "Tag";
fixedrotation = 1;
} }
1203 1203
{ {
@ -5342,6 +5474,7 @@ thingtypes
sprite = "WWSGAR"; sprite = "WWSGAR";
width = 22; width = 22;
height = 64; height = 64;
arrow = 1;
} }
1213 1213
{ {
@ -5349,6 +5482,7 @@ thingtypes
sprite = "WWS2AR"; sprite = "WWS2AR";
width = 22; width = 22;
height = 64; height = 64;
arrow = 1;
} }
1214 1214
{ {
@ -5356,6 +5490,7 @@ thingtypes
sprite = "WWS3ALAR"; sprite = "WWS3ALAR";
width = 16; width = 16;
height = 192; height = 192;
arrow = 1;
} }
1215 1215
{ {
@ -5371,6 +5506,7 @@ thingtypes
sprite = "BARRA1"; sprite = "BARRA1";
width = 24; width = 24;
height = 63; height = 63;
arrow = 1;
} }
1217 1217
{ {
@ -5392,6 +5528,7 @@ thingtypes
sprite = "MCRTCLFR"; sprite = "MCRTCLFR";
width = 22; width = 22;
height = 32; height = 32;
arrow = 1;
} }
1220 1220
{ {
@ -5399,6 +5536,7 @@ thingtypes
sprite = "MCRTIR"; sprite = "MCRTIR";
width = 32; width = 32;
height = 32; height = 32;
arrow = 1;
} }
1221 1221
{ {
@ -5406,6 +5544,7 @@ thingtypes
sprite = "SALDARAL"; sprite = "SALDARAL";
width = 96; width = 96;
height = 160; height = 160;
arrow = 1;
flags8text = "[8] Allow non-minecart players"; flags8text = "[8] Allow non-minecart players";
} }
1222 1222
@ -5467,6 +5606,7 @@ thingtypes
height = 40; height = 40;
flags8text = "[8] Waves vertically"; flags8text = "[8] Waves vertically";
angletext = "On/Off time"; angletext = "On/Off time";
fixedrotation = 1;
parametertext = "Strength"; parametertext = "Strength";
} }
1301 1301
@ -5477,6 +5617,7 @@ thingtypes
height = 40; height = 40;
flags8text = "[8] Shoot downwards"; flags8text = "[8] Shoot downwards";
angletext = "On/Off time"; angletext = "On/Off time";
fixedrotation = 1;
parametertext = "Strength"; parametertext = "Strength";
} }
1302 1302
@ -5500,6 +5641,7 @@ thingtypes
width = 30; width = 30;
height = 32; height = 32;
angletext = "Initial delay"; angletext = "Initial delay";
fixedrotation = 1;
flags8text = "[8] Double size"; flags8text = "[8] Double size";
} }
1305 1305
@ -5537,6 +5679,7 @@ thingtypes
sprite = "WVINALAR"; sprite = "WVINALAR";
width = 1; width = 1;
height = 288; height = 288;
arrow = 1;
} }
1310 1310
{ {
@ -5544,6 +5687,7 @@ thingtypes
sprite = "WVINBLBR"; sprite = "WVINBLBR";
width = 1; width = 1;
height = 288; height = 288;
arrow = 1;
} }
} }
@ -5901,6 +6045,7 @@ thingtypes
width = 8; width = 8;
height = 4096; height = 4096;
sprite = "UNKNA0"; sprite = "UNKNA0";
fixedrotation = 1;
1700 1700
{ {
@ -5959,6 +6104,7 @@ thingtypes
flags4text = "[4] Align player to top"; flags4text = "[4] Align player to top";
flags8text = "[8] Die upon time up"; flags8text = "[8] Die upon time up";
angletext = "Time limit"; angletext = "Time limit";
fixedrotation = 1;
parametertext = "Height"; parametertext = "Height";
} }
1704 1704
@ -5971,6 +6117,7 @@ thingtypes
unflippable = true; unflippable = true;
flagsvaluetext = "Pitch"; flagsvaluetext = "Pitch";
angletext = "Yaw"; angletext = "Yaw";
fixedrotation = 1;
} }
1705 1705
{ {
@ -5983,6 +6130,7 @@ thingtypes
centerHitbox = true; centerHitbox = true;
flagsvaluetext = "Height"; flagsvaluetext = "Height";
angletext = "Pitch/Yaw"; angletext = "Pitch/Yaw";
fixedrotation = 1;
} }
1706 1706
{ {
@ -6104,6 +6252,7 @@ thingtypes
width = 8; width = 8;
height = 16; height = 16;
angletext = "Jump strength"; angletext = "Jump strength";
fixedrotation = 1;
} }
1806 1806
{ {
@ -6336,6 +6485,7 @@ thingtypes
width = 18; width = 18;
height = 28; height = 28;
angletext = "Initial delay"; angletext = "Initial delay";
fixedrotation = 1;
} }
2001 2001
{ {
@ -6459,6 +6609,7 @@ thingtypes
sprite = "XMS6A0"; sprite = "XMS6A0";
width = 52; width = 52;
height = 106; height = 106;
hangs = 1;
} }
} }
@ -6472,6 +6623,7 @@ thingtypes
flags4text = "[4] No movement"; flags4text = "[4] No movement";
flags8text = "[8] Hop"; flags8text = "[8] Hop";
angletext = "Radius"; angletext = "Radius";
fixedrotation = 1;
2200 2200
{ {

View file

@ -1247,6 +1247,7 @@ patterns
sprite = "SPHRA0"; sprite = "SPHRA0";
width = 96; width = 96;
height = 192; height = 192;
}
609 609
{ {
title = "Circle of Rings and Spheres (Big)"; title = "Circle of Rings and Spheres (Big)";

View file

@ -604,6 +604,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-absolute-value) set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-absolute-value)
endif() endif()
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-trigraphs)
add_definitions(-DCMAKECONFIG) add_definitions(-DCMAKECONFIG)
#add_library(SRB2Core STATIC #add_library(SRB2Core STATIC

View file

@ -2,7 +2,7 @@
# GNU Make makefile for SRB2 # GNU Make makefile for SRB2
############################################################################# #############################################################################
# Copyright (C) 1998-2000 by DooM Legacy Team. # Copyright (C) 1998-2000 by DooM Legacy Team.
# Copyright (C) 2003-2020 by Sonic Team Junior. # Copyright (C) 2003-2021 by Sonic Team Junior.
# #
# This program is free software distributed under the # This program is free software distributed under the
# terms of the GNU General Public License, version 2. # terms of the GNU General Public License, version 2.
@ -24,7 +24,9 @@
# clean # clean
# Remove all object files # Remove all object files
# cleandep # cleandep
# Remove depend.dep # Remove dependency files
# distclean
# Remove autogenerated files
# dll # dll
# compile primary HW render DLL/SO # compile primary HW render DLL/SO
# all_dll # all_dll
@ -79,13 +81,23 @@
# #
############################################################################# #############################################################################
,=,
ifeq (,$(filter-out cleandep clean distclean,$(or $(MAKECMDGOALS),all)))
CLEANONLY=1
else ifndef SILENT
echo=@echo "$(1)"
ifndef MAKE_RESTARTS
print=$(info $(1))
endif
endif
ALL_SYSTEMS=\ ALL_SYSTEMS=\
PANDORA\ PANDORA\
LINUX64\ LINUX64\
MINGW64\ MINGW64\
HAIKU\ HAIKU\
DUMMY\ DUMMY\
DJGPPDOS\
MINGW\ MINGW\
UNIX\ UNIX\
LINUX\ LINUX\
@ -98,7 +110,7 @@ ALL_SYSTEMS=\
ifeq (,$(filter $(ALL_SYSTEMS),$(.VARIABLES))) ifeq (,$(filter $(ALL_SYSTEMS),$(.VARIABLES)))
ifeq ($(OS),Windows_NT) # all windows are Windows_NT... ifeq ($(OS),Windows_NT) # all windows are Windows_NT...
$(info Detected a Windows system, compiling for 32-bit MinGW SDL2...) $(call print,Detected a Windows system$(,) compiling for 32-bit MinGW SDL2...)
# go for a 32-bit sdl mingw exe by default # go for a 32-bit sdl mingw exe by default
MINGW=1 MINGW=1
@ -123,7 +135,7 @@ else # if you on the *nix
new_system:=$(new_system)64 new_system:=$(new_system)64
endif endif
$(info Detected $(system) ($(new_system))...) $(call print,Detected $(system) ($(new_system))...)
$(new_system)=1 $(new_system)=1
endif endif
@ -237,6 +249,12 @@ endif
MSGFMT?=msgfmt MSGFMT?=msgfmt
ifdef WINDOWSHELL
COMPTIME=-..\comptime.bat
else
COMPTIME=-../comptime.sh
endif
ifndef ECHO ifndef ECHO
NASM:=@$(NASM) NASM:=@$(NASM)
REMOVE:=@$(REMOVE) REMOVE:=@$(REMOVE)
@ -251,6 +269,7 @@ ifndef ECHO
MSGFMT:=@$(MSGFMT) MSGFMT:=@$(MSGFMT)
UPX:=@$(UPX) UPX:=@$(UPX)
UPX_OPTS+=-q UPX_OPTS+=-q
COMPTIME:=@$(COMPTIME)
endif endif
ifdef NONET ifdef NONET
@ -415,7 +434,7 @@ ifdef GCC48
else else
CFLAGS+=-O0 CFLAGS+=-O0
endif endif
CFLAGS+= -Wall -DPARANOIA -DRANGECHECK -DPACKETDROP -DMOBJCONSISTANCY CFLAGS+= -Wall -DPARANOIA -DRANGECHECK -DPACKETDROP
else else
@ -455,7 +474,6 @@ DBGNAME?=$(EXENAME).debug
# not too sophisticated dependency # not too sophisticated dependency
OBJS:=$(i_main_o) \ OBJS:=$(i_main_o) \
$(OBJDIR)/comptime.o \
$(OBJDIR)/string.o \ $(OBJDIR)/string.o \
$(OBJDIR)/d_main.o \ $(OBJDIR)/d_main.o \
$(OBJDIR)/d_clisrv.o \ $(OBJDIR)/d_clisrv.o \
@ -542,7 +560,10 @@ OBJS:=$(i_main_o) \
$(i_sound_o) \ $(i_sound_o) \
$(OBJS) $(OBJS)
DEPS:=$(patsubst $(OBJDIR)/%.o,$(DEPDIR)/%.d,$(filter %.o,$(OBJS)))
OBJS+=$(OBJDIR)/comptime.o
ifndef SILENT
ifndef ECHO ifndef ECHO
ifndef NOECHOFILENAMES ifndef NOECHOFILENAMES
define echoName = define echoName =
@ -550,6 +571,7 @@ define echoName =
endef endef
endif endif
endif endif
endif
# List of languages to compile. # List of languages to compile.
# For reference, this is the command I use to build a srb2.pot file from the source code. # For reference, this is the command I use to build a srb2.pot file from the source code.
@ -562,12 +584,12 @@ OPTS+=-DGETTEXT
endif endif
ifdef PANDORA ifdef PANDORA
all: pre-build $(BIN)/$(PNDNAME) all: $(BIN)/$(PNDNAME)
endif endif
ifdef SDL ifdef SDL
all: pre-build $(BIN)/$(EXENAME) all: $(BIN)/$(EXENAME)
endif endif
ifdef DUMMY ifdef DUMMY
@ -575,20 +597,15 @@ all: $(BIN)/$(EXENAME)
endif endif
cleandep: cleandep:
$(REMOVE) $(OBJDIR)/depend.dep $(REMOVE) $(DEPS)
$(REMOVE) comptime.h $(REMOVE) comptime.h
pre-build:
ifdef WINDOWSHELL
-..\comptime.bat .
else
-@../comptime.sh .
endif
clean: clean:
$(REMOVE) *~ *.flc $(REMOVE) *~ *.flc
$(REMOVE) $(OBJDIR)/*.o $(REMOVE) $(OBJDIR)/*.o
distclean: clean cleandep
ifdef MINGW ifdef MINGW
$(REMOVE) $(OBJDIR)/*.res $(REMOVE) $(OBJDIR)/*.res
endif endif
@ -604,15 +621,13 @@ asm:
$(REMOVE) $(OBJDIR)/tmp.exe $(REMOVE) $(OBJDIR)/tmp.exe
# executable # executable
# NOTE: DJGPP's objcopy do not have --add-gnu-debuglink
$(BIN)/$(EXENAME): $(POS) $(OBJS) $(BIN)/$(EXENAME): $(POS) $(OBJS)
-$(MKDIR) $(BIN) -$(MKDIR) $(BIN)
@echo Linking $(EXENAME)... $(call echo,Linking $(EXENAME)...)
$(LD) $(LDFLAGS) $(OBJS) -o $(BIN)/$(EXENAME) $(LIBS) $(LD) $(LDFLAGS) $(OBJS) -o $(BIN)/$(EXENAME) $(LIBS)
ifndef VALGRIND ifndef VALGRIND
ifndef NOOBJDUMP ifndef NOOBJDUMP
@echo Dumping debugging info $(call echo,Dumping debugging info)
$(OBJDUMP) $(OBJDUMP_OPTS) $(BIN)/$(EXENAME) > $(BIN)/$(DBGNAME).txt $(OBJDUMP) $(OBJDUMP_OPTS) $(BIN)/$(EXENAME) > $(BIN)/$(DBGNAME).txt
ifdef WINDOWSHELL ifdef WINDOWSHELL
-$(GZIP) $(GZIP_OPTS) $(BIN)/$(DBGNAME).txt -$(GZIP) $(GZIP_OPTS) $(BIN)/$(DBGNAME).txt
@ -631,10 +646,10 @@ ifndef NOUPX
-$(UPX) $(UPX_OPTS) $(BIN)/$(EXENAME) -$(UPX) $(UPX_OPTS) $(BIN)/$(EXENAME)
endif endif
endif endif
@echo Build is done, please look for $(EXENAME) in $(BIN), \(checking for post steps\) $(call echo,Build is done$(,) please look for $(EXENAME) in $(BIN)$(,) (checking for post steps))
reobjdump: reobjdump:
@echo Redumping debugging info $(call echo,Redumping debugging info)
$(OBJDUMP) $(OBJDUMP_OPTS) $(BIN)/$(DBGNAME) > $(BIN)/$(DBGNAME).txt $(OBJDUMP) $(OBJDUMP_OPTS) $(BIN)/$(DBGNAME) > $(BIN)/$(DBGNAME).txt
ifdef WINDOWSHELL ifdef WINDOWSHELL
-$(GZIP) $(GZIP_OPTS) $(BIN)/$(DBGNAME).txt -$(GZIP) $(GZIP_OPTS) $(BIN)/$(DBGNAME).txt
@ -670,24 +685,40 @@ endif
endif endif
#dependecy made by gcc itself ! #dependecy made by gcc itself !
$(OBJS):
ifndef DUMMY ifndef DUMMY
-include $(OBJDIR)/depend.dep ifndef CLEANONLY
$(call print,Checking dependency files...)
-include $(DEPS)
endif
endif endif
$(OBJDIR)/depend.dep: undefine deps_rule
@echo "Creating dependency file, depend.dep"
@echo > comptime.h # windows makes it too hard !
-$(MKDIR) $(OBJDIR) ifndef WINDOWSHELL
$(CC) $(CFLAGS) -MM *.c > $(OBJDIR)/depend.ped ifdef echoName
$(CC) $(CFLAGS) -MM $(INTERFACE)/*.c >> $(OBJDIR)/depend.ped define deps_rule =
ifndef NOHW @printf "%-20.20s\r" $<
$(CC) $(CFLAGS) -MM hardware/*.c >> $(OBJDIR)/depend.ped
endef
endif endif
$(CC) $(CFLAGS) -MM blua/*.c >> $(OBJDIR)/depend.ped endif
@sed -e 's,\(.*\)\.o: ,$(subst /,\/,$(OBJDIR))\/&,g' < $(OBJDIR)/depend.ped > $(OBJDIR)/depend.dep
$(REMOVE) $(OBJDIR)/depend.ped define deps_rule +=
@echo "Created dependency file, depend.dep" $(CC) $(CFLAGS) -M -MF $@ -MT $(OBJDIR)/$(<:.c=.o) $<
endef
$(DEPDIR)/%.d: %.c
$(deps_rule)
$(DEPDIR)/%.d: $(INTERFACE)/%.c
$(deps_rule)
$(DEPDIR)/%.d: hardware/%.c
$(deps_rule)
$(DEPDIR)/%.d: blua/%.c
$(deps_rule)
ifdef VALGRIND ifdef VALGRIND
$(OBJDIR)/z_zone.o: z_zone.c $(OBJDIR)/z_zone.o: z_zone.c
@ -695,9 +726,12 @@ $(OBJDIR)/z_zone.o: z_zone.c
$(CC) $(CFLAGS) $(WFLAGS) -DHAVE_VALGRIND $(VALGRIND_CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) $(WFLAGS) -DHAVE_VALGRIND $(VALGRIND_CFLAGS) -c $< -o $@
endif endif
$(OBJDIR)/comptime.o: comptime.c pre-build $(OBJDIR)/comptime.o::
$(echoName) ifdef echoName
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@ @echo -- comptime.c ...
endif
$(COMPTIME) .
$(CC) $(CFLAGS) $(WFLAGS) -c comptime.c -o $@
$(BIN)/%.mo: locale/%.po $(BIN)/%.mo: locale/%.po
-$(MKDIR) $(BIN) -$(MKDIR) $(BIN)

View file

@ -47,7 +47,8 @@ ifdef MACOSX
endif endif
# Automatically set version flag, but not if one was manually set # Automatically set version flag, but not if one was manually set
ifeq (,$(filter GCC%,$(.VARIABLES))) # And don't bother if this is a clean only run
ifeq (,$(filter GCC% CLEANONLY,$(.VARIABLES)))
version:=$(shell $(CC) --version) version:=$(shell $(CC) --version)
# check if this is in fact GCC # check if this is in fact GCC
ifneq (,$(or $(findstring gcc,$(version)),$(findstring GCC,$(version)))) ifneq (,$(or $(findstring gcc,$(version)),$(findstring GCC,$(version))))
@ -60,12 +61,14 @@ ifeq (,$(filter GCC%,$(.VARIABLES)))
# If this version is not in the list, default to the latest supported # If this version is not in the list, default to the latest supported
ifeq (,$(filter $(v),$(SUPPORTED_GCC_VERSIONS))) ifeq (,$(filter $(v),$(SUPPORTED_GCC_VERSIONS)))
$(info\ define line =
Your compiler version, GCC $(version), is not supported by the Makefile.\ Your compiler version, GCC $(version), is not supported by the Makefile.
The Makefile will assume GCC $(LATEST_GCC_VERSION).) The Makefile will assume GCC $(LATEST_GCC_VERSION).))
endef
$(call print,$(line))
GCC$(subst .,,$(LATEST_GCC_VERSION))=1 GCC$(subst .,,$(LATEST_GCC_VERSION))=1
else else
$(info Detected GCC $(version) (GCC$(v))) $(call print,Detected GCC $(version) (GCC$(v)))
GCC$(v)=1 GCC$(v)=1
endif endif
endif endif
@ -206,7 +209,7 @@ endif
OLDWFLAGS:=$(WFLAGS) OLDWFLAGS:=$(WFLAGS)
# -W -Wno-unused # -W -Wno-unused
WFLAGS=-Wall WFLAGS=-Wall -Wno-trigraphs
ifndef GCC295 ifndef GCC295
#WFLAGS+=-Wno-packed #WFLAGS+=-Wno-packed
endif endif
@ -361,6 +364,7 @@ i_main_o=$(OBJDIR)/i_main.o
#set OBJDIR and BIN's starting place #set OBJDIR and BIN's starting place
OBJDIR=../objs OBJDIR=../objs
BIN=../bin BIN=../bin
DEPDIR=../dep
#Nasm ASM and rm #Nasm ASM and rm
ifdef YASM ifdef YASM
NASM?=yasm NASM?=yasm
@ -383,6 +387,7 @@ ifdef DUMMY
INTERFACE=dummy INTERFACE=dummy
OBJDIR:=$(OBJDIR)/dummy OBJDIR:=$(OBJDIR)/dummy
BIN:=$(BIN)/dummy BIN:=$(BIN)/dummy
DEPDIR:=$(DEPDIR)/dummy
else else
ifdef LINUX ifdef LINUX
NASMFORMAT=elf -DLINUX NASMFORMAT=elf -DLINUX
@ -390,9 +395,11 @@ ifdef LINUX
ifdef LINUX64 ifdef LINUX64
OBJDIR:=$(OBJDIR)/Linux64 OBJDIR:=$(OBJDIR)/Linux64
BIN:=$(BIN)/Linux64 BIN:=$(BIN)/Linux64
DEPDIR:=$(DEPDIR)/Linux64
else else
OBJDIR:=$(OBJDIR)/Linux OBJDIR:=$(OBJDIR)/Linux
BIN:=$(BIN)/Linux BIN:=$(BIN)/Linux
DEPDIR:=$(DEPDIR)/Linux
endif endif
else else
ifdef FREEBSD ifdef FREEBSD
@ -402,6 +409,7 @@ ifdef FREEBSD
OBJDIR:=$(OBJDIR)/FreeBSD OBJDIR:=$(OBJDIR)/FreeBSD
BIN:=$(BIN)/FreeBSD BIN:=$(BIN)/FreeBSD
DEPDIR:=$(DEPDIR)/Linux
else else
ifdef SOLARIS ifdef SOLARIS
INTERFACE=sdl INTERFACE=sdl
@ -410,6 +418,7 @@ ifdef SOLARIS
OBJDIR:=$(OBJDIR)/Solaris OBJDIR:=$(OBJDIR)/Solaris
BIN:=$(BIN)/Solaris BIN:=$(BIN)/Solaris
DEPDIR:=$(DEPDIR)/Solaris
else else
ifdef CYGWIN32 ifdef CYGWIN32
INTERFACE=sdl INTERFACE=sdl
@ -418,18 +427,21 @@ ifdef CYGWIN32
OBJDIR:=$(OBJDIR)/cygwin OBJDIR:=$(OBJDIR)/cygwin
BIN:=$(BIN)/Cygwin BIN:=$(BIN)/Cygwin
DEPDIR:=$(DEPDIR)/Cygwin
else else
ifdef MINGW64 ifdef MINGW64
#NASMFORMAT=win64 #NASMFORMAT=win64
SDL=1 SDL=1
OBJDIR:=$(OBJDIR)/Mingw64 OBJDIR:=$(OBJDIR)/Mingw64
BIN:=$(BIN)/Mingw64 BIN:=$(BIN)/Mingw64
DEPDIR:=$(DEPDIR)/Mingw64
else else
ifdef MINGW ifdef MINGW
NASMFORMAT=win32 NASMFORMAT=win32
SDL=1 SDL=1
OBJDIR:=$(OBJDIR)/Mingw OBJDIR:=$(OBJDIR)/Mingw
BIN:=$(BIN)/Mingw BIN:=$(BIN)/Mingw
DEPDIR:=$(DEPDIR)/Mingw
endif endif
endif endif
endif endif
@ -441,6 +453,7 @@ endif
ifdef ARCHNAME ifdef ARCHNAME
OBJDIR:=$(OBJDIR)/$(ARCHNAME) OBJDIR:=$(OBJDIR)/$(ARCHNAME)
BIN:=$(BIN)/$(ARCHNAME) BIN:=$(BIN)/$(ARCHNAME)
DEPDIR:=$(DEPDIR)/$(ARCHNAME)
endif endif
OBJDUMP_OPTS?=--wide --source --line-numbers OBJDUMP_OPTS?=--wide --source --line-numbers
@ -449,14 +462,17 @@ LD=$(CC)
ifdef SDL ifdef SDL
INTERFACE=sdl INTERFACE=sdl
OBJDIR:=$(OBJDIR)/SDL OBJDIR:=$(OBJDIR)/SDL
DEPDIR:=$(DEPDIR)/SDL
endif endif
ifndef DUMMY ifndef DUMMY
ifdef DEBUGMODE ifdef DEBUGMODE
OBJDIR:=$(OBJDIR)/Debug OBJDIR:=$(OBJDIR)/Debug
BIN:=$(BIN)/Debug BIN:=$(BIN)/Debug
DEPDIR:=$(DEPDIR)/Debug
else else
OBJDIR:=$(OBJDIR)/Release OBJDIR:=$(OBJDIR)/Release
BIN:=$(BIN)/Release BIN:=$(BIN)/Release
DEPDIR:=$(DEPDIR)/Release
endif endif
endif endif

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,5 +1,5 @@
/* /*
Copyright 2019-2020, James R. Copyright 2019-2021, James R.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/* /*
Copyright 2019-2020, James R. Copyright 2019-2021, James R.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2007-2016 by John "JTE" Muniz. // Copyright (C) 2007-2016 by John "JTE" Muniz.
// Copyright (C) 2011-2020 by Sonic Team Junior. // Copyright (C) 2011-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2007-2016 by John "JTE" Muniz. // Copyright (C) 2007-2016 by John "JTE" Muniz.
// Copyright (C) 2012-2020 by Sonic Team Junior. // Copyright (C) 2012-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -1433,6 +1433,7 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
if (var->revert.allocated) if (var->revert.allocated)
{ {
Z_Free(var->revert.v.string); Z_Free(var->revert.v.string);
var->revert.allocated = false; // the below value is not allocated in zone memory, don't try to free it!
} }
var->revert.v.const_munge = var->PossibleValue[i].strvalue; var->revert.v.const_munge = var->PossibleValue[i].strvalue;
@ -1440,6 +1441,10 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
return; return;
} }
// free the old value string
Z_Free(var->zstring);
var->zstring = NULL;
var->value = var->PossibleValue[i].value; var->value = var->PossibleValue[i].value;
var->string = var->PossibleValue[i].strvalue; var->string = var->PossibleValue[i].strvalue;
goto finish; goto finish;
@ -1502,13 +1507,7 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
found: found:
if (client && execversion_enabled) if (client && execversion_enabled)
{ {
if (var->revert.allocated)
{
Z_Free(var->revert.v.string);
}
var->revert.v.const_munge = var->PossibleValue[i].strvalue; var->revert.v.const_munge = var->PossibleValue[i].strvalue;
return; return;
} }
@ -1523,6 +1522,7 @@ found:
if (var->revert.allocated) if (var->revert.allocated)
{ {
Z_Free(var->revert.v.string); Z_Free(var->revert.v.string);
// Z_StrDup creates a new zone memory block, so we can keep the allocated flag on
} }
var->revert.v.string = Z_StrDup(valstr); var->revert.v.string = Z_StrDup(valstr);
@ -1577,7 +1577,7 @@ finish:
} }
var->flags |= CV_MODIFIED; var->flags |= CV_MODIFIED;
// raise 'on change' code // raise 'on change' code
LUA_CVarChanged(var->name); // let consolelib know what cvar this is. LUA_CVarChanged(var); // let consolelib know what cvar this is.
if (var->flags & CV_CALL && !stealth) if (var->flags & CV_CALL && !stealth)
var->func(); var->func();
@ -1787,6 +1787,7 @@ void CV_RevertNetVars(void)
if (cvar->revert.allocated) if (cvar->revert.allocated)
{ {
Z_Free(cvar->revert.v.string); Z_Free(cvar->revert.v.string);
cvar->revert.allocated = false; // no value being held now
} }
cvar->revert.v.string = NULL; cvar->revert.v.string = NULL;

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -34,12 +34,13 @@
* Last updated 2020 / 07 / 10 - v2.2.6 - player.dta & patch.pk3 * Last updated 2020 / 07 / 10 - v2.2.6 - player.dta & patch.pk3
* Last updated 2020 / 09 / 27 - v2.2.7 - patch.pk3 * Last updated 2020 / 09 / 27 - v2.2.7 - patch.pk3
* Last updated 2020 / 10 / 02 - v2.2.8 - patch.pk3 * Last updated 2020 / 10 / 02 - v2.2.8 - patch.pk3
* Last updated 2021 / 05 / 06 - v2.2.9 - patch.pk3 & zones.pk3
*/ */
#define ASSET_HASH_SRB2_PK3 "0277c9416756627004e83cbb5b2e3e28" #define ASSET_HASH_SRB2_PK3 "0277c9416756627004e83cbb5b2e3e28"
#define ASSET_HASH_ZONES_PK3 "f7e88afb6af7996a834c7d663144bead" #define ASSET_HASH_ZONES_PK3 "f8f3e2b5deacf40f14e36686a07d44bb"
#define ASSET_HASH_PLAYER_DTA "49dad7b24634c89728cc3e0b689e12bb" #define ASSET_HASH_PLAYER_DTA "49dad7b24634c89728cc3e0b689e12bb"
#ifdef USE_PATCH_DTA #ifdef USE_PATCH_DTA
#define ASSET_HASH_PATCH_PK3 "466cdf60075262b3f5baa5e07f0999e8" #define ASSET_HASH_PATCH_PK3 "7d467a883f7887b3c311798ee2f56b6a"
#endif #endif
#endif #endif

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -1303,10 +1303,6 @@ boolean CON_Responder(event_t *ev)
if (key < 32 || key > 127) if (key < 32 || key > 127)
return true; return true;
// add key to cmd line here
if (key >= 'A' && key <= 'Z' && !(shiftdown ^ capslock)) //this is only really necessary for dedicated servers
key = key + 'a' - 'A';
if (input_sel != input_cur) if (input_sel != input_cur)
CON_InputDelSelection(); CON_InputDelSelection();
CON_InputAddChar(key); CON_InputAddChar(key);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -1565,15 +1565,6 @@ static void CL_LoadReceivedSavegame(boolean reloading)
} }
CONS_Printf("\"\n"); CONS_Printf("\"\n");
} }
else
{
CONS_Alert(CONS_ERROR, M_GetText("Can't load the level!\n"));
Z_Free(savebuffer);
save_p = NULL;
if (unlink(tmpsave) == -1)
CONS_Alert(CONS_ERROR, M_GetText("Can't delete %s\n"), tmpsave);
return;
}
// done // done
Z_Free(savebuffer); Z_Free(savebuffer);
@ -3112,7 +3103,7 @@ consvar_t cv_maxplayers = CVAR_INIT ("maxplayers", "8", CV_SAVE|CV_NETVAR, maxpl
static CV_PossibleValue_t joindelay_cons_t[] = {{1, "MIN"}, {3600, "MAX"}, {0, "Off"}, {0, NULL}}; static CV_PossibleValue_t joindelay_cons_t[] = {{1, "MIN"}, {3600, "MAX"}, {0, "Off"}, {0, NULL}};
consvar_t cv_joindelay = CVAR_INIT ("joindelay", "10", CV_SAVE|CV_NETVAR, joindelay_cons_t, NULL); consvar_t cv_joindelay = CVAR_INIT ("joindelay", "10", CV_SAVE|CV_NETVAR, joindelay_cons_t, NULL);
static CV_PossibleValue_t rejointimeout_cons_t[] = {{1, "MIN"}, {60 * FRACUNIT, "MAX"}, {0, "Off"}, {0, NULL}}; static CV_PossibleValue_t rejointimeout_cons_t[] = {{1, "MIN"}, {60 * FRACUNIT, "MAX"}, {0, "Off"}, {0, NULL}};
consvar_t cv_rejointimeout = CVAR_INIT ("rejointimeout", "Off", CV_SAVE|CV_NETVAR|CV_FLOAT, rejointimeout_cons_t, NULL); consvar_t cv_rejointimeout = CVAR_INIT ("rejointimeout", "2", CV_SAVE|CV_NETVAR|CV_FLOAT, rejointimeout_cons_t, NULL);
static CV_PossibleValue_t resynchattempts_cons_t[] = {{1, "MIN"}, {20, "MAX"}, {0, "No"}, {0, NULL}}; static CV_PossibleValue_t resynchattempts_cons_t[] = {{1, "MIN"}, {20, "MAX"}, {0, "No"}, {0, NULL}};
consvar_t cv_resynchattempts = CVAR_INIT ("resynchattempts", "10", CV_SAVE|CV_NETVAR, resynchattempts_cons_t, NULL); consvar_t cv_resynchattempts = CVAR_INIT ("resynchattempts", "10", CV_SAVE|CV_NETVAR, resynchattempts_cons_t, NULL);
@ -4268,7 +4259,7 @@ static void HandlePacketFromPlayer(SINT8 node)
case PT_RECEIVEDGAMESTATE: case PT_RECEIVEDGAMESTATE:
sendingsavegame[node] = false; sendingsavegame[node] = false;
resendingsavegame[node] = false; resendingsavegame[node] = false;
savegameresendcooldown[node] = I_GetTime() + 15 * TICRATE; savegameresendcooldown[node] = I_GetTime() + 5 * TICRATE;
break; break;
// -------------------------------------------- CLIENT RECEIVE ---------- // -------------------------------------------- CLIENT RECEIVE ----------
case PT_SERVERTICS: case PT_SERVERTICS:
@ -4480,70 +4471,73 @@ static INT16 Consistancy(void)
ret += P_GetRandSeed(); ret += P_GetRandSeed();
#ifdef MOBJCONSISTANCY #ifdef MOBJCONSISTANCY
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) if (gamestate == GS_LEVEL)
{ {
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
continue;
mo = (mobj_t *)th;
if (mo->flags & (MF_SPECIAL | MF_SOLID | MF_PUSHABLE | MF_BOSS | MF_MISSILE | MF_SPRING | MF_MONITOR | MF_FIRE | MF_ENEMY | MF_PAIN | MF_STICKY))
{ {
ret -= mo->type; if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
ret += mo->x; continue;
ret -= mo->y;
ret += mo->z; mo = (mobj_t *)th;
ret -= mo->momx;
ret += mo->momy; if (mo->flags & (MF_SPECIAL | MF_SOLID | MF_PUSHABLE | MF_BOSS | MF_MISSILE | MF_SPRING | MF_MONITOR | MF_FIRE | MF_ENEMY | MF_PAIN | MF_STICKY))
ret -= mo->momz;
ret += mo->angle;
ret -= mo->flags;
ret += mo->flags2;
ret -= mo->eflags;
if (mo->target)
{ {
ret += mo->target->type; ret -= mo->type;
ret -= mo->target->x; ret += mo->x;
ret += mo->target->y; ret -= mo->y;
ret -= mo->target->z; ret += mo->z;
ret += mo->target->momx; ret -= mo->momx;
ret -= mo->target->momy; ret += mo->momy;
ret += mo->target->momz; ret -= mo->momz;
ret -= mo->target->angle; ret += mo->angle;
ret += mo->target->flags; ret -= mo->flags;
ret -= mo->target->flags2; ret += mo->flags2;
ret += mo->target->eflags; ret -= mo->eflags;
ret -= mo->target->state - states; if (mo->target)
ret += mo->target->tics; {
ret -= mo->target->sprite; ret += mo->target->type;
ret += mo->target->frame; ret -= mo->target->x;
ret += mo->target->y;
ret -= mo->target->z;
ret += mo->target->momx;
ret -= mo->target->momy;
ret += mo->target->momz;
ret -= mo->target->angle;
ret += mo->target->flags;
ret -= mo->target->flags2;
ret += mo->target->eflags;
ret -= mo->target->state - states;
ret += mo->target->tics;
ret -= mo->target->sprite;
ret += mo->target->frame;
}
else
ret ^= 0x3333;
if (mo->tracer && mo->tracer->type != MT_OVERLAY)
{
ret += mo->tracer->type;
ret -= mo->tracer->x;
ret += mo->tracer->y;
ret -= mo->tracer->z;
ret += mo->tracer->momx;
ret -= mo->tracer->momy;
ret += mo->tracer->momz;
ret -= mo->tracer->angle;
ret += mo->tracer->flags;
ret -= mo->tracer->flags2;
ret += mo->tracer->eflags;
ret -= mo->tracer->state - states;
ret += mo->tracer->tics;
ret -= mo->tracer->sprite;
ret += mo->tracer->frame;
}
else
ret ^= 0xAAAA;
ret -= mo->state - states;
ret += mo->tics;
ret -= mo->sprite;
ret += mo->frame;
} }
else
ret ^= 0x3333;
if (mo->tracer && mo->tracer->type != MT_OVERLAY)
{
ret += mo->tracer->type;
ret -= mo->tracer->x;
ret += mo->tracer->y;
ret -= mo->tracer->z;
ret += mo->tracer->momx;
ret -= mo->tracer->momy;
ret += mo->tracer->momz;
ret -= mo->tracer->angle;
ret += mo->tracer->flags;
ret -= mo->tracer->flags2;
ret += mo->tracer->eflags;
ret -= mo->tracer->state - states;
ret += mo->tracer->tics;
ret -= mo->tracer->sprite;
ret += mo->tracer->frame;
}
else
ret ^= 0xAAAA;
ret -= mo->state - states;
ret += mo->tics;
ret -= mo->sprite;
ret += mo->frame;
} }
} }
#endif #endif

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -15,7 +15,7 @@
/// plus functions to parse command line parameters, configure game /// plus functions to parse command line parameters, configure game
/// parameters, and call the startup functions. /// parameters, and call the startup functions.
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON) #if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#endif #endif
@ -61,7 +61,7 @@
#include "p_local.h" // chasecam #include "p_local.h" // chasecam
#include "mserv.h" // ms_RoomId #include "mserv.h" // ms_RoomId
#include "m_misc.h" // screenshot functionality #include "m_misc.h" // screenshot functionality
#include "dehacked.h" // Dehacked list test #include "deh_tables.h" // Dehacked list test
#include "m_cond.h" // condition initialization #include "m_cond.h" // condition initialization
#include "fastcmp.h" #include "fastcmp.h"
#include "keys.h" #include "keys.h"
@ -934,7 +934,7 @@ static void IdentifyVersion(void)
char *srb2wad; char *srb2wad;
const char *srb2waddir = NULL; const char *srb2waddir = NULL;
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) #if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
// change to the directory where 'srb2.pk3' is found // change to the directory where 'srb2.pk3' is found
srb2waddir = I_LocateWad(); srb2waddir = I_LocateWad();
#endif #endif
@ -1045,7 +1045,7 @@ void D_SRB2Main(void)
// Print GPL notice for our console users (Linux) // Print GPL notice for our console users (Linux)
CONS_Printf( CONS_Printf(
"\n\nSonic Robo Blast 2\n" "\n\nSonic Robo Blast 2\n"
"Copyright (C) 1998-2020 by Sonic Team Junior\n\n" "Copyright (C) 1998-2021 by Sonic Team Junior\n\n"
"This program comes with ABSOLUTELY NO WARRANTY.\n\n" "This program comes with ABSOLUTELY NO WARRANTY.\n\n"
"This is free software, and you are welcome to redistribute it\n" "This is free software, and you are welcome to redistribute it\n"
"and/or modify it under the terms of the GNU General Public License\n" "and/or modify it under the terms of the GNU General Public License\n"
@ -1072,7 +1072,7 @@ void D_SRB2Main(void)
G_LoadGameSettings(); G_LoadGameSettings();
// Test Dehacked lists // Test Dehacked lists
DEH_Check(); DEH_TableCheck();
// Netgame URL special case: change working dir to EXE folder. // Netgame URL special case: change working dir to EXE folder.
ChangeDirForUrlHandler(); ChangeDirForUrlHandler();
@ -1107,7 +1107,7 @@ void D_SRB2Main(void)
if (!userhome) if (!userhome)
{ {
#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__) #if (defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)
I_Error("Please set $HOME to your home directory\n"); I_Error("Please set $HOME to your home directory\n");
#else #else
if (dedicated) if (dedicated)
@ -1287,7 +1287,7 @@ void D_SRB2Main(void)
G_LoadGameData(); G_LoadGameData();
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) #if defined (__unix__) || defined (UNIXCOMMON) || defined (HAVE_SDL)
VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen
#endif #endif
@ -1553,7 +1553,7 @@ const char *D_Home(void)
userhome = M_GetNextParm(); userhome = M_GetNextParm();
else else
{ {
#if !((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__APPLE__) #if !(defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON))
if (FIL_FileOK(CONFIGFILENAME)) if (FIL_FileOK(CONFIGFILENAME))
usehome = false; // Let's NOT use home usehome = false; // Let's NOT use home
else else

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -40,10 +40,6 @@ void D_SRB2Main(void);
// Called by IO functions when input is detected. // Called by IO functions when input is detected.
void D_PostEvent(const event_t *ev); void D_PostEvent(const event_t *ev);
#if defined (PC_DOS) && !defined (DOXYGEN)
void D_PostEvent_end(void); // delimiter for locking memory
#endif
void D_ProcessEvents(void); void D_ProcessEvents(void);
const char *D_Home(void); const char *D_Home(void);

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -168,7 +168,7 @@ void SendWeaponPref(void);
void SendWeaponPref2(void); void SendWeaponPref2(void);
static CV_PossibleValue_t usemouse_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Force"}, {0, NULL}}; static CV_PossibleValue_t usemouse_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Force"}, {0, NULL}};
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON) #if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
static CV_PossibleValue_t mouse2port_cons_t[] = {{0, "/dev/gpmdata"}, {1, "/dev/ttyS0"}, static CV_PossibleValue_t mouse2port_cons_t[] = {{0, "/dev/gpmdata"}, {1, "/dev/ttyS0"},
{2, "/dev/ttyS1"}, {3, "/dev/ttyS2"}, {4, "/dev/ttyS3"}, {0, NULL}}; {2, "/dev/ttyS1"}, {3, "/dev/ttyS2"}, {4, "/dev/ttyS3"}, {0, NULL}};
#else #else
@ -255,7 +255,7 @@ consvar_t cv_joyscale2 = CVAR_INIT ("padscale2", "1", CV_SAVE|CV_CALL, NULL, I_J
consvar_t cv_joyscale = CVAR_INIT ("padscale", "1", CV_SAVE|CV_HIDEN, NULL, NULL); //Alam: Dummy for save consvar_t cv_joyscale = CVAR_INIT ("padscale", "1", CV_SAVE|CV_HIDEN, NULL, NULL); //Alam: Dummy for save
consvar_t cv_joyscale2 = CVAR_INIT ("padscale2", "1", CV_SAVE|CV_HIDEN, NULL, NULL); //Alam: Dummy for save consvar_t cv_joyscale2 = CVAR_INIT ("padscale2", "1", CV_SAVE|CV_HIDEN, NULL, NULL); //Alam: Dummy for save
#endif #endif
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON) #if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
consvar_t cv_mouse2port = CVAR_INIT ("mouse2port", "/dev/gpmdata", CV_SAVE, mouse2port_cons_t, NULL); consvar_t cv_mouse2port = CVAR_INIT ("mouse2port", "/dev/gpmdata", CV_SAVE, mouse2port_cons_t, NULL);
consvar_t cv_mouse2opt = CVAR_INIT ("mouse2opt", "0", CV_SAVE, NULL, NULL); consvar_t cv_mouse2opt = CVAR_INIT ("mouse2opt", "0", CV_SAVE, NULL, NULL);
#else #else
@ -788,7 +788,7 @@ void D_RegisterClientCommands(void)
// WARNING: the order is important when initialising mouse2 // WARNING: the order is important when initialising mouse2
// we need the mouse2port // we need the mouse2port
CV_RegisterVar(&cv_mouse2port); CV_RegisterVar(&cv_mouse2port);
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON) #if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
CV_RegisterVar(&cv_mouse2opt); CV_RegisterVar(&cv_mouse2opt);
#endif #endif
CV_RegisterVar(&cv_controlperkey); CV_RegisterVar(&cv_controlperkey);
@ -2130,7 +2130,7 @@ static void Command_Pause(void)
if (cv_pause.value || server || (IsPlayerAdmin(consoleplayer))) if (cv_pause.value || server || (IsPlayerAdmin(consoleplayer)))
{ {
if (modeattacking || !(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION)) if (modeattacking || !(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION) || (marathonmode && gamestate == GS_INTERMISSION))
{ {
CONS_Printf(M_GetText("You can't pause here.\n")); CONS_Printf(M_GetText("You can't pause here.\n"));
return; return;

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -45,7 +45,7 @@ extern consvar_t cv_joyscale2;
// splitscreen with second mouse // splitscreen with second mouse
extern consvar_t cv_mouse2port; extern consvar_t cv_mouse2port;
extern consvar_t cv_usemouse2; extern consvar_t cv_usemouse2;
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) #if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
extern consvar_t cv_mouse2opt; extern consvar_t cv_mouse2opt;
#endif #endif

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -15,7 +15,7 @@
#include <time.h> #include <time.h>
#if defined (_WIN32) || defined (__DJGPP__) #ifdef _WIN32
#include <io.h> #include <io.h>
#include <direct.h> #include <direct.h>
#else #else
@ -30,10 +30,6 @@
#elif defined (_WIN32) #elif defined (_WIN32)
#include <sys/utime.h> #include <sys/utime.h>
#endif #endif
#ifdef __DJGPP__
#include <dir.h>
#include <utime.h>
#endif
#include "doomdef.h" #include "doomdef.h"
#include "doomstat.h" #include "doomstat.h"
@ -562,7 +558,7 @@ static void SV_PrepareSendLuaFileToNextNode(void)
// Find a client to send the file to // Find a client to send the file to
for (i = 1; i < MAXNETNODES; i++) for (i = 1; i < MAXNETNODES; i++)
if (nodeingame[i] && luafiletransfers->nodestatus[i] == LFTNS_WAITING) // Node waiting if (luafiletransfers->nodestatus[i] == LFTNS_WAITING) // Node waiting
{ {
// Tell the client we're about to send them the file // Tell the client we're about to send them the file
netbuffer->packettype = PT_SENDINGLUAFILE; netbuffer->packettype = PT_SENDINGLUAFILE;
@ -570,6 +566,7 @@ static void SV_PrepareSendLuaFileToNextNode(void)
I_Error("Failed to send a PT_SENDINGLUAFILE packet\n"); // !!! Todo: Handle failure a bit better lol I_Error("Failed to send a PT_SENDINGLUAFILE packet\n"); // !!! Todo: Handle failure a bit better lol
luafiletransfers->nodestatus[i] = LFTNS_ASKED; luafiletransfers->nodestatus[i] = LFTNS_ASKED;
luafiletransfers->nodetimeouts[i] = I_GetTime() + 30 * TICRATE;
return; return;
} }
@ -588,7 +585,7 @@ void SV_PrepareSendLuaFile(void)
// Set status to "waiting" for everyone // Set status to "waiting" for everyone
for (i = 0; i < MAXNETNODES; i++) for (i = 0; i < MAXNETNODES; i++)
luafiletransfers->nodestatus[i] = LFTNS_WAITING; luafiletransfers->nodestatus[i] = (nodeingame[i] ? LFTNS_WAITING : LFTNS_NONE);
if (FIL_ReadFileOK(luafiletransfers->realfilename)) if (FIL_ReadFileOK(luafiletransfers->realfilename))
{ {
@ -649,12 +646,14 @@ void RemoveAllLuaFileTransfers(void)
void SV_AbortLuaFileTransfer(INT32 node) void SV_AbortLuaFileTransfer(INT32 node)
{ {
if (luafiletransfers if (luafiletransfers)
&& (luafiletransfers->nodestatus[node] == LFTNS_ASKED
|| luafiletransfers->nodestatus[node] == LFTNS_SENDING))
{ {
luafiletransfers->nodestatus[node] = LFTNS_WAITING; if (luafiletransfers->nodestatus[node] == LFTNS_ASKED
SV_PrepareSendLuaFileToNextNode(); || luafiletransfers->nodestatus[node] == LFTNS_SENDING)
{
SV_PrepareSendLuaFileToNextNode();
}
luafiletransfers->nodestatus[node] = LFTNS_NONE;
} }
} }
@ -928,6 +927,22 @@ void FileSendTicker(void)
filetx_t *f; filetx_t *f;
INT32 packetsent, ram, i, j; INT32 packetsent, ram, i, j;
// If someone is taking too long to download, kick them with a timeout
// to prevent blocking the rest of the server...
if (luafiletransfers)
{
for (i = 1; i < MAXNETNODES; i++)
{
luafiletransfernodestatus_t status = luafiletransfers->nodestatus[i];
if (status != LFTNS_NONE && status != LFTNS_WAITING && status != LFTNS_SENT
&& I_GetTime() > luafiletransfers->nodetimeouts[i])
{
Net_ConnectionTimeout(i);
}
}
}
if (!filestosend) // No file to send if (!filestosend) // No file to send
return; return;

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -85,10 +85,11 @@ boolean PT_RequestFile(INT32 node);
typedef enum typedef enum
{ {
LFTNS_NONE, // This node is not connected
LFTNS_WAITING, // This node is waiting for the server to send the file LFTNS_WAITING, // This node is waiting for the server to send the file
LFTNS_ASKED, // The server has told the node they're ready to send the file LFTNS_ASKED, // The server has told the node they're ready to send the file
LFTNS_SENDING, // The server is sending the file to this node LFTNS_SENDING, // The server is sending the file to this node
LFTNS_SENT // The node already has the file LFTNS_SENT // The node already has the file
} luafiletransfernodestatus_t; } luafiletransfernodestatus_t;
typedef struct luafiletransfer_s typedef struct luafiletransfer_s
@ -99,6 +100,7 @@ typedef struct luafiletransfer_s
INT32 id; // Callback ID INT32 id; // Callback ID
boolean ongoing; boolean ongoing;
luafiletransfernodestatus_t nodestatus[MAXNETNODES]; luafiletransfernodestatus_t nodestatus[MAXNETNODES];
tic_t nodetimeouts[MAXNETNODES];
struct luafiletransfer_s *next; struct luafiletransfer_s *next;
} luafiletransfer_t; } luafiletransfer_t;

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -25,10 +25,6 @@
#include "deh_lua.h" #include "deh_lua.h"
#include "deh_tables.h" #include "deh_tables.h"
#ifdef MUSICSLOT_COMPATIBILITY
#include "deh_soc.h" // for get_mus
#endif
// freeslot takes a name (string only!) // freeslot takes a name (string only!)
// and allocates it to the appropriate free slot. // and allocates it to the appropriate free slot.
// Returns the slot number allocated for it or nil if failed. // Returns the slot number allocated for it or nil if failed.
@ -430,29 +426,6 @@ static inline int lib_getenum(lua_State *L)
if (mathlib) return luaL_error(L, "sfx '%s' could not be found.\n", word); if (mathlib) return luaL_error(L, "sfx '%s' could not be found.\n", word);
return 0; return 0;
} }
#ifdef MUSICSLOT_COMPATIBILITY
else if (!mathlib && fastncmp("mus_",word,4)) {
p = word+4;
if ((i = get_mus(p, false)) == 0)
return 0;
lua_pushinteger(L, i);
return 1;
}
else if (mathlib && fastncmp("MUS_",word,4)) { // SOCs are ALL CAPS!
p = word+4;
if ((i = get_mus(p, false)) == 0)
return luaL_error(L, "music '%s' could not be found.\n", word);
lua_pushinteger(L, i);
return 1;
}
else if (mathlib && (fastncmp("O_",word,2) || fastncmp("D_",word,2))) {
p = word+2;
if ((i = get_mus(p, false)) == 0)
return luaL_error(L, "music '%s' could not be found.\n", word);
lua_pushinteger(L, i);
return 1;
}
#endif
else if (!mathlib && fastncmp("pw_",word,3)) { else if (!mathlib && fastncmp("pw_",word,3)) {
p = word+3; p = word+3;
for (i = 0; i < NUMPOWERS; i++) for (i = 0; i < NUMPOWERS; i++)

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -229,7 +229,10 @@ void readPlayer(MYFILE *f, INT32 num)
SLOTFOUND SLOTFOUND
for (i = 0; i < MAXLINELEN-3; i++) // A friendly neighborhood alias for brevity's sake
#define NOTE_SIZE sizeof(description[num].notes)
for (i = 0; i < (INT32)(MAXLINELEN-NOTE_SIZE-3); i++)
{ {
if (s[i] == '=') if (s[i] == '=')
{ {
@ -239,8 +242,9 @@ void readPlayer(MYFILE *f, INT32 num)
} }
if (playertext) if (playertext)
{ {
strcpy(description[num].notes, playertext); strlcpy(description[num].notes, playertext, NOTE_SIZE);
strcat(description[num].notes, myhashfgets(playertext, sizeof (description[num].notes), f)); strlcat(description[num].notes,
myhashfgets(playertext, NOTE_SIZE, f), NOTE_SIZE);
} }
else else
strcpy(description[num].notes, ""); strcpy(description[num].notes, "");
@ -249,7 +253,7 @@ void readPlayer(MYFILE *f, INT32 num)
// It works down here, though. // It works down here, though.
{ {
INT32 numline = 0; INT32 numline = 0;
for (i = 0; (size_t)i < sizeof(description[num].notes)-1; i++) for (i = 0; (size_t)i < NOTE_SIZE-1; i++)
{ {
if (numline < 20 && description[num].notes[i] == '\n') if (numline < 20 && description[num].notes[i] == '\n')
numline++; numline++;
@ -260,6 +264,7 @@ void readPlayer(MYFILE *f, INT32 num)
} }
description[num].notes[strlen(description[num].notes)-1] = '\0'; description[num].notes[strlen(description[num].notes)-1] = '\0';
description[num].notes[i] = '\0'; description[num].notes[i] = '\0';
#undef NOTE_SIZE
continue; continue;
} }
@ -1140,8 +1145,10 @@ void readgametype(MYFILE *f, char *gtname)
} }
if (descr) if (descr)
{ {
strcpy(gtdescription, descr); strlcpy(gtdescription, descr, sizeof (gtdescription));
strcat(gtdescription, myhashfgets(descr, sizeof (gtdescription), f)); strlcat(gtdescription,
myhashfgets(descr, sizeof (gtdescription), f),
sizeof (gtdescription));
} }
else else
strcpy(gtdescription, ""); strcpy(gtdescription, "");
@ -1574,19 +1581,8 @@ void readlevelheader(MYFILE *f, INT32 num)
sizeof(mapheaderinfo[num-1]->musname), va("Level header %d: music", num)); sizeof(mapheaderinfo[num-1]->musname), va("Level header %d: music", num));
} }
} }
#ifdef MUSICSLOT_COMPATIBILITY
else if (fastcmp(word, "MUSICSLOT")) else if (fastcmp(word, "MUSICSLOT"))
{ deh_warning("Level header %d: MusicSlot parameter is deprecated and will be removed.\nUse \"Music\" instead.", num);
i = get_mus(word2, true);
if (i && i <= 1035)
snprintf(mapheaderinfo[num-1]->musname, 7, "%sM", G_BuildMapName(i));
else if (i && i <= 1050)
strncpy(mapheaderinfo[num-1]->musname, compat_special_music_slots[i - 1036], 7);
else
mapheaderinfo[num-1]->musname[0] = 0; // becomes empty string
mapheaderinfo[num-1]->musname[6] = 0;
}
#endif
else if (fastcmp(word, "MUSICTRACK")) else if (fastcmp(word, "MUSICTRACK"))
mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1); mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1);
else if (fastcmp(word, "MUSICPOS")) else if (fastcmp(word, "MUSICPOS"))
@ -1964,19 +1960,6 @@ static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum)
strncpy(cutscenes[num]->scene[scenenum].musswitch, word2, 7); strncpy(cutscenes[num]->scene[scenenum].musswitch, word2, 7);
cutscenes[num]->scene[scenenum].musswitch[6] = 0; cutscenes[num]->scene[scenenum].musswitch[6] = 0;
} }
#ifdef MUSICSLOT_COMPATIBILITY
else if (fastcmp(word, "MUSICSLOT"))
{
i = get_mus(word2, true);
if (i && i <= 1035)
snprintf(cutscenes[num]->scene[scenenum].musswitch, 7, "%sM", G_BuildMapName(i));
else if (i && i <= 1050)
strncpy(cutscenes[num]->scene[scenenum].musswitch, compat_special_music_slots[i - 1036], 7);
else
cutscenes[num]->scene[scenenum].musswitch[0] = 0; // becomes empty string
cutscenes[num]->scene[scenenum].musswitch[6] = 0;
}
#endif
else if (fastcmp(word, "MUSICTRACK")) else if (fastcmp(word, "MUSICTRACK"))
{ {
cutscenes[num]->scene[scenenum].musswitchflags = ((UINT16)i) & MUSIC_TRACKMASK; cutscenes[num]->scene[scenenum].musswitchflags = ((UINT16)i) & MUSIC_TRACKMASK;
@ -2239,19 +2222,6 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum)
strncpy(textprompts[num]->page[pagenum].musswitch, word2, 7); strncpy(textprompts[num]->page[pagenum].musswitch, word2, 7);
textprompts[num]->page[pagenum].musswitch[6] = 0; textprompts[num]->page[pagenum].musswitch[6] = 0;
} }
#ifdef MUSICSLOT_COMPATIBILITY
else if (fastcmp(word, "MUSICSLOT"))
{
i = get_mus(word2, true);
if (i && i <= 1035)
snprintf(textprompts[num]->page[pagenum].musswitch, 7, "%sM", G_BuildMapName(i));
else if (i && i <= 1050)
strncpy(textprompts[num]->page[pagenum].musswitch, compat_special_music_slots[i - 1036], 7);
else
textprompts[num]->page[pagenum].musswitch[0] = 0; // becomes empty string
textprompts[num]->page[pagenum].musswitch[6] = 0;
}
#endif
else if (fastcmp(word, "MUSICTRACK")) else if (fastcmp(word, "MUSICTRACK"))
{ {
textprompts[num]->page[pagenum].musswitchflags = ((UINT16)i) & MUSIC_TRACKMASK; textprompts[num]->page[pagenum].musswitchflags = ((UINT16)i) & MUSIC_TRACKMASK;
@ -2577,20 +2547,6 @@ void readmenu(MYFILE *f, INT32 num)
menupres[num].musname[6] = 0; menupres[num].musname[6] = 0;
titlechanged = true; titlechanged = true;
} }
#ifdef MUSICSLOT_COMPATIBILITY
else if (fastcmp(word, "MUSICSLOT"))
{
value = get_mus(word2, true);
if (value && value <= 1035)
snprintf(menupres[num].musname, 7, "%sM", G_BuildMapName(value));
else if (value && value <= 1050)
strncpy(menupres[num].musname, compat_special_music_slots[value - 1036], 7);
else
menupres[num].musname[0] = 0; // becomes empty string
menupres[num].musname[6] = 0;
titlechanged = true;
}
#endif
else if (fastcmp(word, "MUSICTRACK")) else if (fastcmp(word, "MUSICTRACK"))
{ {
menupres[num].mustrack = ((UINT16)value - 1); menupres[num].mustrack = ((UINT16)value - 1);
@ -2839,26 +2795,31 @@ void readsound(MYFILE *f, INT32 num)
if (s[0] == '\n') if (s[0] == '\n')
break; break;
// First remove trailing newline, if there is one
tmp = strchr(s, '\n');
if (tmp)
*tmp = '\0';
tmp = strchr(s, '#'); tmp = strchr(s, '#');
if (tmp) if (tmp)
*tmp = '\0'; *tmp = '\0';
if (s == tmp) if (s == tmp)
continue; // Skip comment lines, but don't break. continue; // Skip comment lines, but don't break.
word = strtok(s, " "); // Set / reset word
if (word) word = s;
strupr(word);
// Get the part before the " = "
tmp = strchr(s, '=');
if (tmp)
*(tmp-1) = '\0';
else else
break; break;
strupr(word);
word2 = strtok(NULL, " "); // Now get the part after
if (word2) word2 = tmp += 2;
value = atoi(word2); value = atoi(word2); // used for numerical settings
else
{
deh_warning("No value for token %s", word);
continue;
}
if (fastcmp(word, "SINGULAR")) if (fastcmp(word, "SINGULAR"))
{ {
@ -4178,46 +4139,6 @@ sfxenum_t get_sfx(const char *word)
return sfx_None; return sfx_None;
} }
#ifdef MUSICSLOT_COMPATIBILITY
UINT16 get_mus(const char *word, UINT8 dehacked_mode)
{ // Returns the value of MUS_ enumerations
UINT16 i;
char lumptmp[4];
if (*word >= '0' && *word <= '9')
return atoi(word);
if (!word[2] && toupper(word[0]) >= 'A' && toupper(word[0]) <= 'Z')
return (UINT16)M_MapNumber(word[0], word[1]);
if (fastncmp("MUS_",word,4))
word += 4; // take off the MUS_
else if (fastncmp("O_",word,2) || fastncmp("D_",word,2))
word += 2; // take off the O_ or D_
strncpy(lumptmp, word, 4);
lumptmp[3] = 0;
if (fasticmp("MAP",lumptmp))
{
word += 3;
if (toupper(word[0]) >= 'A' && toupper(word[0]) <= 'Z')
return (UINT16)M_MapNumber(word[0], word[1]);
else if ((i = atoi(word)))
return i;
word -= 3;
if (dehacked_mode)
deh_warning("Couldn't find music named 'MUS_%s'",word);
return 0;
}
for (i = 0; compat_special_music_slots[i][0]; ++i)
if (fasticmp(word, compat_special_music_slots[i]))
return i + 1036;
if (dehacked_mode)
deh_warning("Couldn't find music named 'MUS_%s'",word);
return 0;
}
#endif
hudnum_t get_huditem(const char *word) hudnum_t get_huditem(const char *word)
{ // Returns the value of HUD_ enumerations { // Returns the value of HUD_ enumerations
hudnum_t i; hudnum_t i;
@ -4448,13 +4369,6 @@ static fixed_t find_const(const char **rword)
free(word); free(word);
return r; return r;
} }
#ifdef MUSICSLOT_COMPATIBILITY
else if (fastncmp("MUS_",word,4) || fastncmp("O_",word,2)) {
r = get_mus(word, true);
free(word);
return r;
}
#endif
else if (fastncmp("PW_",word,3)) { else if (fastncmp("PW_",word,3)) {
r = get_power(word); r = get_power(word);
free(word); free(word);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -43,7 +43,7 @@
#include "info.h" #include "info.h"
#include "dehacked.h" #include "dehacked.h"
#include "doomdef.h" // MUSICSLOT_COMPATIBILITY, HWRENDER #include "doomdef.h" // HWRENDER
// Crazy word-reading stuff // Crazy word-reading stuff
/// \todo Put these in a seperate file or something. /// \todo Put these in a seperate file or something.
@ -52,9 +52,6 @@ statenum_t get_state(const char *word);
spritenum_t get_sprite(const char *word); spritenum_t get_sprite(const char *word);
playersprite_t get_sprite2(const char *word); playersprite_t get_sprite2(const char *word);
sfxenum_t get_sfx(const char *word); sfxenum_t get_sfx(const char *word);
#ifdef MUSICSLOT_COMPATIBILITY
UINT16 get_mus(const char *word, UINT8 dehacked_mode);
#endif
hudnum_t get_huditem(const char *word); hudnum_t get_huditem(const char *word);
menutype_t get_menutype(const char *word); menutype_t get_menutype(const char *word);
//INT16 get_gametype(const char *word); //INT16 get_gametype(const char *word);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -5457,3 +5457,27 @@ struct int_const_s const INT_CONST[] = {
{NULL,0} {NULL,0}
}; };
// For this to work compile-time without being in this file,
// this function would need to check sizes at runtime, without sizeof
void DEH_TableCheck(void)
{
#if defined(_DEBUG) || defined(PARANOIA)
const size_t dehstates = sizeof(STATE_LIST)/sizeof(const char*);
const size_t dehmobjs = sizeof(MOBJTYPE_LIST)/sizeof(const char*);
const size_t dehpowers = sizeof(POWERS_LIST)/sizeof(const char*);
const size_t dehcolors = sizeof(COLOR_ENUMS)/sizeof(const char*);
if (dehstates != S_FIRSTFREESLOT)
I_Error("You forgot to update the Dehacked states list, you dolt!\n(%d states defined, versus %s in the Dehacked list)\n", S_FIRSTFREESLOT, sizeu1(dehstates));
if (dehmobjs != MT_FIRSTFREESLOT)
I_Error("You forgot to update the Dehacked mobjtype list, you dolt!\n(%d mobj types defined, versus %s in the Dehacked list)\n", MT_FIRSTFREESLOT, sizeu1(dehmobjs));
if (dehpowers != NUMPOWERS)
I_Error("You forgot to update the Dehacked powers list, you dolt!\n(%d powers defined, versus %s in the Dehacked list)\n", NUMPOWERS, sizeu1(dehpowers));
if (dehcolors != SKINCOLOR_FIRSTFREESLOT)
I_Error("You forgot to update the Dehacked colors list, you dolt!\n(%d colors defined, versus %s in the Dehacked list)\n", SKINCOLOR_FIRSTFREESLOT, sizeu1(dehcolors));
#endif
}

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -72,4 +72,7 @@ extern const char *const MENUTYPES_LIST[];
extern struct int_const_s const INT_CONST[]; extern struct int_const_s const INT_CONST[];
// Moved to this file because it can't work compile-time otherwise
void DEH_TableCheck(void);
#endif #endif

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -188,26 +188,11 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
dbg_line = -1; // start at -1 so the first line is 0. dbg_line = -1; // start at -1 so the first line is 0.
while (!myfeof(f)) while (!myfeof(f))
{ {
char origpos[128];
INT32 size = 0;
char *traverse;
myfgets(s, MAXLINELEN, f); myfgets(s, MAXLINELEN, f);
memcpy(textline, s, MAXLINELEN); memcpy(textline, s, MAXLINELEN);
if (s[0] == '\n' || s[0] == '#') if (s[0] == '\n' || s[0] == '#')
continue; continue;
traverse = s;
while (traverse[0] != '\n')
{
traverse++;
size++;
}
strncpy(origpos, s, size);
origpos[size] = '\0';
if (NULL != (word = strtok(s, " "))) { if (NULL != (word = strtok(s, " "))) {
strupr(word); strupr(word);
if (word[strlen(word)-1] == '\n') if (word[strlen(word)-1] == '\n')
@ -645,25 +630,3 @@ void DEH_LoadDehackedLump(lumpnum_t lumpnum)
{ {
DEH_LoadDehackedLumpPwad(WADFILENUM(lumpnum),LUMPNUM(lumpnum), false); DEH_LoadDehackedLumpPwad(WADFILENUM(lumpnum),LUMPNUM(lumpnum), false);
} }
void DEH_Check(void)
{
#if defined(_DEBUG) || defined(PARANOIA)
const size_t dehstates = sizeof(STATE_LIST)/sizeof(const char*);
const size_t dehmobjs = sizeof(MOBJTYPE_LIST)/sizeof(const char*);
const size_t dehpowers = sizeof(POWERS_LIST)/sizeof(const char*);
const size_t dehcolors = sizeof(COLOR_ENUMS)/sizeof(const char*);
if (dehstates != S_FIRSTFREESLOT)
I_Error("You forgot to update the Dehacked states list, you dolt!\n(%d states defined, versus %s in the Dehacked list)\n", S_FIRSTFREESLOT, sizeu1(dehstates));
if (dehmobjs != MT_FIRSTFREESLOT)
I_Error("You forgot to update the Dehacked mobjtype list, you dolt!\n(%d mobj types defined, versus %s in the Dehacked list)\n", MT_FIRSTFREESLOT, sizeu1(dehmobjs));
if (dehpowers != NUMPOWERS)
I_Error("You forgot to update the Dehacked powers list, you dolt!\n(%d powers defined, versus %s in the Dehacked list)\n", NUMPOWERS, sizeu1(dehpowers));
if (dehcolors != SKINCOLOR_FIRSTFREESLOT)
I_Error("You forgot to update the Dehacked colors list, you dolt!\n(%d colors defined, versus %s in the Dehacked list)\n", SKINCOLOR_FIRSTFREESLOT, sizeu1(dehcolors));
#endif
}

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -30,8 +30,6 @@ typedef enum
void DEH_LoadDehackedLump(lumpnum_t lumpnum); void DEH_LoadDehackedLump(lumpnum_t lumpnum);
void DEH_LoadDehackedLumpPwad(UINT16 wad, UINT16 lump, boolean mainfile); void DEH_LoadDehackedLumpPwad(UINT16 wad, UINT16 lump, boolean mainfile);
void DEH_Check(void);
fixed_t get_number(const char *word); fixed_t get_number(const char *word);
FUNCPRINTF void deh_warning(const char *first, ...); FUNCPRINTF void deh_warning(const char *first, ...);
void deh_strlcpy(char *dst, const char *src, size_t size, const char *warntext); void deh_strlcpy(char *dst, const char *src, size_t size, const char *warntext);

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -100,7 +100,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <ctype.h> #include <ctype.h>
#if defined (_WIN32) || defined (__DJGPP__) #ifdef _WIN32
#include <io.h> #include <io.h>
#endif #endif
@ -112,7 +112,7 @@
//#define PARANOIA // do some tests that never fail but maybe //#define PARANOIA // do some tests that never fail but maybe
// turn this on by make etc.. DEBUGMODE = 1 or use the Debug profile in the VC++ projects // turn this on by make etc.. DEBUGMODE = 1 or use the Debug profile in the VC++ projects
//#endif //#endif
#if defined (_WIN32) || (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON) || defined (macintosh) #if defined (_WIN32) || defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) || defined (macintosh)
#define LOGMESSAGES // write message in log.txt #define LOGMESSAGES // write message in log.txt
#endif #endif
@ -415,7 +415,7 @@ enum {
}; };
// Name of local directory for config files and savegames // Name of local directory for config files and savegames
#if (((defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)) && !defined (__APPLE__) #if (defined (__unix__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__) && !defined (__APPLE__)
#define DEFAULTDIR ".srb2" #define DEFAULTDIR ".srb2"
#else #else
#define DEFAULTDIR "srb2" #define DEFAULTDIR "srb2"
@ -604,10 +604,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// Experimental tweaks to analog mode. (Needs a lot of work before it's ready for primetime.) /// Experimental tweaks to analog mode. (Needs a lot of work before it's ready for primetime.)
//#define REDSANALOG //#define REDSANALOG
/// Backwards compatibility with musicslots.
/// \note You should leave this enabled unless you're working with a future SRB2 version.
#define MUSICSLOT_COMPATIBILITY
/// Experimental attempts at preventing MF_PAPERCOLLISION objects from getting stuck in walls. /// Experimental attempts at preventing MF_PAPERCOLLISION objects from getting stuck in walls.
//#define PAPER_COLLISIONCORRECTION //#define PAPER_COLLISIONCORRECTION

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -54,17 +54,6 @@ typedef long ssize_t;
#define PDWORD_PTR PDWORD #define PDWORD_PTR PDWORD
#endif #endif
#endif #endif
#elif defined (__DJGPP__)
#define UINT8 unsigned char
#define SINT8 signed char
#define UINT16 unsigned short int
#define INT16 signed short int
#define INT32 signed long
#define UINT32 unsigned long
#define INT64 signed long long
#define UINT64 unsigned long long
#else #else
#define __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS
#include <stdint.h> #include <stdint.h>
@ -108,7 +97,7 @@ typedef long ssize_t;
#define strncasecmp strnicmp #define strncasecmp strnicmp
#define strcasecmp strcmpi #define strcasecmp strcmpi
#endif #endif
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON) #if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
#undef stricmp #undef stricmp
#define stricmp(x,y) strcasecmp(x,y) #define stricmp(x,y) strcasecmp(x,y)
#undef strnicmp #undef strnicmp
@ -136,7 +125,7 @@ char *strcasestr(const char *in, const char *what);
#endif #endif
#endif //macintosh #endif //macintosh
#if defined (PC_DOS) || defined (_WIN32) || defined (__HAIKU__) #if defined (_WIN32) || defined (__HAIKU__)
#define HAVE_DOSSTR_FUNCS #define HAVE_DOSSTR_FUNCS
#endif #endif

View file

@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2014-2020 by Sonic Team Junior. // Copyright (C) 2014-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -1138,6 +1138,7 @@ static const char *credits[] = {
"Iestyn \"Monster Iestyn\" Jealous", "Iestyn \"Monster Iestyn\" Jealous",
"William \"GuyWithThePie\" Kloppenberg", "William \"GuyWithThePie\" Kloppenberg",
"Alice \"Alacroix\" de Lemos", "Alice \"Alacroix\" de Lemos",
"Logan \"Hyperchaotix\" McCloud",
"Alexander \"DrTapeworm\" Moench-Ford", "Alexander \"DrTapeworm\" Moench-Ford",
"Andrew \"Senku Niola\" Moran", "Andrew \"Senku Niola\" Moran",
"\"MotorRoach\"", "\"MotorRoach\"",
@ -2545,28 +2546,28 @@ static void F_UnloadAlacroixGraphics(SINT8 oldttscale)
oldttscale--; // zero-based index oldttscale--; // zero-based index
for (i = 0; i < TTMAX_ALACROIX; i++) for (i = 0; i < TTMAX_ALACROIX; i++)
{ {
if(ttembl[oldttscale][i]) { Z_Free(ttembl[oldttscale][i]); ttembl[oldttscale][i] = 0; } if(ttembl[oldttscale][i]) { Patch_Free(ttembl[oldttscale][i]); ttembl[oldttscale][i] = 0; }
if(ttribb[oldttscale][i]) { Z_Free(ttribb[oldttscale][i]); ttribb[oldttscale][i] = 0; } if(ttribb[oldttscale][i]) { Patch_Free(ttribb[oldttscale][i]); ttribb[oldttscale][i] = 0; }
if(ttsont[oldttscale][i]) { Z_Free(ttsont[oldttscale][i]); ttsont[oldttscale][i] = 0; } if(ttsont[oldttscale][i]) { Patch_Free(ttsont[oldttscale][i]); ttsont[oldttscale][i] = 0; }
if(ttrobo[oldttscale][i]) { Z_Free(ttrobo[oldttscale][i]); ttrobo[oldttscale][i] = 0; } if(ttrobo[oldttscale][i]) { Patch_Free(ttrobo[oldttscale][i]); ttrobo[oldttscale][i] = 0; }
if(tttwot[oldttscale][i]) { Z_Free(tttwot[oldttscale][i]); tttwot[oldttscale][i] = 0; } if(tttwot[oldttscale][i]) { Patch_Free(tttwot[oldttscale][i]); tttwot[oldttscale][i] = 0; }
if(ttrbtx[oldttscale][i]) { Z_Free(ttrbtx[oldttscale][i]); ttrbtx[oldttscale][i] = 0; } if(ttrbtx[oldttscale][i]) { Patch_Free(ttrbtx[oldttscale][i]); ttrbtx[oldttscale][i] = 0; }
if(ttsoib[oldttscale][i]) { Z_Free(ttsoib[oldttscale][i]); ttsoib[oldttscale][i] = 0; } if(ttsoib[oldttscale][i]) { Patch_Free(ttsoib[oldttscale][i]); ttsoib[oldttscale][i] = 0; }
if(ttsoif[oldttscale][i]) { Z_Free(ttsoif[oldttscale][i]); ttsoif[oldttscale][i] = 0; } if(ttsoif[oldttscale][i]) { Patch_Free(ttsoif[oldttscale][i]); ttsoif[oldttscale][i] = 0; }
if(ttsoba[oldttscale][i]) { Z_Free(ttsoba[oldttscale][i]); ttsoba[oldttscale][i] = 0; } if(ttsoba[oldttscale][i]) { Patch_Free(ttsoba[oldttscale][i]); ttsoba[oldttscale][i] = 0; }
if(ttsobk[oldttscale][i]) { Z_Free(ttsobk[oldttscale][i]); ttsobk[oldttscale][i] = 0; } if(ttsobk[oldttscale][i]) { Patch_Free(ttsobk[oldttscale][i]); ttsobk[oldttscale][i] = 0; }
if(ttsodh[oldttscale][i]) { Z_Free(ttsodh[oldttscale][i]); ttsodh[oldttscale][i] = 0; } if(ttsodh[oldttscale][i]) { Patch_Free(ttsodh[oldttscale][i]); ttsodh[oldttscale][i] = 0; }
if(tttaib[oldttscale][i]) { Z_Free(tttaib[oldttscale][i]); tttaib[oldttscale][i] = 0; } if(tttaib[oldttscale][i]) { Patch_Free(tttaib[oldttscale][i]); tttaib[oldttscale][i] = 0; }
if(tttaif[oldttscale][i]) { Z_Free(tttaif[oldttscale][i]); tttaif[oldttscale][i] = 0; } if(tttaif[oldttscale][i]) { Patch_Free(tttaif[oldttscale][i]); tttaif[oldttscale][i] = 0; }
if(tttaba[oldttscale][i]) { Z_Free(tttaba[oldttscale][i]); tttaba[oldttscale][i] = 0; } if(tttaba[oldttscale][i]) { Patch_Free(tttaba[oldttscale][i]); tttaba[oldttscale][i] = 0; }
if(tttabk[oldttscale][i]) { Z_Free(tttabk[oldttscale][i]); tttabk[oldttscale][i] = 0; } if(tttabk[oldttscale][i]) { Patch_Free(tttabk[oldttscale][i]); tttabk[oldttscale][i] = 0; }
if(tttabt[oldttscale][i]) { Z_Free(tttabt[oldttscale][i]); tttabt[oldttscale][i] = 0; } if(tttabt[oldttscale][i]) { Patch_Free(tttabt[oldttscale][i]); tttabt[oldttscale][i] = 0; }
if(tttaft[oldttscale][i]) { Z_Free(tttaft[oldttscale][i]); tttaft[oldttscale][i] = 0; } if(tttaft[oldttscale][i]) { Patch_Free(tttaft[oldttscale][i]); tttaft[oldttscale][i] = 0; }
if(ttknib[oldttscale][i]) { Z_Free(ttknib[oldttscale][i]); ttknib[oldttscale][i] = 0; } if(ttknib[oldttscale][i]) { Patch_Free(ttknib[oldttscale][i]); ttknib[oldttscale][i] = 0; }
if(ttknif[oldttscale][i]) { Z_Free(ttknif[oldttscale][i]); ttknif[oldttscale][i] = 0; } if(ttknif[oldttscale][i]) { Patch_Free(ttknif[oldttscale][i]); ttknif[oldttscale][i] = 0; }
if(ttknba[oldttscale][i]) { Z_Free(ttknba[oldttscale][i]); ttknba[oldttscale][i] = 0; } if(ttknba[oldttscale][i]) { Patch_Free(ttknba[oldttscale][i]); ttknba[oldttscale][i] = 0; }
if(ttknbk[oldttscale][i]) { Z_Free(ttknbk[oldttscale][i]); ttknbk[oldttscale][i] = 0; } if(ttknbk[oldttscale][i]) { Patch_Free(ttknbk[oldttscale][i]); ttknbk[oldttscale][i] = 0; }
if(ttkndh[oldttscale][i]) { Z_Free(ttkndh[oldttscale][i]); ttkndh[oldttscale][i] = 0; } if(ttkndh[oldttscale][i]) { Patch_Free(ttkndh[oldttscale][i]); ttkndh[oldttscale][i] = 0; }
} }
ttloaded[oldttscale] = false; ttloaded[oldttscale] = false;
} }

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -3,7 +3,7 @@
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh. // Copyright (C) 2013-2016 by Matthew "Kaito Sinclaire" Walsh.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -1678,7 +1678,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
// At this point, cmd doesn't contain the final angle yet, // At this point, cmd doesn't contain the final angle yet,
// So we need to temporarily transform it so Lua scripters // So we need to temporarily transform it so Lua scripters
// don't need to handle it differently than in other hooks. // don't need to handle it differently than in other hooks.
if (gamestate == GS_LEVEL) if (addedtogame && gamestate == GS_LEVEL)
{ {
INT16 extra = ticcmd_oldangleturn[forplayer] - player->oldrelangleturn; INT16 extra = ticcmd_oldangleturn[forplayer] - player->oldrelangleturn;
INT16 origangle = cmd->angleturn; INT16 origangle = cmd->angleturn;
@ -3507,6 +3507,7 @@ tolinfo_t TYPEOFLEVEL[NUMTOLNAMES] = {
{"MARIO",TOL_MARIO}, {"MARIO",TOL_MARIO},
{"NIGHTS",TOL_NIGHTS}, {"NIGHTS",TOL_NIGHTS},
{"OLDBRAK",TOL_ERZ3}, {"OLDBRAK",TOL_ERZ3},
{"ERZ3",TOL_ERZ3},
{"XMAS",TOL_XMAS}, {"XMAS",TOL_XMAS},
{"CHRISTMAS",TOL_XMAS}, {"CHRISTMAS",TOL_XMAS},
@ -3973,6 +3974,7 @@ static void G_DoCompleted(void)
{ {
G_SetGamestate(GS_INTERMISSION); G_SetGamestate(GS_INTERMISSION);
Y_StartIntermission(); Y_StartIntermission();
Y_LoadIntermissionData();
G_UpdateVisited(); G_UpdateVisited();
G_HandleSaveLevel(); G_HandleSaveLevel();
} }

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2020 by Sonic Team Junior. // Copyright (C) 2020-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -137,6 +137,8 @@ static int comparePolygons(const void *p1, const void *p2)
PolygonArrayEntry* poly2 = &polygonArray[index2]; PolygonArrayEntry* poly2 = &polygonArray[index2];
int diff; int diff;
INT64 diff64; INT64 diff64;
UINT32 downloaded1 = 0;
UINT32 downloaded2 = 0;
int shader1 = poly1->shader; int shader1 = poly1->shader;
int shader2 = poly2->shader; int shader2 = poly2->shader;
@ -152,7 +154,11 @@ static int comparePolygons(const void *p1, const void *p2)
if (shader1 == -1 && shader2 == -1) if (shader1 == -1 && shader2 == -1)
return index1 - index2; return index1 - index2;
diff64 = poly1->texture - poly2->texture; if (poly1->texture)
downloaded1 = poly1->texture->downloaded; // there should be a opengl texture name here, usable for comparisons
if (poly2->texture)
downloaded2 = poly2->texture->downloaded;
diff64 = downloaded1 - downloaded2;
if (diff64 != 0) return diff64; if (diff64 != 0) return diff64;
diff = poly1->polyFlags - poly2->polyFlags; diff = poly1->polyFlags - poly2->polyFlags;
@ -184,16 +190,21 @@ static int comparePolygonsNoShaders(const void *p1, const void *p2)
GLMipmap_t *texture1 = poly1->texture; GLMipmap_t *texture1 = poly1->texture;
GLMipmap_t *texture2 = poly2->texture; GLMipmap_t *texture2 = poly2->texture;
UINT32 downloaded1 = 0;
UINT32 downloaded2 = 0;
if (poly1->polyFlags & PF_NoTexture || poly1->horizonSpecial) if (poly1->polyFlags & PF_NoTexture || poly1->horizonSpecial)
texture1 = NULL; texture1 = NULL;
if (poly2->polyFlags & PF_NoTexture || poly2->horizonSpecial) if (poly2->polyFlags & PF_NoTexture || poly2->horizonSpecial)
texture2 = NULL; texture2 = NULL;
diff64 = texture1 - texture2; if (texture1)
if (diff64 != 0) return diff64; downloaded1 = texture1->downloaded; // there should be a opengl texture name here, usable for comparisons
if (texture2)
downloaded2 = texture2->downloaded;
// skywalls and horizon lines must retain their order for horizon lines to work // skywalls and horizon lines must retain their order for horizon lines to work
if (texture1 == NULL && texture2 == NULL) if (!texture1 && !texture2)
return index1 - index2; return index1 - index2;
diff64 = downloaded1 - downloaded2;
if (diff64 != 0) return diff64;
diff = poly1->polyFlags - poly2->polyFlags; diff = poly1->polyFlags - poly2->polyFlags;
if (diff != 0) return diff; if (diff != 0) return diff;

View file

@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2020 by Sonic Team Junior. // Copyright (C) 2020-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -866,7 +866,7 @@ static void HWR_CacheTextureAsFlat(GLMipmap_t *grMipmap, INT32 texturenum)
} }
// Download a Doom 'flat' to the hardware cache and make it ready for use // Download a Doom 'flat' to the hardware cache and make it ready for use
void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum) void HWR_GetRawFlat(lumpnum_t flatlumpnum)
{ {
GLMipmap_t *grmip; GLMipmap_t *grmip;
patch_t *patch; patch_t *patch;
@ -895,7 +895,7 @@ void HWR_GetLevelFlat(levelflat_t *levelflat)
return; return;
if (levelflat->type == LEVELFLAT_FLAT) if (levelflat->type == LEVELFLAT_FLAT)
HWR_LiterallyGetFlat(levelflat->u.flat.lumpnum); HWR_GetRawFlat(levelflat->u.flat.lumpnum);
else if (levelflat->type == LEVELFLAT_TEXTURE) else if (levelflat->type == LEVELFLAT_TEXTURE)
{ {
GLMapTexture_t *grtex; GLMapTexture_t *grtex;
@ -934,15 +934,17 @@ void HWR_GetLevelFlat(levelflat_t *levelflat)
#ifndef NO_PNG_LUMPS #ifndef NO_PNG_LUMPS
else if (levelflat->type == LEVELFLAT_PNG) else if (levelflat->type == LEVELFLAT_PNG)
{ {
INT32 pngwidth = 0, pngheight = 0;
GLMipmap_t *mipmap = levelflat->mipmap; GLMipmap_t *mipmap = levelflat->mipmap;
UINT8 *flat;
size_t size;
// Cache the picture. // Cache the picture.
if (!levelflat->picture) if (!levelflat->mippic)
{ {
levelflat->picture = Picture_PNGConvert(W_CacheLumpNum(levelflat->u.flat.lumpnum, PU_CACHE), PICFMT_FLAT, &pngwidth, &pngheight, NULL, NULL, W_LumpLength(levelflat->u.flat.lumpnum), NULL, 0); INT32 pngwidth = 0, pngheight = 0;
void *pic = Picture_PNGConvert(W_CacheLumpNum(levelflat->u.flat.lumpnum, PU_CACHE), PICFMT_FLAT, &pngwidth, &pngheight, NULL, NULL, W_LumpLength(levelflat->u.flat.lumpnum), NULL, 0);
Z_ChangeTag(pic, PU_LEVEL);
Z_SetUser(pic, &levelflat->mippic);
levelflat->width = (UINT16)pngwidth; levelflat->width = (UINT16)pngwidth;
levelflat->height = (UINT16)pngheight; levelflat->height = (UINT16)pngheight;
} }
@ -950,7 +952,7 @@ void HWR_GetLevelFlat(levelflat_t *levelflat)
// Make the mipmap. // Make the mipmap.
if (mipmap == NULL) if (mipmap == NULL)
{ {
mipmap = Z_Calloc(sizeof(GLMipmap_t), PU_LEVEL, NULL); mipmap = Z_Calloc(sizeof(GLMipmap_t), PU_STATIC, NULL);
mipmap->format = GL_TEXFMT_P_8; mipmap->format = GL_TEXFMT_P_8;
mipmap->flags = TF_WRAPXY|TF_CHROMAKEYED; mipmap->flags = TF_WRAPXY|TF_CHROMAKEYED;
levelflat->mipmap = mipmap; levelflat->mipmap = mipmap;
@ -958,17 +960,22 @@ void HWR_GetLevelFlat(levelflat_t *levelflat)
if (!mipmap->data && !mipmap->downloaded) if (!mipmap->data && !mipmap->downloaded)
{ {
UINT8 *flat;
size_t size;
if (levelflat->mippic == NULL)
I_Error("HWR_GetLevelFlat: levelflat->mippic == NULL");
mipmap->width = levelflat->width; mipmap->width = levelflat->width;
mipmap->height = levelflat->height; mipmap->height = levelflat->height;
size = (mipmap->width * mipmap->height); size = (mipmap->width * mipmap->height);
flat = Z_Malloc(size, PU_LEVEL, &mipmap->data); flat = Z_Malloc(size, PU_LEVEL, &mipmap->data);
if (levelflat->picture == NULL) M_Memcpy(flat, levelflat->mippic, size);
I_Error("HWR_GetLevelFlat: levelflat->picture == NULL");
M_Memcpy(flat, levelflat->picture, size);
} }
// Tell the hardware driver to bind the current texture to the flat's mipmap // Tell the hardware driver to bind the current texture to the flat's mipmap
HWD.pfnSetTexture(mipmap); HWR_SetCurrentTexture(mipmap);
} }
#endif #endif
else // set no texture else // set no texture
@ -1084,7 +1091,6 @@ void HWR_UnlockCachedPatch(GLPatch_t *gpatch)
return; return;
Z_ChangeTag(gpatch->mipmap->data, PU_HWRCACHE_UNLOCKED); Z_ChangeTag(gpatch->mipmap->data, PU_HWRCACHE_UNLOCKED);
Z_ChangeTag(gpatch, PU_HWRPATCHINFO_UNLOCKED);
} }
static const INT32 picmode2GR[] = static const INT32 picmode2GR[] =

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -48,44 +48,43 @@ struct GLColormap_s
typedef struct GLColormap_s GLColormap_t; typedef struct GLColormap_s GLColormap_t;
// data holds the address of the graphics data cached in heap memory // Texture information (misleadingly named "mipmap" all over the code.)
// NULL if the texture is not in Doom heap cache. // The *data pointer holds the address of the graphics data cached in heap memory.
// NULL if the texture is not in SRB2's heap cache.
struct GLMipmap_s struct GLMipmap_s
{ {
// for TexDownloadMipMap // for UpdateTexture
GLTextureFormat_t format; GLTextureFormat_t format;
void *data; void *data;
UINT32 flags; UINT32 flags;
UINT16 height; UINT16 height;
UINT16 width; UINT16 width;
UINT32 downloaded; // The GPU has this texture. UINT32 downloaded; // The GPU has this texture.
struct GLMipmap_s *nextcolormap; struct GLMipmap_s *nextcolormap;
struct GLColormap_s *colormap; struct GLColormap_s *colormap;
struct GLMipmap_s *nextmipmap; // Linked list of all textures
}; };
typedef struct GLMipmap_s GLMipmap_t; typedef struct GLMipmap_s GLMipmap_t;
// //
// Doom texture info, as cached for hardware rendering // Level textures, as cached for hardware rendering.
// //
struct GLMapTexture_s struct GLMapTexture_s
{ {
GLMipmap_t mipmap; GLMipmap_t mipmap;
float scaleX; //used for scaling textures on walls float scaleX; // Used for scaling textures on walls
float scaleY; float scaleY;
}; };
typedef struct GLMapTexture_s GLMapTexture_t; typedef struct GLMapTexture_s GLMapTexture_t;
// a cached patch as converted to hardware format // Patch information for the hardware renderer.
struct GLPatch_s struct GLPatch_s
{ {
float max_s,max_t; GLMipmap_t *mipmap; // Texture data. Allocated whenever the patch is.
GLMipmap_t *mipmap; float max_s, max_t;
}; };
typedef struct GLPatch_s GLPatch_t; typedef struct GLPatch_s GLPatch_t;

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -216,28 +216,28 @@ enum EPolyFlags
PF_Masked = 0x00000001, // Poly is alpha scaled and 0 alpha pixels are discarded (holes in texture) PF_Masked = 0x00000001, // Poly is alpha scaled and 0 alpha pixels are discarded (holes in texture)
PF_Translucent = 0x00000002, // Poly is transparent, alpha = level of transparency PF_Translucent = 0x00000002, // Poly is transparent, alpha = level of transparency
PF_Environment = 0x00000004, // Poly should be drawn environment mapped. (Hurdler: used for text drawing) PF_Environment = 0x00000004, // Poly should be drawn environment mapped. (Hurdler: used for text drawing)
PF_Additive = 0x00000008, // Additive color blending PF_Additive = 0x00000008, // Source blending factor is additive.
PF_AdditiveSource = 0x00000010, // Source blending factor is additive. This is the opposite of regular additive blending. PF_Subtractive = 0x00000010, // Subtractive color blending
PF_Subtractive = 0x00000020, // Subtractive color blending PF_ReverseSubtract = 0x00000020, // Reverse subtract, used in wall splats (decals)
PF_ReverseSubtract = 0x00000040, // Reverse subtract, used in wall splats (decals) PF_Multiplicative = 0x00000040, // Multiplicative color blending
PF_Multiplicative = 0x00000080, // Multiplicative color blending
PF_Fog = 0x20000000, // Fog blocks PF_Fog = 0x20000000, // Fog blocks
PF_NoAlphaTest = 0x40000000, // Disables alpha testing PF_NoAlphaTest = 0x40000000, // Disables alpha testing
PF_Blending = (PF_Masked|PF_Translucent|PF_Environment|PF_Additive|PF_AdditiveSource|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Fog) & ~PF_NoAlphaTest, PF_Blending = (PF_Masked|PF_Translucent|PF_Environment|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Fog) & ~PF_NoAlphaTest,
// other flag bits // other flag bits
PF_Occlude = 0x00000100, // Updates the depth buffer PF_Occlude = 0x00000100, // Updates the depth buffer
PF_NoDepthTest = 0x00000200, // Disables the depth test mode PF_NoDepthTest = 0x00000200, // Disables the depth test mode
PF_Invisible = 0x00000400, // Disables write to color buffer PF_Invisible = 0x00000400, // Disables write to color buffer
PF_Decal = 0x00000800, // Enables polygon offset PF_Decal = 0x00000800, // Enables polygon offset
PF_Modulated = 0x00001000, // Modulation (multiply output with constant ARGB) PF_Modulated = 0x00001000, // Modulation (multiply output with constant RGBA)
// When set, pass the color constant into the FSurfaceInfo -> PolyColor // When set, pass the color constant into the FSurfaceInfo -> PolyColor
PF_NoTexture = 0x00002000, // Disables texturing PF_NoTexture = 0x00002000, // Disables texturing
PF_Corona = 0x00004000, // Tells the renderer we are drawing a corona PF_Corona = 0x00004000, // Tells the renderer we are drawing a corona
PF_Ripple = 0x00008000, // Water effect shader PF_ColorMapped = 0x00008000, // Surface has "tint" and "fade" colors, which are sent as uniforms to a shader.
PF_RemoveYWrap = 0x00010000, // Forces clamp texture on Y PF_RemoveYWrap = 0x00010000, // Forces clamp texture on Y
PF_ForceWrapX = 0x00020000, // Forces repeat texture on X PF_ForceWrapX = 0x00020000, // Forces repeat texture on X
PF_ForceWrapY = 0x00040000 // Forces repeat texture on Y PF_ForceWrapY = 0x00040000, // Forces repeat texture on Y
PF_Ripple = 0x00100000 // Water ripple effect. The current backend doesn't use it for anything.
}; };
@ -255,9 +255,17 @@ enum ETextureFlags
TF_TRANSPARENT = 0x00000040, // texture with some alpha == 0 TF_TRANSPARENT = 0x00000040, // texture with some alpha == 0
}; };
typedef struct GLMipmap_s FTextureInfo; struct FTextureInfo
{
UINT32 width, height;
UINT32 downloaded;
UINT32 format;
struct GLMipmap_s *texture;
struct FTextureInfo *prev, *next;
};
typedef struct FTextureInfo FTextureInfo;
// jimita 14032019
struct FLightInfo struct FLightInfo
{ {
FUINT light_level; FUINT light_level;
@ -273,7 +281,7 @@ struct FSurfaceInfo
RGBA_t PolyColor; RGBA_t PolyColor;
RGBA_t TintColor; RGBA_t TintColor;
RGBA_t FadeColor; RGBA_t FadeColor;
FLightInfo LightInfo; // jimita 14032019 FLightInfo LightInfo;
}; };
typedef struct FSurfaceInfo FSurfaceInfo; typedef struct FSurfaceInfo FSurfaceInfo;

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -437,18 +437,9 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
if (!(option & V_SCALEPATCHMASK)) if (!(option & V_SCALEPATCHMASK))
{ {
// if it's meant to cover the whole screen, black out the rest (ONLY IF TOP LEFT ISN'T TRANSPARENT) // if it's meant to cover the whole screen, black out the rest
// cx and cy are possibly *slightly* off from float maths // no the patch is cropped do not do this ever
// This is done before here compared to software because we directly alter cx and cy to centre
if (cx >= -0.1f && cx <= 0.1f && gpatch->width == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && gpatch->height == BASEVIDHEIGHT)
{
const column_t *column = (const column_t *)((const UINT8 *)(gpatch->columns) + (gpatch->columnofs[0]));
if (!column->topdelta)
{
const UINT8 *source = (const UINT8 *)(column) + 3;
HWR_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
}
}
// centre screen // centre screen
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f) if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
{ {
@ -470,11 +461,11 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
fwidth = w; fwidth = w;
fheight = h; fheight = h;
if (fwidth > gpatch->width) if (sx + w > gpatch->width)
fwidth = gpatch->width; fwidth = gpatch->width - sx;
if (fheight > gpatch->height) if (sy + h > gpatch->height)
fheight = gpatch->height; fheight = gpatch->height - sy;
if (pscale != FRACUNIT) if (pscale != FRACUNIT)
{ {
@ -506,13 +497,13 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
v[0].s = v[3].s = ((sx)/(float)(gpatch->width))*hwrPatch->max_s; v[0].s = v[3].s = ((sx)/(float)(gpatch->width))*hwrPatch->max_s;
if (sx + w > gpatch->width) if (sx + w > gpatch->width)
v[2].s = v[1].s = hwrPatch->max_s - ((sx+w)/(float)(gpatch->width))*hwrPatch->max_s; v[2].s = v[1].s = hwrPatch->max_s;
else else
v[2].s = v[1].s = ((sx+w)/(float)(gpatch->width))*hwrPatch->max_s; v[2].s = v[1].s = ((sx+w)/(float)(gpatch->width))*hwrPatch->max_s;
v[0].t = v[1].t = ((sy)/(float)(gpatch->height))*hwrPatch->max_t; v[0].t = v[1].t = ((sy)/(float)(gpatch->height))*hwrPatch->max_t;
if (sy + h > gpatch->height) if (sy + h > gpatch->height)
v[2].t = v[3].t = hwrPatch->max_t - ((sy+h)/(float)(gpatch->height))*hwrPatch->max_t; v[2].t = v[3].t = hwrPatch->max_t;
else else
v[2].t = v[3].t = ((sy+h)/(float)(gpatch->height))*hwrPatch->max_t; v[2].t = v[3].t = ((sy+h)/(float)(gpatch->height))*hwrPatch->max_t;
@ -639,7 +630,7 @@ void HWR_DrawFlatFill (INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum
v[0].t = v[1].t = (float)((y & flatflag)/dflatsize); v[0].t = v[1].t = (float)((y & flatflag)/dflatsize);
v[2].t = v[3].t = (float)(v[0].t + h/dflatsize); v[2].t = v[3].t = (float)(v[0].t + h/dflatsize);
HWR_LiterallyGetFlat(flatlumpnum); HWR_GetRawFlat(flatlumpnum);
//Hurdler: Boris, the same comment as above... but maybe for pics //Hurdler: Boris, the same comment as above... but maybe for pics
// it not a problem since they don't have any transparent pixel // it not a problem since they don't have any transparent pixel

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -40,13 +40,12 @@ EXPORT void HWRAPI(DrawIndexedTriangles) (FSurfaceInfo *pSurf, FOutVector *pOutV
EXPORT void HWRAPI(RenderSkyDome) (gl_sky_t *sky); EXPORT void HWRAPI(RenderSkyDome) (gl_sky_t *sky);
EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags); EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags);
EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FRGBAFloat *ClearColor); EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FRGBAFloat *ClearColor);
EXPORT void HWRAPI(SetTexture) (FTextureInfo *TexInfo); EXPORT void HWRAPI(SetTexture) (GLMipmap_t *TexInfo);
EXPORT void HWRAPI(UpdateTexture) (FTextureInfo *TexInfo); EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *TexInfo);
EXPORT void HWRAPI(DeleteTexture) (FTextureInfo *TexInfo); EXPORT void HWRAPI(DeleteTexture) (GLMipmap_t *TexInfo);
EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height, INT32 dst_stride, UINT16 *dst_data); EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height, INT32 dst_stride, UINT16 *dst_data);
EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip); EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip);
EXPORT void HWRAPI(ClearMipMapCache) (void); EXPORT void HWRAPI(ClearMipMapCache) (void);
EXPORT void HWRAPI(ClearCacheList) (void);
//Hurdler: added for backward compatibility //Hurdler: added for backward compatibility
EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value); EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value);
@ -69,7 +68,6 @@ EXPORT void HWRAPI(DrawScreenFinalTexture) (int width, int height);
#define SCREENVERTS 10 #define SCREENVERTS 10
EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2]); EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2]);
// jimita
EXPORT boolean HWRAPI(CompileShaders) (void); EXPORT boolean HWRAPI(CompileShaders) (void);
EXPORT void HWRAPI(CleanShaders) (void); EXPORT void HWRAPI(CleanShaders) (void);
EXPORT void HWRAPI(SetShader) (int type); EXPORT void HWRAPI(SetShader) (int type);
@ -101,7 +99,6 @@ struct hwdriver_s
ReadRect pfnReadRect; ReadRect pfnReadRect;
GClipRect pfnGClipRect; GClipRect pfnGClipRect;
ClearMipMapCache pfnClearMipMapCache; ClearMipMapCache pfnClearMipMapCache;
ClearCacheList pfnClearCacheList;
SetSpecialState pfnSetSpecialState;//Hurdler: added for backward compatibility SetSpecialState pfnSetSpecialState;//Hurdler: added for backward compatibility
DrawModel pfnDrawModel; DrawModel pfnDrawModel;
CreateModelVBOs pfnCreateModelVBOs; CreateModelVBOs pfnCreateModelVBOs;

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -118,7 +118,7 @@ patch_t *HWR_GetPic(lumpnum_t lumpnum);
GLMapTexture_t *HWR_GetTexture(INT32 tex); GLMapTexture_t *HWR_GetTexture(INT32 tex);
void HWR_GetLevelFlat(levelflat_t *levelflat); void HWR_GetLevelFlat(levelflat_t *levelflat);
void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum); void HWR_GetRawFlat(lumpnum_t flatlumpnum);
void HWR_FreeTexture(patch_t *patch); void HWR_FreeTexture(patch_t *patch);
void HWR_FreeTextureData(patch_t *patch); void HWR_FreeTextureData(patch_t *patch);

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -35,7 +35,7 @@
#define DL_HIGH_QUALITY #define DL_HIGH_QUALITY
//#define STATICLIGHT //Hurdler: TODO! //#define STATICLIGHT //Hurdler: TODO!
#define LIGHTMAPFLAGS (PF_Modulated|PF_AdditiveSource) #define LIGHTMAPFLAGS (PF_Modulated|PF_Additive)
#ifdef ALAM_LIGHTING #ifdef ALAM_LIGHTING
static dynlights_t view_dynlights[2]; // 2 players in splitscreen mode static dynlights_t view_dynlights[2]; // 2 players in splitscreen mode
@ -1056,7 +1056,7 @@ void HWR_DoCoronasLighting(FOutVector *outVerts, gl_vissprite_t *spr)
HWR_GetPic(coronalumpnum); /// \todo use different coronas HWR_GetPic(coronalumpnum); /// \todo use different coronas
HWD.pfnDrawPolygon (&Surf, light, 4, PF_Modulated | PF_AdditiveSource | PF_Corona | PF_NoDepthTest); HWD.pfnDrawPolygon (&Surf, light, 4, PF_Modulated | PF_Additive | PF_Corona | PF_NoDepthTest);
} }
} }
#endif #endif
@ -1144,7 +1144,7 @@ void HWR_DrawCoronas(void)
light[3].y = cy+size*1.33f; light[3].y = cy+size*1.33f;
light[3].s = 0.0f; light[3].t = 1.0f; light[3].s = 0.0f; light[3].t = 1.0f;
HWD.pfnDrawPolygon (&Surf, light, 4, PF_Modulated | PF_AdditiveSource | PF_NoDepthTest | PF_Corona); HWD.pfnDrawPolygon (&Surf, light, 4, PF_Modulated | PF_Additive | PF_NoDepthTest | PF_Corona);
} }
} }
#endif #endif

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -173,6 +173,11 @@ boolean gl_shadersavailable = true;
// Lighting // Lighting
// ========================================================================== // ==========================================================================
static boolean HWR_UseShader(void)
{
return (cv_glshaders.value && gl_shadersavailable);
}
void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *colormap) void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *colormap)
{ {
RGBA_t poly_color, tint_color, fade_color; RGBA_t poly_color, tint_color, fade_color;
@ -182,7 +187,7 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
fade_color.rgba = (colormap != NULL) ? (UINT32)colormap->fadergba : GL_DEFAULTFOG; fade_color.rgba = (colormap != NULL) ? (UINT32)colormap->fadergba : GL_DEFAULTFOG;
// Crappy backup coloring if you can't do shaders // Crappy backup coloring if you can't do shaders
if (!cv_glshaders.value || !gl_shadersavailable) if (!HWR_UseShader())
{ {
// be careful, this may get negative for high lightlevel values. // be careful, this may get negative for high lightlevel values.
float tint_alpha, fade_alpha; float tint_alpha, fade_alpha;
@ -371,7 +376,7 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
static FOutVector *planeVerts = NULL; static FOutVector *planeVerts = NULL;
static UINT16 numAllocedPlaneVerts = 0; static UINT16 numAllocedPlaneVerts = 0;
int shader; INT32 shader = SHADER_DEFAULT;
// no convex poly were generated for this subsector // no convex poly were generated for this subsector
if (!xsub->planepoly) if (!xsub->planepoly)
@ -568,12 +573,17 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
else else
PolyFlags |= PF_Masked|PF_Modulated; PolyFlags |= PF_Masked|PF_Modulated;
if (PolyFlags & PF_Fog) if (HWR_UseShader())
shader = SHADER_FOG; // fog shader {
else if (PolyFlags & PF_Ripple) if (PolyFlags & PF_Fog)
shader = SHADER_WATER; // water shader shader = SHADER_FOG;
else else if (PolyFlags & PF_Ripple)
shader = SHADER_FLOOR; // floor shader shader = SHADER_WATER;
else
shader = SHADER_FLOOR;
PolyFlags |= PF_ColorMapped;
}
HWR_ProcessPolygon(&Surf, planeVerts, nrPlaneVerts, PolyFlags, shader, false); HWR_ProcessPolygon(&Surf, planeVerts, nrPlaneVerts, PolyFlags, shader, false);
@ -706,6 +716,9 @@ FBITFIELD HWR_GetBlendModeFlag(INT32 ast)
{ {
switch (ast) switch (ast)
{ {
case AST_COPY:
case AST_OVERLAY:
return PF_Masked;
case AST_ADD: case AST_ADD:
return PF_Additive; return PF_Additive;
case AST_SUBTRACT: case AST_SUBTRACT:
@ -744,7 +757,7 @@ UINT8 HWR_GetTranstableAlpha(INT32 transtablenum)
FBITFIELD HWR_SurfaceBlend(INT32 style, INT32 transtablenum, FSurfaceInfo *pSurf) FBITFIELD HWR_SurfaceBlend(INT32 style, INT32 transtablenum, FSurfaceInfo *pSurf)
{ {
if (!transtablenum) if (!transtablenum || style == AST_COPY || style == AST_OVERLAY)
{ {
pSurf->PolyColor.s.alpha = 0xff; pSurf->PolyColor.s.alpha = 0xff;
return PF_Masked; return PF_Masked;
@ -785,8 +798,17 @@ static void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, I
// //
static void HWR_ProjectWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blendmode, INT32 lightlevel, extracolormap_t *wallcolormap) static void HWR_ProjectWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blendmode, INT32 lightlevel, extracolormap_t *wallcolormap)
{ {
INT32 shader = SHADER_DEFAULT;
HWR_Lighting(pSurf, lightlevel, wallcolormap); HWR_Lighting(pSurf, lightlevel, wallcolormap);
HWR_ProcessPolygon(pSurf, wallVerts, 4, blendmode|PF_Modulated|PF_Occlude, SHADER_WALL, false); // wall shader
if (HWR_UseShader())
{
shader = SHADER_WALL;
blendmode |= PF_ColorMapped;
}
HWR_ProcessPolygon(pSurf, wallVerts, 4, blendmode|PF_Modulated|PF_Occlude, shader, false);
} }
// ========================================================================== // ==========================================================================
@ -831,7 +853,7 @@ static float HWR_ClipViewSegment(INT32 x, polyvertex_t *v1, polyvertex_t *v2)
// //
// HWR_SplitWall // HWR_SplitWall
// //
static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfaceInfo* Surf, INT32 cutflag, ffloor_t *pfloor) static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfaceInfo* Surf, INT32 cutflag, ffloor_t *pfloor, FBITFIELD polyflags)
{ {
/* SoM: split up and light walls according to the /* SoM: split up and light walls according to the
lightlist. This may also include leaving out parts lightlist. This may also include leaving out parts
@ -969,11 +991,11 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
wallVerts[1].y = endbot; wallVerts[1].y = endbot;
if (cutflag & FF_FOG) if (cutflag & FF_FOG)
HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture, true, lightnum, colormap); HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture|polyflags, true, lightnum, colormap);
else if (cutflag & FF_TRANSLUCENT) else if (cutflag & FF_TRANSLUCENT)
HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Translucent, false, lightnum, colormap); HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Translucent|polyflags, false, lightnum, colormap);
else else
HWR_ProjectWall(wallVerts, Surf, PF_Masked, lightnum, colormap); HWR_ProjectWall(wallVerts, Surf, PF_Masked|polyflags, lightnum, colormap);
top = bot; top = bot;
endtop = endbot; endtop = endbot;
@ -998,11 +1020,11 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
wallVerts[1].y = endbot; wallVerts[1].y = endbot;
if (cutflag & FF_FOG) if (cutflag & FF_FOG)
HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture, true, lightnum, colormap); HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture|polyflags, true, lightnum, colormap);
else if (cutflag & FF_TRANSLUCENT) else if (cutflag & FF_TRANSLUCENT)
HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Translucent, false, lightnum, colormap); HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Translucent|polyflags, false, lightnum, colormap);
else else
HWR_ProjectWall(wallVerts, Surf, PF_Masked, lightnum, colormap); HWR_ProjectWall(wallVerts, Surf, PF_Masked|polyflags, lightnum, colormap);
} }
// HWR_DrawSkyWall // HWR_DrawSkyWall
@ -1183,7 +1205,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[1].y = FIXED_TO_FLOAT(worldhighslope); wallVerts[1].y = FIXED_TO_FLOAT(worldhighslope);
if (gl_frontsector->numlights) if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, gl_toptexture, &Surf, FF_CUTLEVEL, NULL); HWR_SplitWall(gl_frontsector, wallVerts, gl_toptexture, &Surf, FF_CUTLEVEL, NULL, 0);
else if (grTex->mipmap.flags & TF_TRANSPARENT) else if (grTex->mipmap.flags & TF_TRANSPARENT)
HWR_AddTransparentWall(wallVerts, &Surf, gl_toptexture, PF_Environment, false, lightnum, colormap); HWR_AddTransparentWall(wallVerts, &Surf, gl_toptexture, PF_Environment, false, lightnum, colormap);
else else
@ -1249,7 +1271,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope); wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope);
if (gl_frontsector->numlights) if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, gl_bottomtexture, &Surf, FF_CUTLEVEL, NULL); HWR_SplitWall(gl_frontsector, wallVerts, gl_bottomtexture, &Surf, FF_CUTLEVEL, NULL, 0);
else if (grTex->mipmap.flags & TF_TRANSPARENT) else if (grTex->mipmap.flags & TF_TRANSPARENT)
HWR_AddTransparentWall(wallVerts, &Surf, gl_bottomtexture, PF_Environment, false, lightnum, colormap); HWR_AddTransparentWall(wallVerts, &Surf, gl_bottomtexture, PF_Environment, false, lightnum, colormap);
else else
@ -1465,13 +1487,17 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
blendmode = HWR_TranstableToAlpha(gl_curline->polyseg->translucency, &Surf); blendmode = HWR_TranstableToAlpha(gl_curline->polyseg->translucency, &Surf);
} }
// Render midtextures on two-sided lines with a z-buffer offset.
// This will cause the midtexture appear on top, if a FOF overlaps with it.
blendmode |= PF_Decal;
if (gl_frontsector->numlights) if (gl_frontsector->numlights)
{ {
if (!(blendmode & PF_Masked)) if (!(blendmode & PF_Masked))
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_TRANSLUCENT, NULL); HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_TRANSLUCENT, NULL, PF_Decal);
else else
{ {
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL); HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL, PF_Decal);
} }
} }
else if (!(blendmode & PF_Masked)) else if (!(blendmode & PF_Masked))
@ -1554,7 +1580,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
// I don't think that solid walls can use translucent linedef types... // I don't think that solid walls can use translucent linedef types...
if (gl_frontsector->numlights) if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL); HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL, 0);
else else
{ {
if (grTex->mipmap.flags & TF_TRANSPARENT) if (grTex->mipmap.flags & TF_TRANSPARENT)
@ -1717,7 +1743,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap); Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
if (gl_frontsector->numlights) if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->flags, rover); HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->flags, rover, 0);
else else
HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap); HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap);
} }
@ -1732,7 +1758,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
} }
if (gl_frontsector->numlights) if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, rover->flags, rover); HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, rover->flags, rover, 0);
else else
{ {
if (blendmode != PF_Masked) if (blendmode != PF_Masked)
@ -1829,7 +1855,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap); Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
if (gl_backsector->numlights) if (gl_backsector->numlights)
HWR_SplitWall(gl_backsector, wallVerts, 0, &Surf, rover->flags, rover); HWR_SplitWall(gl_backsector, wallVerts, 0, &Surf, rover->flags, rover, 0);
else else
HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap); HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap);
} }
@ -1844,7 +1870,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
} }
if (gl_backsector->numlights) if (gl_backsector->numlights)
HWR_SplitWall(gl_backsector, wallVerts, texnum, &Surf, rover->flags, rover); HWR_SplitWall(gl_backsector, wallVerts, texnum, &Surf, rover->flags, rover, 0);
else else
{ {
if (blendmode != PF_Masked) if (blendmode != PF_Masked)
@ -2659,30 +2685,30 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling,
FBITFIELD blendmode, UINT8 lightlevel, levelflat_t *levelflat, sector_t *FOFsector, FBITFIELD blendmode, UINT8 lightlevel, levelflat_t *levelflat, sector_t *FOFsector,
UINT8 alpha, extracolormap_t *planecolormap) UINT8 alpha, extracolormap_t *planecolormap)
{ {
float height; //constant y for all points on the convex flat polygon FSurfaceInfo Surf;
FOutVector *v3d; FOutVector *v3d;
INT32 i; INT32 shader = SHADER_DEFAULT;
float flatxref,flatyref;
size_t nrPlaneVerts = polysector->numVertices;
INT32 i;
float height = FIXED_TO_FLOAT(fixedheight); // constant y for all points on the convex flat polygon
float flatxref, flatyref;
float fflatwidth = 64.0f, fflatheight = 64.0f; float fflatwidth = 64.0f, fflatheight = 64.0f;
INT32 flatflag = 63; INT32 flatflag = 63;
boolean texflat = false; boolean texflat = false;
float scrollx = 0.0f, scrolly = 0.0f; float scrollx = 0.0f, scrolly = 0.0f;
angle_t angle = 0; angle_t angle = 0;
FSurfaceInfo Surf;
fixed_t tempxs, tempyt; fixed_t tempxs, tempyt;
size_t nrPlaneVerts;
static FOutVector *planeVerts = NULL; static FOutVector *planeVerts = NULL;
static UINT16 numAllocedPlaneVerts = 0; static UINT16 numAllocedPlaneVerts = 0;
nrPlaneVerts = polysector->numVertices; if (nrPlaneVerts < 3) // Not even a triangle?
height = FIXED_TO_FLOAT(fixedheight);
if (nrPlaneVerts < 3) //not even a triangle ?
return; return;
else if (nrPlaneVerts > (size_t)UINT16_MAX) // FIXME: exceeds plVerts size
if (nrPlaneVerts > (size_t)UINT16_MAX) // FIXME: exceeds plVerts size
{ {
CONS_Debug(DBG_RENDER, "polygon size of %s exceeds max value of %d vertices\n", sizeu1(nrPlaneVerts), UINT16_MAX); CONS_Debug(DBG_RENDER, "polygon size of %s exceeds max value of %d vertices\n", sizeu1(nrPlaneVerts), UINT16_MAX);
return; return;
@ -2834,7 +2860,6 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling,
v3d->z = FIXED_TO_FLOAT(polysector->vertices[i]->y); v3d->z = FIXED_TO_FLOAT(polysector->vertices[i]->y);
} }
HWR_Lighting(&Surf, lightlevel, planecolormap); HWR_Lighting(&Surf, lightlevel, planecolormap);
if (blendmode & PF_Translucent) if (blendmode & PF_Translucent)
@ -2845,7 +2870,13 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling,
else else
blendmode |= PF_Masked|PF_Modulated; blendmode |= PF_Masked|PF_Modulated;
HWR_ProcessPolygon(&Surf, planeVerts, nrPlaneVerts, blendmode, SHADER_FLOOR, false); // floor shader if (HWR_UseShader())
{
shader = SHADER_FLOOR;
blendmode |= PF_ColorMapped;
}
HWR_ProcessPolygon(&Surf, planeVerts, nrPlaneVerts, blendmode, shader, false);
} }
static void HWR_AddPolyObjectPlanes(void) static void HWR_AddPolyObjectPlanes(void)
@ -3566,6 +3597,8 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
FSurfaceInfo sSurf; FSurfaceInfo sSurf;
float fscale; float fx; float fy; float offset; float fscale; float fx; float fy; float offset;
extracolormap_t *colormap = NULL; extracolormap_t *colormap = NULL;
FBITFIELD blendmode = PF_Translucent|PF_Modulated;
INT32 shader = SHADER_DEFAULT;
UINT8 i; UINT8 i;
SINT8 flip = P_MobjFlip(thing); SINT8 flip = P_MobjFlip(thing);
@ -3658,14 +3691,20 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
HWR_Lighting(&sSurf, 0, colormap); HWR_Lighting(&sSurf, 0, colormap);
sSurf.PolyColor.s.alpha = alpha; sSurf.PolyColor.s.alpha = alpha;
HWR_ProcessPolygon(&sSurf, shadowVerts, 4, PF_Translucent|PF_Modulated, SHADER_SPRITE, false); // sprite shader if (HWR_UseShader())
{
shader = SHADER_SPRITE;
blendmode |= PF_ColorMapped;
}
HWR_ProcessPolygon(&sSurf, shadowVerts, 4, blendmode, shader, false);
} }
// This is expecting a pointer to an array containing 4 wallVerts for a sprite // This is expecting a pointer to an array containing 4 wallVerts for a sprite
static void HWR_RotateSpritePolyToAim(gl_vissprite_t *spr, FOutVector *wallVerts, const boolean precip) static void HWR_RotateSpritePolyToAim(gl_vissprite_t *spr, FOutVector *wallVerts, const boolean precip)
{ {
if (cv_glspritebillboarding.value if (cv_glspritebillboarding.value
&& spr && spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE) && spr && spr->mobj && !R_ThingIsPaperSprite(spr->mobj)
&& wallVerts) && wallVerts)
{ {
float basey = FIXED_TO_FLOAT(spr->mobj->z); float basey = FIXED_TO_FLOAT(spr->mobj->z);
@ -3706,8 +3745,8 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
boolean lightset = true; boolean lightset = true;
FBITFIELD blend = 0; FBITFIELD blend = 0;
FBITFIELD occlusion; FBITFIELD occlusion;
INT32 shader = SHADER_DEFAULT;
boolean use_linkdraw_hack = false; boolean use_linkdraw_hack = false;
boolean splat = R_ThingIsFloorSprite(spr->mobj);
UINT8 alpha; UINT8 alpha;
INT32 i; INT32 i;
@ -3766,22 +3805,19 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
baseWallVerts[0].t = baseWallVerts[1].t = ((GLPatch_t *)gpatch->hardware)->max_t; baseWallVerts[0].t = baseWallVerts[1].t = ((GLPatch_t *)gpatch->hardware)->max_t;
} }
if (!splat) // if it has a dispoffset, push it a little towards the camera
{ if (spr->dispoffset) {
// if it has a dispoffset, push it a little towards the camera float co = -gl_viewcos*(0.05f*spr->dispoffset);
if (spr->dispoffset) { float si = -gl_viewsin*(0.05f*spr->dispoffset);
float co = -gl_viewcos*(0.05f*spr->dispoffset); baseWallVerts[0].z = baseWallVerts[3].z = baseWallVerts[0].z+si;
float si = -gl_viewsin*(0.05f*spr->dispoffset); baseWallVerts[1].z = baseWallVerts[2].z = baseWallVerts[1].z+si;
baseWallVerts[0].z = baseWallVerts[3].z = baseWallVerts[0].z+si; baseWallVerts[0].x = baseWallVerts[3].x = baseWallVerts[0].x+co;
baseWallVerts[1].z = baseWallVerts[2].z = baseWallVerts[1].z+si; baseWallVerts[1].x = baseWallVerts[2].x = baseWallVerts[1].x+co;
baseWallVerts[0].x = baseWallVerts[3].x = baseWallVerts[0].x+co;
baseWallVerts[1].x = baseWallVerts[2].x = baseWallVerts[1].x+co;
}
// Let dispoffset work first since this adjust each vertex
HWR_RotateSpritePolyToAim(spr, baseWallVerts, false);
} }
// Let dispoffset work first since this adjust each vertex
HWR_RotateSpritePolyToAim(spr, baseWallVerts, false);
realtop = top = baseWallVerts[3].y; realtop = top = baseWallVerts[3].y;
realbot = bot = baseWallVerts[0].y; realbot = bot = baseWallVerts[0].y;
ttop = baseWallVerts[3].t; ttop = baseWallVerts[3].t;
@ -3817,8 +3853,6 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
else if (spr->mobj->frame & FF_TRANSMASK) else if (spr->mobj->frame & FF_TRANSMASK)
{ {
INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT; INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
if (spr->mobj->blendmode == AST_TRANSLUCENT && trans >= NUMTRANSMAPS)
return;
blend = HWR_SurfaceBlend(spr->mobj->blendmode, trans, &Surf); blend = HWR_SurfaceBlend(spr->mobj->blendmode, trans, &Surf);
} }
else else
@ -3832,6 +3866,12 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
if (!occlusion) use_linkdraw_hack = true; if (!occlusion) use_linkdraw_hack = true;
} }
if (HWR_UseShader())
{
shader = SHADER_SPRITE;
blend |= PF_ColorMapped;
}
alpha = Surf.PolyColor.s.alpha; alpha = Surf.PolyColor.s.alpha;
// Start with the lightlevel and colormap from the top of the sprite // Start with the lightlevel and colormap from the top of the sprite
@ -3914,7 +3954,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
// The x and y only need to be adjusted in the case that it's not a papersprite // The x and y only need to be adjusted in the case that it's not a papersprite
if (cv_glspritebillboarding.value if (cv_glspritebillboarding.value
&& spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE)) && spr->mobj && !R_ThingIsPaperSprite(spr->mobj))
{ {
// Get the x and z of the vertices so billboarding draws correctly // Get the x and z of the vertices so billboarding draws correctly
realheight = realbot - realtop; realheight = realbot - realtop;
@ -3940,7 +3980,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
Surf.PolyColor.s.alpha = alpha; Surf.PolyColor.s.alpha = alpha;
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, SHADER_SPRITE, false); // sprite shader HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, shader, false);
if (use_linkdraw_hack) if (use_linkdraw_hack)
HWR_LinkDrawHackAdd(wallVerts, spr); HWR_LinkDrawHackAdd(wallVerts, spr);
@ -3969,7 +4009,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
Surf.PolyColor.s.alpha = alpha; Surf.PolyColor.s.alpha = alpha;
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, SHADER_SPRITE, false); // sprite shader HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, shader, false);
if (use_linkdraw_hack) if (use_linkdraw_hack)
HWR_LinkDrawHackAdd(wallVerts, spr); HWR_LinkDrawHackAdd(wallVerts, spr);
@ -3983,7 +4023,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
static void HWR_DrawSprite(gl_vissprite_t *spr) static void HWR_DrawSprite(gl_vissprite_t *spr)
{ {
FOutVector wallVerts[4]; FOutVector wallVerts[4];
patch_t *gpatch; // sprite patch converted to hardware patch_t *gpatch;
FSurfaceInfo Surf; FSurfaceInfo Surf;
const boolean splat = R_ThingIsFloorSprite(spr->mobj); const boolean splat = R_ThingIsFloorSprite(spr->mobj);
@ -4141,6 +4181,11 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
wallVerts[1].z = wallVerts[2].z = spr->z2; wallVerts[1].z = wallVerts[2].z = spr->z2;
} }
// cache the patch in the graphics card memory
//12/12/99: Hurdler: same comment as above (for md2)
//Hurdler: 25/04/2000: now support colormap in hardware mode
HWR_GetMappedPatch(gpatch, spr->colormap);
if (spr->flip) if (spr->flip)
{ {
wallVerts[0].s = wallVerts[3].s = ((GLPatch_t *)gpatch->hardware)->max_s; wallVerts[0].s = wallVerts[3].s = ((GLPatch_t *)gpatch->hardware)->max_s;
@ -4160,11 +4205,6 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
wallVerts[0].t = wallVerts[1].t = ((GLPatch_t *)gpatch->hardware)->max_t; wallVerts[0].t = wallVerts[1].t = ((GLPatch_t *)gpatch->hardware)->max_t;
} }
// cache the patch in the graphics card memory
//12/12/99: Hurdler: same comment as above (for md2)
//Hurdler: 25/04/2000: now support colormap in hardware mode
HWR_GetMappedPatch(gpatch, spr->colormap);
if (!splat) if (!splat)
{ {
// if it has a dispoffset, push it a little towards the camera // if it has a dispoffset, push it a little towards the camera
@ -4219,6 +4259,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
} }
{ {
INT32 shader = SHADER_DEFAULT;
FBITFIELD blend = 0; FBITFIELD blend = 0;
FBITFIELD occlusion; FBITFIELD occlusion;
boolean use_linkdraw_hack = false; boolean use_linkdraw_hack = false;
@ -4244,8 +4285,6 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
else if (spr->mobj->frame & FF_TRANSMASK) else if (spr->mobj->frame & FF_TRANSMASK)
{ {
INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT; INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
if (spr->mobj->blendmode == AST_TRANSLUCENT && trans >= NUMTRANSMAPS)
return;
blend = HWR_SurfaceBlend(spr->mobj->blendmode, trans, &Surf); blend = HWR_SurfaceBlend(spr->mobj->blendmode, trans, &Surf);
} }
else else
@ -4271,7 +4310,13 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
if (!occlusion) use_linkdraw_hack = true; if (!occlusion) use_linkdraw_hack = true;
} }
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, SHADER_SPRITE, false); // sprite shader if (HWR_UseShader())
{
shader = SHADER_SPRITE;
blend |= PF_ColorMapped;
}
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, shader, false);
if (use_linkdraw_hack) if (use_linkdraw_hack)
HWR_LinkDrawHackAdd(wallVerts, spr); HWR_LinkDrawHackAdd(wallVerts, spr);
@ -4282,9 +4327,10 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
// Sprite drawer for precipitation // Sprite drawer for precipitation
static inline void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr) static inline void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
{ {
INT32 shader = SHADER_DEFAULT;
FBITFIELD blend = 0; FBITFIELD blend = 0;
FOutVector wallVerts[4]; FOutVector wallVerts[4];
patch_t *gpatch; // sprite patch converted to hardware patch_t *gpatch;
FSurfaceInfo Surf; FSurfaceInfo Surf;
if (!spr->mobj) if (!spr->mobj)
@ -4337,7 +4383,7 @@ static inline void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
// Always use the light at the top instead of whatever I was doing before // Always use the light at the top instead of whatever I was doing before
INT32 light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); INT32 light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false);
if (!(spr->mobj->frame & FF_FULLBRIGHT)) if (!R_ThingIsFullBright(spr->mobj))
lightlevel = *sector->lightlist[light].lightlevel > 255 ? 255 : *sector->lightlist[light].lightlevel; lightlevel = *sector->lightlist[light].lightlevel > 255 ? 255 : *sector->lightlist[light].lightlevel;
if (*sector->lightlist[light].extra_colormap) if (*sector->lightlist[light].extra_colormap)
@ -4345,7 +4391,7 @@ static inline void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
} }
else else
{ {
if (!(spr->mobj->frame & FF_FULLBRIGHT)) if (!R_ThingIsFullBright(spr->mobj))
lightlevel = sector->lightlevel > 255 ? 255 : sector->lightlevel; lightlevel = sector->lightlevel > 255 ? 255 : sector->lightlevel;
if (sector->extra_colormap) if (sector->extra_colormap)
@ -4358,9 +4404,7 @@ static inline void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
if (spr->mobj->frame & FF_TRANSMASK) if (spr->mobj->frame & FF_TRANSMASK)
{ {
INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT; INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
if (spr->mobj->blendmode == AST_TRANSLUCENT && trans >= NUMTRANSMAPS) blend = HWR_SurfaceBlend(AST_TRANSLUCENT, trans, &Surf);
return;
blend = HWR_SurfaceBlend(spr->mobj->blendmode, trans, &Surf);
} }
else else
{ {
@ -4372,7 +4416,13 @@ static inline void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
blend = HWR_GetBlendModeFlag(spr->mobj->blendmode)|PF_Occlude; blend = HWR_GetBlendModeFlag(spr->mobj->blendmode)|PF_Occlude;
} }
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, SHADER_SPRITE, false); // sprite shader if (HWR_UseShader())
{
shader = SHADER_SPRITE;
blend |= PF_ColorMapped;
}
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, shader, false);
} }
#endif #endif
@ -4921,8 +4971,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
angle_t ang; angle_t ang;
INT32 heightsec, phs; INT32 heightsec, phs;
const boolean papersprite = R_ThingIsPaperSprite(thing);
const boolean splat = R_ThingIsFloorSprite(thing); const boolean splat = R_ThingIsFloorSprite(thing);
const boolean papersprite = (R_ThingIsPaperSprite(thing) && !splat);
angle_t mobjangle = (thing->player ? thing->player->drawangle : thing->angle); angle_t mobjangle = (thing->player ? thing->player->drawangle : thing->angle);
float z1, z2; float z1, z2;
@ -4939,6 +4989,13 @@ static void HWR_ProjectSprite(mobj_t *thing)
if (thing->spritexscale < 1 || thing->spriteyscale < 1) if (thing->spritexscale < 1 || thing->spriteyscale < 1)
return; return;
// Visibility check by the blend mode.
if (thing->frame & FF_TRANSMASK)
{
if (!R_BlendLevelVisible(thing->blendmode, (thing->frame & FF_TRANSMASK)>>FF_TRANSSHIFT))
return;
}
dispoffset = thing->info->dispoffset; dispoffset = thing->info->dispoffset;
this_scale = FIXED_TO_FLOAT(thing->scale); this_scale = FIXED_TO_FLOAT(thing->scale);
@ -5328,6 +5385,13 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
unsigned rot = 0; unsigned rot = 0;
UINT8 flip; UINT8 flip;
// Visibility check by the blend mode.
if (thing->frame & FF_TRANSMASK)
{
if (!R_BlendLevelVisible(thing->blendmode, (thing->frame & FF_TRANSMASK)>>FF_TRANSSHIFT))
return;
}
// transform the origin point // transform the origin point
tr_x = FIXED_TO_FLOAT(thing->x) - gl_viewx; tr_x = FIXED_TO_FLOAT(thing->x) - gl_viewx;
tr_y = FIXED_TO_FLOAT(thing->y) - gl_viewy; tr_y = FIXED_TO_FLOAT(thing->y) - gl_viewy;
@ -5361,7 +5425,7 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
return; return;
#endif #endif
sprframe = &sprdef->spriteframes[ thing->frame & FF_FRAMEMASK]; sprframe = &sprdef->spriteframes[thing->frame & FF_FRAMEMASK];
// use single rotation for all views // use single rotation for all views
lumpoff = sprframe->lumpid[0]; lumpoff = sprframe->lumpid[0];
@ -5654,7 +5718,7 @@ static void HWR_DrawSkyBackground(player_t *player)
dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->width/256.0f); dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->width/256.0f);
v[0].s = v[3].s = (-1.0f * angle) / ((ANGLE_90-1)*dimensionmultiply); // left v[0].s = v[3].s = (-1.0f * angle) / (((float)ANGLE_90-1.0f)*dimensionmultiply); // left
v[2].s = v[1].s = v[0].s + (1.0f/dimensionmultiply); // right (or left + 1.0f) v[2].s = v[1].s = v[0].s + (1.0f/dimensionmultiply); // right (or left + 1.0f)
// use +angle and -1.0f above instead if you wanted old backwards behavior // use +angle and -1.0f above instead if you wanted old backwards behavior
@ -6457,24 +6521,29 @@ void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend,
FBITFIELD blendmode = blend; FBITFIELD blendmode = blend;
UINT8 alpha = pSurf->PolyColor.s.alpha; // retain the alpha UINT8 alpha = pSurf->PolyColor.s.alpha; // retain the alpha
int shader; INT32 shader = SHADER_DEFAULT;
// Lighting is done here instead so that fog isn't drawn incorrectly on transparent walls after sorting // Lighting is done here instead so that fog isn't drawn incorrectly on transparent walls after sorting
HWR_Lighting(pSurf, lightlevel, wallcolormap); HWR_Lighting(pSurf, lightlevel, wallcolormap);
pSurf->PolyColor.s.alpha = alpha; // put the alpha back after lighting pSurf->PolyColor.s.alpha = alpha; // put the alpha back after lighting
shader = SHADER_WALL; // wall shader
if (blend & PF_Environment) if (blend & PF_Environment)
blendmode |= PF_Occlude; // PF_Occlude must be used for solid objects blendmode |= PF_Occlude; // PF_Occlude must be used for solid objects
if (fogwall) if (HWR_UseShader())
{ {
blendmode |= PF_Fog; if (fogwall)
shader = SHADER_FOG; // fog shader shader = SHADER_FOG;
else
shader = SHADER_WALL;
blendmode |= PF_ColorMapped;
} }
if (fogwall)
blendmode |= PF_Fog;
blendmode |= PF_Modulated; // No PF_Occlude means overlapping (incorrect) transparency blendmode |= PF_Modulated; // No PF_Occlude means overlapping (incorrect) transparency
HWR_ProcessPolygon(pSurf, wallVerts, 4, blendmode, shader, false); HWR_ProcessPolygon(pSurf, wallVerts, 4, blendmode, shader, false);
} }
@ -6517,7 +6586,7 @@ void HWR_DoPostProcessor(player_t *player)
Surf.PolyColor.s.alpha = 0xc0; // match software mode Surf.PolyColor.s.alpha = 0xc0; // match software mode
HWD.pfnDrawPolygon(&Surf, v, 4, PF_Modulated|PF_AdditiveSource|PF_NoTexture|PF_NoDepthTest); HWD.pfnDrawPolygon(&Surf, v, 4, PF_Modulated|PF_Additive|PF_NoTexture|PF_NoDepthTest);
} }
// Capture the screen for intermission and screen waving // Capture the screen for intermission and screen waving
@ -6650,7 +6719,6 @@ void HWR_DrawScreenFinalTexture(int width, int height)
HWD.pfnDrawScreenFinalTexture(width, height); HWD.pfnDrawScreenFinalTexture(width, height);
} }
// jimita 18032019
static inline UINT16 HWR_FindShaderDefs(UINT16 wadnum) static inline UINT16 HWR_FindShaderDefs(UINT16 wadnum)
{ {
UINT16 i; UINT16 i;

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -158,7 +158,7 @@ static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
jmp_buf jmpbuf; jmp_buf jmpbuf;
#endif #endif
#endif #endif
png_FILE_p png_FILE; volatile png_FILE_p png_FILE;
//Filename checking fixed ~Monster Iestyn and Golden //Filename checking fixed ~Monster Iestyn and Golden
char *pngfilename = va("%s"PATHSEP"models"PATHSEP"%s", srb2home, filename); char *pngfilename = va("%s"PATHSEP"models"PATHSEP"%s", srb2home, filename);
@ -1314,7 +1314,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
if (!(spr->mobj->frame & FF_FULLBRIGHT)) if (!R_ThingIsFullBright(spr->mobj))
lightlevel = *sector->lightlist[light].lightlevel > 255 ? 255 : *sector->lightlist[light].lightlevel; lightlevel = *sector->lightlist[light].lightlevel > 255 ? 255 : *sector->lightlist[light].lightlevel;
if (*sector->lightlist[light].extra_colormap) if (*sector->lightlist[light].extra_colormap)
@ -1322,7 +1322,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
} }
else else
{ {
if (!(spr->mobj->frame & FF_FULLBRIGHT)) if (!R_ThingIsFullBright(spr->mobj))
lightlevel = sector->lightlevel > 255 ? 255 : sector->lightlevel; lightlevel = sector->lightlevel > 255 ? 255 : sector->lightlevel;
if (sector->extra_colormap) if (sector->extra_colormap)
@ -1340,10 +1340,9 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL; GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL;
INT32 durs = spr->mobj->state->tics; INT32 durs = spr->mobj->state->tics;
INT32 tics = spr->mobj->tics; INT32 tics = spr->mobj->tics;
//mdlframe_t *next = NULL; const boolean papersprite = (R_ThingIsPaperSprite(spr->mobj) && !R_ThingIsFloorSprite(spr->mobj));
const boolean papersprite = (spr->mobj->frame & FF_PAPERSPRITE); const UINT8 flip = (UINT8)(!(spr->mobj->eflags & MFE_VERTICALFLIP) != !R_ThingVerticallyFlipped(spr->mobj));
const UINT8 flip = (UINT8)(!(spr->mobj->eflags & MFE_VERTICALFLIP) != !(spr->mobj->frame & FF_VERTICALFLIP)); const UINT8 hflip = (UINT8)(!(spr->mobj->mirrored) != !R_ThingHorizontallyFlipped(spr->mobj));
const UINT8 hflip = (UINT8)(!(spr->mobj->mirrored) != !(spr->mobj->frame & FF_HORIZONTALFLIP));
spritedef_t *sprdef; spritedef_t *sprdef;
spriteframe_t *sprframe; spriteframe_t *sprframe;
spriteinfo_t *sprinfo; spriteinfo_t *sprinfo;
@ -1406,6 +1405,11 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|| ((!hwrBlendPatch->mipmap->format || !hwrBlendPatch->mipmap->downloaded) && !md2->noblendfile))) || ((!hwrBlendPatch->mipmap->format || !hwrBlendPatch->mipmap->downloaded) && !md2->noblendfile)))
md2_loadBlendTexture(md2); md2_loadBlendTexture(md2);
// Load it again, because it isn't being loaded into blendgpatch after md2_loadblendtexture...
blendgpatch = md2->blendgrpatch;
if (blendgpatch)
hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware);
if (md2->error) if (md2->error)
return false; // we already failed loading this before :( return false; // we already failed loading this before :(
if (!md2->model) if (!md2->model)

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2020 by Sonic Team Junior. // Copyright (C) 1998-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -58,8 +58,9 @@ static GLuint tex_downloaded = 0;
static GLfloat fov = 90.0f; static GLfloat fov = 90.0f;
static FBITFIELD CurrentPolyFlags; static FBITFIELD CurrentPolyFlags;
static FTextureInfo *gl_cachetail = NULL; // Linked list of all textures.
static FTextureInfo *gl_cachehead = NULL; static FTextureInfo *TexCacheTail = NULL;
static FTextureInfo *TexCacheHead = NULL;
RGBA_t myPaletteData[256]; RGBA_t myPaletteData[256];
GLint screen_width = 0; // used by Draw2DLine() GLint screen_width = 0; // used by Draw2DLine()
@ -909,7 +910,6 @@ void SetupGLFunc4(void)
pgluBuild2DMipmaps = GetGLFunc("gluBuild2DMipmaps"); pgluBuild2DMipmaps = GetGLFunc("gluBuild2DMipmaps");
} }
// jimita
EXPORT boolean HWRAPI(CompileShaders) (void) EXPORT boolean HWRAPI(CompileShaders) (void)
{ {
#ifdef GL_SHADERS #ifdef GL_SHADERS
@ -961,8 +961,6 @@ EXPORT boolean HWRAPI(CompileShaders) (void)
} }
} }
SetShader(SHADER_DEFAULT);
return true; return true;
#else #else
return false; return false;
@ -1287,10 +1285,34 @@ void SetStates(void)
// -----------------+ // -----------------+
// DeleteTexture : Deletes a texture from the GPU and frees its data // DeleteTexture : Deletes a texture from the GPU and frees its data
// -----------------+ // -----------------+
EXPORT void HWRAPI(DeleteTexture) (FTextureInfo *pTexInfo) EXPORT void HWRAPI(DeleteTexture) (GLMipmap_t *pTexInfo)
{ {
if (pTexInfo->downloaded) FTextureInfo *head = TexCacheHead;
if (!pTexInfo)
return;
else if (pTexInfo->downloaded)
pglDeleteTextures(1, (GLuint *)&pTexInfo->downloaded); pglDeleteTextures(1, (GLuint *)&pTexInfo->downloaded);
while (head)
{
if (head->downloaded == pTexInfo->downloaded)
{
if (head->next)
head->next->prev = head->prev;
else // no next -> tail is being deleted -> update TexCacheTail
TexCacheTail = head->prev;
if (head->prev)
head->prev->next = head->next;
else // no prev -> head is being deleted -> update TexCacheHead
TexCacheHead = head->next;
free(head);
break;
}
head = head->next;
}
pTexInfo->downloaded = 0; pTexInfo->downloaded = 0;
} }
@ -1303,26 +1325,29 @@ void Flush(void)
{ {
//GL_DBG_Printf ("HWR_Flush()\n"); //GL_DBG_Printf ("HWR_Flush()\n");
while (gl_cachehead) while (TexCacheHead)
{ {
DeleteTexture(gl_cachehead); FTextureInfo *pTexInfo = TexCacheHead;
gl_cachehead = gl_cachehead->nextmipmap; GLMipmap_t *texture = pTexInfo->texture;
if (pTexInfo->downloaded)
{
pglDeleteTextures(1, (GLuint *)&pTexInfo->downloaded);
pTexInfo->downloaded = 0;
}
if (texture)
texture->downloaded = 0;
TexCacheHead = pTexInfo->next;
free(pTexInfo);
} }
ClearCacheList(); //Hurdler: well, gl_cachehead is already NULL TexCacheTail = TexCacheHead = NULL; //Hurdler: well, TexCacheHead is already NULL
tex_downloaded = 0; tex_downloaded = 0;
} }
// -----------------+
// ClearCacheList : Clears the texture cache tail and head
// -----------------+
EXPORT void HWRAPI(ClearCacheList) (void)
{
gl_cachetail = gl_cachehead = NULL;
}
// -----------------+ // -----------------+
// isExtAvailable : Look if an OpenGL extension is available // isExtAvailable : Look if an OpenGL extension is available
// Returns : true if extension available // Returns : true if extension available
@ -1554,12 +1579,11 @@ static void SetBlendMode(FBITFIELD flags)
case PF_Additive & PF_Blending: case PF_Additive & PF_Blending:
case PF_Subtractive & PF_Blending: case PF_Subtractive & PF_Blending:
case PF_ReverseSubtract & PF_Blending: case PF_ReverseSubtract & PF_Blending:
pglBlendFunc(GL_SRC_ALPHA, GL_ONE); // src * alpha + dest
break;
case PF_Environment & PF_Blending: case PF_Environment & PF_Blending:
pglBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); pglBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
break; break;
case PF_AdditiveSource & PF_Blending:
pglBlendFunc(GL_SRC_ALPHA, GL_ONE); // src * alpha + dest
break;
case PF_Multiplicative & PF_Blending: case PF_Multiplicative & PF_Blending:
pglBlendFunc(GL_DST_COLOR, GL_ZERO); pglBlendFunc(GL_DST_COLOR, GL_ZERO);
break; break;
@ -1598,7 +1622,6 @@ static void SetBlendMode(FBITFIELD flags)
break; break;
case PF_Translucent & PF_Blending: case PF_Translucent & PF_Blending:
case PF_Additive & PF_Blending: case PF_Additive & PF_Blending:
case PF_AdditiveSource & PF_Blending:
case PF_Subtractive & PF_Blending: case PF_Subtractive & PF_Blending:
case PF_ReverseSubtract & PF_Blending: case PF_ReverseSubtract & PF_Blending:
case PF_Environment & PF_Blending: case PF_Environment & PF_Blending:
@ -1718,7 +1741,7 @@ EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags)
// -----------------+ // -----------------+
// UpdateTexture : Updates the texture data. // UpdateTexture : Updates the texture data.
// -----------------+ // -----------------+
EXPORT void HWRAPI(UpdateTexture) (FTextureInfo *pTexInfo) EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *pTexInfo)
{ {
// Download a mipmap // Download a mipmap
boolean updatemipmap = true; boolean updatemipmap = true;
@ -1920,7 +1943,7 @@ EXPORT void HWRAPI(UpdateTexture) (FTextureInfo *pTexInfo)
// -----------------+ // -----------------+
// SetTexture : The mipmap becomes the current texture source // SetTexture : The mipmap becomes the current texture source
// -----------------+ // -----------------+
EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo) EXPORT void HWRAPI(SetTexture) (GLMipmap_t *pTexInfo)
{ {
if (!pTexInfo) if (!pTexInfo)
{ {
@ -1937,17 +1960,25 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
} }
else else
{ {
FTextureInfo *newTex = calloc(1, sizeof (*newTex));
UpdateTexture(pTexInfo); UpdateTexture(pTexInfo);
pTexInfo->nextmipmap = NULL;
newTex->texture = pTexInfo;
newTex->downloaded = (UINT32)pTexInfo->downloaded;
newTex->width = (UINT32)pTexInfo->width;
newTex->height = (UINT32)pTexInfo->height;
newTex->format = (UINT32)pTexInfo->format;
// insertion at the tail // insertion at the tail
if (gl_cachetail) if (TexCacheTail)
{ {
gl_cachetail->nextmipmap = pTexInfo; newTex->prev = TexCacheTail;
gl_cachetail = pTexInfo; TexCacheTail->next = newTex;
TexCacheTail = newTex;
} }
else // initialization of the linked list else // initialization of the linked list
gl_cachetail = gl_cachehead = pTexInfo; TexCacheTail = TexCacheHead = newTex;
} }
} }
@ -2144,32 +2175,34 @@ static void PreparePolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FBITFIELD
SetBlend(PolyFlags); //TODO: inline (#pragma..) SetBlend(PolyFlags); //TODO: inline (#pragma..)
// PolyColor
if (pSurf) if (pSurf)
{ {
// If Modulated, mix the surface colour to the texture // If modulated, mix the surface colour to the texture
if (CurrentPolyFlags & PF_Modulated) if (CurrentPolyFlags & PF_Modulated)
{
// Poly color
poly.red = byte2float[pSurf->PolyColor.s.red];
poly.green = byte2float[pSurf->PolyColor.s.green];
poly.blue = byte2float[pSurf->PolyColor.s.blue];
poly.alpha = byte2float[pSurf->PolyColor.s.alpha];
pglColor4ubv((GLubyte*)&pSurf->PolyColor.s); pglColor4ubv((GLubyte*)&pSurf->PolyColor.s);
// If the surface is either modulated or colormapped, or both
if (CurrentPolyFlags & (PF_Modulated | PF_ColorMapped))
{
poly.red = byte2float[pSurf->PolyColor.s.red];
poly.green = byte2float[pSurf->PolyColor.s.green];
poly.blue = byte2float[pSurf->PolyColor.s.blue];
poly.alpha = byte2float[pSurf->PolyColor.s.alpha];
} }
// Tint color // Only if the surface is colormapped
tint.red = byte2float[pSurf->TintColor.s.red]; if (CurrentPolyFlags & PF_ColorMapped)
tint.green = byte2float[pSurf->TintColor.s.green]; {
tint.blue = byte2float[pSurf->TintColor.s.blue]; tint.red = byte2float[pSurf->TintColor.s.red];
tint.alpha = byte2float[pSurf->TintColor.s.alpha]; tint.green = byte2float[pSurf->TintColor.s.green];
tint.blue = byte2float[pSurf->TintColor.s.blue];
tint.alpha = byte2float[pSurf->TintColor.s.alpha];
// Fade color fade.red = byte2float[pSurf->FadeColor.s.red];
fade.red = byte2float[pSurf->FadeColor.s.red]; fade.green = byte2float[pSurf->FadeColor.s.green];
fade.green = byte2float[pSurf->FadeColor.s.green]; fade.blue = byte2float[pSurf->FadeColor.s.blue];
fade.blue = byte2float[pSurf->FadeColor.s.blue]; fade.alpha = byte2float[pSurf->FadeColor.s.alpha];
fade.alpha = byte2float[pSurf->FadeColor.s.alpha]; }
} }
// this test is added for new coronas' code (without depth buffer) // this test is added for new coronas' code (without depth buffer)
@ -2722,7 +2755,7 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
fade.alpha = byte2float[Surface->FadeColor.s.alpha]; fade.alpha = byte2float[Surface->FadeColor.s.alpha];
flags = (Surface->PolyFlags | PF_Modulated); flags = (Surface->PolyFlags | PF_Modulated);
if (Surface->PolyFlags & (PF_Additive|PF_AdditiveSource|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative)) if (Surface->PolyFlags & (PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative))
flags |= PF_Occlude; flags |= PF_Occlude;
else if (Surface->PolyColor.s.alpha == 0xFF) else if (Surface->PolyColor.s.alpha == 0xFF)
flags |= (PF_Occlude | PF_Masked); flags |= (PF_Occlude | PF_Masked);
@ -2983,7 +3016,6 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
pglMatrixMode(GL_PROJECTION); pglMatrixMode(GL_PROJECTION);
pglLoadIdentity(); pglLoadIdentity();
// jimita 14042019
// Simulate Software's y-shearing // Simulate Software's y-shearing
// https://zdoom.org/wiki/Y-shearing // https://zdoom.org/wiki/Y-shearing
if (shearing) if (shearing)
@ -3011,7 +3043,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
EXPORT INT32 HWRAPI(GetTextureUsed) (void) EXPORT INT32 HWRAPI(GetTextureUsed) (void)
{ {
FTextureInfo *tmp = gl_cachehead; FTextureInfo *tmp = TexCacheHead;
INT32 res = 0; INT32 res = 0;
while (tmp) while (tmp)
@ -3028,7 +3060,7 @@ EXPORT INT32 HWRAPI(GetTextureUsed) (void)
// Add it up! // Add it up!
res += tmp->height*tmp->width*bpp; res += tmp->height*tmp->width*bpp;
tmp = tmp->nextmipmap; tmp = tmp->next;
} }
return res; return res;

View file

@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2020 by James R. // Copyright (C) 2020-2021 by James R.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -98,6 +98,7 @@ patch_t *emeraldpics[3][8]; // 0 = normal, 1 = tiny, 2 = coinbox
static patch_t *emblemicon; static patch_t *emblemicon;
patch_t *tokenicon; patch_t *tokenicon;
static patch_t *exiticon; static patch_t *exiticon;
static patch_t *nopingicon;
//------------------------------------------- //-------------------------------------------
// misc vars // misc vars
@ -286,6 +287,7 @@ void HU_LoadGraphics(void)
emblemicon = W_CachePatchName("EMBLICON", PU_HUDGFX); emblemicon = W_CachePatchName("EMBLICON", PU_HUDGFX);
tokenicon = W_CachePatchName("TOKNICON", PU_HUDGFX); tokenicon = W_CachePatchName("TOKNICON", PU_HUDGFX);
exiticon = W_CachePatchName("EXITICON", PU_HUDGFX); exiticon = W_CachePatchName("EXITICON", PU_HUDGFX);
nopingicon = W_CachePatchName("NOPINGICON", PU_HUDGFX);
emeraldpics[0][0] = W_CachePatchName("CHAOS1", PU_HUDGFX); emeraldpics[0][0] = W_CachePatchName("CHAOS1", PU_HUDGFX);
emeraldpics[0][1] = W_CachePatchName("CHAOS2", PU_HUDGFX); emeraldpics[0][1] = W_CachePatchName("CHAOS2", PU_HUDGFX);
@ -2246,8 +2248,8 @@ void HU_Erase(void)
// //
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext, INT32 flags) void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext, INT32 flags)
{ {
UINT8 numbars = 1; // how many ping bars do we draw? UINT8 numbars = 0; // how many ping bars do we draw?
UINT8 barcolor = 35; // color we use for the bars (green, yellow or red) UINT8 barcolor = 31; // color we use for the bars (green, yellow, red or black)
SINT8 i = 0; SINT8 i = 0;
SINT8 yoffset = 6; SINT8 yoffset = 6;
INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping),
@ -2260,11 +2262,16 @@ void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext, INT32 flags)
} }
else if (ping < 256) else if (ping < 256)
{ {
numbars = 2; // Apparently ternaries w/ multiple statements don't look good in C so I decided against it. numbars = 2;
barcolor = 73; barcolor = 73;
} }
else if (ping < UINT32_MAX)
{
numbars = 1;
barcolor = 35;
}
if (!notext || vid.width >= 640) // how sad, we're using a shit resolution. if (ping < UINT32_MAX && (!notext || vid.width >= 640)) // how sad, we're using a shit resolution.
V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE|flags, va("%dms", ping)); V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE|flags, va("%dms", ping));
for (i=0; (i<3); i++) // Draw the ping bar for (i=0; (i<3); i++) // Draw the ping bar
@ -2275,6 +2282,9 @@ void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext, INT32 flags)
yoffset -= 2; yoffset -= 2;
} }
if (ping == UINT32_MAX)
V_DrawSmallScaledPatch(x + 4 - nopingicon->width/2, y + 9 - nopingicon->height/2, 0, nopingicon);
} }
// //
@ -2301,16 +2311,17 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
if (!splitscreen) // don't draw it on splitscreen, if (!splitscreen) // don't draw it on splitscreen,
{ {
if (!(tab[i].num == serverplayer || players[tab[i].num].quittime)) if (tab[i].num != serverplayer)
HU_drawPing(x+ 253, y, playerpingtable[tab[i].num], false, 0); HU_drawPing(x + 253, y, players[tab[i].num].quittime ? UINT32_MAX : playerpingtable[tab[i].num], false, 0);
//else //else
// V_DrawSmallString(x+ 246, y+4, V_YELLOWMAP, "SERVER"); // V_DrawSmallString(x+ 246, y+4, V_YELLOWMAP, "SERVER");
} }
V_DrawString(x + 20, y, if (!players[tab[i].num].quittime || (leveltime / (TICRATE/2) & 1))
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0) V_DrawString(x + 20, y,
| (greycheck ? V_60TRANS : 0) ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| V_ALLOWLOWERCASE, tab[i].name); | (greycheck ? V_60TRANS : 0)
| V_ALLOWLOWERCASE, tab[i].name);
// Draw emeralds // Draw emeralds
if (players[tab[i].num].powers[pw_invulnerability] && (players[tab[i].num].powers[pw_invulnerability] == players[tab[i].num].powers[pw_sneakers]) && ((leveltime/7) & 1)) if (players[tab[i].num].powers[pw_invulnerability] && (players[tab[i].num].powers[pw_invulnerability] == players[tab[i].num].powers[pw_sneakers]) && ((leveltime/7) & 1))
@ -2458,10 +2469,11 @@ static void HU_Draw32TeamTabRankings(playersort_t *tab, INT32 whiteplayer)
supercheck = supercheckdef; supercheck = supercheckdef;
strlcpy(name, tab[i].name, 8); strlcpy(name, tab[i].name, 8);
V_DrawString(x + 10, y, if (!players[tab[i].num].quittime || (leveltime / (TICRATE/2) & 1))
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0) V_DrawString(x + 10, y,
| (greycheck ? 0 : V_TRANSLUCENT) ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| V_ALLOWLOWERCASE, name); | (greycheck ? 0 : V_TRANSLUCENT)
| V_ALLOWLOWERCASE, name);
if (gametyperules & GTR_TEAMFLAGS) if (gametyperules & GTR_TEAMFLAGS)
{ {
@ -2500,10 +2512,10 @@ static void HU_Draw32TeamTabRankings(playersort_t *tab, INT32 whiteplayer)
V_DrawRightAlignedThinString(x+128, y, ((players[tab[i].num].spectator || players[tab[i].num].playerstate == PST_DEAD) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); V_DrawRightAlignedThinString(x+128, y, ((players[tab[i].num].spectator || players[tab[i].num].playerstate == PST_DEAD) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
if (!splitscreen) if (!splitscreen)
{ {
if (!(tab[i].num == serverplayer || players[tab[i].num].quittime)) if (tab[i].num != serverplayer)
HU_drawPing(x+ 135, y+1, playerpingtable[tab[i].num], true, 0); HU_drawPing(x + 135, y+1, players[tab[i].num].quittime ? UINT32_MAX : playerpingtable[tab[i].num], true, 0);
//else //else
//V_DrawSmallString(x+ 129, y+4, V_YELLOWMAP, "HOST"); //V_DrawSmallString(x+ 129, y+4, V_YELLOWMAP, "HOST");
} }
} }
} }
@ -2586,10 +2598,11 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
supercheck = supercheckdef; supercheck = supercheckdef;
strlcpy(name, tab[i].name, 7); strlcpy(name, tab[i].name, 7);
V_DrawString(x + 20, y, if (!players[tab[i].num].quittime || (leveltime / (TICRATE/2) & 1))
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0) V_DrawString(x + 20, y,
| (greycheck ? V_TRANSLUCENT : 0) ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| V_ALLOWLOWERCASE, name); | (greycheck ? V_TRANSLUCENT : 0)
| V_ALLOWLOWERCASE, name);
if (gametyperules & GTR_TEAMFLAGS) if (gametyperules & GTR_TEAMFLAGS)
{ {
@ -2624,10 +2637,10 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
V_DrawRightAlignedThinString(x+100, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count)); V_DrawRightAlignedThinString(x+100, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
if (!splitscreen) if (!splitscreen)
{ {
if (!(tab[i].num == serverplayer || players[tab[i].num].quittime)) if (tab[i].num != serverplayer)
HU_drawPing(x+ 113, y, playerpingtable[tab[i].num], false, 0); HU_drawPing(x+ 113, y, players[tab[i].num].quittime ? UINT32_MAX : playerpingtable[tab[i].num], false, 0);
//else //else
// V_DrawSmallString(x+ 94, y+4, V_YELLOWMAP, "SERVER"); // V_DrawSmallString(x+ 94, y+4, V_YELLOWMAP, "SERVER");
} }
} }
} }
@ -2655,15 +2668,16 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
supercheck = supercheckdef; supercheck = supercheckdef;
strlcpy(name, tab[i].name, 7); strlcpy(name, tab[i].name, 7);
if (!(tab[i].num == serverplayer || players[tab[i].num].quittime)) if (tab[i].num != serverplayer)
HU_drawPing(x+ 113, y, playerpingtable[tab[i].num], false, 0); HU_drawPing(x+ 113, y, players[tab[i].num].quittime ? UINT32_MAX : playerpingtable[tab[i].num], false, 0);
//else //else
// V_DrawSmallString(x+ 94, y+4, V_YELLOWMAP, "SERVER"); // V_DrawSmallString(x+ 94, y+4, V_YELLOWMAP, "SERVER");
V_DrawString(x + 20, y, if (!players[tab[i].num].quittime || (leveltime / (TICRATE/2) & 1))
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0) V_DrawString(x + 20, y,
| (greycheck ? V_TRANSLUCENT : 0) ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| V_ALLOWLOWERCASE, name); | (greycheck ? V_TRANSLUCENT : 0)
| V_ALLOWLOWERCASE, name);
if (G_GametypeUsesLives() && !(G_GametypeUsesCoopLives() && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != INFLIVES)) //show lives if (G_GametypeUsesLives() && !(G_GametypeUsesCoopLives() && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != INFLIVES)) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE, va("%dx", players[tab[i].num].lives)); V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE, va("%dx", players[tab[i].num].lives));
@ -2763,16 +2777,17 @@ static void HU_Draw32TabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scor
strlcpy(name, tab[i].name, 7); strlcpy(name, tab[i].name, 7);
if (!splitscreen) // don't draw it on splitscreen, if (!splitscreen) // don't draw it on splitscreen,
{ {
if (!(tab[i].num == serverplayer || players[tab[i].num].quittime)) if (tab[i].num != serverplayer)
HU_drawPing(x+ 135, y+1, playerpingtable[tab[i].num], true, 0); HU_drawPing(x+ 135, y+1, players[tab[i].num].quittime ? UINT32_MAX : playerpingtable[tab[i].num], true, 0);
//else //else
// V_DrawSmallString(x+ 129, y+4, V_YELLOWMAP, "HOST"); // V_DrawSmallString(x+ 129, y+4, V_YELLOWMAP, "HOST");
} }
V_DrawString(x + 10, y, if (!players[tab[i].num].quittime || (leveltime / (TICRATE/2) & 1))
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0) V_DrawString(x + 10, y,
| (greycheck ? 0 : V_TRANSLUCENT) ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| V_ALLOWLOWERCASE, name); | (greycheck ? 0 : V_TRANSLUCENT)
| V_ALLOWLOWERCASE, name);
if (G_GametypeUsesLives()) //show lives if (G_GametypeUsesLives()) //show lives
V_DrawRightAlignedThinString(x-1, y, V_ALLOWLOWERCASE, va("%d", players[tab[i].num].lives)); V_DrawRightAlignedThinString(x-1, y, V_ALLOWLOWERCASE, va("%d", players[tab[i].num].lives));

View file

@ -2,7 +2,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2011-2020 by Sonic Team Junior. // Copyright (C) 2011-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.
@ -20,7 +20,7 @@
#else #else
#include <winsock.h> #include <winsock.h>
#endif #endif
#elif !defined (__DJGPP__) #else
#include <sys/socket.h> #include <sys/socket.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>

View file

@ -1,6 +1,6 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2011-2020 by Sonic Team Junior. // Copyright (C) 2011-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

View file

@ -1,7 +1,7 @@
// SONIC ROBO BLAST 2 // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior. // Copyright (C) 1999-2021 by Sonic Team Junior.
// //
// This program is free software distributed under the // This program is free software distributed under the
// terms of the GNU General Public License, version 2. // terms of the GNU General Public License, version 2.

Some files were not shown because too many files have changed in this diff Show more