-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ditch DirectX in favor of OpenGL; use SDL window; ditch Windows Registry #1983
Conversation
Download the built assets for this pull request: |
Honestly this plays really nicely! Credit images fade in / fade out seems to work fine. Some issues I noticed (at least with HWR):
|
I made a note of these few issues after a short time testing on HWR.
@walkawayy I didn't notice anything out of the ordinary with the dragon but I can check again soon. |
Can I get direct comparison screenshots? Thanks. If anything it's using 8-bit palette rather than the 16-bit one, but I didn't notice differences so I'd appreciate a more direct example. |
@aredfan what if you use windowed mode and disable 16-bit textures? |
The controls UI is fixed, thank you, but the transparent backgrounds are now more opaque. More screenshots to follow. Left is latest dev snapshot, right is PR. Edit: I noticed the alpha textures appears different along the edges, when bilinear filter is enabled. |
@lahm86 can you check the newest build (once it finishes building) for this?
I can't test this part reliably on wine. |
Fixed! Thank you. |
@aredfan re: weird colors of UI, that's just the way it is with 8-bit palettes. Notice how the good part is actually rendered on top of the keys meshes which have a different background. |
I found these issues while testing. The end of level stats background uses the main menu image instead, with these steps:
The end of level stats background looks bugged, with these steps:
The game crashes with these steps:
or
I found this new issue, if you have bilinear filter enabled and keep pressing F12, the textures will keep zooming in. |
This is likely caused by the aspect ratio mode setting. ((Just a quick reminder, it's now located in the config instead of
Can I ask for help with this one? The original fix was to call
I'll tackle this as part of the black rectangles issue. |
The regressions in my previous reply are fixed, thank you. There are some more issues I found while doing further tests.
|
Got it, apologies. Yes, it looks OK on 16:9 in windowed mode again (so just full-screen issue remains). Maybe this should be the default aspect ration as the default window size is 1280x720? Would it be helpful if I provide a diff for the config tool option additions? Or if you'd like to keep that as a separate PR, that's understandable.
Just to add here that this only happens in windowed 4:3 aspect ratio, 16:9 appears normal.
I can't find the solution to this. I am wondering if it's Windows blocking it for some reason, there are a lot of criteria seemingly for setting the foreground window (I assume SDL is eventually calling this Windows function under the hood). Perhaps it's related to the fact the exe is still Tomb2.exe and Windows thinks we're trying to steal focus (although in my head the criteria is met so I'm really not sure). It's certainly not an issue in TR1X, so maybe we come back to address this one at a later date. |
Yeah – let's default to 16:9. I also plan to add letterboxing in case the player chooses 4:3 aspect mode but has a bigger window. I suppose we should provide some degree of configuration in the config tool, but IMO not all settings make sense, such as window width or height, or the fullscreen option. In any event I'd appreciate a diff to consolidate into this PR with the rest of the settings.
Thanks, but I believe in general the viewport logic needs adjustment as it's clearly cut when the window size is not a multiple of 32.
Thanks for looking into it. Yeah, I think it's best to tackle it as a follow-up issue. |
@rr- LMK if this looks OK. I've only added three config options: aspect ratio, fade effects and mic at Lara. Everything else I agree doesn't make sense in the config tool. diff --git a/src/tr2/config_map.def b/src/tr2/config_map.def
index 1f5f6202..e4dfa1ab 100644
--- a/src/tr2/config_map.def
+++ b/src/tr2/config_map.def
@@ -9,7 +9,7 @@ CFG_BOOL(g_Config, visuals.enable_fade_effects, true)
CFG_BOOL(g_Config, visuals.fix_item_rots, true)
CFG_ENUM(g_Config, rendering.screenshot_format, SCREENSHOT_FORMAT_JPEG, SCREENSHOT_FORMAT)
CFG_ENUM(g_Config, rendering.render_mode, RM_HARDWARE, RENDER_MODE)
-CFG_ENUM(g_Config, rendering.aspect_mode, AM_ANY, ASPECT_MODE)
+CFG_ENUM(g_Config, rendering.aspect_mode, AM_16_9, ASPECT_MODE)
CFG_ENUM(g_Config, rendering.texture_filter, GFX_TF_NN, GFX_TEXTURE_FILTER)
CFG_BOOL(g_Config, rendering.enable_zbuffer, true)
CFG_BOOL(g_Config, rendering.enable_perspective_filter, true)
diff --git a/src/tr2/game/camera.c b/src/tr2/game/camera.c
index 4da1e9e3..f2f8e13b 100644
--- a/src/tr2/game/camera.c
+++ b/src/tr2/game/camera.c
@@ -31,6 +31,7 @@
void __cdecl Camera_Initialise(void)
{
+ g_Camera.is_lara_mic = g_Config.audio.enable_lara_mic;
Camera_ResetPosition();
Output_AlterFOV(GAME_FOV * PHD_DEGREE);
Camera_Update();
diff --git a/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json b/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json
index a567aa39..00060384 100644
--- a/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json
+++ b/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json
@@ -10,6 +10,11 @@
"screenshot_format": {
"jpg": "JPEG",
"png": "PNG"
+ },
+ "aspect_mode": {
+ "any": "Any",
+ "16:9": "16:9",
+ "4:3": "4:3"
}
},
"Properties": {
@@ -41,9 +46,21 @@
"Title": "Key item pre-selection",
"Description": "When Lara presses action against a keyhole or puzzle slot, and she has the corresponding item in the inventory, that item will be pre-selected."
},
+ "aspect_mode": {
+ "Title": "Aspect mode",
+ "Description": "Set the aspect ratio of the game output."
+ },
"screenshot_format": {
"Title": "Screenshot format",
"Description": "Screenshot file format."
+ },
+ "enable_lara_mic" : {
+ "Title": "Microphone at Lara",
+ "Description": "Set the microphone to be at Lara's position. If disabled, the microphone will be at the camera's position."
+ },
+ "enable_fade_effects": {
+ "Title": "Fade effects",
+ "Description": "Enable fade transitions, for example between credit graphics."
}
}
}
diff --git a/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json b/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json
index 53c99167..e3a71e8b 100644
--- a/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json
+++ b/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json
@@ -3,6 +3,11 @@
"screenshot_format": [
"jpg",
"png"
+ ],
+ "aspect_mode": [
+ "any",
+ "16:9",
+ "4:3"
]
},
"CategorisedProperties": [
@@ -70,6 +75,12 @@
"DataType": "Bool",
"DefaultValue": true
},
+ {
+ "Field": "aspect_mode",
+ "DataType": "Enum",
+ "EnumKey": "aspect_mode",
+ "DefaultValue": "16:9"
+ },
{
"Field": "screenshot_format",
"DataType": "Enum",
@@ -82,14 +93,22 @@
"ID": "sound",
"Image": "Graphics/graphic6.jpg",
"Properties": [
-
+ {
+ "Field": "enable_lara_mic",
+ "DataType": "Bool",
+ "DefaultValue": false
+ }
]
},
{
"ID": "ui",
"Image": "Graphics/graphic7.jpg",
"Properties": [
-
+ {
+ "Field": "enable_fade_effects",
+ "DataType": "Bool",
+ "DefaultValue": true
+ }
]
}
] |
I believe the g_Camera fix should go as a separately tracked issue/PR pair as it seems to be an OG bug. |
I've noticed since previous checks the skybox appearing in the distance in e.g. Offshore Rig, but I'm wondering if this can be fixed by introducing draw dist/fade settings. And if so, it'd be fine as a follow up task IMO. I don't think this is a new issue in the PR by the way, I just skipped past certain levels with the problem. One bigger issue has appeared though since testing yesterday: SWR mode crashes for me in windowed mode, but it seems to be dependent on the window size. Unfortunately the log file doesn't produce a trace. The default window size is fine, but it consistently crashes with these values (for example) in the config.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small issue I noticed when using shift+f7 - the OSD says Z-Buffer On
.
Apart from that, everything LGTM, and thank you. 👍
Thank you for re-testing. To clarify, I see the screenshot above is taken with the software renderer, so the z-buffer setting isn't relevant there, and this sorting issue matches the OG's behavior. The issues mainly arise in HWR with the Z buffer on, when we encounter depth races in shadows or culling of objects close to the camera, which differ from the original's behavior. |
Rebased on top of #2004 which'll need to go first. Added a fix for the Z buffer near plane clipping, and an additional fix to support wireframe mode in the inventory screen. |
@rr- The transparent surfaces fix is working well, and it also fixes the same issue that was apparent in Lara's basement. I also re-checked all the issues listed in the OP, LGTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
docs/tr2/CHANGELOG.md
Outdated
- fixed black borders in windowed mode (#1645) | ||
- fixed "Failed to create device" when toggling fullscreen (#1842) | ||
- fixed distant rooms sometimes not appearing, causing the skybox to be visible when it shouldn't (#2000) | ||
- replaced fully the Windows Registry configuration with .json files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick but this is slightly awkward wording imo. I would remove fully
.
Checklist
Description
As a reminder:
Known issues:
/play 1
,/endlevel
)/play 1
, open then close the inventory,/endlevel
, skip cutscene)/play 1
, open the inventory or F5 or F6,/title
/play 1
, open the inventory or F5 or F6,/demo
, ending the demo crashes the game