Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Possible simple MaLa API addition?  (Read 2636 times)

0 Members and 1 Guest are viewing this topic.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:Yesterday at 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Possible simple MaLa API addition?
« on: June 16, 2012, 10:29:29 am »
Hey Loadman

I was just thinking through some bits with things I like to be able to do with Mala from a Plugin.

One thought occurred to me, and I thought I'd run it by you.

Would it be difficult to add a new Notification to the API that would allow plugin's to intercept image draws?

Something like

Procedure MaLaImageDraw(ImgID, x, y, w, h ); cdecl;

Where ImageID is an identifier of the Image needing to be drawn and xy etc is location/size.

The ID could be the actual filename, or it could be the image type (Marquee, snap, Cpanel, definable1, etc)

On return would be a value, "handled" true or false, if TRUE, Mala would just skip it's drawing of that image.

The intent here is to allow a plugin to effectively "take over" rendering of an image. Plugins already have access to the the underlying Mala main window, so they could grab the image, say PNG file, and render it with real transparency etc, with no additional work on the Mala side at all.

I'm not sure how easy it would be to add a notification event like that but it seems like it wouldn't be too difficult.

EDIT: The same thing for the Video window could possibly alleviate the need for the built in commercial library (ie a plugin could supply the video).


Any thoughts?



« Last Edit: June 16, 2012, 12:13:14 pm by drventure »

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:Yesterday at 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Possible simple MaLa API addition?
« Reply #1 on: September 02, 2012, 03:57:49 pm »
Well, I've done some experimenting with the idea of supporting true alpha channel images in Mala.

Here's a screenshot


In this case, I've turned off Definable1,which normally shows cabinet pics, but it's still sited in the yellow rectangle.

But now, my plugin is drawing the image (the TEST with the faded circles).

So, bottom line. It IS doable, and it's not terribly difficult, with one exception.

Mala support a fairly large number of options as to how it creates the filename that it will be looking for.

As far as I can tell, the default is pretty obvious, ROM

Mala takes the Definable1 path, appends the selected games ROM name, then checks for a few image filetypes (JPG, GIF, BMP, etc). As soon as it finds one, that's what it displays.

No problems there.

Ahhh. Just had an epiphany. Looks like the GameSelected structure has +most+ of the required info. I as really concerned that the plugin would have to try and resolve all those variations like "Num Players", Year, Genre, etc, but it looks like all of that is already resolved and passed in the GameSelected structure. Awesome.

I'm still not exactly sure what ROM + 1, ROM + 2, ROM - 1, ROM-2 are for, though.

And I'm unsure of how the Zorder will get worked out if my Plugin is drawing some things and Mala is drawing others, but this is a good step in that direction.

Loadman, if you happen to see this and could comment on the API question, that'd certainly be a more stable and consistent (and easier) solution.
« Last Edit: September 02, 2012, 04:13:27 pm by drventure »

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4305
  • Last login:August 17, 2020, 03:23:55 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: Possible simple MaLa API addition?
« Reply #2 on: October 20, 2012, 07:26:23 pm »
Rom +1 and Rom -1 and the next and previous game to the one selected. Can be handy if showing images scrolling down in the menu

camsauce

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 68
  • Last login:May 08, 2015, 06:39:26 pm
    • Spencer*Arcade
Re: Possible simple MaLa API addition?
« Reply #3 on: April 28, 2015, 10:09:13 pm »
Necro-reviving this thread! 

Did this plugin ever get released?  I'm desperate for a transparency solution for my new layout and the above looks like it would fit the bill! 

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:Yesterday at 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Possible simple MaLa API addition?
« Reply #4 on: April 29, 2015, 12:57:00 pm »
No worries about reviving.

Life has sidetracked me from Engine18 (the plugin for mala that I was hoping to get supporting these kinds of functions).

The plugin itself is functional and available for download. Using it, it becomes trivially easy to develop plug ins for Mala in .NET (C# or VB.net).  That was the original impetus for developing Engine18.

The transparency thing always bugged me about Mala too, but the code can't really effectively be opensourced, and Loadman has done a lot to maintain it but his time is limited too.

Anyway, See my sig for a link to Engine18.

If I get some time, I might try to dig back into it. Things are finally starting to settle down again in the life dept.

And if your interested in possibly working on it, let me know. I haven't yet posted Engine18 to github opensource, but that was always my intent.

camsauce

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 68
  • Last login:May 08, 2015, 06:39:26 pm
    • Spencer*Arcade
Re: Possible simple MaLa API addition?
« Reply #5 on: April 29, 2015, 03:59:55 pm »
I couldn't find the link to download it in the thread linked in your sig?

I'm curious to know if the plugin approach will even solve this.  How would it work with the Z-order, especially if you needed to draw under and over MaLa rendered elements?  Is the API exposed enough that a plugin could take care of all the graphical elements and the gamelist? 

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:Yesterday at 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Possible simple MaLa API addition?
« Reply #6 on: April 29, 2015, 07:48:52 pm »
Yeah.  The zorder issue could be difficult.  I'd just started on playing with it when I had other issues comeup. I was tending toward the idea of just drawing everything and stopping mala from drawing anything.

But imnot sure…

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:Yesterday at 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Possible simple MaLa API addition?
« Reply #7 on: April 29, 2015, 07:49:22 pm »
Yeah.  The zorder issue could be difficult.  I'd just started on playing with it when I had other issues comeup. I was tending toward the idea of just drawing everything and stopping mala from drawing anything.

But imnot sure…