無題
Posted: 2009年8月02日(日) 22:31
龍神録を参考にして妖妖夢風のPSP化を始めました。
それで一章から始めて今4章なのですが
どうしてもエラーが出ます。
---graph.cpp---
extern ch_t ch;
extern int img_ch[2][12];
void graph_ch(){
DrawRotaGraphF(ch.x,ch.y,1.0f,0.0f,img_ch[0][ch.img],TRUE);
}
void graph_main(){
graph_ch();
}
---load.cpp---
extern int img_ch[2][12];
void load(){
LoadDivGraph("../dat.player00.png",12,4,3,33,38,img_ch[0]);
}
---main.cpp---
//データのロード
extern void load();
//描画メイン
extern void graph_main();
int img_ch[2][12]; //キャラクタ画像9枚分 X2(変身用)
//キャラクタデータ宣言
int ch_t ch;
//ループで必ず行う3大処理
int ProcessLoop(){
if(ProcessMessage()!=0)return -1;//プロセス処理がエラーなら-1を返す
if(ClearDrawScreen()!=0)return -1;//画面クリア処理がエラーなら-1を返す
return 0;
}
int main(){
if(DxLib_Init() == -1 ) return -1;//初期化と裏画面化
load();//データロード
while(ProcessLoop()==0){//メインループ
graph_main();//描画メイン
ScreenFlip();//裏画面反映
}
DxLib_End();//DXライブラリ終了処理
return 0;
}
---struct.h---
typedef struct{
int flag; //フラグ
int cnt; //カウンタ
int power; //パワー
int point; //ポイント
int score; //スコア
int num; //残機数
int mutekicnt; //無敵状態とカウント
int shot_mode; //ショットモード
int money; //お金
int img; //画像
int slow; //スローかどうか
double x,y; //座標
}ch_t;
エラーの内容は
main.c:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ch'
chの前に何か加えろということでしょうか?
ちなみにキー関係はPSPなので手をつけていません
それで一章から始めて今4章なのですが
どうしてもエラーが出ます。
---graph.cpp---
extern ch_t ch;
extern int img_ch[2][12];
void graph_ch(){
DrawRotaGraphF(ch.x,ch.y,1.0f,0.0f,img_ch[0][ch.img],TRUE);
}
void graph_main(){
graph_ch();
}
---load.cpp---
extern int img_ch[2][12];
void load(){
LoadDivGraph("../dat.player00.png",12,4,3,33,38,img_ch[0]);
}
---main.cpp---
//データのロード
extern void load();
//描画メイン
extern void graph_main();
int img_ch[2][12]; //キャラクタ画像9枚分 X2(変身用)
//キャラクタデータ宣言
int ch_t ch;
//ループで必ず行う3大処理
int ProcessLoop(){
if(ProcessMessage()!=0)return -1;//プロセス処理がエラーなら-1を返す
if(ClearDrawScreen()!=0)return -1;//画面クリア処理がエラーなら-1を返す
return 0;
}
int main(){
if(DxLib_Init() == -1 ) return -1;//初期化と裏画面化
load();//データロード
while(ProcessLoop()==0){//メインループ
graph_main();//描画メイン
ScreenFlip();//裏画面反映
}
DxLib_End();//DXライブラリ終了処理
return 0;
}
---struct.h---
typedef struct{
int flag; //フラグ
int cnt; //カウンタ
int power; //パワー
int point; //ポイント
int score; //スコア
int num; //残機数
int mutekicnt; //無敵状態とカウント
int shot_mode; //ショットモード
int money; //お金
int img; //画像
int slow; //スローかどうか
double x,y; //座標
}ch_t;
エラーの内容は
main.c:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ch'
chの前に何か加えろということでしょうか?
ちなみにキー関係はPSPなので手をつけていません