#include "DxLib.h"
#define BOX (20)
#define MESH_Y (15)
#define MESH_X (15)
#pragma warning(disable:4996)
/**********************************************マスの作成****************************************/
int PIEL(int x, int y, int color){
int Wh=GetColor(255,255,255), Bl=GetColor(70,70,255), Gr=GetColor(70,255,70), Rd=GetColor(255,155,255);
int Yl=GetColor(249,230,0), col[/url]={Wh,Bl,Rd,Yl,Gr}, sx=x*BOX, sy=y*BOX;
DrawBox(sx, sy, sx+BOX-1, sy+BOX-1, col[colo[/url], TRUE); return 0;
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){
int SetFontThickness(int TinckPal), CheckHitKey(int KeyCode), i, j, MouseX, MouseY, Gry,k=0;
int PI[MESH_Y][MESH_X]={0},d=0, sum=0;
int jMX=0, P=15, p[15][15], t[15], bango[15][15], ironanba[15][15], c; FILE *file;
ChangeWindowMode(TRUE);
if(DxLib_Init() == -1){return -1;}
SetMouseDispFlag(TRUE);
Gry=GetColor(200, 200, 200);
DrawBox(0, 0, 800, 600, Gry, TRUE);
for(i=0; i<MESH_Y; i++){
for(j=0; j<MESH_X; j++){
PIEL(j, i, 0);
}
}
/*********************************************左クリック***************************************/
while(!ProcessMessage()){
if((GetMouseInput() & MOUSE_INPUT_LEFT)){
while (GetMouseInput() & MOUSE_INPUT_LEFT);
GetMousePoint(&MouseX, &MouseY);
MouseX = MouseX/BOX;
MouseY = MouseY/BOX;
if(MouseX<MESH_X && MouseY<MESH_Y){ PI[MouseY][MouseX]++;
if( PI[MouseY][MouseX]>4) PI[MouseY][MouseX]=0;
PIEL(MouseX,MouseY, PI[MouseY][MouseX]);
}
}
}
/***************************************ファイル読み書き込み***********************************/
file=fopen("meshpanel.txt","w");
for(i=0; i<MESH_Y; i++){
for(j=0; j<MESH_X; j++){
fprintf(file,"%d ",PI[j]);
}
fprintf(file,"\n");
}
fclose(file);
file=fopen("meshpanel.txt","r");
for(i=0; i<MESH_Y; i++){
for(j=0; j<MESH_X; j++){
fscanf(file,"%d", &PI[j]);
}
}
fclose(file);
/*****************************************/
for (c = 0; c < P; c++) {
for (j=0; j<P; j++){
t[j] = p[j][c];
}
for (j = 0; j < P;j++){
ironanba[c][j] = 0;
}
while (k < P){
while ((t[j]==0) && (j< MESH_Y)) j+=j;
if (k>= MESH_Y) break;
i = t[k];
while (t[j]==i){
k+=k;
}
ironanba[c][d] =i;
d+=d;
}
}
file=fopen("takasairo.txt","w");
for (j = 0; j <= P; j++) {
for (c=0; c<P; c++){
fprintf(file,"%d",ironanba[c][j]);
}
fprintf(file,"\n");
}
fclose(file);
}
をコンパイルすると、
warning C4715: 'WinMain' : 値を返さないコントロール パスがあります
とでてきます。実行が file=fopen("takasairo.txt","w");while付近でストップします。
returnが必要なのでしょうか?