Author Topic: FB Alpha 0.2.96.91 Release  (Read 40749 times)

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FB Alpha 0.2.96.91 Release
« Reply #45 on: August 09, 2008, 01:23:59 PM »
Oops! there is something I need to implement because if when trying to download a file if the directory doesnt exist FBA will crash xD, so I need to check if the directory exist, if not then create a dir before proceeding to create a new file for download ^^

SeeYaa!
 :biggrin:

kev

  • Guest
Re: FB Alpha 0.2.96.91 Release
« Reply #46 on: August 09, 2008, 02:03:33 PM »
have a look around line 690 in main.cpp, that will show you how to do it., :)

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FB Alpha 0.2.96.91 Release
« Reply #47 on: August 09, 2008, 02:45:50 PM »
have a look around line 690 in main.cpp, that will show you how to do it., :)

ThanX! ^^ I was thinking about something like that

btw, to make it easier to I modded the 'UpdatePreview(TCHAR *szPreviewDir)' function parameters to this 'UpdatePreview(TCHAR *szPreviewDir, int nImageType)' that way we can handle the directories perfectly, it doesnt matter if the user configured a directory from a USB drive, or a network path...here is and example...

Something like this could be done in filedl.cpp

switch(nImageType)
{
   case 0: // previews
   case 1: // titles
   case 2: // flyers
   ...
}

I think the modification of that function is worth ^^, because that way the file download function will be able to know what directory in the server to look for a image!

SeeYaa!
 :biggrin:

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FB Alpha 0.2.96.91 Release
« Reply #48 on: August 09, 2008, 05:11:16 PM »
Hi guys! I think the feature is almost done, lot of stuff has been checked (if not all), you can test my current build to see how the image downloading feature works by now

The current images available at my server are 'previews' and 'titles', I still need the cabinets, flyers, marquees, pcbs and control panels, but I hope to get them and upload them soon ^^ (help is welcome  :biggrin:)

I will attach the latest 'filedl.cpp' and other modified files for reference too

EDIT:


I forgot to say you must have this in 'burner_win32.h'...

// filedl.cpp
int FileDownload(TCHAR* szLocalImageDir, TCHAR* szLocalFilePath, TCHAR* szFile, int nImageType);


SeeYaa!
 :biggrin:

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FB Alpha 0.2.96.91 Release
« Reply #49 on: August 09, 2008, 07:03:05 PM »
Barry I noticed a bug happening in the official build, when the Game Info dialog is up, and start navigating and clicking around, the gamelist behind it still receiving mouse input and changing variables in memory, like the game that is currently selected...so the Game Info dialog is there but its like if it was transparent to mouse input...

I think this is probably because the way a game is selected is determined by checking the mouse commands and coordinates of the mouse action...so probably this can be fixed by temporally hiding the Game selection dialog while the Game Info dialog is active.  Other way this can be probably fixed is by changing the way a game is selected in the gamelist, iirc I have a alternate way in my old Enhanced build, so I'll be checking out my old sources to see if I can help on this matter.

SeeYaa!
 :biggrin:

Offline LittleKaneda

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +1/-0
Re: FB Alpha 0.2.96.91 Release
« Reply #50 on: August 09, 2008, 08:23:03 PM »
small glitch: mapping the game inputs for a game that uses a wheel or a flight stick -> when checking the state of the control and shift keys, one always appears to be in the ON state even when letting go.

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FB Alpha 0.2.96.91 Release
« Reply #51 on: August 09, 2008, 11:21:09 PM »
I took some time to update 'sel.cpp' a bit...I removed a lot of old code for the game selection dialog buttons that I placed long time ago all around 'sel.cpp', everything replaced with like 7 lines of simple code ^^ that do the same job, there are 2 new files that must be added to FBA source for this lines to work...'imagebutton.h', 'imagebutton.cpp' (both can be found attached in this post + the updated 'sel.cpp')

In other news, the issue with the Gamelist and the Game Info dialog is preliminary fixed by making the Game selection dialog to hide while looking at a Game Info  :smilie:, modifications for this where little and can be located in 'gameinfo.cpp', 'burner_win32.h' and 'sel.cpp'.

Basically I made the handle of the Game Selection dialog global, made it external so other modules can use it, and placed 'ShowWindow(hSelDlg, SW_HIDE)' and 'ShowWindow(hSelDlg, SW_SHOW)' in the Game Info module ^^.

I hope this updates can be implemented in the official build since it cleans and fix some things  :smilie:

