Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/SystemCover.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download) (as text)
Sun Aug 15 01:53:13 2010 UTC (13 years, 9 months ago) by okadu
File MIME type: text/x-chdr
File size: 1705 byte(s)


1 #ifndef SYSTEMCOVER_H_INCLUDED
2 #define SYSTEMCOVER_H_INCLUDED
3
4 char *FlashIn(char *, ...);
5 char *FlashOut(int n = -1);
6
7 void Dialog(char *, ...);
8 void ErrorDialog(char *, ...);
9 int YesNo(char *, ...);
10 int YesNoCancel(char *, ...);
11
12 BOOL SelectFile(HWND, char *, int, const char *, const char *, BOOL);
13 BOOL ColorDialog(HWND, PDWORD, DWORD);
14
15 void ShowLastError();
16
17 bool CheckFileExt(char *, char *);
18 string FixFileExt(char *, char *);
19 void CutPath(char *);
20 void CutFileName(char *, char *);
21 void GetAppPath(char *);
22 void MoveToFile(char *);
23 bool CheckSlash(const char *);
24
25 string ExpandDoubleQuote(const string &);
26 string RestoreDoubleQuote(const string &);
27
28 /*
29 * キーチェック
30 */
31 inline bool CheckShift(){
32 return (GetKey(DIK_LSHIFT)|GetKey(DIK_RSHIFT))>=S_PUSH;
33 }
34 inline bool CheckCtrl(){
35 return (GetKey(DIK_LCONTROL)|GetKey(DIK_RCONTROL))>=S_PUSH;
36 }
37 inline bool CheckAlt(){
38 return (GetKey(DIK_LALT)|GetKey(DIK_RALT))>=S_PUSH;
39 }
40
41 /*
42 * 高速移動チェック
43 */
44 inline float CheckFast(){
45 return CheckCtrl() ? 10.0f : 1.0f;
46 }
47
48 /*
49 * リピート判定
50 */
51 inline bool PickRepeat(int *r, int s){
52 *r = s==S_PUSH ? 1 : (*r<1 ? 2 : *r+1);
53 return *r==1 || *r>REPEAT_FRAME;
54 }
55
56 /*
57 * 四捨五入
58 */
59 inline int Round(float v){ return (int)(v>0.0f ? v+0.5f : v-0.5f); }
60 inline int Round(double v){ return (int)(v>0.0 ? v+0.5 : v-0.5); }
61
62 /*
63 * マンハッタン距離
64 */
65 inline int Manhattan(POINT pa, POINT pb){
66 return abs(pa.x-pb.x)+abs(pa.y-pb.y);
67 }
68
69 /*
70 * ファイルにベクトル値の保存
71 */
72 inline void V3Save(
73 FILE *df, // ファイル
74 VEC3 &v, // ベクトル
75 char *e // サフィックス
76 ){
77 fprintf(df, "(%f, %f, %f)%s", v.x, v.y, v.z, e);
78 }
79
80 #endif

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26