MwStringPrintIntoBuffer
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit

This commit is contained in:
IoI_xD 2026-03-30 11:14:33 -07:00
commit 35d2b4bb76
21 changed files with 233 additions and 331 deletions

View file

@ -82,7 +82,7 @@ static void activate(MwWidget handle, void* client, void* user) {
v = fv / sv;
}
sprintf(buf, "%g", v);
MwPrintIntoBuffer(buf, 256, "%g", v);
MwVaApply(inp,
MwNtext, buf,

View file

@ -15,7 +15,7 @@ void color_callback(MwWidget handle, void* user_data, void* call_data) {
rgb->red &= 0xff;
rgb->green &= 0xff;
rgb->blue &= 0xff;
sprintf(hexColor, "#%02X%02X%02X", rgb->red, rgb->green, rgb->blue);
MwPrintIntoBuffer(hexColor, 8, "#%02X%02X%02X", rgb->red, rgb->green, rgb->blue);
MwSetText(window, MwNbackground, hexColor);
}

View file

@ -16,7 +16,7 @@ void activate(MwWidget handle, void* user, void* call) {
(void)user;
sprintf(msg, "You pressed: %s", MwListBoxGet(handle, *(int*)call));
MwPrintIntoBuffer(msg, 256, "You pressed: %s", MwListBoxGet(handle, *(int*)call));
msgbox = MwMessageBox(wmain, msg, "wow", MwMB_ICONINFO | MwMB_BUTTONOK);
MwAddUserHandler(MwMessageBoxGetChild(msgbox, MwMB_BUTTONOK), MwNactivateHandler, destroy, msgbox);
@ -48,7 +48,7 @@ int main() {
for(i = 0; i < len; i++) {
char sz[16];
sprintf(sz, "%d", (int)strlen(harvard[i]));
MwPrintIntoBuffer(sz, 16, "%d", (int)strlen(harvard[i]));
index = MwListBoxPacketInsert(packet, -1);
MwListBoxPacketSetIcon(packet, index, px);
MwListBoxPacketSet(packet, index, 0, harvard[i]);

View file

@ -14,7 +14,7 @@ void activate(MwWidget handle, void* user, void* call) {
(void)user;
sprintf(msg, "You pressed: %s", MwTreeViewGet(handle, call));
MwPrintIntoBuffer(msg, 256, "You pressed: %s", MwTreeViewGet(handle, call));
msgbox = MwMessageBox(wmain, msg, "wow", MwMB_ICONINFO | MwMB_BUTTONOK);
MwAddUserHandler(MwMessageBoxGetChild(msgbox, MwMB_BUTTONOK), MwNactivateHandler, destroy, msgbox);

View file

@ -32,10 +32,10 @@ void tick(MwWidget handle, void* user, void* call) {
char buf[512];
tm = localtime(&t);
sprintf(buf, "%s %02d %s", mon[tm->tm_mon], tm->tm_mday, wday[tm->tm_wday]);
MwPrintIntoBuffer(buf, 512, "%s %02d %s", mon[tm->tm_mon], tm->tm_mday, wday[tm->tm_wday]);
MwSetText(ldate, MwNtext, buf);
sprintf(buf, "%02d:%02d %s", tm->tm_hour % 12, tm->tm_min, tm->tm_hour >= 12 ? "PM" : "AM");
MwPrintIntoBuffer(buf, 512, "%02d:%02d %s", tm->tm_hour % 12, tm->tm_min, tm->tm_hour >= 12 ? "PM" : "AM");
MwSetText(ltime, MwNtext, buf);
render = 1;

View file

@ -17,7 +17,7 @@
char buffer[512];
char* string_VkResult(VkResult res) {
sprintf(buffer, "%d", res);
MwPrintIntoBuffer(buffer, 512, "%d", res);
return &buffer[0];
}
@ -292,8 +292,8 @@ void vulkan_setup(MwWidget handle) {
swapchainCreateInfo.imageExtent = (VkExtent2D){.width = ow, .height = oh},
swapchainCreateInfo.imageArrayLayers = 1,
swapchainCreateInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
VK_IMAGE_USAGE_TRANSFER_DST_BIT |
VK_IMAGE_USAGE_SAMPLED_BIT;
VK_IMAGE_USAGE_TRANSFER_DST_BIT |
VK_IMAGE_USAGE_SAMPLED_BIT;
// th is how we specify no transformation.
swapchainCreateInfo.preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
swapchainCreateInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;