Don't use P96 on gfx.lib v54+ systems

This commit is contained in:
Chris Young 2015-09-01 19:31:58 +01:00
parent e0198789ae
commit fdb9a42eff
2 changed files with 20 additions and 11 deletions

View File

@ -27,6 +27,8 @@
#include <proto/intuition.h> #include <proto/intuition.h>
#include <proto/utility.h> #include <proto/utility.h>
#include <graphics/gfxbase.h> /* Needed for v54 version check */
#ifndef __amigaos4__ #ifndef __amigaos4__
/* OS3 needs these for the XXXX_GetClass() functions */ /* OS3 needs these for the XXXX_GetClass() functions */
#include <proto/arexx.h> #include <proto/arexx.h>
@ -216,7 +218,8 @@ bool ami_libs_open(void)
/*\todo This is down here as we need to check the graphics.library version /*\todo This is down here as we need to check the graphics.library version
* before opening. If it is sufficiently new enough we can avoid using P96 * before opening. If it is sufficiently new enough we can avoid using P96
*/ */
AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, false) if(GfxBase->LibNode.lib_Version >= 54)
AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, false)
/* NB: timer.device is opened in schedule.c (ultimately by the scheduler process). /* NB: timer.device is opened in schedule.c (ultimately by the scheduler process).
* The library base and interface are obtained there, rather than here, due to * The library base and interface are obtained there, rather than here, due to
@ -235,7 +238,6 @@ bool ami_libs_open(void)
* NB: the last argument should be "true" only if the class also has * NB: the last argument should be "true" only if the class also has
* library functions we use. * library functions we use.
*/ */
AMINS_CLASS_OPEN("arexx.class", 44, ARexx, AREXX, false) AMINS_CLASS_OPEN("arexx.class", 44, ARexx, AREXX, false)
AMINS_CLASS_OPEN("images/bevel.image", 44, Bevel, BEVEL, false) AMINS_CLASS_OPEN("images/bevel.image", 44, Bevel, BEVEL, false)
AMINS_CLASS_OPEN("images/bitmap.image", 44, BitMap, BITMAP, false) AMINS_CLASS_OPEN("images/bitmap.image", 44, BitMap, BITMAP, false)

View File

@ -47,19 +47,26 @@ void ami_rtg_freebitmap(struct BitMap *bm)
void ami_rtg_writepixelarray(UBYTE *pixdata, struct BitMap *bm, void ami_rtg_writepixelarray(UBYTE *pixdata, struct BitMap *bm,
ULONG width, ULONG height, ULONG bpr, ULONG format) ULONG width, ULONG height, ULONG bpr, ULONG format)
{ {
struct RenderInfo ri;
struct RastPort trp; struct RastPort trp;
/* This requires P96 currently */
if(P96Base == NULL) return;
ri.Memory = pixdata;
ri.BytesPerRow = bpr;
ri.RGBFormat = format;
InitRastPort(&trp); InitRastPort(&trp);
trp.BitMap = bm; trp.BitMap = bm;
p96WritePixelArray((struct RenderInfo *)&ri, 0, 0, &trp, 0, 0, width, height); /* This requires P96 or gfx.lib v54 currently */
if(P96Base == NULL) {
#ifdef __amigaos4__
if(GfxBase->LibNode.lib_Version >= 54) {
WritePixelArray(pixdata, 0, 0, bpr, format, &trp, 0, 0, width, height);
}
#endif
} else {
struct RenderInfo ri;
ri.Memory = pixdata;
ri.BytesPerRow = bpr;
ri.RGBFormat = format;
p96WritePixelArray((struct RenderInfo *)&ri, 0, 0, &trp, 0, 0, width, height);
}
} }