Graphics warped, even when viewport, camera, and room all share same size

U

Urto

Guest
Normally cameras and stuff don't get the better of me so badly, but I've been banging my head against the wall with this one for over an hour now and just can't figure it out. I create this grid for the player by repeating the same sprite multiple times on a surface and saving it as its own sprite. The obvious problem being that it looks warped and screwy.

upload_2019-6-29_6-16-31.png

Some lines/boxes are larger than others. Let's talk height specifically.

At 32 pixels per cell and 24 cells tall, the total height should be 728. In actuality, the grid winds up being around 660 pixels tall, a huge chunk missing. I'm 99% sure there's nothing wrong with the grid sprite itself. I've triple checked all the math during its creation and even saved the sprite to a file just to make sure it all looks good there. It does.

The thing that's bugging me is I'm just trying to get going on coding this (it's a new project) and wasn't even worrying about cameras. I didn't even have viewports enabled yet and hadn't even set up any type of camera object. The default height of the room is 728 pixels, exactly the height of the grid and so I upped it to create a bit of a buffer on end end, up to 800, 32 more pixels on each side. This is when I started noticing the distortion.

I figured I'd just circumvent the issue by setting the cameras and viewports to the exact dimensions as the room, but this doesn't fix anything. The screenshot of the warped grid above is with the following settings:

upload_2019-6-29_6-21-51.png

Ironically, if I set the camera and viewports heights to the room's STARTING size of 728, it looks dandy, but that makes even less sense to me. I understand all the differences between viewports and cameras but can't understand why this image would ever be warped with a room size, cam size, and viewport size that are all identical. Can anyone explain this to me?
 

Relic

Member
Is the game going full screen or is it windowed to the size of the viewport?

What is the resolution of your monitor/screen?
 
U

Urto

Guest
Is the game going full screen or is it windowed to the size of the viewport?

What is the resolution of your monitor/screen?
It's windowed to the size of the viewport. To be sure, I've also just resized the window to the viewport... to no avail. The height of the grid still winds up being about 660 pixels tall on screen.
Code:
window_set_size(view_wport[0], view_hport[0]);
My monitor is 1920x1080.
 
Are you completely sure your monitor is 1920x1080?

Check the size of the window and the size of the display at run time, to see if any of those values are something you aren't expecting.
 

Relic

Member
Add a few regular sprites into the room to see if the created grid sprite is being scaled alone or if it is a view/camera/resolution thing.
 
U

Urto

Guest
Solved.

I start the game up in a boot room which deserializes a lot of data, etc. Because that room was still using the default room size, it became the window size and the image got scrunched to account for the inconsistent room-to-window size in the main room.
 
Top