Fixed another typo in 8-bit pixel handling (BYTE should have been UBYTE).
[AROS.git] / workbench / c / iprefs / screenmodeprefs.c
blobea237f9590b0d3cf0568253f7a4a4615677a78bf
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 /*********************************************************************************************/
11 #include "global.h"
13 #define DEBUG 0
14 #include <aros/debug.h>
16 #include <prefs/prefhdr.h>
17 #include <prefs/screenmode.h>
19 #include <intuition/iprefs.h>
21 static LONG stopchunks[] =
23 ID_PREF, ID_SCRM
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);
38 if (iff) {
39 while(ParseIFF(iff, IFFPARSE_SCAN) == 0) {
40 smp = LoadChunk(iff, sizeof(struct ScreenModePrefs), MEMF_ANY);
41 if (smp) {
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);
53 FreeVec(smp);
56 KillIFF(iff);