![]() |
![]() |
#41 | |
TDI
Join Date: Feb 2007
Location: Blitter Town
Posts: 124
|
Quote:
Or, yeah, try: pixbuf = SDL_CreateRGBSurface(screen->flags, 320, 255, 32, screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, screen->format->Amask); |
|
![]() |
![]() |
#42 |
Registered User
Join Date: Sep 2009
Location: Norway
Posts: 1,715
|
I added some neat palette functions now....
Code:
/* palette */ #define PAL_TRACKER_BG_1 0 #define PAL_TRACKER_BG_2 1 #define PAL_TRACKER_BG_3 2 #define PAL_GENERAL_TEXT 3 #define PAL_PATTERN_TEXT 4 #define PAL_CURSOR_1 5 #define PAL_CURSOR_2 6 #define PAL_CURSOR_3 7 #define PAL_COLORKEY 8 #define PAL_QUADRASCOPE 9 unsigned int palette[48] = { 0x00BBBBBB, /* 0 - PAL_TRACKER_BG_1 */ 0x00888888, /* 1 - PAL_TRACKER_BG_2 */ 0x00555555, /* 2 - PAL_TRACKER_BG_3 */ 0x00000000, /* 3 - PAL_GENERAL_TEXT */ 0x00009955, /* 4 - PAL_PATTERN_TEXT */ 0x00444444, /* 5 - PAL_CURSOR_1 */ 0x00777777, /* 6 - PAL_CURSOR_2 */ 0x00AAAAAA, /* 7 - PAL_CURSOR_3 */ 0x0000FF00, /* 8 - PAL_COLORKEY */ 0x00BB00FF /* 9 - PAL_QUADRASCOPE */ }; unsigned int pixelToScreenFmtPixel(SDL_Surface *screen, unsigned int pixel) { if (screen != NULL) { /* thanks to korruptor for this code */ return (((pixel & 0xFF000000) >> 24) << screen->format->Ashift) | (((pixel & 0x00FF0000) >> 16) << screen->format->Rshift) | (((pixel & 0x0000FF00) >> 8) << screen->format->Gshift) | ((pixel & 0x000000FF) << screen->format->Bshift); } return 0; } void setPaletteEntry(SDL_Surface *screen, unsigned int palette[48], int num, unsigned int color) { palette[num] = pixelToScreenFmtPixel(screen, color); return; } void convertPaletteToScreenFmt(unsigned int *palette, SDL_Surface *screen) { if ((screen != NULL) && (palette != NULL)) { int i; for (i = 0; i < 48; i++) { unsigned int pix = *palette; *palette++ = pixelToScreenFmtPixel(screen, pix); } } return; } Code:
setPaletteEntry(screen, palette, PAL_CURSOR_1, 0x00444444); setPaletteEntry(screen, palette, PAL_CURSOR_2, 0x00777777); setPaletteEntry(screen, palette, PAL_CURSOR_3, 0x00AAAAAA); |
![]() |
![]() |
#43 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,658
|
Re: Poll. If you do hardpan, users can (possibly) softpan in soundcard settings. The other way round is not possible
![]() Best way I think is an option, like in WinUAE, like a slider 0-100% where 0 is mono and 100 is hard pan. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
My old source code | gemanix | Coders. General | 36 | 09 July 2017 13:33 |
Source code for game in C? | Leandro Jardim | Coders. General | 2 | 17 February 2013 00:27 |
Protracker all Versions incl. Source | sun68 | support.Apps | 16 | 01 April 2012 00:59 |
Source Code | camelord | support.Games | 2 | 06 August 2010 17:45 |
Source Code | Thalion | project.WinUAE - Kaillera | 3 | 28 April 2006 09:55 |
|
|