mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-10-14 14:50:24 +02:00
SW NativeVertexFormat: Utilize std::array where applicable
Gets rid of some hardcoded looping bounds, and also simplifies code in some places, sometimes allowing for removal of a loop altogether.
This commit is contained in:
1 parent
c12418788a
commit
ffaa9a3bea
4 files changed
+27
-27
No files matched your search
@@ -330,7 +330,7 @@ void TransformColor(const InputVertexData* src, OutputVertexData* dst)
|
||||
// color
|
||||
const LitChannel& colorchan = xfmem.color[chan];
|
||||
if (colorchan.matsource)
|
||||
std::memcpy(matcolor.data(), src->color[chan], sizeof(u32)); // vertex
|
||||
matcolor = src->color[chan]; // vertex
|
||||
else
|
||||
std::memcpy(matcolor.data(), &xfmem.matColor[chan], sizeof(u32));
|
||||
|
||||
@@ -403,7 +403,7 @@ void TransformColor(const InputVertexData* src, OutputVertexData* dst)
|
||||
|
||||
// abgr -> rgba
|
||||
const u32 rgba_color = Common::swap32(chancolor.data());
|
||||
std::memcpy(dst->color[chan], &rgba_color, sizeof(u32));
|
||||
std::memcpy(dst->color[chan].data(), &rgba_color, sizeof(u32));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user