|
25 | 25 |
|
26 | 26 | #include "GLCheck.h"
|
27 | 27 | #include "glad/gl.h"
|
| 28 | +#include "Draw.h" |
28 | 29 |
|
29 | 30 | #include "tracy/Tracy.hpp"
|
30 | 31 | #include "tracy/TracyOpenGL.hpp"
|
@@ -418,6 +419,59 @@ void FrameMan::ClearScreenText(int whichScreen) {
|
418 | 419 | }
|
419 | 420 | }
|
420 | 421 |
|
| 422 | +void FrameMan::SetBlendMode(DrawBlendMode blendMode) { |
| 423 | + GLint invertLoc = rlGetLocationUniformCurrent("rteBlendInvert"); |
| 424 | + glUniform1i(invertLoc, 0); |
| 425 | + switch (blendMode) { |
| 426 | + case BlendTransparency: { |
| 427 | + rlSetBlendMode(RL_BLEND_ALPHA); |
| 428 | + break; |
| 429 | + } |
| 430 | + case BlendScreen: { |
| 431 | + rlSetBlendMode(RL_BLEND_SCREEN); |
| 432 | + break; |
| 433 | + } |
| 434 | + case BlendDifference: { |
| 435 | + rlSetBlendMode(RL_BLEND_SUBTRACT_COLORS); |
| 436 | + break; |
| 437 | + } |
| 438 | + case BlendMultiply: { |
| 439 | + rlSetBlendMode(RL_BLEND_MULTIPLIED); |
| 440 | + break; |
| 441 | + } |
| 442 | + case BlendBurn: { |
| 443 | + rlSetBlendMode(RL_BLEND_BURN); |
| 444 | + break; |
| 445 | + } |
| 446 | + case BlendDodge: { |
| 447 | + rlSetBlendMode(RL_BLEND_DODGE); |
| 448 | + break; |
| 449 | + } |
| 450 | + case BlendColor: { |
| 451 | + rlSetBlendMode(RL_BLEND_HSL_COLOR); |
| 452 | + break; |
| 453 | + } |
| 454 | + case BlendLuminance: { |
| 455 | + rlSetBlendMode(RL_BLEND_HSL_LUMINOSITY); |
| 456 | + break; |
| 457 | + } |
| 458 | + case BlendSaturation: { |
| 459 | + rlSetBlendMode(RL_BLEND_HSL_SATURATION); |
| 460 | + break; |
| 461 | + } |
| 462 | + case BlendInvert: { |
| 463 | + rlSetBlendMode(RL_BLEND_ALPHA); |
| 464 | + glUniform1i(invertLoc, 1); |
| 465 | + break; |
| 466 | + } |
| 467 | + default: { |
| 468 | + rlSetBlendMode(RL_BLEND_ALPHA); |
| 469 | + RTEAssert(blendMode < BlendModeCount, "Unkown blend mode selected!"); |
| 470 | + break; |
| 471 | + } |
| 472 | + } |
| 473 | +} |
| 474 | + |
421 | 475 | void FrameMan::SetColorTable(DrawBlendMode blendMode, std::array<int, 4> colorChannelBlendAmounts) {
|
422 | 476 | RTEAssert(blendMode > DrawBlendMode::NoBlend && blendMode < DrawBlendMode::BlendModeCount, "Invalid DrawBlendMode or DrawBlendMode::NoBlend passed into FrameMan::SetColorTable. See DrawBlendMode enumeration for defined values.");
|
423 | 477 |
|
@@ -900,6 +954,9 @@ void FrameMan::Draw() {
|
900 | 954 | g_SceneMan.Draw(drawScreen, drawScreenGUI, targetPos, true, true);
|
901 | 955 | }
|
902 | 956 |
|
| 957 | + |
| 958 | + g_PrimitiveMan.DrawPrimitives(playerScreen, drawScreenGUI, targetPos); |
| 959 | + |
903 | 960 | // Get only the scene-relative post effects that affect this player's screen
|
904 | 961 | if (pActivity) {
|
905 | 962 | g_PostProcessMan.GetPostScreenEffectsWrapped(targetPos, drawScreen->w, drawScreen->h, screenRelativeEffects, pActivity->GetTeamOfPlayer(pActivity->PlayerOfScreen(playerScreen)));
|
|
0 commit comments