pixeltailgames / cinema

:movie_camera: Gamemode for Garry's Mod featuring multiplayer video streaming
http://www.pixeltailgames.com/cinema/
87 stars 63 forks source link

Fullscreen not working for cinema_theatron, other maps partially fine #144

Open RadovanKaradzic opened 6 years ago

RadovanKaradzic commented 6 years ago

The fullscreen feature doesn't seem to be working these last few months, but specifically on all screens on the 'cinema_theatron' map.

If you attempt to go into fullscreen, no panel is drawn at all, and the player simply remains frozen staring at the map itself, where the original world screen is not drawn anymore.

Other default supported maps seem to be partially fine with this. For example, on theater_gcinema, only the screens facing angle (0, 90 or -90, 0) work, but perpendicular to this they do not.

A temporary fix for this is to remove the check: https://github.com/pixeltailgames/cinema/blob/cc2d90a4b0635ddf103eb09b565eab3e4cbecf8b/cinema/gamemode/modules/theater/cl_draw.lua#L45 But of course, this results in drawing both the fullscreen and world panel, which is rather laggy.

Any ideas or suggestions?

RadovanKaradzic commented 6 years ago

Issue solved. Replicate this line from the world screen draw: https://github.com/pixeltailgames/cinema/blob/cc2d90a4b0635ddf103eb09b565eab3e4cbecf8b/cinema/gamemode/modules/theater/cl_draw.lua#L71

Into the DrawFullscreen() function, round abouts here: https://github.com/pixeltailgames/cinema/blob/cc2d90a4b0635ddf103eb09b565eab3e4cbecf8b/cinema/gamemode/modules/theater/cl_draw.lua#L165

Potentially an engine-level race condition with surface.SetDrawColour() or DirectX/OpenGL equivalents (GlColor4f/shaders/etc.), something messing with these values at same time as the texture draw.

VinnieTeix commented 5 years ago

Not sure if it helps but I've noticed that when you hover you mouse to anything that "reacts" to it like the audio arrow when you hold tab, the fullscreen comes back but disappears again when you move your mouse away from it. Also you could make a instruction of applying this code to the mod? Thank you.

VinnieTeix commented 5 years ago

Do I only need to replicate the surface.SetDrawColor( 0, 0, 0, 255 ) without removing the check from if theater.Fullscreen then return end -- Don't render twice or do I need to do both?

KuwuroUsagi commented 5 years ago

-snip-or do I need to do both?

Ideally you don't want to render it twice so leave it be and look to see if the SetDrawColor line will fix it.

Another temporary fix I've seen is seemingly ulx blind allows fullscreen to work fine, Even if the amount is only 1.

VinnieTeix commented 5 years ago

I was asking because when I added the surface.SetDrawColor( 0, 0, 0, 255 ) It didn't work but turns out I forgot to uninstall the Workshop version of the Cinema gamemode which conflicted with the Cinema gamemode folder. So, after uninstalling the Workshop version of Cinema it worked prefectly fine.