A new TgSmush.dll

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderator: JeremyaFr

A new TgSmush.dll

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Jun 23, 2014 5:13 pm

Hi,

Do you remenber the TgSmush dll made by Isildur? Before that, there was a dll made by Defiant.

The first version of XCR played a video on a separate window using DirectShow. That caused Windows flickering.
Isildur solved this problem is the second version of XCR by using more low level api. The player does not use a separate window, but instead sends each frame to the xwa exe engine. But since the xwa engine is 640x480 16 bits, XCR converts the video to that resolution.

Sending each video frame to the exe is fine for the interface videos (like marko, pod or techroom) because the playing is smooth. But this was not a good solution for cutscenes (like logofinal) because the video resolution is restrained to 640x480 16-bits.

I think Isildur was close to a solution that allow smooth playing and hight resolution cutscenes. But the project was not finished.

So, like Bman has suggested, I am working on a new TgSmush.dll.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Tue Aug 05, 2014 4:12 am

Edited. Jeremy, I finished testing a new cutscene at 1280 x 1024 pixels per .bmp 24-bit colored frame, compiled into a .avi video both with and without video compression codecs.

Using Isildur's current dll file I got following results:
WinXP Pro 32-Bit or Windows 8 64-bit. Cutscene looks bad. Resolution is dumbed down 640x480 but plays and fills the whole display screen as usual.

Using your new dll file I got following results:
Still won't work under WinXP Pro 32-Bit.
Under Windows 8 64-bit, looks great (remains sharp & high color). However it seems to center the video cutscene in the center of the display screen and adds black background boarder to the left and right of the video. Does the same thing for .avi videos compiled at native 640x480 pixel frames. Is the cutscene supposed to fill the whole display screen without pixellating image quality ?
It could be just my display monitor which is setup as 1920 x 1080 desktop. But it's working. Thanks.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Aug 06, 2014 9:53 pm

Hello,

Here is the dll:
TgSmush.zip

Supported formats are .snm (redirected to the original dll), .avi, .wmv.
The video is played at fullscreen using the desktop resolution.
Internally, the dll uses DirectShow to play the video.
The aspect ratio is preserved and the video is centered to the screen.

For example, if your screen's resolution is 1920x1080 and the video resolution is 1280x1024, the rendered video size will be 1350x1080 (1280*1080/1024=1350) and a 285 ((1920-1350)/2=285) pixels wide black border will appear on left and right.

The minimal requirement is Windows XP SP2.
Last edited by JeremyaFr on Sun Jan 17, 2021 5:14 pm, edited 3 times in total.
Reason: Update download link

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Aug 07, 2014 10:34 pm

An update.
I have integrated Isildur's code into the dll. It is used to play avi files whose resolution is lower 640x480.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Thu Aug 07, 2014 11:55 pm

First in your readme it says "1) rename the original TGSMUSH.DLL to TgSmusgOrig.dll"

Is this correct to rename the TGSMUSH.DLL to TgSmusgOrig.dll with a "G" instead of a "H"???

Next tried the new Dll file, but upon starting XWA it comes up with this
Smush1.jpg
I found the file on the web and placed it in the system32 folder and because my system is Win7 64bit I also placed it in the SysWOW64 folder

tried to start XWA again, but this error message appeared
Smush2.jpg
Restarted my pc, tried to start XWA again and got the same error message

Removed your TGSmush.Dll replaced with Isildur TGSmush.dll started XWA and it played a custom cutscene

It might work with WinXP and Win8, but it seems it doesn't work with Win7 64bit :(
You do not have the required permissions to view the files attached to this post.
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Aug 08, 2014 12:51 am

Thanks for testing.

The original TGSMUSH.DLL has to be renamed to TgSmushOrig.dll.
It's the same thing as with Isildur's dll.
I have corrected the typo error in the readme.

The error related to msvcp120.dll is because your system doesn't have the visual c++ 2013 runtime dlls installed.
Here is a download link to the runtime:
Visual C++ Redistributable Packages for Visual Studio 2013: vcredist_x86.exe
http://www.microsoft.com/en-us/download ... x?id=40784

