カラーはうまくいかないので外しました。 by softya(ソフト屋)
main.cpp
#include "../include/GV.h"
#define GLOBAL_INSTANCE
#include "../include/GV.h"
//現在のキー入力処理を行う
extern int GetHitKeyStateAll_2();
//受け取ったキー番号の現在の入力状態を返す
extern int CheckStateKey(unsigned char Handle);
//データのロード
extern void load();
//描画メイン
extern void graph_main();
int img_ch[2][12]; //キャラクタ画像9枚分 X2(変身用)
ch_t ch; //キャラクタデータ
//ループで必ず行う3大処理
int ProcessLoop(){
if(ProcessMessage()!=0)return -1;//プロセス処理がエラーなら-1を返す
if(ClearDrawScreen()!=0)return -1;//画面クリア処理がエラーなら-1を返す
GetHitKeyStateAll_2();//現在のキー入力処理を行う
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){
ChangeWindowMode(TRUE);//ウィンドウモード
if(DxLib_Init() == -1 || SetDrawScreen( DX_SCREEN_BACK )!=0) return -1;//初期化と裏画面化
load();//データロード
while(ProcessLoop()==0){//メインループ
graph_main();//描画メイン
if(CheckStateKey(KEY_INPUT_ESCAPE)==1)break;//エスケープが入力されたらブレイク
ScreenFlip();//裏画面反映
}
DxLib_End();//DXライブラリ終了処理
return 0;
}
struct.h
#include "../include/GV.h"
--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;
load.cpp
#include "../include/GV.h"
extern int img_ch[2][12];
void load(){
LoadDivGraph( "../dat/img/char/0.png" , 12 , 4 , 3 , 73 , 73 , img_ch[0] ) ;
}
graph.cpp
#include "../include/GV.h"
#include "../include/GV.h"
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();
}
なにがいけないのでしょうか?