Author Topic: OR code change  (Read 3394 times)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR code change
« Reply #15 on: December 06, 2019, 06:02:19 am »
Infotip.h:
BOOL IsAnimated() { // MLL -> PAT: 12-05-2019
    if (gP.bGiration || gP.bRotation || gP.bAniBkgnd)
        return TRUE;
    return FALSE;
}

;D ;D ;D ;D

All your mods have merged OK and are working as expected. Thank you!

I still think the mouse control label should be completely removed from the right-side panel. Anyway, it doesn't fully describe what mouse does and how. Mouse control is different in different modes of operation. Removing the label will add extra space and will allow us to make all the controls rotary similar to the volume control.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1806
    • zapsolution
Re: OR code change
« Reply #16 on: December 06, 2019, 12:03:33 pm »
Your thought?
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR code change
« Reply #17 on: December 06, 2019, 12:45:14 pm »
Very nice! :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1806
    • zapsolution
Re: OR code change
« Reply #18 on: December 06, 2019, 01:53:52 pm »
Here is the new GUI...

No specific comments, you will have to use WinMerge to see the many changes that have been done.  ???
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR code change
« Reply #19 on: December 06, 2019, 04:14:56 pm »
Everything seems to work as expected, thank you!

Two things to discuss:

1. A threshold looks confusing but apparently there's no glyph in Trebuchet. We can however call it Alpha value which fits in the existing checkbox label perfectly. Not very exact but passable under the circumstances.

Alternatively, can the checkbox label be implemented as a bitmap (possibly as a bitmap substrate under an empty label or a gap in the label), rather than text, to display instead of A?

2. Now that we have enough room for the checkboxes, we can make them inactive, rather than invisible, if they are not applicable to the current model. This will avoid ugly gaps in the checkbox list.

It will only require a few changes from IsWindowVisible to IsWindowEnabled throughout the sources.

What is your opinion?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1806
    • zapsolution
Re: OR code change
« Reply #20 on: December 06, 2019, 04:32:18 pm »
Currently there is no ugly gaps, because the checkbox list has been setup to display first those that are always visible.
For the labels i could replace them with disabled image buttons, but so far i would prefer to use the label "Alpha value" rather than "A threshold".

Quote
2. Now that we have enough room for the checkboxes, we can make them inactive, rather than invisible.
I have to think of it...
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR code change
« Reply #21 on: December 06, 2019, 04:47:58 pm »
There is a gap if the model uses the Animation checkbox but doesn't use Play audio.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1806
    • zapsolution
Re: OR code change
« Reply #22 on: December 06, 2019, 06:47:38 pm »
Here is the new sync version, keeping all controls always visible, using enable/disable rather than show/hide.

I hope i didn't forget anything  :o

« Last Edit: December 06, 2019, 07:42:30 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR code change
« Reply #23 on: December 06, 2019, 08:04:20 pm »
Amazing! :D

It seems to work OK, thank you my friend! :D
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Straylight Control
« Reply #24 on: December 07, 2019, 08:04:21 am »
Patrice,

You made straylight slider horizontal but you forgot to adjust its control accordingly. (its max is currently at -100 at its extreme left)

Please make the following fixes. My files differ from yours because my OR is somewhat more advanced than yours, so your line numbering may be slightly different.

Main.cpp, WndProc(), near line 3167:
    case WM_HSCROLL: // ML 02-01-2018: scene brightness
        hCtrl = (HWND)lParam;
        if (hCtrl == GetDlgItem(hWnd, IDC_BRIGHT_CONTROL)) {
            gP.rIllumFactor = SendMessage(hCtrl, TBM_GETPOS, 0, 0) / 100.0f;
            SCALEILLUM(0); SCALEILLUM(1); SCALEILLUM(2); SCALEILLUM(3);
            swprintf_s(zTxt, strSize(zTxt), L"brightness %2.0f", gP.rIllumFactor * 100 + 0.001f);
            skSetToolTipText(hCtrl, TipFormat(zTxt));

            gP.bRedraw = TRUE; // Redraw the OpenGL scene
        }
        break;


Main.cpp, wWinMain(), near line 4025:
                    SendMessage(hCtrl, TBM_SETRANGE, TRUE, MAKELONG(0, 100)); // Both WinLIFT and GDImage support negative ranges, for example -50, 50; then 0 being the medium value
                    SendMessage(hCtrl, TBM_SETPOS, TRUE, 100);


Mobj.h, Mobj_importMaterials(), near line 962:
    Mobj_strayLight(100, TRUE);            // PAT: 01-10-2018