Note that this is not the final version of the dll. I have uploaded it so that compatibility issues can be more easily identified.
There may be some issues on Windows XP or if you need to use a custom ddraw.dll.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Fri Aug 08, 2014 10:57 am

I thought it was a Typo, but thought I would ask :)

And thanks for the link to visual c++ , I installed it and your new DLL ran just fine

Thanks for that :)
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat Aug 09, 2014 3:56 am

Ok, thanks for pixel resolution explanation. I won't be creating anything that small. :-) Oh, how does the color depth work? Does it still dumb down high-color frames to 16-bit depth, or does it keep the native color of the recorded .avi ?
Last edited by Bman on Tue Aug 12, 2014 3:43 am, edited 1 time in total.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Aug 09, 2014 1:45 pm

For snm files, the color depth is 16 bits.
For avi files, if the resolution of the video is lower than or equal to 640x480 then the color depth is reduced to 16 bits, otherwise the color depth of the video is used.
For wmv files, the color depth of the video is used.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue Aug 12, 2014 12:50 am

If you use the ZeqMacaw's ddraw.dll wrapper from jkhub.net (credits: ZeqMacaw, Sige, Timeslip) published in 2009, you will see an error message box.
The title is "ActiveMovie Window: XWingAlliance.exe - Entry Point Not Found".
The message is "The procedure entry point CompleteCreateSysmemSurface could not be located in the dynamic link library C:\Windows\SYSTEM32\D3DIM700.DLL".

The error appears because this wrapper does not fully/correctly wrap the system ddraw.dll.

According to the description, what this dll does is:
Changed the function used to clear the z-buffer -- from DirectDrawSurface.Blt(DDBLT_DEPTHFILL) to Direct3DViewport3.Clear2(D3DCLEAR_ZBUFFER).
This dll changes the method used to clear the depth buffer. Is there another reason to use it? If the answer is no, the simplest way to change the z-buffer clearing method is to modify the xwa exe, and to not use a custom dll to do that.

Is the use of ZeqMacaw's ddraw wrapper really needed?

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Tue Aug 12, 2014 3:54 am

Aside from the Cutscenes issue, I'd say yes, it's needed for many of us who use older ATI cards. Although the option to have both ways might help some people or not. When I installed XWA on Windows8.1 64-bit, I tested and documented that this modified "ddraw.dll" file was necessary to display 3D objects correctly, AFTER running Reimar's 32bitmode.bat patch to fix the "Targeting craft and then all goes black" screen issue, and then the "FixedClear.bat" patch too. I remember that error message only came up one or two times after I first lauched the game, never seen it occur since then and all is running well except for the minor issues of text corruption during the hangar loading "review your briefing" screen etc. Anyway, in my opinion, I think your beta version of your TGSmush.dll is working well. What are your goals to make it better ?
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue Aug 12, 2014 1:57 pm

Bman wrote:Anyway, in my opinion, I think your beta version of your TGSmush.dll is working well. What are your goals to make it better ?
If playing videos works fine, I think the dll could be considered as a definitive version.

Can you say if it works on Windows XP?

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Fri Aug 15, 2014 7:05 am

Still does not work under XP SP3 32-bit. Meaning game engine will not even start since the opening cutscene is processed first. Something in .dll it doesn't like. Thanks.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Aug 15, 2014 8:31 pm

Hello,

Could you run the following tests?

EDIT: link removed
TgSmushTests.zip
  • Test0: Check presence of Visual C++ 2013 Runtime (x86)
  • Test1: empty program
  • Test2: empty program
  • Test3: link to TgSmushOrig.dll
  • Test4: link to TgSmush.dll
  • Test5: link to TgSmush.dll from XWA exe
Last edited by JeremyaFr on Sun Aug 17, 2014 4:14 pm, edited 1 time in total.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sun Aug 17, 2014 3:10 am

Ok, Jeremy I was missing the above 2013 VB C++ runtime components. Thanks. All of those tests said OK. Results using XP Pro 32-bit SP3:
1) All of the existing custom .avi video/cutscene movies play in full screen mode like Isildur's version. There are no black boarders. Great job!

2) However, the custom .avi cutscene videos recorded in 640x480 frame format (and probably smaller) are missing audio.

