Make glOrtho remap coordinates to vid.width and vid.height, this makes calculating coordinates in HWR_Draw2DModel easier
This commit is contained in:
1 parent
c01818e2e3
commit
7a0fb01626
2 files changed
+6
-6
No files matched your search
@@ -1559,9 +1559,9 @@ void HWR_Draw2DModel(md2_t *md2, INT32 x, INT32 y, INT32 skinnum, skincolors_t c
|
||||
|
||||
memset(&p, 0x00, sizeof(FTransform));
|
||||
|
||||
p.x = x + (vid.width/(float)vid.dup - BASEVIDWIDTH)/4;
|
||||
p.y = -100.0f; // idk man, but this makes the model not cull, kinda?
|
||||
p.z = y; // for whatever reason y and z are switched here
|
||||
p.x = x*vid.dup + (vid.width - BASEVIDWIDTH*vid.dup)/2;
|
||||
p.y = -200.0f; // idk man, but this makes the model not cull, kinda?
|
||||
p.z = y*vid.dup + (vid.height - BASEVIDHEIGHT*vid.dup)/2; // for whatever reason y and z are switched here
|
||||
|
||||
p.angley = FixedToFloat(AngleFixed(angle));
|
||||
p.anglex = 0.0f;
|
||||
@@ -1578,8 +1578,8 @@ void HWR_Draw2DModel(md2_t *md2, INT32 x, INT32 y, INT32 skinnum, skincolors_t c
|
||||
0.0f,
|
||||
-1,
|
||||
&p,
|
||||
FixedToFloat(scale) * (BASEVIDWIDTH / ((float)vid.width/vid.dup)),
|
||||
FixedToFloat(scale) * (BASEVIDHEIGHT / ((float)vid.height/vid.dup)),
|
||||
FixedToFloat(scale*vid.dup),
|
||||
FixedToFloat(scale*vid.dup),
|
||||
true,
|
||||
false,
|
||||
&Surf
|
||||
|
||||
@@ -3116,7 +3116,7 @@ void GL_Draw2DModel(model_t *model, INT32 frameIndex, INT32 duration, INT32 tics
|
||||
// thisll make sure our coords will be remapped to pixel coords
|
||||
// try to scale it to the base width and height
|
||||
// shit still be weird, and needs accounting for diff resolutions
|
||||
pglOrtho(0.0f, (float)BASEVIDWIDTH, (float)BASEVIDHEIGHT, 0.0f, NZCLIP_PLANE, FAR_ZCLIP_DEFAULT);
|
||||
pglOrtho(0.0f, (float)vid.width, (float)vid.height, 0.0f, NZCLIP_PLANE, FAR_ZCLIP_DEFAULT);
|
||||
|
||||
pglMatrixMode(GL_MODELVIEW);
|
||||
pglLoadIdentity();
|
||||
|
||||
Reference in new issue
Block a user