mirror of
https://github.com/deadw00d/AROS.git
synced 2026-03-21 12:38:38 +00:00
Use Intuition SetPointer() to clear the mouse pointer for the nomedia screen. Fixes missing pointer when not setting a non-default pointer.
This commit is contained in:
@ -9,10 +9,9 @@
|
||||
|
||||
#include <aros/debug.h>
|
||||
#include <intuition/screens.h>
|
||||
#include <proto/oop.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/graphics.h>
|
||||
#include <hidd/gfx.h>
|
||||
#include <proto/intuition.h>
|
||||
|
||||
#include "bootanim.h"
|
||||
|
||||
@ -21,23 +20,7 @@ extern void banm_Dispose(struct DOSBootBase *DOSBootBase);
|
||||
extern void banm_ShowFrame(struct Screen *scr, BOOL init, struct DOSBootBase *DOSBootBase);
|
||||
|
||||
// core flags...
|
||||
#define STATEF_OOPATTRIBS (1 << 1)
|
||||
#define STATEF_POINTERHIDE (1 << 2)
|
||||
|
||||
#if defined(__OOP_NOATTRBASES__)
|
||||
static CONST_STRPTR const attrbaseIDs[] =
|
||||
{
|
||||
IID_Hidd_BitMap,
|
||||
NULL
|
||||
};
|
||||
#endif
|
||||
#if defined(__OOP_NOMETHODBASES__)
|
||||
static CONST_STRPTR const methBaseIDs[] =
|
||||
{
|
||||
IID_Hidd_Gfx,
|
||||
NULL
|
||||
};
|
||||
#endif
|
||||
#define STATEF_POINTERHIDE (1 << 0)
|
||||
|
||||
void WriteChunkRegion(struct DOSBootBase *DOSBootBase,
|
||||
struct RastPort *rp, UWORD x, UWORD y, UWORD width,
|
||||
@ -58,53 +41,10 @@ APTR anim_Init(struct Screen *scr, struct DOSBootBase *DOSBootBase)
|
||||
if (ad)
|
||||
{
|
||||
D(bug("[dosboot] %s: ad @ 0x%p\n", __func__, ad);)
|
||||
if ((ad->OOPBase = OpenLibrary("oop.library",0)) != NULL)
|
||||
{
|
||||
#if defined(__OOP_NOATTRBASES__) || defined(__OOP_NOMETHODBASES__)
|
||||
int fcount;
|
||||
#endif
|
||||
#define OOPBase ad->OOPBase
|
||||
D(bug("[dosboot] %s: OOPBase @ 0x%p\n", __func__, OOPBase);)
|
||||
D(bug("[dosboot] %s: Bitmap @ 0x%p, hidd obj @ 0x%p\n", __func__, scr->RastPort.BitMap, HIDD_BM_OBJ(scr->RastPort.BitMap));)
|
||||
#if defined(__OOP_NOATTRBASES__)
|
||||
if ((fcount = OOP_ObtainAttrBasesArray(&ad->bitMapAttrBase, attrbaseIDs)) == 0)
|
||||
{
|
||||
ad->ad_State |= STATEF_OOPATTRIBS;
|
||||
#endif
|
||||
#if defined(__OOP_NOMETHODBASES__)
|
||||
if ((fcount = OOP_ObtainMethodBasesArray(&ad->gfxMethodBase, methBaseIDs)) == 0)
|
||||
{
|
||||
#endif
|
||||
#undef HiddBitMapAttrBase
|
||||
#define HiddBitMapAttrBase (ad->bitMapAttrBase)
|
||||
OOP_GetAttr(HIDD_BM_OBJ(scr->RastPort.BitMap), aHidd_BitMap_GfxHidd, (IPTR *)&ad->gfxhidd);
|
||||
if (ad->gfxhidd){
|
||||
D(bug("[dosboot] %s: Gfx hidd @ 0x%p\n", __func__, ad->gfxhidd);)
|
||||
struct pHidd_Gfx_SetCursorVisible p;
|
||||
#if defined(__OOP_NOMETHODBASES__)
|
||||
p.mID = ad->gfxMethodBase;
|
||||
#endif
|
||||
p.mID += moHidd_Gfx_SetCursorVisible;
|
||||
p.visible = FALSE;
|
||||
(VOID)OOP_DoMethod(ad->gfxhidd, &p.mID);
|
||||
ad->ad_State |= STATEF_POINTERHIDE;
|
||||
}
|
||||
#if defined(__OOP_NOMETHODBASES__)
|
||||
}
|
||||
else
|
||||
{
|
||||
D(bug("[dosboot] %s: Failed to obtain %u Method Base(s)\n", __func__, fcount);)
|
||||
}
|
||||
#endif
|
||||
#if defined(__OOP_NOATTRBASES__)
|
||||
}
|
||||
else
|
||||
{
|
||||
D(bug("[dosboot] %s: Failed to obtain %u Attibute Base(s)\n", __func__, fcount);)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
DOSBootBase->blank_pointer = AllocMem(6*2, MEMF_CHIP | MEMF_CLEAR);
|
||||
SetPointer(DOSBootBase->bm_Window, DOSBootBase->blank_pointer,
|
||||
1, 16, 0, 0);
|
||||
ad->ad_State |= STATEF_POINTERHIDE;
|
||||
SetAPen(&scr->RastPort, 0);
|
||||
RectFill(&scr->RastPort, 0, 0, scr->Width, scr->Height);
|
||||
DOSBootBase->animData = ad;
|
||||
@ -133,12 +73,11 @@ void anim_Stop(struct DOSBootBase *DOSBootBase)
|
||||
struct AnimData *ad = DOSBootBase->animData;
|
||||
if (ad)
|
||||
{
|
||||
#if defined(__OOP_NOATTRBASES__)
|
||||
if (ad->ad_State & STATEF_OOPATTRIBS)
|
||||
if (ad->ad_State & STATEF_POINTERHIDE)
|
||||
{
|
||||
OOP_ReleaseAttrBasesArray(&ad->bitMapAttrBase, attrbaseIDs);
|
||||
FreeMem(DOSBootBase->blank_pointer, 6*2);
|
||||
DOSBootBase->blank_pointer = NULL;
|
||||
}
|
||||
#endif
|
||||
banm_Dispose(DOSBootBase);
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,12 +15,6 @@ struct AnimData
|
||||
ULONG framecnt;
|
||||
ULONG tick;
|
||||
UBYTE frame;
|
||||
#if defined(__OOP_NOATTRBASES__)
|
||||
OOP_AttrBase bitMapAttrBase;
|
||||
#endif
|
||||
#if defined(__OOP_NOMETHODBASES__)
|
||||
OOP_MethodID gfxMethodBase;
|
||||
#endif
|
||||
};
|
||||
|
||||
// reserve 8 bits for the main bootanim code
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
#include <exec/libraries.h>
|
||||
#include <graphics/gfxbase.h>
|
||||
#include <graphics/modeid.h>
|
||||
#include <intuition/intuition.h>
|
||||
#include <intuition/screens.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/graphics.h>
|
||||
@ -73,11 +74,35 @@ struct Screen *NoBootMediaScreen(struct DOSBootBase *DOSBootBase)
|
||||
/* Boot anim requires 16+ color screen and 1:1 pixels */
|
||||
struct Screen *scr = OpenBootScreenType(DOSBootBase, 4, TRUE);
|
||||
|
||||
if (!anim_Init(scr, DOSBootBase))
|
||||
if (scr)
|
||||
{
|
||||
SetAPen(&scr->RastPort, 1);
|
||||
Move(&scr->RastPort, 215, 120);
|
||||
Text(&scr->RastPort, "No bootable media found...", 26);
|
||||
/* Having a window allows us to control the shape of the mouse cursor
|
||||
through Intuition functions. */
|
||||
struct NewWindow nw =
|
||||
{
|
||||
0, 0,
|
||||
scr->Width, scr->Height,
|
||||
0, 0,
|
||||
0,
|
||||
WFLG_ACTIVATE | WFLG_BORDERLESS | WFLG_BACKDROP,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
scr,
|
||||
NULL,
|
||||
0, 0,
|
||||
scr->Width, scr->Height,
|
||||
CUSTOMSCREEN
|
||||
};
|
||||
|
||||
DOSBootBase->bm_Window = OpenWindow(&nw);
|
||||
|
||||
if (!anim_Init(scr, DOSBootBase))
|
||||
{
|
||||
SetAPen(&scr->RastPort, 1);
|
||||
Move(&scr->RastPort, 215, 120);
|
||||
Text(&scr->RastPort, "No bootable media found...", 26);
|
||||
}
|
||||
}
|
||||
|
||||
return scr;
|
||||
@ -85,6 +110,12 @@ struct Screen *NoBootMediaScreen(struct DOSBootBase *DOSBootBase)
|
||||
|
||||
void CloseBootScreen(struct Screen *scr, struct DOSBootBase *DOSBootBase)
|
||||
{
|
||||
/* Close the window if it was created */
|
||||
if (DOSBootBase->bm_Window)
|
||||
{
|
||||
CloseWindow(DOSBootBase->bm_Window);
|
||||
}
|
||||
|
||||
CloseScreen(scr);
|
||||
|
||||
CloseLibrary(&IntuitionBase->LibNode);
|
||||
|
||||
@ -49,6 +49,7 @@ struct DOSBootBase
|
||||
|
||||
WORD devicesCount;
|
||||
BOOL *devicesEnabled;
|
||||
UWORD *blank_pointer;
|
||||
struct List bootList;
|
||||
struct List devicesList;
|
||||
};
|
||||
|
||||
@ -841,6 +841,7 @@ static WORD initWindow(LIBBASETYPEPTR LIBBASE, struct BootConfig *bcfg, WORD pag
|
||||
freeGadgets(LIBBASE, page);
|
||||
}
|
||||
CloseWindow(LIBBASE->bm_Window);
|
||||
LIBBASE->bm_Window = NULL;
|
||||
}
|
||||
|
||||
FreeGadgets(gadlist);
|
||||
|
||||
Reference in New Issue
Block a user