mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-20 05:08:04 +00:00
[Examples/Website] treat RenderCommand.commandType as uint8_t instead of uint32_t
This commit is contained in:
parent
0bbd6385d7
commit
d9ad33c3a5
@ -426,7 +426,8 @@
|
|||||||
element.style.height = Math.round(renderCommand.boundingBox.height.value) + 'px';
|
element.style.height = Math.round(renderCommand.boundingBox.height.value) + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(renderCommand.commandType.value) {
|
// note: commandType is packed to uint8_t and has 3 garbage bytes of padding
|
||||||
|
switch(renderCommand.commandType.value & 0xff) {
|
||||||
case (CLAY_RENDER_COMMAND_TYPE_NONE): {
|
case (CLAY_RENDER_COMMAND_TYPE_NONE): {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -580,7 +581,9 @@
|
|||||||
for (let i = 0; i < length; i++, arrayOffset += renderCommandSize) {
|
for (let i = 0; i < length; i++, arrayOffset += renderCommandSize) {
|
||||||
let renderCommand = readStructAtAddress(arrayOffset, renderCommandDefinition);
|
let renderCommand = readStructAtAddress(arrayOffset, renderCommandDefinition);
|
||||||
let boundingBox = renderCommand.boundingBox;
|
let boundingBox = renderCommand.boundingBox;
|
||||||
switch(renderCommand.commandType.value) {
|
|
||||||
|
// note: commandType is packed to uint8_t and has 3 garbage bytes of padding
|
||||||
|
switch(renderCommand.commandType.value & 0xff) {
|
||||||
case (CLAY_RENDER_COMMAND_TYPE_NONE): {
|
case (CLAY_RENDER_COMMAND_TYPE_NONE): {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user