Merge branch 'master' of https://github.com/Clownacy/Cave-Story-Engine-2
This commit is contained in:
commit
cb730ff9d7
2 changed files with 22 additions and 22 deletions
|
@ -158,9 +158,9 @@ void MoveCampCursor()
|
||||||
{
|
{
|
||||||
int arms_num = 0;
|
int arms_num = 0;
|
||||||
int item_num = 0;
|
int item_num = 0;
|
||||||
while ( gArmsData[arms_num].code != 0 )
|
while (gArmsData[arms_num].code != 0)
|
||||||
++arms_num;
|
++arms_num;
|
||||||
while ( gItemData[item_num].code != 0 )
|
while (gItemData[item_num].code != 0)
|
||||||
++item_num;
|
++item_num;
|
||||||
|
|
||||||
if (arms_num == 0 && item_num == 0)
|
if (arms_num == 0 && item_num == 0)
|
||||||
|
@ -228,9 +228,9 @@ void MoveCampCursor()
|
||||||
bChange = TRUE;
|
bChange = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( gKeyTrg & gKeyDown )
|
if (gKeyTrg & gKeyDown)
|
||||||
{
|
{
|
||||||
if ( gSelectedItem / 6 == (item_num - 1) / 6 )
|
if (gSelectedItem / 6 == (item_num - 1) / 6)
|
||||||
gCampActive = FALSE;
|
gCampActive = FALSE;
|
||||||
else
|
else
|
||||||
gSelectedItem += 6;
|
gSelectedItem += 6;
|
||||||
|
@ -325,7 +325,7 @@ void PutCampObject()
|
||||||
PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 160) / 2, gArmsData[i].level, 0);
|
PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 160) / 2, gArmsData[i].level, 0);
|
||||||
|
|
||||||
// Draw ammo
|
// Draw ammo
|
||||||
if ( gArmsData[i].max_num )
|
if (gArmsData[i].max_num)
|
||||||
{
|
{
|
||||||
PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 144) / 2, gArmsData[i].num, 0);
|
PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 144) / 2, gArmsData[i].num, 0);
|
||||||
PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 128) / 2, gArmsData[i].max_num, 0);
|
PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 128) / 2, gArmsData[i].max_num, 0);
|
||||||
|
|
34
src/Back.cpp
34
src/Back.cpp
|
@ -21,7 +21,7 @@ BOOL InitBack(const char *fName, int type)
|
||||||
// Unused, hilariously
|
// Unused, hilariously
|
||||||
color_black = GetCortBoxColor(RGB(0, 0, 0x10));
|
color_black = GetCortBoxColor(RGB(0, 0, 0x10));
|
||||||
|
|
||||||
//Get width and height
|
// Get width and height
|
||||||
char path[PATH_LENGTH];
|
char path[PATH_LENGTH];
|
||||||
sprintf(path, "%s/%s.pbm", gDataPath, fName);
|
sprintf(path, "%s/%s.pbm", gDataPath, fName);
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ BOOL InitBack(const char *fName, int type)
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Set background stuff and load texture
|
// Set background stuff and load texture
|
||||||
gBack.flag = 1;
|
gBack.flag = 1;
|
||||||
if (!ReloadBitmap_File(fName, SURFACE_ID_LEVEL_BACKGROUND))
|
if (!ReloadBitmap_File(fName, SURFACE_ID_LEVEL_BACKGROUND))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -138,7 +138,7 @@ void PutBack(int fx, int fy)
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
case 7:
|
case 7:
|
||||||
//Sky
|
// Sky
|
||||||
static unsigned int fillNext;
|
static unsigned int fillNext;
|
||||||
fillNext = 0;
|
fillNext = 0;
|
||||||
for (int y = 0; y < WINDOW_HEIGHT - 240 + 88; y += 88)
|
for (int y = 0; y < WINDOW_HEIGHT - 240 + 88; y += 88)
|
||||||
|
@ -156,7 +156,7 @@ void PutBack(int fx, int fy)
|
||||||
rect.right = 320;
|
rect.right = 320;
|
||||||
PutBitmap4(&grcGame, (WINDOW_WIDTH - 320) / 2, WINDOW_HEIGHT - 240, &rect, SURFACE_ID_LEVEL_BACKGROUND);
|
PutBitmap4(&grcGame, (WINDOW_WIDTH - 320) / 2, WINDOW_HEIGHT - 240, &rect, SURFACE_ID_LEVEL_BACKGROUND);
|
||||||
|
|
||||||
//Cloud layer 1
|
// Cloud layer 1
|
||||||
rect.top = 88;
|
rect.top = 88;
|
||||||
rect.bottom = 123;
|
rect.bottom = 123;
|
||||||
rect.left = gBack.fx / 2;
|
rect.left = gBack.fx / 2;
|
||||||
|
@ -167,7 +167,7 @@ void PutBack(int fx, int fy)
|
||||||
for (int i = 0; i < ((WINDOW_WIDTH - 1) / 320) + 1; i++)
|
for (int i = 0; i < ((WINDOW_WIDTH - 1) / 320) + 1; i++)
|
||||||
PutBitmap4(&grcGame, (320 * (i + 1)) - gBack.fx / 2 % 320, 88 + (WINDOW_HEIGHT - 240), &rect, SURFACE_ID_LEVEL_BACKGROUND);
|
PutBitmap4(&grcGame, (320 * (i + 1)) - gBack.fx / 2 % 320, 88 + (WINDOW_HEIGHT - 240), &rect, SURFACE_ID_LEVEL_BACKGROUND);
|
||||||
|
|
||||||
//Cloud layer 2
|
// Cloud layer 2
|
||||||
rect.top = 123;
|
rect.top = 123;
|
||||||
rect.bottom = 146;
|
rect.bottom = 146;
|
||||||
rect.left = gBack.fx % 320;
|
rect.left = gBack.fx % 320;
|
||||||
|
@ -178,7 +178,7 @@ void PutBack(int fx, int fy)
|
||||||
for (int i = 0; i < ((WINDOW_WIDTH - 1) / 320) + 1; i++)
|
for (int i = 0; i < ((WINDOW_WIDTH - 1) / 320) + 1; i++)
|
||||||
PutBitmap4(&grcGame, (320 * (i + 1)) - gBack.fx % 320, 123 + (WINDOW_HEIGHT - 240), &rect, SURFACE_ID_LEVEL_BACKGROUND);
|
PutBitmap4(&grcGame, (320 * (i + 1)) - gBack.fx % 320, 123 + (WINDOW_HEIGHT - 240), &rect, SURFACE_ID_LEVEL_BACKGROUND);
|
||||||
|
|
||||||
//Cloud layer 3
|
// Cloud layer 3
|
||||||
rect.top = 146;
|
rect.top = 146;
|
||||||
rect.bottom = 176;
|
rect.bottom = 176;
|
||||||
rect.left = 2 * gBack.fx % 320;
|
rect.left = 2 * gBack.fx % 320;
|
||||||
|
@ -189,7 +189,7 @@ void PutBack(int fx, int fy)
|
||||||
for (int i = 0; i < ((WINDOW_WIDTH - 1) / 320) + 1; i++)
|
for (int i = 0; i < ((WINDOW_WIDTH - 1) / 320) + 1; i++)
|
||||||
PutBitmap4(&grcGame, (320 * (i + 1)) - 2 * gBack.fx % 320, 146 + (WINDOW_HEIGHT - 240), &rect, SURFACE_ID_LEVEL_BACKGROUND);
|
PutBitmap4(&grcGame, (320 * (i + 1)) - 2 * gBack.fx % 320, 146 + (WINDOW_HEIGHT - 240), &rect, SURFACE_ID_LEVEL_BACKGROUND);
|
||||||
|
|
||||||
//Cloud layer 4
|
// Cloud layer 4
|
||||||
rect.top = 176;
|
rect.top = 176;
|
||||||
rect.bottom = 240;
|
rect.bottom = 240;
|
||||||
rect.left = 4 * gBack.fx % 320;
|
rect.left = 4 * gBack.fx % 320;
|
||||||
|
@ -248,49 +248,49 @@ void PutFront(int fx, int fy)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Draw black bars
|
// Draw black bars
|
||||||
if (!(g_GameFlags & 8)) //Detect if credits are running
|
if (!(g_GameFlags & 8)) // Detect if credits are running
|
||||||
{
|
{
|
||||||
const bool fromFocus = (gStageNo == 31); //Get if we should only draw around a 320x240 area of the focus point
|
const bool fromFocus = (gStageNo == 31); // Get if we should only draw around a 320x240 area of the focus point
|
||||||
|
|
||||||
//Get focus rect
|
// Get focus rect
|
||||||
int focusX = gFrame.x + (WINDOW_WIDTH << 8) - (320 << 8);
|
int focusX = gFrame.x + (WINDOW_WIDTH << 8) - (320 << 8);
|
||||||
int focusY = gFrame.y + (WINDOW_HEIGHT << 8) - (240 << 8);
|
int focusY = gFrame.y + (WINDOW_HEIGHT << 8) - (240 << 8);
|
||||||
int focusR = focusX + (320 << 9);
|
int focusR = focusX + (320 << 9);
|
||||||
int focusB = focusY + (240 << 9);
|
int focusB = focusY + (240 << 9);
|
||||||
|
|
||||||
//Get borders
|
// Get borders
|
||||||
const int barLeft = fromFocus ? focusX : -0x1000;
|
const int barLeft = fromFocus ? focusX : -0x1000;
|
||||||
const int barTop = fromFocus ? focusY : -0x1000;
|
const int barTop = fromFocus ? focusY : -0x1000;
|
||||||
|
|
||||||
const int barRight = fromFocus ? focusR : (gMap.width << 13) - 0x1000;
|
const int barRight = fromFocus ? focusR : (gMap.width << 13) - 0x1000;
|
||||||
const int barBottom = fromFocus ? focusB : (gMap.length << 13) - 0x1000;
|
const int barBottom = fromFocus ? focusB : (gMap.length << 13) - 0x1000;
|
||||||
|
|
||||||
//Draw bars
|
// Draw bars
|
||||||
RECT barRect;
|
RECT barRect;
|
||||||
|
|
||||||
//Left
|
// Left
|
||||||
barRect.left = 0;
|
barRect.left = 0;
|
||||||
barRect.top = 0;
|
barRect.top = 0;
|
||||||
barRect.right = (barLeft - gFrame.x) >> 9;
|
barRect.right = (barLeft - gFrame.x) >> 9;
|
||||||
barRect.bottom = WINDOW_HEIGHT;
|
barRect.bottom = WINDOW_HEIGHT;
|
||||||
CortBox(&barRect, 0x000000);
|
CortBox(&barRect, 0x000000);
|
||||||
|
|
||||||
//Top
|
// Top
|
||||||
barRect.left = 0;
|
barRect.left = 0;
|
||||||
barRect.top = 0;
|
barRect.top = 0;
|
||||||
barRect.right = WINDOW_WIDTH;
|
barRect.right = WINDOW_WIDTH;
|
||||||
barRect.bottom = (barTop - gFrame.y) >> 9;
|
barRect.bottom = (barTop - gFrame.y) >> 9;
|
||||||
CortBox(&barRect, 0x000000);
|
CortBox(&barRect, 0x000000);
|
||||||
|
|
||||||
//Right
|
// Right
|
||||||
barRect.left = (barRight - gFrame.x) >> 9;
|
barRect.left = (barRight - gFrame.x) >> 9;
|
||||||
barRect.top = 0;
|
barRect.top = 0;
|
||||||
barRect.right = WINDOW_WIDTH;
|
barRect.right = WINDOW_WIDTH;
|
||||||
barRect.bottom = WINDOW_HEIGHT;
|
barRect.bottom = WINDOW_HEIGHT;
|
||||||
CortBox(&barRect, 0x000000);
|
CortBox(&barRect, 0x000000);
|
||||||
|
|
||||||
//Bottom
|
// Bottom
|
||||||
barRect.left = 0;
|
barRect.left = 0;
|
||||||
barRect.top = (barBottom - gFrame.y) >> 9;
|
barRect.top = (barBottom - gFrame.y) >> 9;
|
||||||
barRect.right = WINDOW_WIDTH;
|
barRect.right = WINDOW_WIDTH;
|
||||||
|
|
Loading…
Add table
Reference in a new issue