viewport ?

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

viewport ?

Post by Korenn »

Code: Select all

		Point pt = RemapCoords(x, y, 241);	// (480/2)+1
		width = (vd->dpi.left + vd->dpi.width - pt.x + 95) >> 6;
		height = (vd->dpi.top + vd->dpi.height - pt.y) >> 5 << 1;
how in heaven's name can this work?

the outcome should be a width and height converted from window coords... but what's up with the 95? aaarggh ?(
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

nevermind, worked it out myself ;)
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 33 guests