本文属spanzhang原创,其blog地址为:http://blog.csdn.net/spanzhang。引用或转贴请注明出处,谢谢!!
/*/////////////////////////////////////////////////////////////////////
文件:stdafx.h
描述:pedalpoint预编译头文件
作者:张友邦
时间:2004-09-02
声明:本文件系作者辛苦熬夜的产物,任何人使用本文件请保留本描述文本。
历史:
/*/////////////////////////////////////////////////////////////////////
#if !defined(_public_h)
#define _public_h
#if _msc_ver > 1000
#pragma once
#endif // _msc_ver > 1000
#pragma warning(disable: 4786)
//////////////////////////////////////////////////////////////////////
#define null null
#define pi_half 1.57079632679489661923
#define pi 3.14159265358979323846f
#define pi2 6.28318530717958647692f
#define safedelete(objs) if(objs){ delete[] objs; objs=null; }
#define safefree(buffer) if(buffer){ globalfree(buffer); buffer = null; }
#define saferelease(obj) if(obj){ obj->release(); obj=null; }
#define displaymsg(x) {::messagebox(null,x,"pedal point v2",mb_ok|mb_iconinformation);}
//////////////////////////////////////////////////////////////////////
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
#include "sys/types.h"
#include "sys/timeb.h"
#include "windows.h"
#include "direct.h"
#include "ddraw.h"
#include "scrnsave.h"
#include "resource.h"
#include "mmsystem.h"
#include "process.h"
#include "vector"
#include "list"
#include "string"
namespace pb //public
{
extern handle eventmutex;
typedef byte byte;
typedef unsigned char uchar;
//////////////////////////////////////////////////////////////////////
//二维矢量
typedef struct vector2d
{
float x;
float y;
vector2d(float _x, float _y) : x(_x), y(_y) {}
vector2d() : x(0), y(0) {}
} vector2d;
typedef std::list<std::string> stringlist;
typedef paletteentry paletteentrys[256];
#define wave_buffer_length 1024
typedef int waveformdata[wave_buffer_length + 1];
//返回一个[0,1]随机数
float rnd();
//返回一个[0,max]随机数
float rnd(float max);
//返回一个[-1,1]之间的随机数
float rand();
float rand(float max);
//返回一个随机的符号
float randsign();
//符号函数
int sign(float num);
float trwv(float r);
float wrap(float r);
float sqr(float r);
float clip(float r);
float sgn(float r);
float pos(float r);
float sqwv(float r);
int trnc(float r);
//绕一个特定点旋转特定的角度
void rotate(int& x, int& y, int cx, int cy, float theta);
//用当前时间初始随机数
void initrandom();
//////////////////////////////////////////////////////////////////////
}; //namespace pb
//////////////////////////////////////////////////////////////////////
//end of this file.
#endif