📄 reg17.c
字号:
/*************************************************************************/
/* */
/* Copyright (c) 1997 - 1999 Accelerated Technology, Inc. */
/* */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the */
/* subject matter of this material. All manufacturing, reproduction, */
/* use, and sales rights pertaining to this subject matter are governed */
/* by the license agreement. The recipient of this software implicitly */
/* accepts the terms of the license. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* FILE NAME VERSION */
/* */
/* REG17.c 1.9 */
/* */
/* COMPONENT */
/* */
/* All */
/* */
/* DESCRIPTION */
/* */
/* This file contains the EqualRegion function. */
/* */
/* AUTHOR */
/* */
/* Giac Dinh, Accelerated Technology, Inc. */
/* */
/* DATA STRUCTURES */
/* */
/* None */
/* */
/* FUNCTIONS */
/* */
/* None */
/* */
/* DEPENDENCIES */
/* */
/* None */
/* */
/* HISTORY */
/* */
/* NAME DATE REMARKS */
/* */
/* */
/*************************************************************************/
#include "meta_wnd.h"
#include "metconst.h" /* MetaWINDOW Constant & Stucture Definitions */
#include "metports.h" /* MetaWINDOW Port & Bitmap Definitions */
#include "grafdata.h"
#include "metmacs3.h"
/* Function EqualRegion checks to see if two regios structures describe
identical regions. */
int EqualRegion( region *rg1, region *rg2 )
{
rect *rg1Rect;
rect *rg2Rect;
int rCnt;
/* Check used size */
if(rg1->rgnSize != rg2->rgnSize)
return(0);
if((rg1->rgnRect.Xmin != rg2->rgnRect.Xmin) ||
(rg1->rgnRect.Ymin != rg2->rgnRect.Ymin) ||
(rg1->rgnRect.Xmax != rg2->rgnRect.Xmax) ||
(rg1->rgnRect.Ymax != rg2->rgnRect.Ymax) )
return(0);
/* Check the header pointer */
if( (((long)rg1->rgnList - (long)rg1) != ((long)rg2->rgnList - (long)rg2)) ||
(((long)rg1->rgnListEnd - (long)rg1) != ((long)rg2->rgnListEnd - (long)rg2)) )
return(0);
/* Compare the data in the list */
rg1Rect = rg1->rgnList;
rg2Rect = rg2->rgnList;
for (rCnt = 0; rCnt <= ((int) (rg1->rgnListEnd - rg1->rgnList)); rCnt++)
{
if ((rg1Rect->Xmin != rg2Rect->Xmin) ||
(rg1Rect->Ymin != rg2Rect->Ymin) ||
(rg1Rect->Xmax != rg2Rect->Xmax) ||
(rg1Rect->Ymax != rg2Rect->Ymax)) return(0);
rg1Rect++;
rg2Rect++;
}
return(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -