home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #3
/
amigamamagazinepolishissue1998.iso
/
kolekcje
/
stanislaw_weslawski
/
ulubione_share
/
obtainpens
/
obtainpens.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-11-21
|
2KB
|
62 lines
#include <dos/dos.h>
#include <intuition/intuition.h>
#include <graphics/GfxBase.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/graphics.h>
/* OpenScreenTagList */
#define VEC -0x264
#define LIB (struct Library*) IntuitionBase
static char vers[] = "$VER: ObtainPens V1.0 (21.11.96) ©1996 ALeX Kazik";
struct {
ULONG pen1,r1,g1,b1;
ULONG pen2,r2,g2,b2;
ULONG pen3,r3,g3,b3;
ULONG pen4,r4,g4,b4;
} args = {4, 0x7B7B7B7B, 0x7B7B7B7B, 0x7B7B7B7B,
5, 0xAFAFAFAF, 0xAFAFAFAF, 0xAFAFAFAF,
6, 0xAAAAAAAA, 0x90909090, 0x7C7C7C7C,
7, 0xFFFFFFFF, 0xA9A9A9A9, 0x97979797};
struct Screen __asm *(*old_OpenScreenTagList)(register __a0 struct NewScreen *, register __a1 struct TagItem *, register __a6 struct Library *);
struct Screen __saveds __asm *new_OpenScreenTagList(register __a0 struct NewScreen *newscr, register __a1 struct TagItem *tagitem, register __a6 struct Library *lib){
struct Screen *scr;
if((scr = old_OpenScreenTagList(newscr, tagitem, lib)) && ((scr->Flags & SCREENTYPE) == WBENCHSCREEN)){
ObtainPen(scr->ViewPort.ColorMap, args.pen1, args.r1, args.g1, args.b1, 0);
ObtainPen(scr->ViewPort.ColorMap, args.pen2, args.r2, args.g2, args.b2, 0);
ObtainPen(scr->ViewPort.ColorMap, args.pen3, args.r3, args.g3, args.b3, 0);
ObtainPen(scr->ViewPort.ColorMap, args.pen4, args.r4, args.g4, args.b4, 0);
}
return(scr);
}
int main (){
if (GfxBase->LibNode.lib_Version < 39)
return(20);
Disable();
old_OpenScreenTagList = SetFunction(LIB,VEC,(APTR)new_OpenScreenTagList);
CacheClearU();
Enable();
Wait(SIGBREAKF_CTRL_C);
if(FindPort("SetMan")){
Disable();
SetFunction(LIB,VEC,(APTR)old_OpenScreenTagList);
CacheClearU();
Enable();
}else
Wait(0);
return(0);
}