3) The new High Definition .avi cutscene I finished plays fantastic, crisp detail (recorded at 1280x1024 frames), and plays it's internal audio.

Great job again. Just #2 seems to be the only problem left. Thanks.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Aug 17, 2014 4:40 pm

I have corrected the problem #2.
Just re-download TgSmush.zip. It should be fine.

Things that need to be tested:
  • snm video
  • avi video <= 640x480
  • avi video > 640x480
  • When the user presses spacebar (or by another method), the video playback must be interrupted, otherwise it must not be interrupted.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Tue Aug 19, 2014 3:20 am

Edited
Last edited by Bman on Thu Aug 21, 2014 7:04 am, edited 3 times in total.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue Aug 19, 2014 6:34 pm

Thanks for the crash report. It's very useful: the address indicates exactly where the problem is.
I have corrected that.

The keys to interrupt the playback are:
  • with keyboard: Escape, Space, Return, Back
  • with mouse: Left Button, Right Button
It's the same keys for any video (snm, avi <= 640x480, avi > 640x480, wmv).

I have tested the dll on Windows 8.1 64-bit:
  • snm: OK (I used xwa videos)
  • avi <= 640x480: OK (I used DSUCP videos)
  • avi > 640x480: OK (I used Big Buck Bunny movie)
  • wmv: OK (I used Windows 7 Wildlife sample video)

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Thu Aug 21, 2014 7:38 am

Ok, everything is working perfectly now for XP Pro SP3 32-Bit side. All custom custscene.avi frame sizes above and below default 640x480 size are fine. Tested a stock .snm video from CD and it plays fine too. The interrupt keys work fine. Perhaps if a few others can test under Win7 O/S for another week or so for errors/issues, I think this cutscene project is perfectly done. Great job on this and perfecting Isildur's work.

Edit: Also, if playing a HD/high resolution custom.avi video with Windows "Extended Desktop" projected onto a second monitor, the video will automatically be scaled down to default 640x480 display and is very pixelated. Solution is to turn off the Extended Desktop before playing XWA.

Ok to test a custom video, say it's called Battle2.avi, one must create an empty file with same name but give it a .snm extention. So just create a new text file with nothing in it, save 0Kb, and rename it, i.e.--Battle2.txt to Battle2.snm with your Battle2.avi file in the .../Movies folder. Your custom video file should also be referenced correctly in the ...FrontRes/Cutscene folder, etc.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sun Sep 21, 2014 7:24 am

Jeremy to recap, using XP-Pro SP3 32-bit, your custom TGSmush.dll works perfectly, for 640x480 and higher resolution videos.

Using Windows8.1 64-bit, the cutscenes with 640x480 frames stretch across the screen like Isildur's code did. Works fine.
When playing a 1280x1024 video cutscene, the game forces it into a 4:3 aspect ratio meaning there are still black boarders on each side of the cutscene. Is there a way to make it so it stretches across the screen too without the video pixellating and losing color quality & sharpness ?
Thanks.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Sep 25, 2014 6:27 pm

I have uploaded an update.

The dll should now work on a multi monitors system.

I have added a config file.

Code: Select all

; TgSmush.cfg
; config file for TgSmush.dll

; PreserveAspectRatio = 0 (no) or 1 (yes)
; When set to 0, the display will be stretched.
; When set to 1, the aspect ratio will be preserved.
PreserveAspectRatio = 1

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Tue Sep 30, 2014 7:56 am

Works perfectly, thanks! Great idea with the *.cfg files so people can adjust.
Last edited by Bman on Sat Sep 15, 2018 1:22 am, edited 1 time in total.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Fri Oct 24, 2014 6:43 pm

Hi Jeremy, do you think this is the final version now??
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Oct 24, 2014 8:17 pm

Here is the release (final) version 2.1:
TgSmush.2.1.zip

This dll requires Windows XP SP2 or superior.

Dufar
Recruit
Posts: 4
Joined: Fri Sep 11, 2015 9:54 pm

Post by Dufar » Sat Sep 12, 2015 12:08 am

Is this included in the 1.3 update by default?

Post Reply