reduce cpu usage

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@590 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-11-04 02:43:38 +00:00
parent 1e7b838d7b
commit 3e7d53b958
35 changed files with 15449 additions and 15459 deletions

View File

@@ -76,7 +76,7 @@ MwClassRec MwButtonClassRec = {
MwForceRender2, /* mouse_down */
NULL, /* key */
NULL, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -48,7 +48,7 @@ MwClassRec MwCheckBoxClassRec = {
MwForceRender2, /* mouse_down */
NULL, /* key */
NULL, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -139,7 +139,7 @@ MwClassRec MwEntryClassRec = {
MwForceRender2, /* mouse_down */
key, /* key */
NULL, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -52,7 +52,7 @@ MwClassRec MwFrameClassRec = {
NULL, /* mouse_down */
NULL, /* key */
NULL, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -40,7 +40,7 @@ MwClassRec MwImageClassRec = {
NULL, /* mouse_down */
NULL, /* key */
NULL, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -57,7 +57,7 @@ MwClassRec MwLabelClassRec = {
NULL, /* mouse_down */
NULL, /* key */
NULL, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -312,7 +312,7 @@ static int create(MwWidget handle) {
lb->selected = -1;
lb->click_time = 0;
lb->width = NULL;
lb->changed = 0;
lb->changed = 0;
MwSetInteger(handle, MwNleftPadding, 0);
MwSetInteger(handle, MwNhasHeading, 0);
@@ -506,10 +506,10 @@ static void func_handler(MwWidget handle, const char* name, void* out, va_list v
}
}
static void tick(MwWidget handle){
static void tick(MwWidget handle) {
MwListBox lb = handle->internal;
if(lb->changed){
if(lb->changed) {
lb->changed = 0;
MwForceRender(lb->frame);
}
@@ -527,7 +527,7 @@ MwClassRec MwListBoxClassRec = {
NULL, /* mouse_down */
NULL, /* key */
func_handler, /* execute */
tick, /* tick */
tick, /* tick */
NULL,
NULL,
NULL};

View File

@@ -209,7 +209,7 @@ MwClassRec MwMenuClassRec = {
mouse_down, /* mouse_down */
NULL, /* key */
func_handler, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -140,7 +140,7 @@ MwClassRec MwNumberEntryClassRec = {
mouse_down, /* mouse_down */
key, /* key */
NULL, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -180,7 +180,7 @@ MwClassRec MwOpenGLClassRec = {
NULL, /* mouse_down */
NULL, /* key */
func_handler, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -56,7 +56,7 @@ MwClassRec MwProgressBarClassRec = {
NULL, /* mouse_down */
NULL, /* key */
NULL, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -57,7 +57,7 @@ MwClassRec MwRadioBoxClassRec = {
MwForceRender2, /* mouse_down */
NULL, /* key */
NULL, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -254,7 +254,7 @@ MwClassRec MwScrollBarClassRec = {
mouse_down, /* mouse_down */
NULL, /* key */
func_handler, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -208,7 +208,7 @@ MwClassRec MwSubMenuClassRec = {
MwForceRender2, /* mouse_down */
NULL, /* key */
func_handler, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -141,34 +141,34 @@ static void func_handler(MwWidget handle, const char* name, void* out, va_list v
}
}
static void tick(MwWidget handle){
static void tick(MwWidget handle) {
MwViewport vp = handle->internal;
if(vp->vchanged){
if(vp->vchanged) {
vp->vchanged = 0;
int v = MwGetInteger(vp->vscroll, MwNvalue);
int mv = MwGetInteger(vp->vscroll, MwNmaxValue);
int l = MwGetInteger(vp->frame, MwNheight);
v = (mv - l) * (double)v / mv;
int v = MwGetInteger(vp->vscroll, MwNvalue);
int mv = MwGetInteger(vp->vscroll, MwNmaxValue);
int l = MwGetInteger(vp->frame, MwNheight);
v = (mv - l) * (double)v / mv;
if(v < 0) v = 0;
MwVaApply(vp->inframe,
MwNy, -v,
NULL);
if(v < 0) v = 0;
MwVaApply(vp->inframe,
MwNy, -v,
NULL);
}
if(vp->hchanged){
if(vp->hchanged) {
vp->vchanged = 0;
int v = MwGetInteger(vp->hscroll, MwNvalue);
int mv = MwGetInteger(vp->hscroll, MwNmaxValue);
int l = MwGetInteger(vp->frame, MwNwidth);
v = (mv - l) * (double)v / mv;
int v = MwGetInteger(vp->hscroll, MwNvalue);
int mv = MwGetInteger(vp->hscroll, MwNmaxValue);
int l = MwGetInteger(vp->frame, MwNwidth);
v = (mv - l) * (double)v / mv;
if(v < 0) v = 0;
MwVaApply(vp->inframe,
MwNx, -v,
NULL);
if(v < 0) v = 0;
MwVaApply(vp->inframe,
MwNx, -v,
NULL);
}
}
@@ -184,7 +184,7 @@ MwClassRec MwViewportClassRec = {
NULL, /* mouse_down */
NULL, /* key */
func_handler, /* execute */
tick, /* tick */
tick, /* tick */
NULL,
NULL,
NULL};

View File

@@ -524,7 +524,7 @@ MwClassRec MwVulkanClassRec = {
NULL, /* mouse_down */
NULL, /* key */
func_handler, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};

View File

@@ -44,7 +44,7 @@ MwClassRec MwWindowClassRec = {
NULL, /* mouse_down */
NULL, /* key */
func_handler, /* execute */
NULL, /* tick */
NULL, /* tick */
NULL,
NULL,
NULL};