ページ 11

無題

Posted: 2009年8月02日(日) 22:31
by さとり
龍神録を参考にして妖妖夢風の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なので手をつけていません

Re:無題

Posted: 2009年8月02日(日) 22:44
by ねこ
[color=red>int[/color] ch_t ch;
↑が要らないと思います。後、構造体定義したヘッダファイルがincludeされてるのか不明です。

Re:無題

Posted: 2009年8月02日(日) 23:29
by さとり
たびたびすみません。
intをはずしincludeをして構造体のエラーがなくなったのですが、新しいエラーが発生しました


graph.c: In function 'graph_ch':
graph.c:9: error: too few arguments to function 'DrawRotaGraphF'
make: *** [graph.o] Error 1

Re:無題

Posted: 2009年8月03日(月) 00:27
by
ミスです

すいません

Re:無題

Posted: 2009年8月03日(月) 19:26
by pooka
少し見ただけなので違うかもしれませんが、
DrawRotaGraphF関数の引数の最後に、「画像の左右反転を行うかのフラグ」があるので
TRUEまたはFALSEを指定すればいけるかもしれません。