#include <stdio.h>
#include <string.h>
#include <exec/types.h>
#include <graphics/gfxbase.h>
#include <intuition/intuition.h>
#include <iff.h>
Go to the source code of this file.
|
struct Library * | IntuitionBase = ((void *)0) |
|
struct Library * | IFFBase = ((void *)0) |
|
struct GfxBase * | GfxBase = ((void *)0) |
|
struct NewScreen | ns |
|
struct Screen * | screen [3] = { ((void *)0) , ((void *)0) , ((void *)0) } |
|
APTR | ifffile = ((void *)0) |
|
char * | fname [3] = { ((void *)0) , ((void *)0) , ((void *)0) } |
|
int | fsiz = 0 |
|
void CenterScreen |
( |
register struct Screen * |
, |
|
|
int * |
, |
|
|
int * |
|
|
) |
| |
Definition at line 12 of file CenterScreen.c.
14 int c640, c320, r400, r200, w, h, max_x,
max_y;
15 struct Preferences prefs;
18 GetPrefs(&prefs,
sizeof(prefs));
19 c640 = 640 + prefs.ColumnSizeChange;
21 r200 = 200 + prefs.RowSizeChange;
25 if (
screen->ViewPort.Modes & LACE){
29 if (
screen->ViewPort.Modes & HIRES){
32 if (
screen->ViewPort.DWidth <= max_x) {
33 w =
screen->ViewPort.DWidth;
37 if (
screen->ViewPort.DHeight <= max_y) {
38 h =
screen->ViewPort.DHeight;
43 if (
screen->ViewPort.Modes & HIRES){
44 screen->ViewPort.DxOffset += (c640 - w) / 2;
45 *dx =
screen->ViewPort.DxOffset / 2;
47 screen->ViewPort.DxOffset += (c320 - w) / 2;
48 *dx =
screen->ViewPort.DxOffset;
50 if (
screen->ViewPort.Modes & LACE){
51 screen->ViewPort.DyOffset += (r400 - h) / 2;
52 *dy =
screen->ViewPort.DyOffset / 2;
54 screen->ViewPort.DyOffset += (r200 - h) / 2;
55 *dy =
screen->ViewPort.DyOffset;
static struct NewScreen screen
void Fail |
( |
char * |
text, |
|
|
int |
status |
|
) |
| |
main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 63 of file show3.c.
References fname, fsiz, IntuitionBase, and screen.
68 struct BitMapHeader *bmhd;
70 if(!strcmp(argv[1],
"?") || ((argc !=4) && (argc != 2))) {
71 printf(
"Usage: %s redfile greenfile bluefile\n"
72 " %s filename (.[rgb] will be appended)\n",
81 fsiz = strlen(argv[1]) + 3;
85 Fail(
"Can't allocate memory", 1);
87 strcpy(
fname[i], argv[1]);
88 strcat(
fname[i], ((i == 0) ?
".r" : ((i == 1) ?
".g" :
".b")));
93 Fail(
"Can't open graphics.library", 1);
97 Fail(
"Can't open intuition.library", 1);
100 Fail(
"Copy the iff.library to your LIBS: directory!", 1);
103 for (i=0; i<3; i++) {
105 Fail(
"Error opening file", 1);
108 Fail(
"BitMapHeader not found", 1);
112 ns.Depth = bmhd->nPlanes;
116 Fail(
"Can't open screen!", 1);
120 count = GetColorTab(
ifffile,colortable);
121 if(count>32L) count = 32L;
122 LoadRGB4(&(
screen[i]->ViewPort),colortable,count);
125 Fail(
"Can't decode picture", 1);
130 SetTaskPri(FindTask(0L), 20L);
132 if(!((*((UBYTE*)0xbfe001))&64))
break;
134 if(!((*((UBYTE*)0xbfe001))&64))
break;
136 if(!((*((UBYTE*)0xbfe001))&64))
break;
void CenterScreen(register struct Screen *, int *, int *)
struct Library * OpenLibrary()
struct Library * IntuitionBase
struct Screen * OpenScreen()
struct Screen * screen[3]
void Fail(char *text, int status)
struct Library * OpenLibrary |
( |
| ) |
|
struct Screen * OpenScreen |
( |
| ) |
|
char* fname[3] = { ((void *)0) , ((void *)0) , ((void *)0) } |
struct GfxBase* GfxBase = ((void *)0) |
struct Library * IFFBase = ((void *)0) |
APTR ifffile = ((void *)0) |
struct Library* IntuitionBase = ((void *)0) |
Initial value:=
{
0,0,0,0,0,0,0, ((void *)0) , CUSTOMSCREEN | SCREENQUIET, ((void *)0) , (STRPTR)"Show3", ((void *)0) ,
((void *)0)
}
Definition at line 23 of file show3.c.
struct Screen* screen[3] = { ((void *)0) , ((void *)0) , ((void *)0) } |