Author Topic: PLUGIN: Direct3D v1.0 (Sprite and Theora video rendering) [2012-02-08]  (Read 4147 times)  Share 

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
Thanks! :)
I'll see about getting it downloaded and test it.

Yes, I know about not working on other platforms, and atm am not that worried about it.
So unless you can make the AGS play.movie (or what it's called) command play a movie in the BG (non-blocking), which I would rather use than a plugin... I have litte choice.
The only other choice is importing a huge amount of sprites and explode the sprite and game size. :( 

EDIT: Just finished installing the D3DX9_43 (dxwebsetup.exe I downloaded by following the CW's link), and that fixed it! :D I'm on win10, just for future reference. ;)

Thanks bunch, now I can test this pluging and see if it fixes the flipped frames bug from scotch's plugin. :D

EDIT 2: This is weird... I got this error even though my game is 32bits colour with true alpha. ??? ???
Quote
---------------------------
Adventure Game Studio
---------------------------
An internal error has occurred. Please note down the following information.
If the problem persists, post the details on the AGS Technical Forum.
(ACI version 3.4.0.13)

Error: 32bit colour mode required.

---------------------------
OK   
---------------------------
« Last Edit: 10 Jan 2017, 16:34 by Cassiebsg »
There are those who believe that life here began out there...

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
EDIT 2: This is weird... I got this error even though my game is 32bits colour with true alpha. ??? ???
Quote
---------------------------
Adventure Game Studio
---------------------------
An internal error has occurred. Please note down the following information.
If the problem persists, post the details on the AGS Technical Forum.
(ACI version 3.4.0.13)

Error: 32bit colour mode required.

---------------------------
OK   
---------------------------

This is because the plugin checks which graphics mode is set preliminary, in AGS_EngineInitGfx plugin callback, and therefore gets "incorrect" values.
Something changed in between AGS 3.2.1 and 3.4.0, probably in earlier versions AGS set up these values in advance (before actually trying to set screen mode).



EDIT:

I have checked the Plugin API description, and this is what is said there:
Quote
DLLEXPORT void AGS_EngineInitGfx(const char* driverID, void *data);
Called by AGS just before the graphics driver is initialized. This allows you to make changes to how the driver starts up.
driverID is the ID of the graphics driver in use. This can either be "D3D9" if the player is using the Direct3D driver, or "DX5" if they are using the standard DirectDraw driver.
If driverID is "D3D9", then the data parameter is a pointer to the D3DPRESENT_PARAMETERS structure that AGS is about to pass into CreateDevice. If you need to enable extra features such as the Auto Depth Stencil, then you can do so by changing the member variables at this point.
If driverID is "DX5", then the data parameter will currently be passed as NULL.
   
This event is called just as the graphics subsystem is starting, so functions that like GetScreenDimensions that rely on the screen being initialized will not work if called from this event.

Note what I marked with red color. This is actually what the plugin is doing: it calls GetScreenDimensions at that point, which is not guaranteed to work. The reason that it worked with 3.2.1 was pure luck, it's just that engine was coded in such way back then.


EDIT2:
I can with all honesty say, that I would not want to "fix" engine to work with this plugin; although we make such backwards-compatible fixes for old scripts, but how plugin is coded is not responsibility of AGS developers.
AJA seem to visit forums recently, I suggest to contact him and ask if he still has this plugin sources and whether he may fix it. Plugin needs to use callback argument (D3DPRESENT_PARAMETERS) instead of GetScreenDimensions to check screen mode.
« Last Edit: 13 Jan 2017, 15:37 by Crimson Wizard »

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
Thanks bunch for checking CW! (nod)
I'll wait a bit and see if AJA sees and replies here in the thread, before PMing him.
There are those who believe that life here began out there...

To my great surprise, I found the sources for this ancient turd, whee!

Should run in AGS 3.4.x now: http://www.serpentpictures.net/ags_d3d/ags_d3d.zip

Thanks, CW, for figuring out the fix beforehand. Saved me a lot of time, cheers! :cheesy:

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
Cool, thanks bunch you two! :)

Downloaded, activated and tested (as in yes, I can open my game now with no error! :-D ).
Looking forward to test it with the code and video now! (nod)

EDIT: eeeeewwwwwwwww..... :~( Finally had some time to test this, and now I get a game crash when trying to load the video.

Quote
---------------------------
Illegal exception
---------------------------
An exception 0xE06D7363 occurred in ACWIN.EXE at EIP = 0x76BDB727 ; program pointer is +1004, ACI version 3.4.0.13, gtags (32,400)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and post the details on the AGS Technical Forum.

in "room1.asc", line 29


Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.

An error file CrashInfo.dmp has been created. You may be asked to upload this file when reporting this problem on the AGS Forums. (code 0)
---------------------------
OK   
---------------------------

The line in question is: video = D3D.OpenVideo( "Galactica_Intro.ogv" );

Now, this video works fine if I use scotch's Theora plugin.
I basically just copy/pasted this code:
Code: Adventure Game Studio
  1. D3D_Video* video;
  2.  
  3. function room_Load()
  4. {
  5.     // Required for autoplay
  6.     D3D.SetLoopsPerSecond( GetGameSpeed() );
  7.    
  8.     // Open video file
  9.     video = D3D.OpenVideo( "TheoraVideo.ogv" );
  10.    
  11.     if ( video )
  12.     {
  13.         // Use room coordinates
  14.         video.relativeTo = eD3D_RelativeToRoom;
  15.        
  16.         // Anchor point to top left corner
  17.         video.SetAnchor( -0.5, -0.5 );
  18.        
  19.         // Play!
  20.         video.Autoplay();
  21.     }
  22.     else
  23.     {
  24.         Display( "Couldn't open video." );
  25.         return;
  26.     }
  27. }
  28.  
  29. function room_Leave()
  30. {
  31.     // Free memory when leaving the room
  32.     video = null;
  33. }
  34.  

And replaced the name of the file with my video.
Is it me that is doing something wrong?
I can provide the dump, if needed.
« Last Edit: 14 Jan 2017, 21:28 by Cassiebsg »
There are those who believe that life here began out there...