summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-03-31 03:34:21 +0200
committerGitHub <noreply@github.com>2025-03-30 21:34:21 -0400
commitdaadae488119c7a8cd28548e5d502abdafbf68e0 (patch)
treebaf3b22d728e066b639e8ae967aba305ef41f9d4
parente85a989271d9445d4c4e1da41dfb6d90cb0652aa (diff)
Link d2d (#145)
-rw-r--r--config/SOUE01/symbols.txt26
-rw-r--r--configure.py2
-rw-r--r--include/d/d_textunk.h49
-rw-r--r--include/d/lyt/d2d.h2
-rw-r--r--include/d/lyt/d_textbox.h27
-rw-r--r--include/sized_string.h28
-rw-r--r--src/d/lyt/d2d.cpp74
7 files changed, 125 insertions, 83 deletions
diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt
index d14c421f..d135e1c4 100644
--- a/config/SOUE01/symbols.txt
+++ b/config/SOUE01/symbols.txt
@@ -3782,7 +3782,7 @@ setAnmFrame__Q23d2d14AnmGroupBase_cFf = .text:0x800AC900; // type:function size:
syncAnmFrame__Q23d2d14AnmGroupBase_cFv = .text:0x800AC910; // type:function size:0xC
setForward__Q23d2d14AnmGroupBase_cFv = .text:0x800AC920; // type:function size:0x14
setBackward__Q23d2d14AnmGroupBase_cFv = .text:0x800AC940; // type:function size:0x14
-fn_800AC960 = .text:0x800AC960; // type:function size:0x4C
+pushToEnd__3d2dFPQ34nw4r3lyt4Pane = .text:0x800AC960; // type:function size:0x4C
init__Q23d2d9AnmGroupsFPQ23d2d10AnmGroup_cPCQ23d2d15LytBrlanMappingUlPQ23m2d10ResAccIf_cPQ23d2d8Layout_c = .text:0x800AC9B0; // type:function size:0x80
remove__Q23d2d9AnmGroupsFv = .text:0x800ACA30; // type:function size:0x64
draw__Q23d2d9LytBase_cFv = .text:0x800ACAA0; // type:function size:0x18
@@ -3860,7 +3860,7 @@ fn_800B0DE0 = .text:0x800B0DE0; // type:function size:0x158
fn_800B0F40 = .text:0x800B0F40; // type:function size:0x240
fn_800B1180 = .text:0x800B1180; // type:function size:0x3F0
dTextBox_c__setFontSize = .text:0x800B1570; // type:function size:0x14
-fn_800B1590 = .text:0x800B1590; // type:function size:0x14
+MySetScale__10dTextBox_cFRCQ34nw4r3lyt4Size = .text:0x800B1590; // type:function size:0x14
GetRuntimeTypeInfo__Q34nw4r3lyt7TextBoxCFv = .text:0x800B15B0; // type:function size:0x8 scope:weak
fn_800B15C0 = .text:0x800B15C0; // type:function size:0x68
__ct__9dWindow_cFPCQ44nw4r3lyt3res6WindowRCQ34nw4r3lyt11ResBlockSet = .text:0x800B1630; // type:function size:0x3C
@@ -29169,9 +29169,9 @@ lbl_804FBC7C = .rodata:0x804FBC7C; // type:object size:0xC
zeroVec__3EGG = .rodata:0x804FBC88; // type:object size:0xC data:float
lbl_804FBC98 = .rodata:0x804FBC98; // type:object size:0xC data:4byte
lbl_804FBCA4 = .rodata:0x804FBCA4; // type:object size:0xC data:4byte
-lbl_804FBCB0 = .rodata:0x804FBCB0; // type:object size:0x10 data:4byte
+sIndTexMtxId__3EGG = .rodata:0x804FBCB0; // type:object size:0xC data:4byte
sCpuTexGradientOp__3EGG = .rodata:0x804FBCC0; // type:object size:0x48 data:4byte
-lbl_804FBD08 = .rodata:0x804FBD08; // type:object size:0x48 data:float
+lbl_804FBD08 = .rodata:0x804FBD08; // type:object size:0xC data:float
lbl_804FBD50 = .rodata:0x804FBD50; // type:object size:0x10 data:float
lbl_804FBD60 = .rodata:0x804FBD60; // type:object size:0x10 data:float
lbl_804FBD70 = .rodata:0x804FBD70; // type:object size:0x18
@@ -30943,7 +30943,7 @@ lbl_8050FF88 = .data:0x8050FF88; // type:object size:0x10
lbl_8050FF98 = .data:0x8050FF98; // type:object size:0x10
lbl_8050FFA8 = .data:0x8050FFA8; // type:object size:0x10 data:string
lbl_8050FFB8 = .data:0x8050FFB8; // type:object size:0x10
-lbl_8050FFC8 = .data:0x8050FFC8; // type:object size:0x48
+lbl_8050FFC8 = .data:0x8050FFC8; // type:object size:0xC data:string
__vt__Q23d2d9LytBase_c = .data:0x80510010; // type:object size:0x1C
__vt__Q23d2d7Multi_c = .data:0x8051002C; // type:object size:0x1C
__vt__Q23d2d8Layout_c = .data:0x80510048; // type:object size:0x40
@@ -38090,11 +38090,11 @@ lbl_80572268 = .sdata:0x80572268; // type:object size:0x8
lbl_80572270 = .sdata:0x80572270; // type:object size:0x8
lbl_80572278 = .sdata:0x80572278; // type:object size:0x8
lbl_80572280 = .sdata:0x80572280; // type:object size:0x8
-lbl_80572288 = .sdata:0x80572288; // type:object size:0x8
-lbl_80572290 = .sdata:0x80572290; // type:object size:0x8
-lbl_80572298 = .sdata:0x80572298; // type:object size:0x8
-lbl_805722A0 = .sdata:0x805722A0; // type:object size:0x8
-lbl_805722A8 = .sdata:0x805722A8; // type:object size:0x8
+lbl_80572288 = .sdata:0x80572288; // type:object size:0x6 data:string
+lbl_80572290 = .sdata:0x80572290; // type:object size:0x5 data:string
+lbl_80572298 = .sdata:0x80572298; // type:object size:0x6 data:string
+lbl_805722A0 = .sdata:0x805722A0; // type:object size:0x5 data:string
+lbl_805722A8 = .sdata:0x805722A8; // type:object size:0x6 data:string
lbl_805722B0 = .sdata:0x805722B0; // type:object size:0x4 data:string
lbl_805722B4 = .sdata:0x805722B4; // type:object size:0x4 data:4byte
lbl_805722B8 = .sdata:0x805722B8; // type:object size:0x4
@@ -39831,7 +39831,7 @@ lbl_80574F2C = .sdata:0x80574F2C; // type:object size:0x4 data:4byte
lbl_80574F30 = .sdata:0x80574F30; // type:object size:0x8
sTextureSize__Q23EGG12LightTexture = .sdata:0x80574F38; // type:object size:0x2 data:2byte
lbl_80574F3A = .sdata:0x80574F3A; // type:object size:0x1 data:byte
-lbl_80574F3C = .sdata:0x80574F3C; // type:object size:0xC
+lbl_80574F3C = .sdata:0x80574F3C; // type:object size:0x5 data:string
sByteCodeCalcStr__Q23EGG7ModelEx = .sdata:0x80574F48; // type:object size:0x4 data:4byte
lbl_80574F50 = .sdata:0x80574F50; // type:object size:0x8 data:string
sByteCodeMixStr__Q23EGG7ModelEx = .sdata:0x80574F58; // type:object size:0x4 data:4byte
@@ -48007,7 +48007,7 @@ lbl_8057F3E0 = .sdata2:0x8057F3E0; // type:object size:0x4 data:float
lbl_8057F3E8 = .sdata2:0x8057F3E8; // type:object size:0x8 data:double
lbl_8057F3F0 = .sdata2:0x8057F3F0; // type:object size:0x8 data:double
lbl_8057F3F8 = .sdata2:0x8057F3F8; // type:object size:0x4
-lbl_8057F3FC = .sdata2:0x8057F3FC; // type:object size:0xC
+lbl_8057F3FC = .sdata2:0x8057F3FC; // type:object size:0x6
lbl_8057F408 = .sdata2:0x8057F408; // type:object size:0x4 data:4byte
lbl_8057F40C = .sdata2:0x8057F40C; // type:object size:0x2 data:2byte
lbl_8057F40E = .sdata2:0x8057F40E; // type:object size:0x1 data:byte
@@ -48123,7 +48123,7 @@ lbl_8057F6B8 = .sdata2:0x8057F6B8; // type:object size:0x4 data:float
lbl_8057F6BC = .sdata2:0x8057F6BC; // type:object size:0x4 data:float
lbl_8057F6C0 = .sdata2:0x8057F6C0; // type:object size:0x4 data:float
lbl_8057F6C4 = .sdata2:0x8057F6C4; // type:object size:0x4 data:float
-lbl_8057F6C8 = .sdata2:0x8057F6C8; // type:object size:0x18 data:float
+lbl_8057F6C8 = .sdata2:0x8057F6C8; // type:object size:0x4 data:float
lbl_8057F6E0 = .sdata2:0x8057F6E0; // type:object size:0x8
lbl_8057F6E8 = .sdata2:0x8057F6E8; // type:object size:0x8 data:double
lbl_8057F6F0 = .sdata2:0x8057F6F0; // type:object size:0x4 data:float
diff --git a/configure.py b/configure.py
index a4cf29a7..e295fb6b 100644
--- a/configure.py
+++ b/configure.py
@@ -375,7 +375,7 @@ config.libs = [
Object(Matching, "toBeSorted/counters/key_piece_counter.cpp"),
Object(Matching, "toBeSorted/counters/extra_wallet_counter.cpp"),
Object(NonMatching, "d/lyt/d_structd.cpp"),
- Object(NonMatching, "d/lyt/d2d.cpp"),
+ Object(Matching, "d/lyt/d2d.cpp"),
Object(NonMatching, "d/lyt/d_textbox.cpp"),
Object(Matching, "d/lyt/d_window.cpp"),
Object(Matching, "d/d_textunk.cpp"),
diff --git a/include/d/d_textunk.h b/include/d/d_textunk.h
index 3860c81b..5e43e709 100644
--- a/include/d/d_textunk.h
+++ b/include/d/d_textunk.h
@@ -42,10 +42,59 @@ public:
return 1.0f;
}
+ inline static f32 getFn800B1FD0() {
+ if (sInstance != nullptr) {
+ return sInstance->fn_800B1FD0();
+ }
+ return 1.0f;
+ }
+
inline static f32 getFn800B1F10() {
return sInstance->fn_800B1F10();
}
+ inline static f32 getFn800B1FF0() {
+ if (sInstance != nullptr) {
+ return sInstance->fn_800B1FF0();
+ }
+ return 0.0f;
+ }
+
+ inline static f32 getFn800B2000() {
+ if (sInstance != nullptr) {
+ return sInstance->fn_800B2000();
+ }
+ return 0.0f;
+ }
+
+ inline static f32 getFn800B2010() {
+ if (sInstance != nullptr) {
+ return sInstance->fn_800B2010();
+ }
+ return 0.0f;
+ }
+
+ inline static f32 getFn800B2020() {
+ if (sInstance != nullptr) {
+ return sInstance->fn_800B2020();
+ }
+ return 0.0f;
+ }
+
+ inline static f32 getFn800B2030() {
+ if (sInstance != nullptr) {
+ return sInstance->fn_800B2030();
+ }
+ return 0.0f;
+ }
+
+ inline static f32 getFn800B2040() {
+ if (sInstance != nullptr) {
+ return sInstance->fn_800B2040();
+ }
+ return 0.0f;
+ }
+
private:
static UnkTextThing *sInstance;
diff --git a/include/d/lyt/d2d.h b/include/d/lyt/d2d.h
index 0bb7d45f..83482558 100644
--- a/include/d/lyt/d2d.h
+++ b/include/d/lyt/d2d.h
@@ -286,6 +286,8 @@ struct AnmGroup_c : public AnmGroupBase_c {
/* 0x28 */ m2d::FrameCtrl_c mFrameCtrl;
};
+void pushToEnd(nw4r::lyt::Pane *);
+
// This abstraction is apparently only ever used in CsGame
class AnmGroups {
public:
diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h
index 653aafb3..49afd74c 100644
--- a/include/d/lyt/d_textbox.h
+++ b/include/d/lyt/d_textbox.h
@@ -3,8 +3,7 @@
#include "d/lyt/d2d.h"
#include "nw4r/lyt/lyt_textBox.h"
-
-extern "C" void *lbl_805753B0;
+#include "nw4r/lyt/lyt_types.h"
class dTextBox_c : public nw4r::lyt::TextBox {
friend class dWindow_c;
@@ -18,13 +17,13 @@ public:
mpLytBase = lytBase;
}
- void SetScale(float scale) {
- nw4r::math::VEC2 value = GetScale();
- value.x = GetScale().x * scale;
- value.y = GetScale().y * scale;
+ void SetScale(f32 scale) {
+ nw4r::lyt::Size value(mTextScale);
+ value.width *= scale;
+ value.height *= scale;
mScale = scale;
MySetScale(value);
- nw4r::lyt::TextBox::SetScale(value);
+ nw4r::lyt::TextBox::SetFontSize(value);
}
void set0x1F8(u8 val) {
@@ -35,28 +34,18 @@ public:
return mScale;
}
- static inline f32 GetTranslateX1() {
- if (lbl_805753B0 != nullptr) {
- return GetTranslateX1_();
- } else {
- return 0.0f;
- }
- }
-
void fn_800E0A60(const char *area, ...) {
// TODO
}
- static f32 GetTranslateX1_();
-
// @bug: This does not implement UT's RTTI, so casts to dTextBox_c will
// succeed even if all you have is a lyt::TextBox
private:
- void MySetScale(const nw4r::math::VEC2 &value);
+ void MySetScale(const nw4r::lyt::Size &value);
/* 0x104 */ d2d::LytBase_c *mpLytBase;
/* 0x108 */ u8 field_0x108[0x118 - 0x108];
- /* 0x118 */ nw4r::math::VEC2 mTextScale;
+ /* 0x118 */ nw4r::lyt::Size mTextScale;
/* 0x120 */ f32 mScale;
/* 0x124 */ u8 field_0x124[0x1F8 - 0x124];
/* 0x1F8 */ u8 field_0x1F8;
diff --git a/include/sized_string.h b/include/sized_string.h
index 64b01a5a..c0670728 100644
--- a/include/sized_string.h
+++ b/include/sized_string.h
@@ -44,21 +44,25 @@ struct SizedString {
void operator+=(const char *src) {
if (src != nullptr) {
- size_t destLen = strlen(mChars);
- size_t copyLen = strlen(src);
-
- // Make sure copy length isnt more than destination length
- if (destLen + copyLen + 1 >= Size) {
- size_t tmpLen = Size - destLen;
- copyLen = tmpLen - 1;
- }
+ append(src);
+ }
+ }
- strncpy(mChars + destLen, src, copyLen);
+ void append(const char *src) {
+ size_t destLen = strlen(mChars);
+ size_t copyLen = strlen(src);
- // make sure string is null terminated
- size_t offset = destLen + copyLen;
- mChars[offset] = '\0';
+ // Make sure copy length isnt more than destination length
+ if (destLen + copyLen + 1 >= Size) {
+ size_t tmpLen = Size - destLen;
+ copyLen = tmpLen - 1;
}
+
+ strncpy(mChars + destLen, src, copyLen);
+
+ // make sure string is null terminated
+ size_t offset = destLen + copyLen;
+ mChars[offset] = '\0';
}
bool operator==(const char *other) const {
diff --git a/src/d/lyt/d2d.cpp b/src/d/lyt/d2d.cpp
index d33c741e..4a550e83 100644
--- a/src/d/lyt/d2d.cpp
+++ b/src/d/lyt/d2d.cpp
@@ -1,15 +1,15 @@
#include "d/lyt/d2d.h"
#include "d/d_font_manager.h"
+#include "d/d_textunk.h"
#include "d/lyt/d_textbox.h"
#include "d/lyt/d_window.h"
#include "egg/gfx/eggScreen.h"
#include "nw4r/lyt/lyt_bounding.h"
#include "nw4r/lyt/lyt_group.h"
+#include "nw4r/lyt/lyt_pane.h"
#include "nw4r/lyt/lyt_picture.h"
-#include "nw4r/lyt/lyt_textBox.h"
#include "nw4r/lyt/lyt_utils.h"
-#include "nw4r/lyt/lyt_window.h"
#include "sized_string.h"
using namespace nw4r::lyt;
@@ -200,15 +200,15 @@ void Multi_c::calcAfter() {
extern "C" bool NeedsScreenAdjustment();
-// Largerly copied from m2d::Simple_c::draw
+// Largely copied from m2d::Simple_c::draw
void Multi_c::draw() {
nw4r::ut::Rect r = mLayout.GetLayoutRect();
f32 near = 0.0f;
f32 far = 500.0f;
EGG::Screen s;
bool needsAdjust = NeedsScreenAdjustment();
- f32 f1 = EGG::Screen::GetSizeXMax(EGG::Screen::TV_MODE_UNK_3);
- f32 f2 = EGG::Screen::GetSizeXMax(EGG::Screen::TV_MODE_16_9);
+ f32 f1 = EGG::Screen::GetSizeXMax(EGG::Screen::TV_MODE_16_9);
+ f32 f2 = EGG::Screen::GetSizeXMax(EGG::Screen::TV_MODE_4_3);
f32 left = needsAdjust ? f1 * r.left / f2 : r.left;
f32 right = needsAdjust ? f1 * r.right / f2 : r.right;
@@ -445,8 +445,6 @@ extern "C" const char *fn_801B2600(const char *);
extern "C" void fn_800AF930(dTextBox_c *, const char *);
extern "C" void fn_800B0F40(dTextBox_c *);
-// NOTE: This function uses `textBox->GetTranslateX1()` as a general placeholder to figure
-// out the details first. In reality these are all different functions!
void LytBase_c::setProperties(nw4r::lyt::Pane *pane, f32 posX, f32 posY, f32 scale, f32 spaceX, f32 spaceY) {
if (pane->GetName()[0] != 'T') {
return;
@@ -475,41 +473,40 @@ void LytBase_c::setProperties(nw4r::lyt::Pane *pane, f32 posX, f32 posY, f32 sca
}
nw4r::math::VEC3 t2 = textBox->GetTranslate();
- t2.x += textBox->GetTranslateX1();
- t2.y += textBox->GetTranslateX1();
+ t2.x += UnkTextThing::getFn800B2030();
+ t2.y += UnkTextThing::getFn800B2040();
textBox->SetTranslate(t2);
if (scale != -9999.0f) {
const nw4r::ut::Font *f = textBox->GetFont();
if (f != nullptr) {
- // VEC2 internally copied via GPRs here, should be FPRs
- textBox->SetScale(scale * 0.01f);
+ scale *= 0.01f;
+ textBox->SetScale(scale);
}
} else {
const nw4r::ut::Font *f = textBox->GetFont();
if (f != nullptr) {
- // VEC2 internally copied via GPRs here, should be FPRs
- textBox->SetScale(textBox->GetTranslateX1());
+ textBox->SetScale(UnkTextThing::getFn800B1FD0());
}
}
- f32 f4 = 0.0f;
f32 f6 = 0.0f;
+ f32 f4 = 0.0f;
if (spaceX != -9999.0f) {
textBox->SetCharSpace(spaceX);
} else {
- f6 = textBox->GetTranslateX1();
+ f6 = UnkTextThing::getFn800B2010();
}
if (spaceY != -9999.0f) {
textBox->SetLineSpace(spaceY);
} else {
- f4 = textBox->GetTranslateX1();
+ f4 = UnkTextThing::getFn800B1FF0();
}
- textBox->SetCharSpace(f6 + textBox->GetCharSpace() + textBox->GetTranslateX1());
- textBox->SetLineSpace(f4 + textBox->GetLineSpace() + textBox->GetTranslateX1());
+ textBox->SetCharSpace(textBox->GetCharSpace() + UnkTextThing::getFn800B2020() + f6);
+ textBox->SetLineSpace(textBox->GetLineSpace() + UnkTextThing::getFn800B2000() + f4);
fn_800AB930(textBox);
}
@@ -595,7 +592,7 @@ bool LytBase_c::fn_800ABB80(dTextBox_c *textbox1, dTextBox_c *textbox2, int arg)
bool LytBase_c::fn_800ABCE0(
const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, int arg
) {
- int userDatInt = userDatum->GetInt();
+ s32 userDatInt = userDatum->GetInt();
SizedString<0x40> str1;
SizedString<0x40> str2;
@@ -605,11 +602,9 @@ bool LytBase_c::fn_800ABCE0(
if (arg != -1) {
userDatInt = arg;
}
- str2.sprintf(":%02d", userDatInt);
- // TODO this operator is not behaving correctly here - there's
- // an additional null check, and the source string address is
- // computed twice via stack instead of once.
- str1 += str2;
+ SizedString<0x40> &fmt = str2;
+ fmt.sprintf(":%02d", userDatInt);
+ str1.append(fmt);
}
const char *text = LMS_GetTextByLabel(getMsbtInfo(), str1);
@@ -693,17 +688,15 @@ extern "C" void fn_800AF840(dTextBox_c *textbox1, MsbtInfo *, const char *, int
bool LytBase_c::fn_800AC1AC(
const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, int arg, void *unk
) {
- int userDatInt = userDatum->GetInt();
+ s32 userDatInt = userDatum->GetInt();
SizedString<0x40> str1;
SizedString<0x40> str2;
str1 = textbox2->GetName();
if (userDatInt != 0) {
- str2.sprintf(":%02d", 0);
- // TODO this operator is not behaving correctly here - there's
- // an additional null check, and the source string address is
- // computed twice via stack instead of once.
- str1 += str2;
+ SizedString<0x40> &fmt = str2;
+ fmt.sprintf(":%02d", 0);
+ str1.append(fmt);
}
fn_800AF840(textbox1, getMsbtInfo(), str1, arg, unk);
@@ -754,18 +747,17 @@ bool hasSameBaseName(const char *left, const char *right) {
char *sRef = "ref";
void dSubPane::linkMeters(nw4r::lyt::Group *group, d2d::SubPaneList *meterGroup) {
- // single regswap
- nw4r::ut::LinkList<d2d::SubPaneListNode, 0>::Iterator beginIt = meterGroup->GetBeginIter();
- nw4r::ut::LinkList<d2d::SubPaneListNode, 0>::Iterator endIt = meterGroup->GetEndIter();
+ SubPaneList::Iterator beginIt = meterGroup->GetBeginIter();
+ SubPaneList::Iterator endIt = meterGroup->GetEndIter();
+
+ nw4r::lyt::PaneList::Iterator paneEndIt = group->GetPaneList()->GetEndIter();
- for (nw4r::lyt::PaneList::Iterator paneIt = group->GetPaneList()->GetBeginIter();
- paneIt != group->GetPaneList()->GetEndIter(); ++paneIt) {
+ for (nw4r::lyt::PaneList::Iterator paneIt = group->GetPaneList()->GetBeginIter(); paneIt != paneEndIt; ++paneIt) {
nw4r::lyt::Pane *pane = paneIt->mTarget;
- int num = pane->GetExtUserDataNum();
- if (num != 0) {
+ if (pane->GetExtUserDataNum()) {
const nw4r::lyt::res::ExtUserData *dat = pane->FindExtUserDataByName(sRef);
if (dat != nullptr && dat->GetType() == nw4r::lyt::res::TYPE_STRING) {
- for (nw4r::ut::LinkList<d2d::SubPaneListNode, 0>::Iterator it = beginIt; it != endIt; ++it) {
+ for (SubPaneList::Iterator it = beginIt; it != endIt; ++it) {
d2d::dSubPane *meter = it->mpLytPane;
if (!meter->LytMeter0x24()) {
if (hasSameBaseName(dat->GetString(), meter->getName())) {
@@ -895,6 +887,12 @@ void AnmGroupBase_c::setBackward() {
mpFrameCtrl->setBackward();
}
+void pushToEnd(nw4r::lyt::Pane *pane) {
+ nw4r::lyt::Pane *parent = pane->GetParent();
+ parent->RemoveChild(pane);
+ parent->AppendChild(pane);
+}
+
bool AnmGroups::init(
d2d::AnmGroup_c *pGroups, const LytBrlanMapping *mappings, u32 num, m2d::ResAccIf_c *acc, d2d::Layout_c *layout
) {