本文属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 
|