[PLUGIN] Are we using a scale filter from winsetup.exe?

Started by DoorKnobHandle, Thu 07/10/2010 19:14:42

Previous topic - Next topic

DoorKnobHandle

Hi guys,

I have a problem. I have written a nice C++ plugin that uses the D3D9 driver to overlay any adventure game room with a fullscreen quad (a layer basically) and blends that using true additive blending. As far as I know, this effect is really not doable from within AGS any other way.

It works and gives awesome results - but one thing is bugging the living hell out of me:

(1) If the user runs the game using a graphics scale filter from winsetup.exe (say x2), that fullscreen rectangle only covers the top-left quarter of the screen. It doesn't get scaled along. Scaling that thing myself would be trivial but I haven't found a way to actually determe if the game is running at a different scale or not.

(2) If I run this (640x400 BTW) game in fullscreen instead of windowed, and only at x1 scale without modifier from winsetup.exe, it puts black bars all around the screen, to the left, right, above and below it. I don't quite know why that happens but it's always been like that on my 1920x1080 screen. Switching any options around in the game and in winsetup.exe achieves absolutely nothing, no change whatsoever. This isn't so much of a problem, but when it has the black bars on top, my fullscreen quad is offset by that as well. The bars left and right don't matter at all, but those that (I assume) AGS just draws on the screen there, the top and bottom ones, they affect the position. So the room 0/0 is actually somewhere around 100/100 in actual screen coordinates. My fullscreen quad should be at 100/100 but it is at 100/0.

Is there any way to fight these issues?

Any input is well-appreciated!

Calin Leafshade

how about checking the size of the render target?

That will give you the resolution that the game is running at.

Failing that you could just check the config file on load.


Offtopic would you like the code from my shaders plugin?

I got shaders working kinda but I dont know enough C++ and DX9 to make a decent render target queue so any shaders which require multiple passes are difficult for me to pull off and you seem to actually know what youre doing.  ::)

DoorKnobHandle

Hey, thanks! I tried it with the render target but it causes the same problem - apparently the render target is 640x400 in a 640x400 even when it's running at x2 scale. Weird.

Trying to parse the acsetup.cfg file now. That's a pretty good idea BTW! :D

EDIT: Nevermind, seems I am getting the proper resolution from the render target. Sorry for that.

Don't really have the time to work on anything apart from this project at the moment, and I don't have any experience with multiple render targets or multipass shaders myself I'm afraid. Thanks for the offer tho.

SMF spam blocked by CleanTalk