mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-11 21:21:57 -04:00
more BE stuff, fix scissors for dmap/fmap
This commit is contained in:
@@ -96,10 +96,10 @@ public:
|
||||
/* 0x02 */ const char mStageName[8];
|
||||
/* 0x0A */ u8 mRoomNo;
|
||||
/* 0x0B */ u8 mWarpPlayerNo;
|
||||
/* 0x0C */ u16 mMessageID;
|
||||
/* 0x0C */ BE(u16) mMessageID;
|
||||
/* 0x0E */ u8 mStageNo;
|
||||
/* 0x0F */ u8 mSwitchNo;
|
||||
/* 0x10 */ cXyz mPosition;
|
||||
/* 0x10 */ BE(Vec) mPosition;
|
||||
};
|
||||
|
||||
/* 0x0 */ u8 field_0x0[8];
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
#include "JSystem/JStudio/JStudio/ctb.h"
|
||||
|
||||
const u32 JStudio::ctb::data::ga4cSignature = 'CTB\0';
|
||||
const u32 JStudio::ctb::data::ga4cSignature = BSWAP32('CTB\0');
|
||||
|
||||
@@ -68,7 +68,7 @@ JStudio::ctb::TObject* JStudio::ctb::TControl::getObject_index(u32 param_0) {
|
||||
JStudio::ctb::TFactory::~TFactory() {}
|
||||
|
||||
JStudio::ctb::TObject* JStudio::ctb::TFactory::create(JStudio::ctb::data::TParse_TBlock const& param_0) {
|
||||
switch(param_0.get_scheme()) {
|
||||
switch(BSWAP16(param_0.get_scheme())) {
|
||||
case 1:
|
||||
return JKR_NEW TObject_TxyzRy(param_0);
|
||||
default:
|
||||
|
||||
@@ -588,9 +588,11 @@ static void cut_control2(obj_brg_class* i_this, br_s* i_part) {
|
||||
}
|
||||
|
||||
static void himo_cut_control1(obj_brg_class* i_this, cXyz* param_1, f32 param_2) {
|
||||
cXyz sp74;
|
||||
cXyz sp80;
|
||||
cXyz sp8C;
|
||||
STUB_RET();
|
||||
|
||||
cXyz sp74 = {};
|
||||
cXyz sp80 = {};
|
||||
cXyz sp8C = {};
|
||||
|
||||
sp74.x = 0.0f;
|
||||
sp74.y = 0.0f;
|
||||
@@ -602,7 +604,7 @@ static void himo_cut_control1(obj_brg_class* i_this, cXyz* param_1, f32 param_2)
|
||||
sp74.y = 0.0f;
|
||||
sp74.z = param_2;
|
||||
|
||||
int i, temp_r27 = (intptr_t) ++param_1;
|
||||
intptr_t i, temp_r27 = (intptr_t) ++param_1;
|
||||
f32 var_f31, var_f30, var_f29, var_f28, var_f27;
|
||||
for (i = 1; i < 5; i++, param_1++) {
|
||||
var_f28 = i_this->field_0xaf30 * cM_ssin( (i_this->field_0xaf20 * 6000) + (NREG_S(3) - 10000) * (temp_r27 + i) )
|
||||
|
||||
+20
-1
@@ -864,14 +864,23 @@ void dMenu_DmapBg_c::draw() {
|
||||
grafContext->setup2D();
|
||||
|
||||
GXGetScissor(&scissor_left, &scissor_top, &scissor_width, &scissor_height);
|
||||
grafContext->scissor(field_0xd94, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafContext->scissor(field_0xd94, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
|
||||
mBaseScreen->draw(field_0xd94, field_0xd98, grafContext);
|
||||
dMenu_Dmap_c::myclass->drawFloorScreenBack(mFloorScreen, field_0xd94, field_0xd98, grafContext);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 dVar21 = mDoGph_gInf_c::getWidth() / FB_WIDTH;
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeight() / FB_HEIGHT;
|
||||
#else
|
||||
f32 dVar21 = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
mMapScreen[0]->draw(field_0xd94, field_0xd98, grafContext);
|
||||
|
||||
if (mpBackTexture != NULL) {
|
||||
@@ -896,9 +905,15 @@ void dMenu_DmapBg_c::draw() {
|
||||
mpBackTexture->draw(local_28c, field_0xd94 + mpBackTexture->getBounds().i.y, mpBackTexture->getWidth(),
|
||||
mpBackTexture->getHeight(), false, false, false);
|
||||
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94,
|
||||
0, mDoGph_gInf_c::getWidth(),
|
||||
scissor_height);
|
||||
#else
|
||||
grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(),
|
||||
scissor_top, mDoGph_gInf_c::getWidthF(),
|
||||
scissor_height);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
}
|
||||
|
||||
@@ -918,7 +933,11 @@ void dMenu_DmapBg_c::draw() {
|
||||
|
||||
Vec local_26c = pane.getGlobalVtx(mMapPane, &local_110, 0, false, 0);
|
||||
drawIcon(local_26c.x + field_0xd94, local_26c.y, field_0xda8, 1.0f);
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94, scissor_top, mDoGph_gInf_c::getWidth(), scissor_height);
|
||||
#else
|
||||
grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(), scissor_top, mDoGph_gInf_c::getWidthF(), scissor_height);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
grafContext->scissor(scissor_left, scissor_top, scissor_width, scissor_height);
|
||||
grafContext->setScissor();
|
||||
|
||||
+16
-3
@@ -275,14 +275,18 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
u32 scissorLeft, scissorTop, scissorWidth, scissorHeight;
|
||||
GXGetScissor(&scissorLeft, &scissorTop, &scissorWidth, &scissorHeight);
|
||||
|
||||
#if TARGET_PC
|
||||
grafPort->scissor(mTransX, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafPort->scissor(mTransX, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
grafPort->setScissor();
|
||||
|
||||
mpBackTex->setBlackWhite(field_0x1208, field_0x120c);
|
||||
mpBackTex->setAlpha(mAlphaRate * 255.0f * g_fmapHIO.mBackgroundAlpha);
|
||||
mpBackTex->draw(mTransX + mDoGph_gInf_c::getMinXF(),
|
||||
mTransZ + mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(),
|
||||
mDoGph_gInf_c::getHeightF(), false, false, false);
|
||||
mTransZ + mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidth(),
|
||||
mDoGph_gInf_c::getHeight(), false, false, false);
|
||||
|
||||
mpBackScreen->draw(mTransX, mTransZ, grafPort);
|
||||
mpBaseScreen->draw(mTransX, mTransZ, grafPort);
|
||||
@@ -292,8 +296,13 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
|
||||
Vec vec2 = mpMapArea->getGlobalVtx(&mtx, 3, false, 0);
|
||||
|
||||
f32 width = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
#if TARGET_PC
|
||||
f32 width = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth();
|
||||
f32 height = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 width = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 height = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
|
||||
grafPort->scissor(mTransX + ((vec1.x - mDoGph_gInf_c::getMinXF()) / width),
|
||||
mTransZ + (vec1.y / height), (vec2.x - vec1.x) / width,
|
||||
@@ -2554,7 +2563,11 @@ void dMenu_Fmap2DTop_c::draw() {
|
||||
J2DOrthoGraph* ctx = static_cast<J2DOrthoGraph*>(dComIfGp_getCurrentGrafPort());
|
||||
ctx->setup2D();
|
||||
GXGetScissor(&scissor_left, &scissor_top, &scissor_width, &scissor_height);
|
||||
#if TARGET_PC
|
||||
ctx->scissor(mTransX, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
ctx->scissor(mTransX, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
ctx->setScissor();
|
||||
mpTitleScreen->draw(mTransX, mTransY, ctx);
|
||||
ctx->scissor(scissor_left, scissor_top, scissor_width, scissor_height);
|
||||
|
||||
Reference in New Issue
Block a user