実行画面を上にドラッグして放すと
ドラッグする前の位置にy座標が戻ってしまいます。
上以外は問題ないです。
下や左右に移動しても座標が戻ることはありません。
どうすればこの状態を解消できるでしょうか?
ご助力の程、よろしくお願いします。
//main.cpp
#include "DxLib.h"
#include "dayData.h"
#include "draw_clock.h"
#include "Setup.h"
void jihou(struct dayData* day);
void plan(struct dayData* day);
void Time(struct dayData* day);
void date(struct dayData* day);
void version(struct dayData* day);
int title(int,struct dayData* day);
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ){
struct dayData day[450];
// マウス状態管理用変数
int nClickNow = 0 , nClickPrev = 0;
int nClickNow_R = 0 , nClickPrev_R = 0;
int nClickR_Count = 0;
int status = 0,temp = 0;
bool menu_flg = false;
// 画面モードの変更
SetGraphMode( 1680 , 1050 , 32 ) ;//パソコンの解像度に合わせる
SetMainWindowText("clock");
ChangeWindowMode( TRUE );
// ウインドウの透過色モードON
SetUseBackBufferTransColorFlag( TRUE ) ;
SetWindowStyleMode(2);
SetAlwaysRunFlag( TRUE ) ;
if ( DxLib_Init( ) == -1 ) return -1;
SetDrawScreen(DX_SCREEN_BACK);
Load_Graph();
Setup_load(day);//設定を読み込む
plan(day);//予定を音声再生する
int NewMouse = 0, OldMouse = GetMouseInput( );
while (ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0){
if((NewMouse = GetMouseInput()) != OldMouse && NewMouse & MOUSE_INPUT_LEFT) {
SendMessage(GetMainWindowHandle(), WM_NCLBUTTONDOWN, HTCAPTION, 0);//ウインドウを移動させる為、ウインドウ枠をクリックしたと思わせる
}
OldMouse = NewMouse;
draw_face(day);
draw_clock(day);
// マウス状態の更新
nClickNow = (GetMouseInput() & MOUSE_INPUT_LEFT);
nClickNow_R = (GetMouseInput() & MOUSE_INPUT_RIGHT);
if( nClickNow_R )nClickR_Count++;//右クリックを押しているときはカウントアップ
else{nClickR_Count = 0;}//それ以外ではカウントを0にする
if ( nClickNow_R && !nClickPrev_R){
if(status){
menu_flg = false;
status = 0;
}
else{
menu_flg = true;
status = -1;
}
if(temp)temp = 0;
}
if(menu_flg)temp = title(status,day);
if( nClickNow && !nClickPrev){
if(temp == 1){
Time(day);
}
else if(temp == 2 ){
date(day);
}
else if(temp == 4 ){
Setup(temp,day);//引数はtemp
Setup_save(day);//設定を書き込む
Setup_load(day);//変更された設定を読み込む
}
else if(temp == 6){
return 0;
}
else if(status == 3){
Setup(status,day);//引数はstatus
Setup_save(day);//設定を書き込む
Setup_load(day);//変更された設定を読み込む
}
if(temp)status = temp;
}
if(status == 3){
Setup_draw(day);
}
else if(status == 5){
version(day);
}
// 今回のクリック状態を保持する
nClickPrev = nClickNow;
nClickPrev_R = nClickNow_R;
jihou(day);//全ての描画関数が終わってから呼ぶ
}
DxLib_End();
return 0;
}
//draw_clock.h
void draw_clock(struct dayData* day);
void draw_face(struct dayData* day);
void draw_mouse(struct dayData* day);
void Load_Graph();
extern int GHandle[20];
//draw_clock.cpp
#include <time.h>
#include "DxLib.h"
#include "dayData.h"
#include "Setup.h"
#pragma warning ( disable : 4996 )
#define face_width 64
#define needle_x clock_x + 96
#define needle_y clock_y + 96
#define FontSize 16
#define PI 3.1415926535897932384626433832795f
int GHandle[20];
int GHandle_F[5][16];
void draw_clock(struct dayData* day){
time_t timer;
struct tm *local;
timer = time(NULL);//現在時刻を取得
local = localtime(&timer); //地方時に変換
// 読みこんだグラフィックを回転描画
DrawGraph( clock_x , clock_y , GHandle[0] , TRUE ) ;//文字盤
DrawRotaGraph2( needle_x, needle_y, 1, 1, 1.0,( (local->tm_hour%12)*30 + (local->tm_min/2) + 180)*PI/180, GHandle[1], TRUE ) ;//短針 時間*30度%12時間 + 分/2 1分毎に0.5度づつ進む為/2
DrawRotaGraph2( needle_x, needle_y, 1, 1, 1.0,( (local->tm_min*6) + 180)*PI/180, GHandle[2], TRUE ) ;//長針
DrawRotaGraph2( needle_x, needle_y, 1, 1, 1.0,( (local->tm_sec*6) + 180)*PI/180, GHandle[3], TRUE ) ;//秒針
}
void draw_face(struct dayData* day){
static int frmcnt = 0;//フレームカウント
frmcnt++;
//現状の数値は1199フレーム(約20秒) 数列は11990
int blink = (day + 8) -> number[0] * 1000 + (day + 8) -> number[1] * 100 + (day + 8) -> number[2] * 10 + (day + 8) -> number[3];
if(frmcnt % blink >= 0 && frmcnt % blink <= (day + 9) -> number[0] ){
DrawGraph( chara_x , chara_y , GHandle_F[ character ][ 1 ] , TRUE ) ;//2枚目(目パチ) アニメーションスピードは3フレーム
}
else{
DrawGraph( chara_x , chara_y , GHandle_F[ character ][ 0 ] , TRUE ) ;//通常時の顔
}
}
void draw_mouse(struct dayData* day){
static int frmcnt = 0;//フレームカウント
frmcnt++;
static int arr = 2;
if( frmcnt % (day + 10) -> number[0] == 0){
DrawGraph( chara_x , chara_y , GHandle_F[ character ][ arr++ ] , TRUE ) ;//3枚目からアニメーション10枚 アニメーションスピードは3フレーム
}
if(arr == 12)arr -= 10;
}
void Load_Graph(){
GHandle[0] = LoadGraph( "Resourse./PNG/mojiban.png" );
GHandle[1] = LoadGraph( "Resourse./PNG/tanshin.png");
GHandle[2] = LoadGraph( "Resourse./PNG/cyoushin.png" );
GHandle[3] = LoadGraph( "Resourse./PNG/byoushin.png");
LoadDivGraph( "Resourse./PNG/menu.png" , 14 , 2 , 7 , 128 , 16 , GHandle + 4 ) ;
GHandle[18] = LoadGraph( "Resourse./PNG/menu.png") ;
GHandle[19] = LoadGraph( "Resourse./PNG/chara_name.png") ;
LoadDivGraph( "Resourse./PNG/face_00.png" , 16 , 4 , 4 , face_width , face_width , GHandle_F[0] ) ;
LoadDivGraph( "Resourse./PNG/face_01.png" , 16 , 4 , 4 , face_width , face_width , GHandle_F[1] ) ;
LoadDivGraph( "Resourse./PNG/face_02.png" , 16 , 4 , 4 , face_width , face_width , GHandle_F[2] ) ;
LoadDivGraph( "Resourse./PNG/face_03.png" , 16 , 4 , 4 , face_width , face_width , GHandle_F[3] ) ;
LoadDivGraph( "Resourse./PNG/face_04.png" , 16 , 4 , 4 , face_width , face_width , GHandle_F[4] ) ;
}
//title.cpp
#include "DxLib.h"
#include "draw_clock.h"
#include "dayData.h"
#include "Setup.h"
#define FontSize 16
#define across 192//文字盤の直径
#define menu_x chara_x
#define menu_y chara_y + 64
#define menu_width 128
int title(int menu_number,struct dayData* day){
int status = 0;
int MouseX=0,MouseY=0;
if(menu_number != 3 && menu_number != 5){//オプションとバージョン情報以外
DrawGraph( menu_x , menu_y , GHandle[4] , TRUE ) ;//時刻 白色
DrawGraph( menu_x , menu_y + FontSize , GHandle[6] , TRUE ) ;//日付・曜日 白色
DrawGraph( menu_x , menu_y + FontSize * 2 , GHandle[8] , TRUE ) ;//オプション 白色
DrawGraph( menu_x , menu_y + FontSize * 3 , GHandle[4] , TRUE ) ;//時報
DrawRectGraph( menu_x + 80, menu_y + FontSize * 3 , FontSize * 3 * ( day + 5 ) -> number[0] , 240 , FontSize * 3 , FontSize, GHandle[18], TRUE, FALSE ) ;//ON/OFF
DrawRectGraph( menu_x, menu_y + FontSize * 4 , 0 , 160 , menu_width , FontSize, GHandle[18], TRUE, FALSE ) ;//バージョン情報 白色
DrawRectGraph( menu_x, menu_y + FontSize * 5 , 0 , 192 , menu_width , FontSize, GHandle[18], TRUE, FALSE ) ;//終了
// マウスの位置を取得
GetMousePoint( &MouseX , &MouseY ) ;
if(MouseX > menu_x && MouseX < menu_x + menu_width){
if(MouseY >= menu_y && MouseY < menu_y + FontSize){
DrawGraph( menu_x , menu_y , GHandle[5] , TRUE ) ;//時刻の色変更
status = 1;
}
else if(MouseY >= menu_y + FontSize && MouseY < menu_y + FontSize * 2){
DrawGraph( menu_x , menu_y + FontSize , GHandle[7] , TRUE ) ;//日付・曜日の色変更
status = 2;
}
else if(MouseY >= menu_y + FontSize * 2 && MouseY < menu_y + FontSize * 3){
DrawGraph( menu_x , menu_y + FontSize * 2 , GHandle[9] , TRUE ) ;//オプションの色変更
status = 3;
}
else if(MouseY >= menu_y + FontSize * 3 && MouseY < menu_y + FontSize * 4){
DrawGraph( menu_x , menu_y + FontSize * 3 , GHandle[5] , TRUE ) ;//時報
DrawRectGraph( menu_x + 80, menu_y + FontSize * 3 , FontSize * 3 * ( day + 5 ) -> number[0] + 128 , 240 , FontSize * 3 , FontSize, GHandle[18], TRUE, FALSE ) ;//ON/OFF
status = 4;
}
else if(MouseY >= menu_y + FontSize * 4 && MouseY < menu_y + FontSize * 5){
DrawRectGraph( menu_x, menu_y + FontSize * 4 , 128 , 160 , menu_width, FontSize, GHandle[18], TRUE, FALSE ) ;//バージョンの色変更
status = 5;
}
else if(MouseY >= menu_y + FontSize * 5 && MouseY < menu_y + FontSize * 6){
DrawRectGraph( menu_x, menu_y + FontSize * 5 , 128 , 192 , menu_width, FontSize, GHandle[18], TRUE, FALSE ) ;//終了の色変更
status = 6;
}
else
status = 0;
}
}
return status;
}
//Setup.h
void Setup_draw(struct dayData* day);
void Setup(int,struct dayData* day);
void Setup_load(struct dayData* day);
void Setup_save(struct dayData* day);
extern int character;
extern int ch;
extern int clock_x;
extern int clock_y;
extern int chara_x;
extern int chara_y;
//Setup.cpp
#include "DxLib.h"
#include "dayData.h"
#include "draw_clock.h"
#define FontSize 16
#define menu_x chara_x
#define menu_y chara_y + 64
#define menu_width 160//オプション画面の横文字の長さ フォントサイズが16なので10文字分
int character = 0;
int ch = 0;
int chara_x = 0;
int chara_y = 0;
int clock_x = 0;
int clock_y = 0;
void Setup_draw(struct dayData* day){
int MouseX=0,MouseY=0;
int week[4] = { (day + 0) -> number[0], (day + 1) -> number[0], (day + 2) -> number[0], (day + 3) -> number[0]};
int shift[4] = {0,0,0,0};//描画元の画像を変更する変数
int byougamoto_x[10] = {0,0,0,0,0,0,0,0,0,0} , byougamoto_y[10] = {0,0,0,0,0,0,0,0,0,0};
DrawGraph( menu_x , menu_y , GHandle[10] , TRUE ) ;//燃える
DrawGraph( menu_x , menu_y + FontSize , GHandle[12] , TRUE ) ;//燃えない
DrawGraph( menu_x , menu_y + FontSize * 2 , GHandle[14] , TRUE ) ;//資源
DrawGraph( menu_x , menu_y + FontSize * 3 , GHandle[16] , TRUE ) ;//再生日切り替え
DrawRectGraph( menu_x, menu_y + FontSize * 4 , 0, 224, 128, FontSize, GHandle[18], TRUE, FALSE ) ;//キャラクター
DrawRectGraph( menu_x + 112, menu_y + FontSize * 4 , 0, character * FontSize, 48, FontSize, GHandle[19], TRUE, FALSE ) ;//名前
//マウスの位置を取得
GetMousePoint( &MouseX , &MouseY ) ;
if(MouseX > menu_x && MouseX < menu_x + menu_width){
if(MouseY >= menu_y && MouseY < menu_y + FontSize){
DrawGraph( menu_x , menu_y , GHandle[11] , TRUE ) ;//文字の色変更 燃える
shift[0] = 128;
}
else if(MouseY >= menu_y + FontSize && MouseY < menu_y + FontSize * 2){
DrawGraph( menu_x , menu_y + FontSize , GHandle[13] , TRUE ) ;//文字の色変更 燃えない
shift[1] = 128;
}
else if(MouseY >= menu_y + FontSize * 2 && MouseY < menu_y + FontSize * 3){
DrawGraph( menu_x , menu_y + FontSize * 2 , GHandle[15] , TRUE ) ;//資源
shift[2] = 128;
}
else if(MouseY >= menu_y + FontSize * 3 && MouseY < menu_y + FontSize * 4){
DrawGraph( menu_x , menu_y + FontSize * 3 , GHandle[17] , TRUE ) ;//再生日切り替え
shift[3] = 128;
}
else if(MouseY >= menu_y + FontSize * 4 && MouseY < menu_y + FontSize * 5){
DrawRectGraph( menu_x, menu_y + FontSize * 4 , 128, 224, 128, FontSize, GHandle[18], TRUE, FALSE ) ;//キャラクター
DrawRectGraph( menu_x + 112, menu_y + FontSize * 4 , 128, character * FontSize, 48, FontSize, GHandle[19], TRUE, FALSE ) ;//名前
}
}
for(int i = 0; i<5; i++){
if(i == 3){
byougamoto_x[i] = week[i] * FontSize * 3 + shift[i];
byougamoto_y[i] = 112;
if(week[i]){
DrawRectGraph( menu_x + menu_width - FontSize * 3, menu_y + FontSize * i , byougamoto_x[i], byougamoto_y[i], FontSize * 3, FontSize, GHandle[18], TRUE, FALSE ) ;//前日
}
else{
DrawRectGraph( menu_x + menu_width - FontSize * 3, menu_y + FontSize * i , byougamoto_x[i], byougamoto_y[i], FontSize * 3, FontSize, GHandle[18], TRUE, FALSE ) ;//当日
}
}
else{
byougamoto_x[i] = week[i] * FontSize + shift[i];
byougamoto_y[i] = 144;
switch( week[i] ){
case 0:
DrawRectGraph( menu_x + menu_width - FontSize * 3, menu_y + FontSize * i , byougamoto_x[i], byougamoto_y[i], FontSize, FontSize, GHandle[18], TRUE, FALSE ) ;//日
break;
case 1:
DrawRectGraph( menu_x + menu_width - FontSize * 3, menu_y + FontSize * i , byougamoto_x[i], byougamoto_y[i], FontSize, FontSize, GHandle[18], TRUE, FALSE ) ;//月
break;
case 2:
DrawRectGraph( menu_x + menu_width - FontSize * 3, menu_y + FontSize * i , byougamoto_x[i], byougamoto_y[i], FontSize, FontSize, GHandle[18], TRUE, FALSE ) ;//火
break;
case 3:
DrawRectGraph( menu_x + menu_width - FontSize * 3, menu_y + FontSize * i , byougamoto_x[i], byougamoto_y[i], FontSize, FontSize, GHandle[18], TRUE, FALSE ) ;//水
break;
case 4:
DrawRectGraph( menu_x + menu_width - FontSize * 3, menu_y + FontSize * i , byougamoto_x[i], byougamoto_y[i], FontSize, FontSize, GHandle[18], TRUE, FALSE ) ;//木
break;
case 5:
DrawRectGraph( menu_x + menu_width - FontSize * 3, menu_y + FontSize * i , byougamoto_x[i], byougamoto_y[i], FontSize, FontSize, GHandle[18], TRUE, FALSE ) ;//金
break;
case 6:
DrawRectGraph( menu_x + menu_width - FontSize * 3, menu_y + FontSize * i , byougamoto_x[i], byougamoto_y[i], FontSize, FontSize, GHandle[18], TRUE, FALSE ) ;//土
break;
}
DrawRectGraph( menu_x + menu_width - FontSize * 2, menu_y + FontSize * i , shift[i] , 128, FontSize * 2, FontSize * 2, GHandle[18], TRUE, FALSE ) ;//曜日
}
}
}
void Setup(int menu_number,struct dayData* day){
// 描画する文字列のサイズを設定
int nMouseX = 0;
int nMouseY = 0;
// マウスの位置を取得
GetMousePoint(&nMouseX, &nMouseY);
// 文字の色と曜日の更新
for (int i = 0; i < 5; i++){
// クリックされた箇所の判定
if( nMouseX > chara_x){
if (nMouseY >= menu_y + (i * 16) && nMouseY < menu_y + (i + 1) * 16 ){
if(menu_number == 3){
( day + i ) -> number[0]++;//曜日を1つ進める
}
else if(menu_number == 4){
if(i == 3){
( day + 5 ) -> number[0]++;//数字を1つ進める
}
}
if(i == 3){//再生日または時報
if( ( day + i ) -> number[0] == 2){ ( day + i ) -> number[0] = 0;}
if( ( day + 5 ) -> number[0] == 2){ ( day + 5 ) -> number[0] = 0;}
}
else if(i == 4){//キャラクター
if( ( day + i ) -> number[0] == 5){ ( day + i ) -> number[0] = 0;}
}
else{//燃える 燃えない 資源
if( ( day + i ) -> number[0] == 7){ ( day + i ) -> number[0] = 0;}
}
}
}
}
}
//-----------------------------------------------------------------------------
// Name: Setup_load()
// Desc: 設定読み込み関数
//-----------------------------------------------------------------------------
void Setup_load(struct dayData* day){
char key1[8]="name000";
char key2[8]="data000";
//INIファイル読み込み
for(int i = 0; i < 15; i++){
GetPrivateProfileString("Setup",key1,"--------", (day+i) -> name,30,"Resourse./Setup.INI");
GetPrivateProfileString("Setup",key2,"00000" , (day+i) -> number,6,"Resourse./Setup.INI");
key1[6]++;
key2[6]++;
if(key1[6] == ':'){ key1[5]++; key1[6] = '0';}//10の位をプラス 1の位を0に
if(key2[6] == ':'){ key2[5]++; key2[6] = '0';}
if(key1[5] == ':'){ key1[4]++; key1[5] = '0';}//100の位をプラス 10の位を0に
if(key2[5] == ':'){ key2[4]++; key2[5] = '0';}
for(int j = 0;j<5;j++){
(day+i) -> number[j] -= '0';//アスキーコードから数字に変換
}
}
character = ( day + 4 ) -> number[0] ;
ch = character * 87;
chara_x = (day + 11) -> number[0] * 1000 + (day + 11) -> number[1] * 100 + (day + 11) -> number[2] * 10 + (day + 11) -> number[3];
chara_y = (day + 12) -> number[0] * 1000 + (day + 12) -> number[1] * 100 + (day + 12) -> number[2] * 10 + (day + 12) -> number[3];
clock_x = (day + 13) -> number[0] * 1000 + (day + 13) -> number[1] * 100 + (day + 13) -> number[2] * 10 + (day + 13) -> number[3];
clock_y = (day + 14) -> number[0] * 1000 + (day + 14) -> number[1] * 100 + (day + 14) -> number[2] * 10 + (day + 14) -> number[3];
//INIファイル読み込み
if( (day+15) -> name[0] < 0){
for(int i = 15; i < 450; i++){
GetPrivateProfileString("Setup",key1,"--------", (day+i) -> name,30,"Resourse./Setup.INI");
GetPrivateProfileString("Setup",key2,"00000" , (day+i) -> number,6,"Resourse./Setup.INI");
key1[6]++;
key2[6]++;
if(key1[6] == ':'){ key1[5]++; key1[6] = '0';}//10の位をプラス 1の位を0に
if(key2[6] == ':'){ key2[5]++; key2[6] = '0';}
if(key1[5] == ':'){ key1[4]++; key1[5] = '0';}//100の位をプラス 10の位を0に
if(key2[5] == ':'){ key2[4]++; key2[5] = '0';}
}
}
}
//-----------------------------------------------------------------------------
// Name: Setup_save()
// Desc: 設定書き込み関数
//-----------------------------------------------------------------------------
void Setup_save(struct dayData* day){
char key1[8]="name000";
char key2[8]="data000";
//INIファイル書き込み
for(int i = 0; i < 15; i++){
for(int j = 0;j<5;j++){
(day+i) -> number[j] += '0';//数字からアスキーコードに変換
}
WritePrivateProfileString("Setup",key1, (day+i) -> name,"Resourse./Setup.INI");
WritePrivateProfileString("Setup",key2, (day+i) -> number,"Resourse./Setup.INI");
key1[6]++;
key2[6]++;
if(key1[6] == ':'){ key1[5]++; key1[6] = '0';}
if(key2[6] == ':'){ key2[5]++; key2[6] = '0';}
if(key1[5] == ':'){ key1[4]++; key1[5] = '0';}
if(key2[5] == ':'){ key2[4]++; key2[5] = '0';}
}
}
//time.cpp
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "dayData.h"
#include "draw_clock.h"
#include "DxLib.h"
#include "Setup.h"
#pragma warning ( disable : 4996 )
void Time(struct dayData* day){
time_t timer;
struct tm *local;
timer = time(NULL);//現在時刻を取得
local = localtime(&timer); //地方時に変換
int volume = (day + 7) -> number[0] * 100 + (day + 7) -> number[1] * 10 + (day + 7) -> number[2];//ボリュームは0~255 初期設定では255
int SHandle;
for(int i = 41; i<102; i++){
int hiduke = 1;
bool sound = false;
int hour = local->tm_hour % 12;
switch(hour){
case 0:
hiduke = strcmp((day+i+ch)->name, (day+64+ch)->name);
if( !hiduke )sound = true;
break;
case 1:
hiduke = strcmp((day+i+ch)->name, (day+65+ch)->name);
if( !hiduke )sound = true;
break;
case 2:
hiduke = strcmp((day+i+ch)->name, (day+66+ch)->name);
if( !hiduke )sound = true;
break;
case 3:
hiduke = strcmp((day+i+ch)->name, (day+67+ch)->name);
if( !hiduke )sound = true;
break;
case 4:
hiduke = strcmp((day+i+ch)->name, (day+68+ch)->name);
if( !hiduke )sound = true;
break;
case 5:
hiduke = strcmp((day+i+ch)->name, (day+69+ch)->name);
if( !hiduke )sound = true;
break;
case 6:
hiduke = strcmp((day+i+ch)->name, (day+70+ch)->name);
if( !hiduke )sound = true;
break;
case 7:
hiduke = strcmp((day+i+ch)->name, (day+71+ch)->name);
if( !hiduke )sound = true;
break;
case 8:
hiduke = strcmp((day+i+ch)->name, (day+72+ch)->name);
if( !hiduke )sound = true;
break;
case 9:
hiduke = strcmp((day+i+ch)->name, (day+73+ch)->name);
if( !hiduke )sound = true;
break;
case 10:
hiduke = strcmp((day+i+ch)->name, (day+74+ch)->name);
if( !hiduke )sound = true;
break;
case 11:
hiduke = strcmp((day+i+ch)->name, (day+75+ch)->name);
if( !hiduke )sound = true;
break;
}
if(sound){//音声再生フラグがon
SHandle = LoadSoundMem( (day+i+ch) -> name ) ;
ChangeVolumeSoundMem( volume, SHandle ) ;
PlaySoundMem( SHandle , DX_PLAYTYPE_BACK ) ;
while( CheckSoundMem( SHandle ) == 1 ){ draw_mouse(day); draw_clock(day); ScreenFlip(); }// なり終わるまでここでループ
}
}
int min[2];
min[0] = (local->tm_min / 10)%10;
min[1] = local->tm_min % 10;
for(int i = 41; i<102; i++){
int hiduke = 1;
bool sound = false;
switch(min[0]){
case 1:
hiduke = strcmp((day+i+ch)->name, (day+50+ch)->name);
if( !hiduke )sound = true;
break;
case 2:
hiduke = strcmp((day+i+ch)->name, (day+53+ch)->name);
if( !hiduke )sound = true;
break;
case 3:
hiduke = strcmp((day+i+ch)->name, (day+54+ch)->name);
if( !hiduke )sound = true;
break;
case 4:
hiduke = strcmp((day+i+ch)->name, (day+55+ch)->name);
if( !hiduke )sound = true;
break;
case 5:
hiduke = strcmp((day+i+ch)->name, (day+56+ch)->name);
if( !hiduke )sound = true;
break;
}
if(sound){//音声再生フラグがon
SHandle = LoadSoundMem( (day+i+ch) -> name ) ;
ChangeVolumeSoundMem( volume, SHandle ) ;
if(min[0])PlaySoundMem( SHandle , DX_PLAYTYPE_BACK ) ;
while( CheckSoundMem( SHandle ) == 1 ){ draw_mouse(day); draw_clock(day); ScreenFlip(); }// なり終わるまでここでループ
}
}
for(int i = 41; i<102; i++){
int hiduke = 1;
bool sound = false;
switch(min[1]){
case 0:
if( min[0] ){
hiduke = strcmp((day+i+ch)->name, (day+77+ch)->name);
if( !hiduke )sound = true;
}
break;
case 1:
hiduke = strcmp((day+i+ch)->name, (day+78+ch)->name);
if( !hiduke )sound = true;
break;
case 2:
hiduke = strcmp((day+i+ch)->name, (day+79+ch)->name);
if( !hiduke )sound = true;
break;
case 3:
hiduke = strcmp((day+i+ch)->name, (day+80+ch)->name);
if( !hiduke )sound = true;
break;
case 4:
hiduke = strcmp((day+i+ch)->name, (day+81+ch)->name);
if( !hiduke )sound = true;
break;
case 5:
hiduke = strcmp((day+i+ch)->name, (day+82+ch)->name);
if( !hiduke )sound = true;
break;
case 6:
hiduke = strcmp((day+i+ch)->name, (day+83+ch)->name);
if( !hiduke )sound = true;
break;
case 7:
hiduke = strcmp((day+i+ch)->name, (day+84+ch)->name);
if( !hiduke )sound = true;
break;
case 8:
hiduke = strcmp((day+i+ch)->name, (day+85+ch)->name);
if( !hiduke )sound = true;
break;
case 9:
hiduke = strcmp((day+i+ch)->name, (day+86+ch)->name);
if( !hiduke )sound = true;
break;
}
if(sound){//音声再生フラグがon
SHandle = LoadSoundMem( (day+i+ch) -> name ) ;
ChangeVolumeSoundMem( volume, SHandle ) ;
if(local->tm_min)PlaySoundMem( SHandle , DX_PLAYTYPE_BACK ) ;
while( CheckSoundMem( SHandle ) == 1 ){ draw_mouse(day); draw_clock(day); ScreenFlip(); }// なり終わるまでここでループ
}
}
SHandle = LoadSoundMem( (day+90+ch)->name ) ;//です
ChangeVolumeSoundMem( volume, SHandle ) ;
PlaySoundMem( SHandle , DX_PLAYTYPE_BACK ) ;
while( CheckSoundMem( SHandle ) == 1 ){ draw_mouse(day); draw_clock(day); ScreenFlip(); }// なり終わるまでここでループ
InitSoundMem() ;//サウンドデータの削除
}
//dayData.h
struct dayData{
char name[30];
char number[6];
} ;
//Setup.INI
[Setup]
name000=moeru
data000=50000
name001=moenai
data001=60000
name002=sigen
data002=30000
name003=saiseibi
data003=10000
name004=character
data004=20000
name005=timer
data005=10000
name006=version
data006=10000
name007=volume
data007=25500
name008=blink_interval
data008=11990
name009=blink_speed
data009=30000
name010=mouse_speed
data010=30000
name011=chara_setup_x
data011=14120
name012=chara_setup_y
data012=03600
name013=clock_setup_x
data013=12000
name014=clock_setup_y
data014=03600
~