Mobj.h, Mobj_importMaterials(), near line 1056:
                } else if(strcmp(szBuffer, "#straylight") == 0) {           // SCENE ILLUMINATION BRIGHTNESS
                    fgets(szBuffer, sizeof(szBuffer), pFile);
                    if (sscanf(szBuffer, "%d", &nStraylight) == 1) {
                        Mobj_strayLight(nStraylight, TRUE);
                    }


Mobj.h, Mobj_importGeometryFirstPass(), near line 1573:
        Mobj_strayLight(100, TRUE); // MLL 10-18-2018: init lighting for models w/ missing or undefined MTL files


Hopefully, that's all there is to it... ???
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR code change
« Reply #25 on: December 07, 2019, 08:24:35 am »
Also, I made tooltips on the new checkboxes a little more informative and consistent with each other. Please fix yours in wWinMain() accordingly:

........
                    //skSetAnchorCtrl(GetDlgItem(gP.hMain, IDC_GAUGE_CHECKBOX), ANCHOR_RIGHT);

                    hCtrl = GetDlgItem(gP.hMain, IDC_GAUGE_CONTROL);  // MLL: 12-06-2019
                    skSetAnchorCtrl(hCtrl, ANCHOR_RIGHT); skCreateToolTip(hCtrl, L"  Threshold level  ");

                    hCtrl = GetDlgItem(gP.hMain, IDC_GAUGE_CHECKBOX);  // PAT: 12-06-2019
                    skSetAnchorCtrl(hCtrl, ANCHOR_RIGHT); skCreateToolTip(hCtrl, L"  Threshold On/Off  ");

                    hCtrl = GetDlgItem(gP.hMain, IDC_GAUGE_VOLUME);  // PAT: 12-05-2019
                    skSetAnchorCtrl(hCtrl, ANCHOR_RIGHT); skCreateToolTip(hCtrl, L"  Audio volume level  ");

                    hCtrl = GetDlgItem(gP.hMain, IDC_AUDIO);  // PAT: 11-05-2019
                    skSetAnchorCtrl(hCtrl, ANCHOR_RIGHT); skCreateToolTip(hCtrl, L"  Audio On/Off  ");

                    hCtrl = GetDlgItem(gP.hMain, IDC_ANIMATION);
                    skSetAnchorCtrl(hCtrl, ANCHOR_RIGHT); skCreateToolTip(hCtrl, L"  Mesh animation On/Off  ");

                    hCtrl = GetDlgItem(gP.hMain, IDC_DEMO_MODE);
                    skSetAnchorCtrl(hCtrl, ANCHOR_RIGHT); skCreateToolTip(hCtrl, L"  Y rotation On/Off  ");

                    hCtrl = GetDlgItem(gP.hMain, IDC_BRIGHT_CONTROL);
                    skSetAnchorCtrl(hCtrl, ANCHOR_RIGHT); skCreateToolTip(hCtrl, L"  Straylight intensity  ");

                    ///////////////////////////////////////
........
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1806
    • zapsolution
Re: OR code change
« Reply #26 on: December 07, 2019, 12:21:12 pm »
Changes have been done, thank you!

and here is a new one to avoid moving unexpectedly the slider button while using the threshold gauge.


                    y = 422;
                    hCtrl = addLabel(gP.hMain, LAB_STRAYLIGHT, L"Straylight", ClientW - 129, y, 120, 13, WS_CHILD | WS_VISIBLE | SS_LEFT);
                    // ML 01-02-2018: scene brightness
                    y += 15;
                    dwStyle = WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_RIGHT;
                    hCtrl = CreateWindowExW(0, L"msctls_trackbar32", $NULL, dwStyle, ClientW - 127, y, 120, 16, gP.hMain, (HMENU)IDC_BRIGHT_CONTROL, gP.hInstance, NULL);
                    SendMessage(hCtrl, TBM_SETRANGE, TRUE, MAKELONG(0, 100)); // Both WinLIFT and GDImage support negative ranges, for example -50, 50; then 0 being the medium value
                    SendMessage(hCtrl, TBM_SETPOS, TRUE, 100);

                    y += 31;
                    hCtrl = CreateWindowEx(0, L"BUTTON", L"Alpha value", WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
                                           ClientW - 127, y, 88, 16, gP.hMain, (HMENU) IDC_GAUGE_CHECKBOX, gP.hInstance, NULL);
« Last Edit: December 07, 2019, 12:44:57 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR code change
« Reply #27 on: December 07, 2019, 02:16:49 pm »
Fixed, thank you!
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1806
    • zapsolution
Re: OR code change
« Reply #28 on: December 07, 2019, 03:00:21 pm »
Now that we have more room, would you like to have a FPS check box there?
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR code change
« Reply #29 on: December 07, 2019, 05:09:36 pm »
Yes, both FPS and Turbo!!! :-*

BTW my FPS counter now shows in green if CPU load is <= 60%, in yellow if 60% < CPU <= 80%, and in red if > 80%. :P
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)