PS: Almost done downloading MAME flyers, cabinets, marquees and cpanels (still haven't found a good place to download PCBs package), when finished with download I will get from those only the needed files that FBA will use and upload them to my server.

SeeYaa!
 :biggrin:

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FB Alpha 0.2.96.91 Release
« Reply #52 on: August 10, 2008, 12:19:19 AM »
I made a quick update to the Game Selection window too, you can see the attached pictures and compare before and after the update ^^

app.rc and sel.cpp are attached in the previous post with latest updates

Look at the previews locations ;p

SeeYaa!
 :biggrin:

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: FB Alpha 0.2.96.91 Release
« Reply #53 on: August 10, 2008, 12:12:26 PM »
I took some time to update 'sel.cpp' a bit...I removed a lot of old code for the game selection dialog buttons that I placed long time ago all around 'sel.cpp', everything replaced with like 7 lines of simple code ^^ that do the same job, there are 2 new files that must be added to FBA source for this lines to work...'imagebutton.h', 'imagebutton.cpp' (both can be found attached in this post + the updated 'sel.cpp')

In other news, the issue with the Gamelist and the Game Info dialog is preliminary fixed by making the Game selection dialog to hide while looking at a Game Info  :smilie:, modifications for this where little and can be located in 'gameinfo.cpp', 'burner_win32.h' and 'sel.cpp'.

Basically I made the handle of the Game Selection dialog global, made it external so other modules can use it, and placed 'ShowWindow(hSelDlg, SW_HIDE)' and 'ShowWindow(hSelDlg, SW_SHOW)' in the Game Info module ^^.

I hope this updates can be implemented in the official build since it cleans and fix some things  :smilie:

PS: Almost done downloading MAME flyers, cabinets, marquees and cpanels (still haven't found a good place to download PCBs package), when finished with download I will get from those only the needed files that FBA will use and upload them to my server.

SeeYaa!
 :biggrin:

Thanks for that. I've merged in the changes.

I haven't used the fix for the gameinfo problem though. It breaks the modal property of the dialog meaning that the user can use the menus. It's also not a great fix for when the dialog is called from the menu. Can you describe the problem in more detail and I'll look for an appropriate fix?

Be careful with UpdatePreview() too. I need to centralise it as it's used in various parts of the app slightly different each time - I need to consolidate those into one function. The nImageType function isn't needed either - if you need to know what you're rendering check the szPreviewDir variable. I plan on consolidating this function very soon.

I have also attached an updated imagebutton.cpp file too - I fixed various warnings in it.
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FB Alpha 0.2.96.91 Release
« Reply #54 on: August 10, 2008, 02:04:26 PM »
Thanks for that. I've merged in the changes.

I haven't used the fix for the gameinfo problem though. It breaks the modal property of the dialog meaning that the user can use the menus. It's also not a great fix for when the dialog is called from the menu. Can you describe the problem in more detail and I'll look for an appropriate fix?

Be careful with UpdatePreview() too. I need to centralise it as it's used in various parts of the app slightly different each time - I need to consolidate those into one function. The nImageType function isn't needed either - if you need to know what you're rendering check the szPreviewDir variable. I plan on consolidating this function very soon.

I have also attached an updated imagebutton.cpp file too - I fixed various warnings in it.

I removed my preliminary fix because i didnt notice the modal property being affected, and it didnt solve the problem completelly because sometimes it was still happening T___T

In my point of view nImageType is needed because if the user changes the previews directory name for example to 'c:\mybestpreview\' then 'szPreviewsDir' would not have its default value and the File Download function wouldn't be able to know what dir it should look for in my server...check the following pieces of my current code at filedl.cpp and you should see what I mean...

Quote
// This will return directory name without '/' or '\\'
TCHAR* getImageDirectory(int nImageType)
{

   TCHAR szDirs[DIRS_MAX][MAX_PATH] = {
        {_T("previews")},   // 0
        {_T("titles")},   // 1
        {_T("flyers")},   // 2
        {_T("cabinets")},   // 3
        {_T("marquees")},   // 4
        {_T("controls")},   // 5
        {_T("pcbs")},      // 6
   };

   return szDirs[nImageType];
}


Quote
   TCHAR szFILESERVER1[512] = _T("http://fightercore.plesk3.freepgs.com/files/neosource/fba/support/");
   TCHAR szFinalURL[512] = _T("");

   // Prepare final URL for current download
   _stprintf(szFinalURL, _T("%s%s/%s"), szFILESERVER1, getImageDirectory(nImageType), szFile);


And if I remove all that code and simply use the value inside 'szPreviewsDir' variable, the instead of looking for 'http://myserver.com/previews/' in the server URL would be looking for 'http://myserver.com/c:\mybestpreview\' ...this would be happening with Flyers, Cabinets, CPanels, etc too.

Right now I know what you mention about being careful with UpdatePreview(), because there are 2 of the functions located in 'sel.cpp' and 'gameinfo.cpp', both are a bit different in some ways of each others, including one having less parameters.

Oh and I will post some pictures of the problem with the Game Selection dialog and the Game Info asap  :wink:

SeeYaa!
 :biggrin:

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: FB Alpha 0.2.96.91 Release
« Reply #55 on: August 10, 2008, 02:17:39 PM »
You need nImageType there - but not in UpdatePreview(). :)
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FB Alpha 0.2.96.91 Release
« Reply #56 on: August 10, 2008, 02:21:49 PM »
Here i bring 2 pictures of the problem, if i change tabs the problem will still be there and probably will look for other game images while i change tabs, the other information like rom info will not change, its only a problem with images...very strange

SeeYaa!
 :biggrin:

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FB Alpha 0.2.96.91 Release
« Reply #57 on: August 10, 2008, 02:29:44 PM »
You need nImageType there - but not in UpdatePreview(). :)

