Author Topic: OR audio (Bass.dll)  (Read 23560 times)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR audio (Bass.dll)
« Reply #15 on: October 10, 2019, 09:48:05 pm »
Now it works fine! But the audio and background aren't killed and reset, respectively, on clicking the File->Close all and clear scene menu... ???
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1992
    • zapsolution
Re: OR audio (Bass.dll)
« Reply #16 on: October 10, 2019, 09:48:23 pm »
Quote
Renaming the OGG file to Grid.ogg...
Yes, but we must protect us against it anyway
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1992
    • zapsolution
Re: OR audio (Bass.dll)
« Reply #17 on: October 10, 2019, 09:50:37 pm »
Quote
File->Close all and clear scene menu
I never used it until now, easy to fix
add a BassCloseChannel()
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR audio (Bass.dll)
« Reply #18 on: October 10, 2019, 09:53:01 pm »
Re. protection: who does the appropriate protection, you or me? ;)

Re. fix: should be somewhere at the beginning of the function, I presume?


But the overall effect is very, very good! Thanks a lot for this enhancement! :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1992
    • zapsolution
Re: OR audio (Bass.dll)
« Reply #19 on: October 10, 2019, 10:00:44 pm »
There is another problem

Try to use "Reload model" after that a "Close and clear scene" has been performed.
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR audio (Bass.dll)
« Reply #20 on: October 10, 2019, 10:07:28 pm »
This isn't a problem but a feature. ;)

Clearing everything also clears the memory about the last model loaded.

Reloading the model is primarily meant for actualizing the most recent changes to its materials, maps, and geo.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1992
    • zapsolution
Re: OR audio (Bass.dll)
« Reply #21 on: October 10, 2019, 11:07:54 pm »
I did this to protect the code in mobj.h starting form line 1079
but i am unsure that it is the best way to do it.

    // Load the materials in the MTL file.
    while (fscanf(pFile, "%s", szBuffer) != EOF) {
        CharLowerA(szBuffer);
        if (strcmp(szBuffer, "#playaudio") == 0) {           // 10-10-2019 Bass.dll (we must ignore this meta there)
            s1[0] = 0; s2[0] = 0; s3[0] = 0;
            fgets(szBuffer, sizeof(szBuffer), pFile);
            sscanf(szBuffer, "%s %s %s", s1, s2, s3);
        }

        switch (szBuffer[0]) {
        case 'n': // Ns
« Last Edit: October 10, 2019, 11:14:48 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR audio (Bass.dll)
« Reply #22 on: October 11, 2019, 12:10:44 am »
Alternatively,

........
        case 't': // Tr
            switch (szBuffer[1]) {
            case 'r': // Tr
                if (szBuffer[2] == 32 || szBuffer[2] == 9) { // MLL 10-10-2019: Tr should always be followed by a space or tab
                    if (pMaterial->alpha == 1.0f) { // 12-06-2015 ML: only if alpha is still default
                        fscanf(pFile, "%f", &pMaterial->alpha);
                        if (pMaterial->alpha > 0.0f) {
                            pMaterial->alpha = 1.0f - pMaterial->alpha; // 12-06-2015 ML: follow OBJ specs
                        }
                        if (pMaterial->alpha == 0.0f) { pMaterial->alpha = 1.0f; } // 02-05-2016
                    } else {
                        fgets(szBuffer, sizeof(szBuffer), pFile); // 12-06-2015 ML: ignore
                    }
                }
                break;
........


This way the style of existing code is preserved.

8)

P.S. And I also think that every two-letter case for the other parameters should be supplied with such a sanity check... ::)
« Last Edit: October 11, 2019, 08:31:58 am by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1992
    • zapsolution
Re: OR audio (Bass.dll)
« Reply #23 on: October 11, 2019, 09:03:55 am »
My friend

Indeed i think that we must protect for all the cases, this i the reason why i made the test before the switch.

To follow what you suggested here:
Re. fix:
Quote
should be somewhere at the beginning of the function, I presume?

and avoiding code duplication for each two letter-case of the other parameters.

I have attached the Version_2_80.zip sync, just to make sure that we are both using the same latest changes.

Shall we release this version as the new official one, to be able to add audio in the new material files?
« Last Edit: October 11, 2019, 01:09:05 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR audio (Bass.dll)
« Reply #24 on: October 11, 2019, 01:48:23 pm »
Patrice,

Thank you for the code!

1. Don't you think that checking only a few scarce enough two-letter abbreviations (Tr, Ns, Ka, Kd, etc.) for just one space byte after them will be much faster than checking every line in the .MTL file for a multibyte #playaudio char sequence, and thus worthy of code duplication?

2. I have added much code to my selectable MSAA/CSAA/FXAA option but it isn't either complete or fully tested yet, nor does it go well with the PP options ATM that are also far too few for a sterling release.

So if all that code is still not used then yes, we can publish another intermediary release that won't be a major one until both AA and PP options are fully complete... ???
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1992
    • zapsolution
Re: OR audio (Bass.dll)
« Reply #25 on: October 11, 2019, 03:26:30 pm »
Quote
1. Don't you think that checking only a few scarce enough two-letter abbreviations (Tr, Ns, Ka, Kd, etc.) for just one space byte after them will be much faster than checking every line in the .MTL file for a multibyte #playaudio char sequence, and thus worthy of code duplication?

Then please could you make the change for me, because i am currently working on a WinDev demo project that i would like to complete first.
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: OR audio (Bass.dll)
« Reply #26 on: October 11, 2019, 06:20:50 pm »
OK I'll do that tomorrow if you don't mind.
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 audio (Bass.dll)
« Reply #27 on: October 13, 2019, 08:05:19 am »
Patrice,

If you want to release your code as v2.80, please send me the entire set of your files for sync'ing, not just these few. There may be more differences in our code elsewhere. It's been a long time indeed since we merged last.

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

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1992
    • zapsolution
Re: OR audio (Bass.dll)
« Reply #28 on: October 13, 2019, 09:26:07 am »
Here they are, within distinct ZIP files inside of SYNC.zip
« Last Edit: October 13, 2019, 03:33:18 pm by Michael Lobko-Lobanovsky »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1992
    • zapsolution
Re: OR audio (Bass.dll)
« Reply #29 on: October 24, 2019, 05:42:29 pm »
I plan to release animated backgrounds altogether with audio, in version #2.80, to have only one version to manage, do you have any fixup to apply befeore i publish the new official version?
Patrice
(Always working with the latest Windows version available...)