From: Shamus Hammons Date: Thu, 5 Jun 2008 12:11:39 +0000 (+0000) Subject: Initial stab at fixing the GUI classes so that they work properly. X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=463f5b68a439cbe862a1332a01c267f052616aeb;p=apple2 Initial stab at fixing the GUI classes so that they work properly. --- diff --git a/apple2.cfg b/apple2.cfg index e494c0c..c2aee79 100755 --- a/apple2.cfg +++ b/apple2.cfg @@ -28,7 +28,7 @@ floppyImage1 = ./disks/bt1_boot.dsk #floppyImage1 = ./disks/bt3_boot.dsk # Yes #floppyImage1 = ./disks/Sabotage.dsk -# ??? +# ??? (//c or //e w/128K required) #floppyImage1 = ./disks/airheart.dsk # Yes #floppyImage1 = ./disks/drol.dsk @@ -38,7 +38,7 @@ floppyImage1 = ./disks/bt1_boot.dsk #floppyImage1 = ./disks/wolfenstein_dos32.nib # Yes, keys??? #floppyImage1 = ./disks/MidnightMagic_etc.dsk -# ??? +# ??? (PRODOS 8 V1.4 - UNABLE TO LOAD ATINIT FILE) #floppyImage1 = ./disks/battle_chess_1.dsk # Yes #floppyImage1 = ./disks/MoebiusI-1.dsk diff --git a/src/applevideo.cpp b/src/applevideo.cpp index 932422e..86eeeda 100755 --- a/src/applevideo.cpp +++ b/src/applevideo.cpp @@ -638,6 +638,7 @@ static void RenderHiRes(uint16 toLine/*= 192*/) uint32 pixelOn = (screenType == ST_WHITE_MONO ? 0xFFFFFFFF : 0xFF61FF61); #else // Now it is. Now roll this fix into all the other places... !!! FIX !!! +// The colors are set in the 8-bit array as R G B A uint8 monoColors[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0x61, 0xFF, 0x61, 0xFF }; uint32 * colorPtr = (uint32 *)monoColors; uint32 pixelOn = (screenType == ST_WHITE_MONO ? colorPtr[0] : colorPtr[1]); diff --git a/src/gui/draggablewindow2.cpp b/src/gui/draggablewindow2.cpp index 25df4d0..be4207c 100755 --- a/src/gui/draggablewindow2.cpp +++ b/src/gui/draggablewindow2.cpp @@ -53,18 +53,22 @@ DraggableWindow2::DraggableWindow2(uint32 x/*= 0*/, uint32 y/*= 0*/, uint32 w/*= uint16 imgHeight = (floppyDiskImg[2] << 8) | floppyDiskImg[3]; img = SDL_CreateRGBSurfaceFrom(&floppyDiskImg[4], imgWidth, imgHeight, 32, imgWidth * 4, MASK_R, MASK_G, MASK_B, MASK_A); - label = SDL_CreateRGBSurface(SDL_SWSURFACE, 16*7, 32, 32, - MASK_R, MASK_G, MASK_B, MASK_A); +// label = SDL_CreateRGBSurface(SDL_SWSURFACE, 16*7, 32, 32, +// MASK_R, MASK_G, MASK_B, MASK_A); //Prolly should draw this in the constructor... //Now is! :-D extern char textChar2e[]; uint8 * fontAddr = (uint8 *)textChar2e + ((128 + 32) * 7 * 8); SetNewFont(Font(fontAddr, 7, 8)); - DrawStringOpaque(label, 0, 0, 0xFF000000, 0xFFFFFFFF, "Ultima III - Boo"); - DrawStringOpaque(label, 0, 8, 0xFF000000, 0xFFFFFFFF, "0123456789012345"); - DrawStringOpaque(label, 0, 16, 0xFF000000, 0xFFFFFFFF, "1234567890123456"); - DrawStringOpaque(label, 0, 24, 0xFF000000, 0xFFFFFFFF, "2345678901234567"); +// DrawStringOpaque(label, 0, 0, 0xFF000000, 0xFFFFFFFF, "Ultima III - Boo"); +// DrawStringOpaque(label, 0, 8, 0xFF000000, 0xFFFFFFFF, "0123456789012345"); +// DrawStringOpaque(label, 0, 16, 0xFF000000, 0xFFFFFFFF, "1234567890123456"); +// DrawStringOpaque(label, 0, 24, 0xFF000000, 0xFFFFFFFF, "2345678901234567"); + DrawStringOpaque(img, 8, 6, 0xFF000000, 0xFFFFFFFF, "Ultima III - Boo"); + DrawStringOpaque(img, 8, 14, 0xFF000000, 0xFFFFFFFF, "t Disk6789012345"); + DrawStringOpaque(img, 8, 22, 0xFF000000, 0xFFFFFFFF, "1234567890123456"); + DrawStringOpaque(img, 6, 30, 0xFF000000, 0xFFFFFFFF, "2345678901234567"); RestoreOldFont(); #endif @@ -84,7 +88,7 @@ printf("Inside ~DraggableWindow2()...\n"); #ifdef BACKGROUND_IMG_TEST SDL_FreeSurface(img); - SDL_FreeSurface(label); +// SDL_FreeSurface(label); #endif } @@ -112,6 +116,10 @@ void DraggableWindow2::HandleMouseMove(uint32 x, uint32 y) extents.x = newX; extents.y = newY; SaveScreenToBackstore(); +#ifdef USE_COVERAGE_LISTS +//If we don't do this, the coverage list doesn't move with the window...! + ResetCoverageList(); +#endif // SDL_BlitSurface(screen, &extents, backstore, NULL); Draw(); @@ -149,6 +157,7 @@ void DraggableWindow2::HandleMouseButton(uint32 x, uint32 y, bool mouseDown) void DraggableWindow2::Draw(void) { +//NOTE: What we need to do here is render into a surface THEN do the blits from the coverage list. !!! FIX !!! #ifdef USE_COVERAGE_LISTS // These are *always* top level and parentless, so no need to traverse up through // the parent chain... @@ -160,11 +169,12 @@ void DraggableWindow2::Draw(void) SDL_BlitSurface(img, &src, screen, &dst); } +// HUH??!?!? The label should have been drawn into img already!!! !!! FIX !!! [DONE] //This doesn't get clipped at all... !!! FIX !!! - SDL_Rect src, dst; - src.x = 0, src.y = 0, src.w = label->w, src.h = label->h; - dst.x = extents.x + 8, dst.y = extents.y + 6; - SDL_BlitSurface(label, &src, screen, &dst); +// SDL_Rect src, dst; +// src.x = 0, src.y = 0, src.w = label->w, src.h = label->h; +// dst.x = extents.x + 8, dst.y = extents.y + 6; +// SDL_BlitSurface(label, &src, screen, &dst); // Handle the items this window contains... for(uint32 i=0; iHandleMouseMove(mouse.x, mouse.y); // windowList.back()->HandleMouseMove(mouse.x, mouse.y); @@ -347,9 +347,12 @@ Also, when doing a window drag, the coverage lists for all windows have to be re //*misses* to everyone else... Otherwise, you can have overlapping draggable windows //and be able to drag both by clicking on a point that intersects both... //(though that may be an interesting way to handle things!) +//The thing is that you want to do it on purpose (like with a special grouping widget) +//instead of by accident. So, !!! FIX !!! // Pass the click on to all windows - for(i=windowList.begin(); i!=windowList.end(); i++) - (*i)->HandleMouseButton(event.button.x, event.button.y, true); +// for(i=windowList.begin(); i!=windowList.end(); i++) +// (*i)->HandleMouseButton(event.button.x, event.button.y, true); + windowList.back()->HandleMouseButton(event.button.x, event.button.y, true); // // & bail if nothing changed... if (movedWindow) @@ -360,6 +363,8 @@ Also, when doing a window drag, the coverage lists for all windows have to be re //the Z order where the previous window was. for(i=windowList.begin(); i!=windowList.end(); i++) { +//One other little quirk: Probably need to clear the backing store as well! +//Not sure... (*i)->ResetCoverageList(); // This looks odd, but it's just a consequence of iterator weirdness.