Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions workbench/libs/gadtools/freevisualinfo.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright � 1995-2007, The AROS Development Team. All rights reserved.
Copyright © 1995-2007, The AROS Development Team. All rights reserved.
$Id$

Desc:
Expand Down Expand Up @@ -47,11 +47,22 @@
***************************************************************************/
{
AROS_LIBFUNC_INIT
struct ImageLink *il;
struct ImageLink *nextil;

if (vi)
{
FreeScreenDrawInfo(((struct VisualInfo *)vi)->vi_screen, ((struct VisualInfo *)vi)->vi_dri);
FreeVec(vi);
il = ((struct VisualInfo *)vi)->vi_images;
while(il)
{
nextil = il->il_Next;
DisposeObject(il->il_Image);
FreeVec(il);
il = nextil;
}
FreeScreenDrawInfo(((struct VisualInfo *)vi)->vi_screen, ((struct VisualInfo *)vi)->vi_dri);
CloseFont(((struct VisualInfo *)vi)->vi_screenfont);
FreeVec(vi);
}

AROS_LIBFUNC_EXIT
Expand Down
6 changes: 5 additions & 1 deletion workbench/libs/gadtools/gadtools_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define GADTOOLS_INTERN_H

/*
Copyright � 1995-2011, The AROS Development Team. All rights reserved.
Copyright © 1995-2011, The AROS Development Team. All rights reserved.
$Id$

Desc: Internal definitions for gadtools.library.
Expand Down Expand Up @@ -300,7 +300,11 @@ struct GT_IntuiMessage
struct VisualInfo
{
struct Screen * vi_screen;
struct TextFont * vi_screenfont;
struct DrawInfo * vi_dri;
struct ImageLink * vi_images;
UBYTE vi_textpen;
UBYTE vi_backpen;
};

/* dummy gadget created by CreateContext */
Expand Down
11 changes: 8 additions & 3 deletions workbench/libs/gadtools/getvisualinfoa.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright � 1995-2007, The AROS Development Team. All rights reserved.
Copyright © 1995-2007, The AROS Development Team. All rights reserved.
$Id$

Desc:
Expand Down Expand Up @@ -61,13 +61,18 @@
if (screen == NULL)
return NULL;

vi = AllocVec(sizeof(struct VisualInfo), MEMF_ANY);
vi = AllocVec(sizeof(struct VisualInfo), MEMF_ANY|MEMF_CLEAR);
if (!vi)
return NULL;

vi->vi_screen = screen;
vi->vi_screenfont = OpenFont(screen->Font);
vi->vi_dri = GetScreenDrawInfo(screen);

if(vi->vi_dri)
{
vi->vi_textpen = vi->vi_dri->dri_Pens[TEXTPEN];
vi->vi_backpen = vi->vi_dri->dri_Pens[BACKGROUNDPEN];
}
return vi;

AROS_LIBFUNC_EXIT
Expand Down