mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-22 06:08:03 +00:00
Compare commits
5 Commits
62b402bcbb
...
e53a50c681
Author | SHA1 | Date | |
---|---|---|---|
|
e53a50c681 | ||
|
1204ac400b | ||
|
6a7ce77024 | ||
|
7c9506bc31 | ||
|
46c962d7f2 |
37
clay.h
37
clay.h
@ -136,7 +136,7 @@ static inline void Clay__SuppressUnusedLatchDefinitionVariableWarning(void) { (v
|
||||
for ( \
|
||||
CLAY__ELEMENT_DEFINITION_LATCH = (Clay__OpenElement(), Clay__ConfigureOpenElement(CLAY__CONFIG_WRAPPER(Clay_ElementDeclaration, __VA_ARGS__)), 0); \
|
||||
CLAY__ELEMENT_DEFINITION_LATCH < 1; \
|
||||
++CLAY__ELEMENT_DEFINITION_LATCH, Clay__CloseElement() \
|
||||
CLAY__ELEMENT_DEFINITION_LATCH=1, Clay__CloseElement() \
|
||||
)
|
||||
|
||||
// These macros exist to allow the CLAY() macro to be called both with an inline struct definition, such as
|
||||
@ -1373,7 +1373,7 @@ uint64_t Clay__HashData(const uint8_t* data, size_t length) {
|
||||
length -= 16;
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < length; i++) {
|
||||
for (size_t i = 0; i < length; i++) {
|
||||
overflowBuffer[i] = data[i];
|
||||
}
|
||||
msg = _mm_loadu_si128((const __m128i*)overflowBuffer);
|
||||
@ -1430,11 +1430,11 @@ uint64_t Clay__HashData(const uint8_t* data, size_t length) {
|
||||
length -= 8;
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < length; i++) {
|
||||
for (size_t i = 0; i < length; i++) {
|
||||
overflowBuffer[i] = data[i];
|
||||
}
|
||||
uint8x8_t lower = vld1_u8(overflowBuffer);
|
||||
msg = vcombine_u8(lower, vdup_n_u8(0));
|
||||
msg = vreinterpretq_u64_u8(vcombine_u8(lower, vdup_n_u8(0)));
|
||||
length = 0;
|
||||
}
|
||||
v0 = veorq_u64(v0, msg);
|
||||
@ -3794,6 +3794,21 @@ void Clay_SetPointerState(Clay_Vector2 position, bool isPointerDown) {
|
||||
}
|
||||
context->pointerInfo.position = position;
|
||||
context->pointerOverIds.length = 0;
|
||||
|
||||
if (isPointerDown) {
|
||||
if (context->pointerInfo.state == CLAY_POINTER_DATA_PRESSED_THIS_FRAME) {
|
||||
context->pointerInfo.state = CLAY_POINTER_DATA_PRESSED;
|
||||
} else if (context->pointerInfo.state != CLAY_POINTER_DATA_PRESSED) {
|
||||
context->pointerInfo.state = CLAY_POINTER_DATA_PRESSED_THIS_FRAME;
|
||||
}
|
||||
} else {
|
||||
if (context->pointerInfo.state == CLAY_POINTER_DATA_RELEASED_THIS_FRAME) {
|
||||
context->pointerInfo.state = CLAY_POINTER_DATA_RELEASED;
|
||||
} else if (context->pointerInfo.state != CLAY_POINTER_DATA_RELEASED) {
|
||||
context->pointerInfo.state = CLAY_POINTER_DATA_RELEASED_THIS_FRAME;
|
||||
}
|
||||
}
|
||||
|
||||
Clay__int32_tArray dfsBuffer = context->layoutElementChildrenBuffer;
|
||||
for (int32_t rootIndex = context->layoutElementTreeRoots.length - 1; rootIndex >= 0; --rootIndex) {
|
||||
dfsBuffer.length = 0;
|
||||
@ -3845,20 +3860,6 @@ void Clay_SetPointerState(Clay_Vector2 position, bool isPointerDown) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isPointerDown) {
|
||||
if (context->pointerInfo.state == CLAY_POINTER_DATA_PRESSED_THIS_FRAME) {
|
||||
context->pointerInfo.state = CLAY_POINTER_DATA_PRESSED;
|
||||
} else if (context->pointerInfo.state != CLAY_POINTER_DATA_PRESSED) {
|
||||
context->pointerInfo.state = CLAY_POINTER_DATA_PRESSED_THIS_FRAME;
|
||||
}
|
||||
} else {
|
||||
if (context->pointerInfo.state == CLAY_POINTER_DATA_RELEASED_THIS_FRAME) {
|
||||
context->pointerInfo.state = CLAY_POINTER_DATA_RELEASED;
|
||||
} else if (context->pointerInfo.state != CLAY_POINTER_DATA_RELEASED) {
|
||||
context->pointerInfo.state = CLAY_POINTER_DATA_RELEASED_THIS_FRAME;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CLAY_WASM_EXPORT("Clay_Initialize")
|
||||
|
Loading…
Reference in New Issue
Block a user