Browse Source

Added resizable screen. Game after starting game the mouse wont be allowed to leave screen

pull/18/head
aperturesecurity 7 years ago
parent
commit
e70aabf8eb
  1. 1
      Source/diablo.cpp
  2. 2
      Source/gmenu.cpp
  3. 3
      Source/inv.cpp
  4. 13
      Stub/init.cpp
  5. 11
      Stub/sdlrender.cpp

1
Source/diablo.cpp

@ -239,7 +239,6 @@ void __fastcall start_game(int uMsg)
{
cineflag = 0;
zoomflag = 1;
InitCursor();
InitLightTable();
LoadDebugGFX();
music_stop();

2
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);

3
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 )
{

13
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<MSG> 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;

11
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);

Loading…
Cancel
Save