Pages vues depuis 25/07/2007 : 25 174 205
Index du forum »» OS4 sur AmigaOne X5000 »» E-UAE sur X5000
Je viens de regarder un peu les sources de E-UAE: il est bien difficile de savoir ce qu'il faut y changer
(même si faire un update avec le compositing est facile et prendrai que qque dizaines de lignes de code)
Est on au moins sur que c'est l'update de l'écran via SDL qui ralentit ? un petit coup d'Hyeronimus serait utile
Notamment il semble aussi exister un update via cybergraphics dont on voit pas pourquoi il serait lent ou alors il est pas compilé dans cette version ?!?
dans ami-win.c :
#ifdef USE_CYBERGFX
# ifndef USE_CYBERGFX_V41
static void flush_line_cgx (struct vidbuf_description *gfxinfo, int line_no)
{
BltBitMapRastPort (CybBitMap,
0, line_no,
RP,
XOffset,
YOffset + line_no,
gfxinfo->width,
1,
0xc0);
}
static void flush_block_cgx (struct vidbuf_description *gfxinfo, int first_line, int last_line)
{
BltBitMapRastPort (CybBitMap,
0, first_line,
RP,
XOffset,
YOffset + first_line,
gfxinfo->width,
last_line - first_line + 1,
0xc0);
}
# else
static void flush_line_cgx_v41 (struct vidbuf_description *gfxinfo, int line_no)
{
WritePixelArray (CybBuffer,
0 , line_no,
gfxinfo->rowbytes,
RP,
XOffset,
YOffset + line_no,
gfxinfo->width,
1,
RECTFMT_RAW);
}
static void flush_block_cgx_v41 (struct vidbuf_description *gfxinfo, int first_line, int last_line)
{
WritePixelArray (CybBuffer,
0 , first_line,
gfxinfo->rowbytes,
RP,
XOffset,
YOffset + first_line,
gfxinfo->width,
last_line - first_line + 1,
RECTFMT_RAW);
}
# endif
on c'est mal compris : je voulais dire si je savais quelle partie il faut modifier (où ajouter cette fonction dans le code) alors ajouter le compositing ne serait pas difficile
Mais j'essayerai de le recompiler la semaine prochaine car je comprends pas que le rendu cybergraphics soit lent (peut être est il pas compilé dans nos versions)
Alain
Voici le code que j'utilise dans GMAP pour updater une fenetre au Compositing automatiquement (!refresh! window):
/*==========================================================================*/
struct Rectangle winrect;
#ifdef OS4
struct Hook winhook;
/*==========================================================================*/
/* The hook for performing compositing to a rastport. */
/* Thanks to Fredrik Wikstrom (a.k.a., salass00) for the example code... */
/* rastPort: pointer to the RastPort to render to */
/* msg: pointer to the backfill */
/*==========================================================================*/
ULONG compositeHookFunc(struct Hook *hook, struct RastPort *rastPort, struct BackFillMessage *msg) {
struct GM_Game *G=(struct GM_Game *)hook->h_Data;
struct OS_Screen *S=G->screen;
struct Window *window;
struct BitMap *bm;
struct GM_Rect Dst;
struct GM_Rect *Src;
float ScaleX,ScaleY;
ULONG flags,ret;
window=S->window;
Src=&S->T->rect;
bm=S->T->bm;
winrect.MinX = window->BorderLeft;
winrect.MinY = window->BorderTop;
winrect.MaxX = window->Width - window->BorderRight - 1;
winrect.MaxY = window->Height - window->BorderBottom - 1;
Dst.x = winrect.MinX;
Dst.y = winrect.MinY;
Dst.w = winrect.MaxX - winrect.MinX + 1;
Dst.h = winrect.MaxY - winrect.MinY + 1;
ScaleX = (Dst.w + 0.5f) / Src->w;
ScaleY = (Dst.h + 0.5f) / Src->h;
if(S->filter)
flags= COMPFLAG_SrcFilter|COMPFLAG_IgnoreDestAlpha;
else
flags= COMPFLAG_IgnoreDestAlpha;
ret = CompositeTags(
COMPOSITE_Src_Over_Dest,bm, rastPort->BitMap,
COMPTAG_SrcWidth, Src->w,
COMPTAG_SrcHeight, Src->h,
COMPTAG_ScaleX, COMP_FLOAT_TO_FIX(ScaleX),
COMPTAG_ScaleY, COMP_FLOAT_TO_FIX(ScaleY),
COMPTAG_OffsetX, msg->Bounds.MinX - (msg->OffsetX - Dst.x),
COMPTAG_OffsetY, msg->Bounds.MinY - (msg->OffsetY - Dst.y),
COMPTAG_DestX, msg->Bounds.MinX,
COMPTAG_DestY, msg->Bounds.MinY,
COMPTAG_DestWidth, msg->Bounds.MaxX - msg->Bounds.MinX + 1,
COMPTAG_DestHeight, msg->Bounds.MaxY - msg->Bounds.MinY + 1,
COMPTAG_Flags,flags,
TAG_END);
return 0;
}
/*==========================================================================*/
void OS4SetCompositeHook(struct GM_Game *G)
{
struct OS_Screen *S=G->screen;
struct Window *window;
window=S->window;
winrect.MinX = window->BorderLeft;
winrect.MinY = window->BorderTop;
winrect.MaxX = window->Width - window->BorderRight - 1;
winrect.MaxY = window->Height - window->BorderBottom - 1;
LockLayer(0, window->RPort->Layer);
// Need to composite onto the window's rastport. As CompositeTags() only renders to bitmaps we use DoHookClipRects() */
winhook.h_Entry = (HOOKFUNC)compositeHookFunc;
winhook.h_Data = G;
DoHookClipRects(&winhook,window->RPort,&winrect);
UnlockLayer(window->RPort->Layer);
}
#endif
Hello
Ok juste pour dire que j'ai réussi ce jour à recompiler EUAE avec l'aide de ces 2 derniers porteurs Michael Trebilcock & Davide Calaminici
Là une mégadémo tourne tranquillement (lentement) dans EUAE dans WinUAE-ppc :-P
Soyons clair: pour l'instant je n'y ai pas rajouté de lignes de code mais c'est déjà une satisfaction.
Question bête : la version SDL apporte t'elle qque chose par rapport à la version amigfx ?
Car je pensais ajouter la composition plutôt à la version AMIGFX...