⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wndo7.c

📁 nucleus 文件系统,内核和彩色图形系统,在小系统上非常好用
💻 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          */
/*                                                                       */
/*      WNDO7.c                                          1.9             */
/*                                                                       */
/* COMPONENT                                                             */
/*                                                                       */
/*      All                                                              */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This file contains the DefinePattern function.                   */
/*                                                                       */
/* AUTHOR                                                                */
/*                                                                       */
/*      Robert G. Burrill, 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"

#define maxPatSize	32


/* Function DefinePattern redefines the specified pattern index (patNDX)
to a user specified pattern.  If the pattern address (adsPAT) is NULL
then the original internal pattern is re-loaded.  Only patterns 8 thru
31 may be redefined.

NOTE:  Pattern alignments are *always* set to zero, even when re-loaded
from the default pattern set.  Thus, if the internal pattern was
(a) re-aligned and (b) reset by passing a NULL image ptr, the alignment
value will be false because the old alignment value is not saved. */
void DefinePattern(int patNDX, pattern *adsPAT)
{
	short grafErrValue;
	pattern *patPtr;

	#if	 ErrChecks
	if((patNDX > 31) || (patNDX < 8))
	{
		grafErrValue = c_DefinePa + c_BadPatt;
		nuGrafErr(grafErrValue);
		return;
	}
	#endif

	if (adsPAT == NULL)	/* check if null pointer */
	{	/* use default internal pattern data */
		patPtr = (pattern *) &FillPat[patNDX];
	}
	else
	{
		patPtr = adsPAT;
	}

	if ((patPtr->patWidth > maxPatSize) || (patPtr->patHeight > maxPatSize))
	{
		grafErrValue = c_DefinePa + c_BadPattSize;
		nuGrafErr(grafErrValue);
		return;
	}

	thePort->portPat->patAlignX[patNDX] = 0;
	thePort->portPat->patAlignY[patNDX] = 0;

	#ifdef FIXUP386
	patPtr += dllFixup;	/* fixup pattern pointer */
	#endif

	thePort->portPat->patPtr[patNDX] = patPtr;
	return;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -