From d6da832f889ded238c01c0fde56adcfa153c35d2 Mon Sep 17 00:00:00 2001 From: cuckydev Date: Tue, 5 Feb 2019 21:21:43 -0500 Subject: [PATCH] did some widescreen fixes and fixed baby polish --- build/Profile - Copy.dat | Bin 1540 -> 0 bytes ...e Curly Booster v2 Spur Whimsical Star.dat | Bin 1540 -> 0 bytes build/fps | 0 build/pre-omega Profile.dat | Bin 1540 -> 0 bytes src/Back.cpp | 48 ++++++++++++++++++ src/BossLife.cpp | 15 +++--- src/Escape.cpp | 10 ++-- src/Flash.cpp | 33 ++++++------ src/Frame.cpp | 45 +++++++++++----- src/Frame.h | 2 + src/Game.cpp | 26 +++++----- src/Map.cpp | 12 ++--- src/MapName.cpp | 4 +- src/NpcAct040.cpp | 1 + 14 files changed, 135 insertions(+), 61 deletions(-) delete mode 100644 build/Profile - Copy.dat delete mode 100644 build/Save Curly Booster v2 Spur Whimsical Star.dat delete mode 100644 build/fps delete mode 100644 build/pre-omega Profile.dat diff --git a/build/Profile - Copy.dat b/build/Profile - Copy.dat deleted file mode 100644 index e5a14056278023f277fed39ebf962053fe0960da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1540 zcmZ?CH!v|YGBOZhU|`?`;&NU_1_lKn1_EX%26K>zGBpMUCLkZA3Z!N*0+zw(s3GJg oHy=lLNGc%U=mZ7^N01U0Xow#GaRwn^AB1iib<$`E41y2<07|t5*8l(j diff --git a/build/Save Curly Booster v2 Spur Whimsical Star.dat b/build/Save Curly Booster v2 Spur Whimsical Star.dat deleted file mode 100644 index 42c36f85f95e49ff5b907d5c26dd92a786ce7f1d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1540 zcmZ?CH!v|YGBRLfU|`?_VumUps{zDdV9;b>24V;R$!&wO-K4k}c!6w?9%R4;> 9; + barRect.bottom = WINDOW_HEIGHT; + CortBox(&barRect, 0x000000); + + //Top + barRect.left = 0; + barRect.top = 0; + barRect.right = WINDOW_WIDTH; + barRect.bottom = (barTop - gFrame.y) >> 9; + CortBox(&barRect, 0x000000); + + //Right + barRect.left = (barRight - gFrame.x) >> 9; + barRect.top = 0; + barRect.right = WINDOW_WIDTH; + barRect.bottom = WINDOW_HEIGHT; + CortBox(&barRect, 0x000000); + + //Bottom + barRect.left = 0; + barRect.top = (barBottom - gFrame.y) >> 9; + barRect.right = WINDOW_WIDTH; + barRect.bottom = WINDOW_HEIGHT; + CortBox(&barRect, 0x000000); + } } diff --git a/src/BossLife.cpp b/src/BossLife.cpp index ca82ea2e..5df2297f 100644 --- a/src/BossLife.cpp +++ b/src/BossLife.cpp @@ -1,9 +1,10 @@ -#include "BossLife.h" +#include "WindowsWrapper.h" +#include "CommonDefines.h" +#include "BossLife.h" #include "Draw.h" #include "NpChar.h" #include "Boss.h" -#include "WindowsWrapper.h" static struct { @@ -70,11 +71,11 @@ void PutBossLife(void) rcBr.right = 198 * gBL.br / gBL.max; - PutBitmap3(&grcGame, 32, 220, &rcBox1, SURFACE_ID_TEXT_BOX); - PutBitmap3(&grcGame, 32, 228, &rcBox2, SURFACE_ID_TEXT_BOX); - PutBitmap3(&grcGame, 72, 224, &rcBr, SURFACE_ID_TEXT_BOX); - PutBitmap3(&grcGame, 72, 224, &rcLife, SURFACE_ID_TEXT_BOX); - PutBitmap3(&grcGame, 40, 224, &rcText, SURFACE_ID_TEXT_BOX); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 256) / 2, WINDOW_HEIGHT - 20, &rcBox1, SURFACE_ID_TEXT_BOX); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 256) / 2, WINDOW_HEIGHT - 12, &rcBox2, SURFACE_ID_TEXT_BOX); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 176) / 2, WINDOW_HEIGHT - 16, &rcBr, SURFACE_ID_TEXT_BOX); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 176) / 2, WINDOW_HEIGHT - 16, &rcLife, SURFACE_ID_TEXT_BOX); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 240) / 2, WINDOW_HEIGHT - 16, &rcText, SURFACE_ID_TEXT_BOX); } else { diff --git a/src/Escape.cpp b/src/Escape.cpp index 12c0ee8c..0d7c96ed 100644 --- a/src/Escape.cpp +++ b/src/Escape.cpp @@ -1,6 +1,7 @@ -#include "Escape.h" - #include "WindowsWrapper.h" + +#include "CommonDefines.h" +#include "Escape.h" #include "Draw.h" #include "KeyControl.h" #include "Main.h" @@ -9,7 +10,7 @@ int Call_Escape() { RECT rc = {0, 128, 208, 144}; - do + while (Flip_SystemTask()) { //Get pressed keys GetTrg(); @@ -32,10 +33,9 @@ int Call_Escape() //Draw screen CortBox(&grcFull, 0x000000); - PutBitmap3(&grcFull, 56, 112, &rc, 26); + PutBitmap3(&grcFull, (WINDOW_WIDTH - 208) / 2, (WINDOW_HEIGHT - 16) / 2, &rc, 26); PutFramePerSecound(); } - while (Flip_SystemTask()); //Quit if window is closed gKeyTrg = 0; diff --git a/src/Flash.cpp b/src/Flash.cpp index bf930c49..a9fa57f6 100644 --- a/src/Flash.cpp +++ b/src/Flash.cpp @@ -1,8 +1,9 @@ -#include "Flash.h" - -#include "Draw.h" #include "WindowsWrapper.h" +#include "Flash.h" +#include "Draw.h" +#include "CommonDefines.h" + static struct { int mode; @@ -50,26 +51,26 @@ void ActFlash_Explosion(int flx, int fly) right = 0; if (left < 0) left = 0; - if (top > 320) - top = 320; - if (bottom > 240) - bottom = 240; + if (top > WINDOW_WIDTH) + top = WINDOW_WIDTH; + if (bottom > WINDOW_HEIGHT) + bottom = WINDOW_HEIGHT; flash.rect1.left = right; flash.rect1.right = top; flash.rect1.top = 0; - flash.rect1.bottom = 240; + flash.rect1.bottom = WINDOW_HEIGHT; flash.rect2.left = 0; - flash.rect2.right = 320; + flash.rect2.right = WINDOW_WIDTH; flash.rect2.top = left; flash.rect2.bottom = bottom; - if (flash.width > 0xA0000) + if (flash.width > (WINDOW_WIDTH << 11)) { flash.act_no = 1; flash.cnt = 0; - flash.width = 0x1E000; + flash.width = (WINDOW_HEIGHT << 9); } } else if (flash.act_no == 1) @@ -84,8 +85,8 @@ void ActFlash_Explosion(int flx, int fly) top = 0; int bottom = (flash.width + flash.y - fly) / 0x200; - if (bottom > 240) - bottom = 240; + if (bottom > WINDOW_HEIGHT) + bottom = WINDOW_HEIGHT; flash.rect1.left = 0; flash.rect1.right = 0; @@ -95,7 +96,7 @@ void ActFlash_Explosion(int flx, int fly) flash.rect2.top = top; flash.rect2.bottom = bottom; flash.rect2.left = 0; - flash.rect2.right = 320; + flash.rect2.right = WINDOW_WIDTH; } } @@ -111,9 +112,9 @@ void ActFlash_Flash(void) if (flash.cnt / 2 % 2) { flash.rect2.top = 0; - flash.rect2.bottom = 240; + flash.rect2.bottom = WINDOW_HEIGHT; flash.rect2.left = 0; - flash.rect2.right = 320; + flash.rect2.right = WINDOW_WIDTH; } else { diff --git a/src/Frame.cpp b/src/Frame.cpp index 7ab34df1..97400399 100644 --- a/src/Frame.cpp +++ b/src/Frame.cpp @@ -18,15 +18,33 @@ void MoveFrame3() gFrame.y += (*gFrame.tgt_y - (WINDOW_HEIGHT << 8) - gFrame.y) / gFrame.wait; //Keep in bounds - if (gFrame.x <= -0x200) - gFrame.x = 0; - if (gFrame.y <= -0x200) - gFrame.y = 0; + const int num_x = ((WINDOW_WIDTH + 0xF) >> 4) + 1; + const int num_y = ((WINDOW_HEIGHT + 0xF) >> 4) + 1; - if (gFrame.x > ((((map_w - 1) << 4) - WINDOW_WIDTH)) << 9) - gFrame.x = (((map_w - 1) << 4) - WINDOW_WIDTH) << 9; - if (gFrame.y > ((((map_l - 1) << 4) - WINDOW_HEIGHT)) << 9) - gFrame.y = (((map_l - 1) << 4) - WINDOW_HEIGHT) << 9; + if (map_w >= num_x) + { + if (gFrame.x <= -0x200) + gFrame.x = 0; + if (gFrame.x > ((((map_w - 1) << 4) - WINDOW_WIDTH)) << 9) + gFrame.x = (((map_w - 1) << 4) - WINDOW_WIDTH) << 9; + } + else + { + gFrame.x = (((map_w - 1) << 4) - WINDOW_WIDTH) << 8; + } + + if (map_l >= num_y) + { + if (gFrame.y <= -0x200) + gFrame.y = 0; + if (gFrame.y > ((((map_l - 1) << 4) - WINDOW_HEIGHT)) << 9) + gFrame.y = (((map_l - 1) << 4) - WINDOW_HEIGHT) << 9; + } + else + { + + gFrame.y = (((map_l - 1) << 4) - WINDOW_HEIGHT) << 8; + } //Quake if (gFrame.quake2) @@ -43,10 +61,13 @@ void MoveFrame3() } //Keep in bounds - if (gFrame.x <= -0x200) - gFrame.x = 0; - if (gFrame.y <= -0x200) - gFrame.y = 0; + if (map_w >= num_x && map_l >= num_y) + { + if (gFrame.x <= -0x200) + gFrame.x = 0; + if (gFrame.y <= -0x200) + gFrame.y = 0; + } } void GetFramePosition(int *fx, int *fy) diff --git a/src/Frame.h b/src/Frame.h index 6c18cd97..9a40f13e 100644 --- a/src/Frame.h +++ b/src/Frame.h @@ -10,6 +10,8 @@ struct FRAME int quake2; }; +extern FRAME gFrame; + void MoveFrame3(); void GetFramePosition(int *fx, int *fy); void SetFramePosition(int fx, int fy); diff --git a/src/Game.cpp b/src/Game.cpp index 09213ed4..8824bc97 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -340,21 +340,21 @@ int ModeTitle() CortBox(&grcGame, 0x202020); //Draw version - PutBitmap3(&grcGame, 100, 216, &rcVersion, SURFACE_ID_TEXT_BOX); - PutBitmap3(&grcGame, 156, 216, &rcPeriod, SURFACE_ID_TEXT_BOX); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 120) / 2, WINDOW_HEIGHT - 24, &rcVersion, SURFACE_ID_TEXT_BOX); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 8) / 2, WINDOW_HEIGHT - 24, &rcPeriod, SURFACE_ID_TEXT_BOX); int v1, v2, v3, v4; GetCompileVersion(&v1, &v2, &v3, &v4); - PutNumber4(140, 216, v1, 0); - PutNumber4(156, 216, v2, 0); - PutNumber4(172, 216, v3, 0); - PutNumber4(188, 216, v4, 0); + PutNumber4((WINDOW_WIDTH - 40) / 2, WINDOW_HEIGHT - 24, v1, 0); + PutNumber4((WINDOW_WIDTH - 8) / 2, WINDOW_HEIGHT - 24, v2, 0); + PutNumber4((WINDOW_WIDTH + 24) / 2, WINDOW_HEIGHT - 24, v3, 0); + PutNumber4((WINDOW_WIDTH + 56) / 2, WINDOW_HEIGHT - 24, v4, 0); //Draw main title - PutBitmap3(&grcGame, 88, 40, &rcTitle, 0); - PutBitmap3(&grcGame, 136, 128, &rcNew, 0); - PutBitmap3(&grcGame, 136, 148, &rcContinue, 0); - PutBitmap3(&grcGame, 80, 192, &rcPixel, 1); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 144) / 2, 40, &rcTitle, 0); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 48) / 2, (WINDOW_HEIGHT + 16) / 2, &rcNew, 0); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 48) / 2, (WINDOW_HEIGHT + 56) / 2, &rcContinue, 0); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 160) / 2, WINDOW_HEIGHT - 48, &rcPixel, 1); //Draw character cursor RECT char_rc; @@ -386,11 +386,11 @@ int ModeTitle() int char_y; if (bContinue == 1) - char_y = 147; + char_y = (WINDOW_HEIGHT + 54) / 2; else - char_y = 127; + char_y = (WINDOW_HEIGHT + 14) / 2; - PutBitmap3(&grcGame, 116, char_y, &char_rc, char_surf); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 88) / 2, char_y, &char_rc, char_surf); //Draw carets PutCaret(0, 0); diff --git a/src/Map.cpp b/src/Map.cpp index fe229dad..c3b50039 100644 --- a/src/Map.cpp +++ b/src/Map.cpp @@ -133,8 +133,8 @@ bool ChangeMapParts(int x, int y, uint8_t no) void PutStage_Back(int fx, int fy) { //Get range to draw - int num_x = (WINDOW_WIDTH >> 4) + 1; - int num_y = (WINDOW_HEIGHT >> 4) + 1; + int num_x = ((WINDOW_WIDTH + 0xF) >> 4) + 1; + int num_y = ((WINDOW_HEIGHT + 0xF) >> 4) + 1; int put_x = (fx / 0x200 + 8) / 16; int put_y = (fy / 0x200 + 8) / 16; @@ -166,8 +166,8 @@ void PutStage_Front(int fx, int fy) RECT rcSnack = {256, 48, 272, 64}; //Get range to draw - int num_x = (WINDOW_WIDTH >> 4) + 1; - int num_y = (WINDOW_HEIGHT >> 4) + 1; + int num_x = ((WINDOW_WIDTH + 0xF) >> 4) + 1; + int num_y = ((WINDOW_HEIGHT + 0xF) >> 4) + 1; int put_x = (fx / 0x200 + 8) / 16; int put_y = (fy / 0x200 + 8) / 16; @@ -200,8 +200,8 @@ void PutStage_Front(int fx, int fy) void PutMapDataVector(int fx, int fy) { //Get range to draw - int num_x = (WINDOW_WIDTH >> 4) + 1; - int num_y = (WINDOW_HEIGHT >> 4) + 1; + int num_x = ((WINDOW_WIDTH + 0xF) >> 4) + 1; + int num_y = ((WINDOW_HEIGHT + 0xF) >> 4) + 1; int put_x = (fx / 0x200 + 8) / 16; int put_y = (fy / 0x200 + 8) / 16; diff --git a/src/MapName.cpp b/src/MapName.cpp index 0db417a6..cd9a4842 100644 --- a/src/MapName.cpp +++ b/src/MapName.cpp @@ -46,12 +46,12 @@ void PutMapName(bool bMini) //Map system RECT rcBack = {0, 7, WINDOW_WIDTH, 24}; CortBox(&rcBack, 0x000000); - PutBitmap3(&grcGame, 74, 10, &rc, SURFACE_ID_ROOM_NAME); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 172) / 2, 10, &rc, SURFACE_ID_ROOM_NAME); } else if (gMapName.flag) { //MNA - PutBitmap3(&grcGame, 74, 80, &rc, SURFACE_ID_ROOM_NAME); + PutBitmap3(&grcGame, (WINDOW_WIDTH - 172) / 2, (WINDOW_HEIGHT - 80) / 2, &rc, SURFACE_ID_ROOM_NAME); if (++gMapName.wait > 160) gMapName.flag = 0; } diff --git a/src/NpcAct040.cpp b/src/NpcAct040.cpp index 9fcf4ad2..e6bb8281 100644 --- a/src/NpcAct040.cpp +++ b/src/NpcAct040.cpp @@ -621,6 +621,7 @@ void ActNpc045(NPCHAR *npc) npc->ym2 = npc->ym; // Fallthrough case 1: + case 2: if ( ++npc->ani_no > 2 ) npc->ani_no = 1;