mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-12 01:08:16 +03:00
SDL cursor functions
This commit is contained in:
+1
-2
@@ -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
@@ -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)
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "ags.h"
|
||||
#include <windows.h>
|
||||
|
||||
void AGS::draw_text(char string[])
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
[ NACT ]
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include "nact.h"
|
||||
#include "ags.h"
|
||||
#include "mako.h"
|
||||
|
||||
Reference in New Issue
Block a user