2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
9 /*********************************************************************************************/
14 #include <aros/debug.h>
16 #include <prefs/prefhdr.h>
17 #include <prefs/screenmode.h>
19 #include <intuition/iprefs.h>
21 static LONG stopchunks
[] =
26 /*********************************************************************************************/
28 void ScreenModePrefs_Handler(STRPTR filename
)
30 struct IFFHandle
*iff
;
31 struct ScreenModePrefs
*smp
;
33 D(bug("In IPrefs:ScreenModePrefs_Handler\n"));
34 D(bug("filename=%s\n",filename
));
36 iff
= CreateIFF(filename
, stopchunks
, 1);
39 while(ParseIFF(iff
, IFFPARSE_SCAN
) == 0) {
40 smp
= LoadChunk(iff
, sizeof(struct ScreenModePrefs
), MEMF_ANY
);
42 struct IScreenModePrefs i
;
44 i
.smp_DisplayID
= AROS_BE2LONG(smp
->smp_DisplayID
);
45 i
.smp_Width
= AROS_BE2WORD(smp
->smp_Width
);
46 i
.smp_Height
= AROS_BE2WORD(smp
->smp_Height
);
47 i
.smp_Depth
= AROS_BE2WORD(smp
->smp_Depth
);
48 i
.smp_Control
= AROS_BE2WORD(smp
->smp_Control
);
49 D(bug("[ScreenModePrefs] ModeID: 0x%08lX, Size: %dx%d, Depth: %d, Control: 0x%08lX\n",
50 i
.smp_DisplayID
, i
.smp_Width
, i
.smp_Height
, i
.smp_Depth
, i
.smp_Control
));
52 SetIPrefs(&i
, sizeof(struct IScreenModePrefs
), IPREFS_TYPE_SCREENMODE
);