Hello everyone!
After a lot of time I found a way to implement a widescreen in the PT Source!
The reason that I'm posting it in the Dev section is because it's not complete yet and I hope that you guys will help me to develop it.
Let's look in here(src\smLib3d\smRend3d.cpp):
The original source didn't have the IF statement and it looked like that:
I found out that if "s_DxProjection_w" is increased, then the game width is increased (which is what we are looking for).
No matter what the resolution is, "s_DxProjection_h" always equals to "2.68110371".
"s_DxProjection_w" is affected by ""s_DxProjection_h" as you can see and by the resolution ratio.
For example a 4:3 resolution would generate a:
A 16:9 resolution:
I'm not sure why h/w result is the correct ratio instead of w/h but the bottom line is that the width is adjusted correctly.
So if the code is right why in a 16:9 we keep on seeing black bars? I have no idea but what I do know is that if the value of "s_DxProjection_w" is equals "2" everything is printed properly in a 16:9 resolution:
(1366x768)
So bottom line the widescreen is working, but I had to change code that seems to be right! I'll keep posting if I find out more information about it.
I would love to hear your opinion and help me and you work it out!
After a lot of time I found a way to implement a widescreen in the PT Source!
The reason that I'm posting it in the Dev section is because it's not complete yet and I hope that you guys will help me to develop it.
Let's look in here(src\smLib3d\smRend3d.cpp):
Code:
void SetDxProjection( float radians, int SizeX, int SizeY, float near_z, float far_z )
{
s_DxProjection_h = float(1.f / tan(radians/2.f));
//Imri's edit
if (SizeY / SizeX < 0.75)
s_DxProjection_w = 2;
else
s_DxProjection_w = s_DxProjection_h / (float(SizeX) / float(SizeY));
s_DxProjection_q1 = far_z / (far_z - near_z);
s_DxProjection_q2 = -near_z * s_DxProjection_q1;
s_CenterX = SizeX >> 1;
s_CenterY = SizeY >> 1;
float fWinSizeOffset_X = float(SizeX) / 800.f;
float fWinSizeOffset_Y = float(SizeY) / 600.f;
g_fZoomInAdd_x = (30.f * fWinSizeOffset_X);
g_fZoomInAdd_y = (337.f * fWinSizeOffset_Y);
g_fZoomInDiv_x = (float(SizeX) / (320.f * fWinSizeOffset_X));
g_fZoomInDiv_y = (float(SizeY) / (240.f * fWinSizeOffset_Y));
}
The original source didn't have the IF statement and it looked like that:
Code:
s_DxProjection_h = float(1.f / tan(radians/2.f));
s_DxProjection_w = s_DxProjection_h / (float(SizeX) / float(SizeY));
I found out that if "s_DxProjection_w" is increased, then the game width is increased (which is what we are looking for).
No matter what the resolution is, "s_DxProjection_h" always equals to "2.68110371".
"s_DxProjection_w" is affected by ""s_DxProjection_h" as you can see and by the resolution ratio.
For example a 4:3 resolution would generate a:
Code:
h = 2.68110371
w = 2.01082778
h/w = 1.33 = 4/3 = 1.33
A 16:9 resolution:
Code:
h = 2.68110371
w = 1.50812078
h/w = 1.77 = 16/9 = 1.77
I'm not sure why h/w result is the correct ratio instead of w/h but the bottom line is that the width is adjusted correctly.
So if the code is right why in a 16:9 we keep on seeing black bars? I have no idea but what I do know is that if the value of "s_DxProjection_w" is equals "2" everything is printed properly in a 16:9 resolution:
(1366x768)
So bottom line the widescreen is working, but I had to change code that seems to be right! I'll keep posting if I find out more information about it.
I would love to hear your opinion and help me and you work it out!
Last edited: