SDL cursor functions

This commit is contained in:
kichikuou
2016-04-02 22:23:33 +09:00
parent d0abebdf24
commit 79039f90dc
6 changed files with 9 additions and 13 deletions
+1 -2
View File
@@ -71,7 +71,6 @@ AGS::AGS(NACT* parent) : nact(parent)
for(int i = 0; i < 10; i++) {
hCursor[i] = NULL;
}
hArrow = LoadCursor(NULL, IDC_ARROW);
// GAIJI.DAT読み込み
memset(gaiji, 0, sizeof(gaiji));
@@ -304,7 +303,7 @@ AGS::~AGS()
// カーソル開放
for(int i = 0; i < 10; i++) {
if(hCursor[i]) {
DestroyCursor(hCursor[i]);
SDL_FreeCursor(hCursor[i]);
}
}
+1 -3
View File
@@ -7,7 +7,6 @@
#ifndef _AGS_H_
#define _AGS_H_
#include <windows.h>
#include <stdio.h>
#include "../common.h"
#include "nact.h"
@@ -57,8 +56,7 @@ private:
TTF_Font* hFont64;
// カーソル
HCURSOR hArrow;
HCURSOR hCursor[10];
SDL_Cursor* hCursor[10];
// AGS
#if defined(_SYSTEM1)
+5 -6
View File
@@ -26,8 +26,6 @@ void AGS::load_cursor(int page)
cg_dest_y = j_y;
dest_screen = dest;
HINSTANCE hinst = (HINSTANCE)GetModuleHandle(NULL);
// フォントの生成
for(int i = 0; i < 10; i++) {
// パターン読み込み
@@ -76,18 +74,19 @@ void AGS::load_cursor(int page)
}
}
if(hCursor[i]) {
DestroyCursor(hCursor[i]);
SDL_FreeCursor(hCursor[i]);
}
hCursor[i] = CreateCursor(hinst, 2, 2, 32, 32, amask, xmask);
// TODO: fix amask/xmask values
hCursor[i] = SDL_CreateCursor(amask, xmask, 32, 32, 2, 2);
}
}
void AGS::select_cursor()
{
if(cursor_index == 0) {
SetCursor(hArrow);
SDL_SetCursor(SDL_GetDefaultCursor());
} else if(1 <= cursor_index && cursor_index <= 10 && hCursor[cursor_index - 1]) {
SetCursor(hCursor[cursor_index - 1]);
SDL_SetCursor(hCursor[cursor_index - 1]);
}
}
+1
View File
@@ -5,6 +5,7 @@
*/
#include "ags.h"
#include <windows.h>
void AGS::draw_text(char string[])
{
+1 -1
View File
@@ -198,7 +198,7 @@ void AGS::close_text_window(int index, bool update)
void AGS::clear_menu_window()
{
// TODO: use draw function
memset(hBmpScreen[2]->pixels, menu_back_color, 640 * 480 * sizeof(DWORD));
memset(hBmpScreen[2]->pixels, menu_back_color, 640 * 480 * sizeof(Uint32));
}
void AGS::open_menu_window(int index)
-1
View File
@@ -4,7 +4,6 @@
[ NACT ]
*/
#include <windows.h>
#include "nact.h"
#include "ags.h"
#include "mako.h"