Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/OpenSHC/UI/Rendering/PencilRenderCore/dimBox.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "../PencilRenderCore.func.hpp"

namespace OpenSHC {
namespace UI {
namespace Rendering {

// FUNCTION: STRONGHOLDCRUSADER 0x00471050
void PencilRenderCore::dimBox(int left, int top, int right, int bottom)
{
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencilSurface, this)();
if (!MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencil, this)(
left, top, right, bottom, 0)) {
return;
}
for (; this->currentHeight_0x2c >= 0; --this->currentHeight_0x2c, ++this->drawStartY) {
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::dimHorizontalLine, this)();
}
}

}
}
}
22 changes: 22 additions & 0 deletions src/OpenSHC/UI/Rendering/PencilRenderCore/drawColorBox.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "../PencilRenderCore.func.hpp"

namespace OpenSHC {
namespace UI {
namespace Rendering {

// FUNCTION: STRONGHOLDCRUSADER 0x00470E90
void PencilRenderCore::drawColorBox(int left, int top, int right, int bottom, ushort color)
{
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencilSurface, this)();
if (!MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencil, this)(
left, top, right, bottom, color)) {
return;
}
for (; this->currentHeight_0x2c >= 0; --this->currentHeight_0x2c, ++this->drawStartY) {
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHorizontalLine, this)();
}
}

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "../PencilRenderCore.func.hpp"

namespace OpenSHC {
namespace UI {
namespace Rendering {

// FUNCTION: STRONGHOLDCRUSADER 0x00471220
void PencilRenderCore::drawDiagonalHeigherThanWideUnk()
{
// Bresenham, the major axis moved in each arm, as the original does (once after the if does not match)
int const straightStep = this->currentWidth_0x28 * 2;
int const diagonalStep = straightStep - this->currentHeight_0x2c * 2;
int error = straightStep - this->currentHeight_0x2c;
for (; this->currentHeight_0x2c >= 0; --this->currentHeight_0x2c) {
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawCurrentPixel, this)();
if (error > 0) {
this->currentX += this->moveDirectionXUnk_0x20;
this->currentY += this->moveDirectionYUnk_0x24;
error += diagonalStep;
} else {
this->currentY += this->moveDirectionYUnk_0x24;
error += straightStep;
}
}
}

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "../PencilRenderCore.func.hpp"

namespace OpenSHC {
namespace UI {
namespace Rendering {

// FUNCTION: STRONGHOLDCRUSADER 0x00471280
void PencilRenderCore::drawDiagonalWiderThanHighUnk()
{
// Bresenham, the major axis moved in each arm, as the original does (once after the if does not match)
int const straightStep = this->currentHeight_0x2c * 2;
int const diagonalStep = straightStep - this->currentWidth_0x28 * 2;
int error = straightStep - this->currentWidth_0x28;
for (; this->currentWidth_0x28 >= 0; --this->currentWidth_0x28) {
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawCurrentPixel, this)();
if (error > 0) {
this->currentX += this->moveDirectionXUnk_0x20;
this->currentY += this->moveDirectionYUnk_0x24;
error += diagonalStep;
} else {
this->currentX += this->moveDirectionXUnk_0x20;
error += straightStep;
}
}
}

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "../PencilRenderCore.func.hpp"

#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp"

namespace OpenSHC {
namespace UI {
namespace Rendering {

// FUNCTION: STRONGHOLDCRUSADER 0x004712E0
void PencilRenderCore::drawPixelPattern4x4OverWholeScreen()
{
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencilSurface, this)();
// The 4x4 pattern tiled over the whole screen
for (this->currentY = 0; this->currentY < DAT_WindowAndDirectDraw::instance.resolutionY;
this->currentY += 4) {
for (this->currentX = 0; this->currentX < DAT_WindowAndDirectDraw::instance.resolutionX;
this->currentX += 4) {
MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawPixelPattern4x4, this)(
this->currentX, this->currentY);
}
}
}

}
}
}
10 changes: 5 additions & 5 deletions status/addresses-SHC-3BB0A8C1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21265,25 +21265,25 @@ SHC_3BB0A8C1_0x00470B30 | 100.0% | Reimplemented

SHC_3BB0A8C1_0x00470BC0 | 100.0% | Reimplemented, requires SHC_3BB0A8C1_0x0046CCD0 to be active

SHC_3BB0A8C1_0x00470E90 | 0.0% | Pending
SHC_3BB0A8C1_0x00470E90 | 100.0% | Reimplemented

SHC_3BB0A8C1_0x00470EE0 | 0.0% | Pending

SHC_3BB0A8C1_0x00470FC0 | 0.0% | Pending

SHC_3BB0A8C1_0x00471000 | 0.0% | Pending

SHC_3BB0A8C1_0x00471050 | 0.0% | Pending
SHC_3BB0A8C1_0x00471050 | 100.0% | Reimplemented

SHC_3BB0A8C1_0x004710A0 | 0.0% | Pending

SHC_3BB0A8C1_0x004711B0 | 0.0% | Pending

SHC_3BB0A8C1_0x00471220 | 0.0% | Pending
SHC_3BB0A8C1_0x00471220 | 100.0% | Reimplemented

SHC_3BB0A8C1_0x00471280 | 0.0% | Pending
SHC_3BB0A8C1_0x00471280 | 100.0% | Reimplemented

SHC_3BB0A8C1_0x004712E0 | 0.0% | Pending
SHC_3BB0A8C1_0x004712E0 | 100.0% | Reimplemented

SHC_3BB0A8C1_0x00471340 | 0.0% | Pending

Expand Down
Loading