Here is how Im using it right now (btw Im not telling you're wrong I just explaining my reasons, and trying to figure out another way based on your points ^^)...

this is in gameinfo.cpp...

Quote
   if (Msg == WM_NOTIFY) {
      NMHDR* pNmHdr = (NMHDR*)lParam;

      if (pNmHdr->code == TCN_SELCHANGE) {
         int TabPage= SendMessage(hTabControl, TCM_GETCURSEL, 0, 0);
         if (TabPage == 0) UpdatePreview(szAppPreviewsPath, 0);
         if (TabPage == 1) UpdatePreview(szAppTitlesPath, 1);
         if (TabPage == 2) UpdatePreview(szAppFlyersPath, 2);
         if (TabPage == 3) UpdatePreview(szAppCabinetsPath, 3);
         if (TabPage == 4) UpdatePreview(szAppMarqueesPath, 4);
         if (TabPage == 5) UpdatePreview(szAppControlsPath, 5);
         if (TabPage == 6) UpdatePreview(szAppPCBsPath, 6);
         if (TabPage == 7) DisplayRomInfo();
         if (TabPage == 8) DisplayHistory();
         return FALSE;
      }
   }

BUT I think your point is I should handle nImageType like a global integer and not like a parameter depending the situation, right? ^^

Well i will start removing the parameter to try with a global int  :smilie:

SeeYaa!
 :biggrin:

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: FB Alpha 0.2.96.91 Release
« Reply #58 on: August 10, 2008, 03:45:19 PM »
Hmmm, I can't recreate the gameinfo problem at all. Can anybody else? What OS are you using?

For UpdatePreview() - if you want to find out what type of image is being requested then just use szPreviewPath as I said. See this example from the gameinfo.cpp UpdatePreview() function.

Code: [Select]
if (fp) {
int Screenshot = 0;
if (szPreviewDir == szAppPreviewsPath || szPreviewDir == szAppTitlesPath) Screenshot = 1;
hNewImage = LoadPNG(hGameInfoDlg, fp, Screenshot);
fclose(fp);
}

This checks the path to see if it is a preview or title and if it is then it tells the LoadPNG function that it is loading a screenshot and then it gets the aspect ratio from the driver to display the image - otherwise it uses the original image aspect ratio. This is an example of how to recognise the image type from the path.
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: FB Alpha 0.2.96.91 Release
« Reply #59 on: August 10, 2008, 04:36:17 PM »
ThanX for taking a time to look at the issue Barry ^^, here you have some info of my system...

Quote
----------------------------------------------------------------------
System information:

OS:  Microsoft Windows XP Professional Service Pack 3 (build 2600)
CPU: GenuineIntel, P6 family
     1833 MHz, MMX, SSE, SSE2 (2 system processors)

Physical RAM: 1046572 KB (1022 MB) total,  408936 KB ( 399 MB) avail
Total RAM:    4194303 KB (4095 MB) total, 4194303 KB (4095 MB) avail
FB Alpha:       11612 KB in use (13016 KB peak, 12336 KB virtual)

Installed displays and display adapters:
    Plug and Play Monitor on NVIDIA GeForce Go 7400 (primary)
    Plug and Play Monitor on NVIDIA GeForce Go 7400 (disabled)


and about the UpdatePreview() I removed all the parameter modifications and made 'int nImageType' a global variable.

now the only thing I did to handle its value is this ^^ at gameinfo.cpp

Quote
   if (Msg == WM_NOTIFY) {
      NMHDR* pNmHdr = (NMHDR*)lParam;

      if (pNmHdr->code == TCN_SELCHANGE) {
         int TabPage = SendMessage(hTabControl, TCM_GETCURSEL, 0, 0);
         nImageType = TabPage;
         if (TabPage == 0) UpdatePreview(szAppPreviewsPath);
         if (TabPage == 1) UpdatePreview(szAppTitlesPath);
         if (TabPage == 2) UpdatePreview(szAppFlyersPath);
         if (TabPage == 3) UpdatePreview(szAppCabinetsPath);
         if (TabPage == 4) UpdatePreview(szAppMarqueesPath);
         if (TabPage == 5) UpdatePreview(szAppControlsPath);
         if (TabPage == 6) UpdatePreview(szAppPCBsPath);
         if (TabPage == 7) DisplayRomInfo();
         if (TabPage == 8) DisplayHistory();
         return FALSE;
      }
   }

Back to the image issue and the game selection, I noticed something interesting about the problem, the popup menu seems to have something to do with this...check the attached picture to see what I mean...oh and this is happening is you first select a game , for example '1000 Miglia: Great 1000 Miles Rally (94/07/18)' and after having it selected, select (using right click only and without left clicking it first) '19XX - the war against destiny (951207 USA)'...the menu will come and when you go to the Game Info dialog go to Titles tab, you will see the problem there...so I think the problem has to do with the Right Click and PopUp menu event.

The problem will not happen is you select a game with Left Click first and then Right Clicking on it again to see its game info.

those are my findings so far

SeeYaa!
 :biggrin: