this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

#1322: int->s32 type fixes

nesbox 1ae2560f 4493f351

+7 -7
+5 -5
src/system/sdl/main.c
··· 525 525 if(crtMonitorEnabled()) 526 526 { 527 527 if(rect.w) { 528 - int temp_x = (mx - rect.x) * TIC80_FULLWIDTH / rect.w; 528 + s32 temp_x = (mx - rect.x) * TIC80_FULLWIDTH / rect.w; 529 529 if (temp_x < 0) temp_x = 0; else if (temp_x >= TIC80_FULLWIDTH) temp_x = TIC80_FULLWIDTH-1; // clip: 0 to TIC80_FULLWIDTH-1 530 530 input->mouse.x = temp_x; 531 531 } 532 532 if(rect.h) { 533 - int temp_y = (my - rect.y) * TIC80_FULLHEIGHT / rect.h; 533 + s32 temp_y = (my - rect.y) * TIC80_FULLHEIGHT / rect.h; 534 534 if (temp_y < 0) temp_y = 0; else if (temp_y >= TIC80_FULLHEIGHT) temp_y = TIC80_FULLHEIGHT-1; // clip: 0 to TIC80_FULLHEIGHT-1 535 535 input->mouse.y = temp_y; 536 536 } ··· 539 539 #endif 540 540 { 541 541 if (rect.w) { 542 - int temp_x = (mx - rect.x) * TIC80_WIDTH / rect.w + TIC80_OFFSET_LEFT; 542 + s32 temp_x = (mx - rect.x) * TIC80_WIDTH / rect.w + TIC80_OFFSET_LEFT; 543 543 if (temp_x < 0) temp_x = 0; else if (temp_x >= TIC80_FULLWIDTH) temp_x = TIC80_FULLWIDTH-1; // clip: 0 to TIC80_FULLWIDTH-1 544 544 input->mouse.x = temp_x; 545 545 } 546 546 if (rect.h) { 547 - int temp_y = (my - rect.y) * TIC80_HEIGHT / rect.h + TIC80_OFFSET_TOP; 547 + s32 temp_y = (my - rect.y) * TIC80_HEIGHT / rect.h + TIC80_OFFSET_TOP; 548 548 if (temp_y < 0) temp_y = 0; else if (temp_y >= TIC80_FULLHEIGHT) temp_y = TIC80_FULLHEIGHT-1; // clip: 0 to TIC80_FULLHEIGHT-1 549 549 input->mouse.y = temp_y; 550 550 } ··· 1683 1683 { 1684 1684 if (argc >= 2) 1685 1685 { 1686 - int pos = strlen(argv[1]) - strlen(".tic"); 1686 + s32 pos = strlen(argv[1]) - strlen(".tic"); 1687 1687 if (pos >= 0 && strcmp(&argv[1][pos], ".tic") == 0) 1688 1688 { 1689 1689 const char* url = argv[1];
+2 -2
src/system/sokol/sokol.c
··· 357 357 sokol_calc_viewport(&rect.x, &rect.y, &rect.w, &rect.h); 358 358 359 359 if (rect.w) { 360 - int temp_x = ((s32)event->mouse_x - rect.x) * TIC80_FULLWIDTH / rect.w 360 + s32 temp_x = ((s32)event->mouse_x - rect.x) * TIC80_FULLWIDTH / rect.w 361 361 if (temp_x < 0) temp_x = 0; else if (temp_x >= TIC80_FULLWIDTH) temp_x = TIC80_FULLWIDTH-1; // clip: 0 to TIC80_FULLWIDTH-1 362 362 input->mouse.x = temp_x; 363 363 } 364 364 if (rect.h) { 365 - int temp_y = ((s32)event->mouse_y - rect.y) * TIC80_FULLHEIGHT / rect.h; 365 + s32 temp_y = ((s32)event->mouse_y - rect.y) * TIC80_FULLHEIGHT / rect.h; 366 366 if (temp_y < 0) temp_y = 0; else if (temp_y >= TIC80_FULLHEIGHT) temp_y = TIC80_FULLHEIGHT-1; // clip: 0 to TIC80_FULLHEIGHT-1 367 367 input->mouse.y = temp_y; 368 368 }