153
162
SDL_EnableUNICODE(1);
164
if(power_conf->verbose)
156
165
afficheMessage("> sdl_tlk.cpp/xw_init(): successful initialization!");
161
170
//------------------------------------------------------------------------------
162
// SDL : initialise le mode video / initialize vide mode
163
// sortie / output <= 0 : erreur
171
// SDL: initialize video mode
172
// return: 0 = > error / 1 => no error
164
173
//------------------------------------------------------------------------------
165
174
int init_video_mode()
170
// test le mode video --------------------------------------------------------
171
flag = SDL_ANYFORMAT;
172
if(iOctetsParPixel == 1)
173
flag = flag | SDL_HWPALETTE;
175
flag = flag | SDL_FULLSCREEN;
176
bpp = SDL_VideoModeOK(iLargeurEcran, iHauteurEcran, iProfondeur2, flag);
181
"sdl_tlk.cpp/xw_init() : SDL_VideoModeOK() Mode not available : %s",
185
// echec en plein ecran, ressaie en mode fenetree
188
flag = SDL_ANYFORMAT;
189
if(iOctetsParPixel == 1)
190
flag = flag | SDL_HWPALETTE;
191
bpp = SDL_VideoModeOK(iLargeurEcran, iHauteurEcran, iProfondeur2, flag);
194
"sdl_tlk.cpp/xw_init() : SDL_VideoModeOK() Mode not available : %s",
201
// initialie le mode video ---------------------------------------------------
203
SDL_SetVideoMode(iLargeurEcran, iHauteurEcran, iProfondeur2, flag);
204
if(!pPowerMangaDisplay)
206
"ecran_hard::ecran_init() : SDL_SetVideoMode() failed: %s\n",
210
SDL_WM_SetCaption(nomfenetre, nomfenetre);
211
iAffiche = 0; // force refresh all the screen
213
SDL_ShowCursor(SDL_DISABLE);
215
SDL_ShowCursor(SDL_ENABLE);
179
//##############################################################
180
// 640x400 => 640x480 (win32 only)
181
//##############################################################
182
if ((vmode) && (vmode2)) {
186
//##############################################################
188
//##############################################################
189
flag = SDL_ANYFORMAT;
190
if(iOctetsParPixel == 1)
191
flag = flag | SDL_HWPALETTE;
192
if(power_conf->fullscreen > 0)
193
flag = flag | SDL_FULLSCREEN;
194
bpp = SDL_VideoModeOK(iLargeurEcran, iHauteurEcran, iProfondeur2, flag);
196
{ if(!power_conf->fullscreen)
198
"sdl_tlk.cpp/init_video_mode(): SDL_VideoModeOK() return: %s",
204
// fullscreen fail, try in window mode
205
power_conf->fullscreen = 0;
206
flag = SDL_ANYFORMAT;
207
if(iOctetsParPixel == 1)
208
flag = flag | SDL_HWPALETTE;
209
bpp = SDL_VideoModeOK(iLargeurEcran, iHauteurEcran, iProfondeur2, flag);
212
"sdl_tlk.cpp/init_video_mode(): SDL_VideoModeOK() return: %s",
220
//##############################################################
221
// initialize video mode
222
//##############################################################
224
SDL_SetVideoMode(iLargeurEcran, iHauteurEcran, iProfondeur2, flag);
225
if(!pPowerMangaDisplay)
227
"sdl_tlk.cpp/init_video_mode(): SDL_SetVideoMode() return %s\n",
232
//##############################################################
233
// restore valid height screen (win32 only)
234
//##############################################################
235
if ((vmode) && (vmode2)) {
236
iHauteurEcran = HAUT_ECRAN_PHY * 2;
239
SDL_WM_SetCaption(nomfenetre, nomfenetre);
240
iAffiche = 0; // force refresh all the screen
241
if(power_conf->fullscreen > 0)
242
SDL_ShowCursor(SDL_DISABLE);
244
SDL_ShowCursor(SDL_ENABLE);
219
248
//------------------------------------------------------------------------------
506
535
{ copy2X(ecran_playanim, ecran_ram640, 320, 200, 0,
507
536
iLargeurEcran * iOctetsParPixel * 2 -
508
537
(iLargeurEcran * iOctetsParPixel));
509
rsour.x = 0; rsour.y = 0;
510
545
rsour.w = iLargeurEcran; rsour.h = iHauteurEcran;
511
546
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rsour);
513
548
fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
516
SDL_UpdateRect(pPowerMangaDisplay, 0, 0,
517
pPowerMangaDisplay->w, pPowerMangaDisplay->h);
553
SDL_UpdateRect(pPowerMangaDisplay, 0, 40,
554
pPowerMangaDisplay->w, pPowerMangaDisplay->h - 40);
556
SDL_UpdateRect(pPowerMangaDisplay, 0, 0,
557
pPowerMangaDisplay->w, pPowerMangaDisplay->h);
644
687
copy2X_512x440(_pSource,
645
688
ecran_ram640 + (iLargeurEcran * iOctetsParPixel * 32),
651
702
{ rsour.x = 0; rsour.y = 32;
652
rsour.w = LARG_ECR_RAM * 2; rsour.h = HAUT_ECR_RAM * 2;
653
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rsour);
703
rsour.w = LARG_ECR_RAM * 2; rsour.h = HAUT_ECR_RAM * 2;
704
rdest.x = 0; rdest.y = 32 + starty;
705
rdest.w = LARG_ECR_RAM * 2; rdest.h = HAUT_ECR_RAM * 2;
706
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rdest);
655
708
fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
680
733
(iLargeurEcran * iOctetsParPixel * 2) -
681
734
14 * iOctetsParPixel * 2);
682
735
rsour.x = (LARG_ECR_RAM + 41) * 2; rsour.y = (SCR_HAUTE + 171) * 2;
683
rsour.w = 14 * 2; rsour.h = 8 * 2;
684
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rsour);
736
rsour.w = 14 * 2; rsour.h = 8 * 2;
737
rdest.x = (LARG_ECR_RAM + 41) * 2; rdest.y = (SCR_HAUTE + 171) * 2 + starty;
738
rdest.w = 14 * 2; rdest.h = 8 * 2;
739
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rdest);
686
741
fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
687
742
iBonusX2Affiche = 0;
697
752
(iLargeurEcran * iOctetsParPixel * 2) -
698
753
14 * iOctetsParPixel * 2);
699
754
rsour.x = (LARG_ECR_RAM + 41) * 2; rsour.y = (SCR_HAUTE + 5) * 2;
700
rsour.w = 14 * 2; rsour.h = 8 * 2;
701
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rsour);
755
rsour.w = 14 * 2; rsour.h = 8 * 2;
756
rdest.x = (LARG_ECR_RAM + 41) * 2; rdest.y = (SCR_HAUTE + 5) * 2 + starty;
757
rdest.w = 14 * 2; rdest.h = 8 * 2;
758
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rdest);
703
760
fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
704
761
iBonusX4Affiche = 0;
717
774
(iLargeurEcran * iOctetsParPixel * 2) -
718
775
28 * iOctetsParPixel * 2);
719
776
rsour.x = (LARG_ECR_RAM + _iOptionX) * 2; rsour.y = (SCR_HAUTE + _iOptionY) * 2;
720
rsour.w = 28 * 2; rsour.h = 28 * 2;
721
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rsour);
777
rsour.w = 28 * 2; rsour.h = 28 * 2;
778
rdest.x = (LARG_ECR_RAM + _iOptionX) * 2; rdest.y = (SCR_HAUTE + _iOptionY) * 2 + starty;
779
rdest.w = 28 * 2; rdest.h = 28 * 2;
780
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rdest);
723
782
fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
735
794
(iLargeurEcran * iOctetsParPixel * 2) -
736
795
100 * iOctetsParPixel * 2);
737
796
rsour.x = 210 * 2; rsour.y = 3 * 2;
738
rsour.w = 100 * 2; rsour.h = 9 * 2;
739
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rsour);
797
rsour.w = 100 * 2; rsour.h = 9 * 2;
798
rdest.x = 210 * 2; rdest.y = 3 * 2 + starty;
799
rdest.w = 100 * 2; rdest.h = 9 * 2;
800
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rdest);
741
802
fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
773
834
iLargeurEcran * iOctetsParPixel * 2 -
774
835
(OPT_LARGE * 2 * iOctetsParPixel));
775
836
rsour.x = 0; rsour.y = 0; rsour.w = iLargeurEcran; rsour.h = iHauteurEcran;
776
rdest.x = 0; rdest.y = 0; rdest.w = iLargeurEcran; rdest.h = iHauteurEcran;
837
rdest.x = 0; rdest.y = starty; rdest.w = iLargeurEcran; rdest.h = iHauteurEcran;
777
838
v = SDL_BlitSurface(pEcranXImage640, &rsour, pPowerMangaDisplay, &rdest);
779
840
fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
781
842
iOptionIndex = -1;
783
SDL_UpdateRect(pPowerMangaDisplay, 0, 0, pPowerMangaDisplay->w, pPowerMangaDisplay->h);
845
SDL_UpdateRect(pPowerMangaDisplay, 0, starty, pPowerMangaDisplay->w, pPowerMangaDisplay->h - starty);
786
851
//------------------------------------------------------------------------------
787
852
// SDL : ferme l'affichage sous SDL