Var r = buffer_peek(buff, offset+2, buffer_u8) // 0 - 255 Var g = buffer_peek(buff, offset+1, buffer_u8) // 0 - 255 Var b = buffer_peek(buff, offset, buffer_u8) // 0 - 255 Sounds easy when you just say it like that.Īfter struggling to find out what the actual format surface data was stored in, I was lucky enough to find someone had ran into the same problem as me and had a stab at re-implementing the function.Ĭode for( var j=0 j < surface_get_height(surf) j++ )įor( var i=0 i < surface_get_width(surf) i++ ) This turned out to be a big mistake.Īfter that I had a new plan to get this working: re-implement buffer_set_surface in a custom function. I tried implementing it, and while it worked it appeared to be bottlenecked by the file creation and I dismissed it. So how the hell was I going to make this work? The WebM player had an alternate way to get the video data, video_grab_image_frame, which saved the current video frame to a PNG. I'm inclined to believe they're speaking bullshit. Yoyo claims it's a driver error with Intel hardware, but my CPU and GPU are both AMD and I've seen people have the same issue with Nvidia GPUs. I even downloaded a known working exmaple of the function and it didn't work. Literally no data is copied from the buffer to the surface when called. The problem? buffer_set_surface is completley broken in GMS1. This very useful for extensions as it's one of the only ways to pass in image data from an extension to GMS: return the image in buffer format and then use buffer_set_surface. With buffer_get_surface and buffer_set_surface you can effectively get the raw data of a surface, manipulate it's data and then put it back into a surface. A surface can be thought of like a whiteboard where you can run drawing funcitons on it and then draw/manipulate the whole surface seperatly. So you know I mentioned buffer_set_surface? If you're unfamiliar (which I certainly was when I started), buffers in GMS are basically regions of memory which can be defined with specific size, data type and overflow handling. There was something wrong with GMS itself.ĬHAPTER 2: Buffer machine broke, understandable have a bad day However after enough troubleshooting and googling, I found out there was nothing wrong with the object or extension. I tried messing around with the object and project settings to see if there was any weirdness going on with the draw that I either missed when porting everything or stuff that mattered in GMS2 but not GMS1. and while I could hear the video's audio, there was no video to actually see. (with the only change needed being add some extra arguments to a little function called buffer_set_surface.) I was ready to test this ported extension out. With every function put in and the example object ported. (thankfully they all had the same return type and call type.) I had to carefully figure out every function's name, external name and arguments. The toughest part was porting the DLL functions as the GMS2 file with that is not easy to parse by humans. I didn't have a copy of GMS2 so I had to manually look through the gml, yyp and yy files to try and figure out how to import them into GMS1. Porting the stuff to GMS1 was just proving to be a bit tedious more than anything else so far. All I had to do was download the files and import everything into GMS1 and we'd be gravy, right? It seemed pretty much perfect outside of the fact it's GMS2-only. So after getting it working I decided to see if there was a better solution out there surely this can't be the only video playing solution of GMS? And then I found the WebM Player. I was pretty unsatisfied with it however it used a proprietary format with a slow convertor, video files were massive (even for a 256x224 video) with poor quality and upon examination the video files just seem to be zipped images+audio. A different devteam member bought the GMLVideo extension and I set about implementing it. It won't be out anytime soon but I hope this'll start this story on a suitably terrifying note) we were discussing the possibily of adding FMVs to the game, because we're that braindead apparently. Near the end of June in the Cop Mario 2 discord (that's right, we're making a sequel to Cop Mario.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |