DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦f5ee0c114⟧ TextFile

    Length: 1315 (0x523)
    Types: TextFile
    Notes: UNIX file
    Names: »gcoord.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦2d53db1df⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »hr/src/smgr/gcoord.c« 

TextFile

#include "graph.h"

/******************************************************************************
	gkToGlobal(pt)	- Convert a logical point to global coordinates.
	gkToLogical(pt)	- Convert a global point to logical coordinates.
	gkToLogicalX(x) - Convert an x-coordinate to logical value.
	gkToLogicalY(y) - Convert a y-coordinate to logical value.
	gkToGlobalX(x) -  Convert an x-coordinate to a global value.
	gkToGlobalY(y)  - Convert a y-coordinate to a global value.

	Entry:	pt = point structure containing the logical absolute
		     or relative coordinate.

	Exit:	point structure or coordinate value
*******************************************************************************/

POINT gkToGlobal(pt)
POINT pt;
{
	pt.x -= gkLorigin.x - gkBitMap.rect.origin.x;
	pt.y -= gkLorigin.y - gkBitMap.rect.origin.y;
	return pt;
}


POINT gkToLogical(pt)
POINT pt;
{
	pt.x -= gkBitMap.rect.origin.x - gkLorigin.x ;
	pt.y -= gkBitMap.rect.origin.y - gkLorigin.y ;
	return pt;
}

int gkToGlobalX(x)
int x;
{
	return (x - gkLorigin.x + gkBitMap.rect.origin.x);
}

int gkToGlobalY(y)
int y;
{
	return (y - gkLorigin.y + gkBitMap.rect.origin.y);
}

int gkToLogicalX(x)
int x;
{
	return (x - gkBitMap.rect.origin.x + gkLorigin.x);
}

int gkToLogicalY(y)
int y;
{
	return (y - gkBitMap.rect.origin.y + gkLorigin.y);
}