SRC/LOADING/rooms.cpp
/** \brief reads a room portal definition.
  *
  * A check is preformed to see wether the normal lies on a coordinate axis, if not an exception gets thrown.
  */
\brief reads a room portal definition.
A check is preformed to see wether the normal lies on a coordinate axis, if not an exception gets thrown.
\ brief reads a room portal definition . A check is preformed to see wether the normal lies on a coordinate axis if not an exception gets thrown .
uint8_t * read_tr_room_portal(uint8_t * const srcPtr, tr_room_portal_t & portal)
{
    uint8_t * src = srcPtr;
	portal.adjoining_room = *(uint16_t*)(src); src+=2;
	src=read_tr_vertex16(src, portal.normal);
	src=read_tr_vertex16(src, portal.vertices[0]);
	src=read_tr_vertex16(src, portal.vertices[1]);
	src=read_tr_vertex16(src, portal.vertices[2]);
	src=read_tr_vertex16(src, portal.vertices[3]);
	if ((portal.normal.x == 1.0f) && (portal.normal.y == 0.0f) && (portal.normal.z == 0.0f))
		return src;
	if ((portal.normal.x == -1.0f) && (portal.normal.y == 0.0f) && (portal.normal.z == 0.0f))
		return src;
	if ((portal.normal.x == 0.0f) && (portal.normal.y == 1.0f) && (portal.normal.z == 0.0f))
		return src;
	if ((portal.normal.x == 0.0f) && (portal.normal.y == -1.0f) && (portal.normal.z == 0.0f))
		return src;
	if ((portal.normal.x == 0.0f) && (portal.normal.y == 0.0f) && (portal.normal.z == 1.0f))
		return src;
	if ((portal.normal.x == 0.0f) && (portal.normal.y == 0.0f) && (portal.normal.z == -1.0f))
		return src;
	return src;
}
uint8_t * read_tr_room_portal ( uint8_t * const srcPtr , tr_room_portal_t & portal ) { uint8_t * src = srcPtr ; portal . adjoining_room = * ( uint16_t * ) ( src ) ; src += 2 ; src = read_tr_vertex16 ( src , portal . normal ) ; src = read_tr_vertex16 ( src , portal . vertices [ 0 ] ) ; src = read_tr_vertex16 ( src , portal . vertices [ 1 ] ) ; src = read_tr_vertex16 ( src , portal . vertices [ 2 ] ) ; src = read_tr_vertex16 ( src , portal . vertices [ 3 ] ) ; if ( ( portal . normal . x == 1.0f ) && ( portal . normal . y == 0.0f ) && ( portal . normal . z == 0.0f ) ) return src ; if ( ( portal . normal . x == -1.0f ) && ( portal . normal . y == 0.0f ) && ( portal . normal . z == 0.0f ) ) return src ; if ( ( portal . normal . x == 0.0f ) && ( portal . normal . y == 1.0f ) && ( portal . normal . z == 0.0f ) ) return src ; if ( ( portal . normal . x == 0.0f ) && ( portal . normal . y == -1.0f ) && ( portal . normal . z == 0.0f ) ) return src ; if ( ( portal . normal . x == 0.0f ) && ( portal . normal . y == 0.0f ) && ( portal . normal . z == 1.0f ) ) return src ; if ( ( portal . normal . x == 0.0f ) && ( portal . normal . y == 0.0f ) && ( portal . normal . z == -1.0f ) ) return src ; return src ; }
\brief reads a room portal definition.
\ brief reads a room portal definition .
//	cout << "read_tr_room_portal: normal not on world axis\n";