diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 3a05f9048..f3a2857ea 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -239,7 +239,6 @@ void __fastcall start_game(int uMsg) { cineflag = 0; zoomflag = 1; - InitCursor(); InitLightTable(); LoadDebugGFX(); music_stop(); diff --git a/Source/gmenu.cpp b/Source/gmenu.cpp index aecbb45e8..c6ebf5eaf 100644 --- a/Source/gmenu.cpp +++ b/Source/gmenu.cpp @@ -446,6 +446,8 @@ void __cdecl gmenu_init_menu() gdwFont3Height = dwData[1]; pFont3 = LoadFileInMem("ui_art\\font16.bin", 0); + + pCursCels = LoadFileInMem("Data\\Inv\\Objcurs.CEL", 0); MenuPentegram = LoadFileInMem("Gendata\\Pentitle.CEL",0); pTitlgrayCel_sgpBackCel = LoadFileInMem("Gendata\\Titlgray.CEL", 0); diff --git a/Source/inv.cpp b/Source/inv.cpp index 31ac0c892..c531caaa8 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -170,6 +170,8 @@ void __cdecl DrawInv() int frame = plr[myplr].InvBody[INVLOC_HEAD]._iCurs + 12; int frame_width = InvItemWidth[frame]; + printf("FRAME %d, WIDTH %d", frame, frame_width); + if ( pcursinvitem == INVITEM_HEAD ) { int colour = 197; @@ -376,6 +378,7 @@ void __cdecl DrawInv() int frame = plr[myplr].InvBody[INVLOC_CHEST]._iCurs + 12; int frame_width = InvItemWidth[frame]; + if ( pcursinvitem == INVITEM_CHEST ) { diff --git a/Stub/init.cpp b/Stub/init.cpp index 3e98d3e22..5b3993708 100644 --- a/Stub/init.cpp +++ b/Stub/init.cpp @@ -73,6 +73,9 @@ void __fastcall init_create_window(int nCmdShow) gmenu_init_menu(); SDL_Diablo_UI(); SDL_ShowCursor(SDL_DISABLE); + SDL_SetWindowSize(window, 1920,1080); //2560x1440 + SDL_SetRelativeMouseMode(SDL_TRUE); + } LRESULT __stdcall MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) @@ -165,6 +168,8 @@ void SDL_Diablo_UI() // I anticipate to move this later. int CharsLoaded = 0; int HeroPortrait = 3; + int Selection[4]; + printf("Main Menu Init\n"); // SDL_ShowCursor(SDL_DISABLE);//Doesn't really work... Use HideCursor() instead. SdlDiabloMainWindow(); @@ -178,13 +183,11 @@ void SDL_Diablo_UI() // I anticipate to move this later. // static std::deque message_queue; while (1 && quit == false) { - // DrawMouse(); + DrawMouse(); PaletteFadeIn(32); if (menu == 0) { - // CreateMainDiabloMenu(); SDL_RenderDiabloMainPage(); - DrawMouse(); } if (menu == 2) { @@ -196,7 +199,7 @@ void SDL_Diablo_UI() // I anticipate to move this later. } SDL_RenderDiabloSinglePlayerPage(); gbMaxPlayers = 1; - DrawMouse(); // Not accurate for some reason. It adds too much and I am not sure why. + //DrawMouse(); // Not accurate for some reason. It adds too much and I am not sure why. ConstantButtons(); } @@ -204,7 +207,7 @@ void SDL_Diablo_UI() // I anticipate to move this later. CreateHeroMenu(); DrawNewHeroKartinka(HeroPortrait, 1); ConstantButtons(); - DrawMouse(); + //DrawMouse(); } int m4Loaded = 0; diff --git a/Stub/sdlrender.cpp b/Stub/sdlrender.cpp index 04184bef3..c7551f55a 100644 --- a/Stub/sdlrender.cpp +++ b/Stub/sdlrender.cpp @@ -616,7 +616,8 @@ void SdlDiabloMainWindow() SDL_Init(SDL_INIT_VIDEO); window = SDL_CreateWindow("Diablo", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, Window_Width, Window_Height, - SDL_WINDOW_SHOWN); + SDL_WINDOW_RESIZABLE); + renderer = SDL_CreateRenderer(window, -1, 0); printf("Window And Renderer Created!\n"); @@ -846,7 +847,13 @@ void DrawMouse() SDL_GetMouseState(&MouseX, &MouseY); - CelDecodeOnly(MouseX, MouseY, pPcxCursorImage, 1, 36); + //CelDecodeOnly(64, 64, pCursCels, 1, 28); + + //CelDecodeOnly(MouseX, MouseY, pCursCels, 1, 36); + + // frame_width = InvItemWidth[frame]; + + // lock_buf_priv(); // DrawArtWithMask(MouseX, MouseY, gdwCursorWidth, lines, 0, 0, pPcxCursorImage);