parent
6725edcf5f
commit
86d8a92ce0
|
@ -5266,7 +5266,7 @@ int calledShotSelectHitLocation(Object* critter, int* hitLocation, int hitMode)
|
||||||
int calledShotWindowX = (screenGetWidth() - CALLED_SHOT_WINDOW_WIDTH) / 2;
|
int calledShotWindowX = (screenGetWidth() - CALLED_SHOT_WINDOW_WIDTH) / 2;
|
||||||
// Center vertically for HRP, otherwise maintain original location (20).
|
// Center vertically for HRP, otherwise maintain original location (20).
|
||||||
int calledShotWindowY = screenGetHeight() != 480
|
int calledShotWindowY = screenGetHeight() != 480
|
||||||
? (screenGetHeight() - 100 - 1 - CALLED_SHOT_WINDOW_HEIGHT) / 2
|
? (screenGetHeight() - INTERFACE_BAR_HEIGHT - 1 - CALLED_SHOT_WINDOW_HEIGHT) / 2
|
||||||
: CALLED_SHOT_WINDOW_Y;
|
: CALLED_SHOT_WINDOW_Y;
|
||||||
gCalledShotWindow = windowCreate(calledShotWindowX,
|
gCalledShotWindow = windowCreate(calledShotWindowX,
|
||||||
calledShotWindowY,
|
calledShotWindowY,
|
||||||
|
|
13
src/core.cc
13
src/core.cc
|
@ -4,6 +4,7 @@
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "dinput.h"
|
#include "dinput.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
|
#include "interface.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "mmx.h"
|
#include "mmx.h"
|
||||||
#include "text_font.h"
|
#include "text_font.h"
|
||||||
|
@ -2047,6 +2048,8 @@ int _GNW95_init_mode_ex(int width, int height, int bpp)
|
||||||
if (configGetBool(&resolutionConfig, "MAIN", "WINDOWED", &windowed)) {
|
if (configGetBool(&resolutionConfig, "MAIN", "WINDOWED", &windowed)) {
|
||||||
fullscreen = !windowed;
|
fullscreen = !windowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configGetBool(&resolutionConfig, "IFACE", "IFACE_BAR_MODE", &gInterfaceBarMode);
|
||||||
}
|
}
|
||||||
configFree(&resolutionConfig);
|
configFree(&resolutionConfig);
|
||||||
}
|
}
|
||||||
|
@ -4617,6 +4620,16 @@ int screenGetHeight()
|
||||||
return rectGetHeight(&_scr_size);
|
return rectGetHeight(&_scr_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int screenGetVisibleHeight()
|
||||||
|
{
|
||||||
|
int windowBottomMargin = 0;
|
||||||
|
|
||||||
|
if (!gInterfaceBarMode) {
|
||||||
|
windowBottomMargin = INTERFACE_BAR_HEIGHT;
|
||||||
|
}
|
||||||
|
return screenGetHeight() - windowBottomMargin;
|
||||||
|
}
|
||||||
|
|
||||||
void mouseGetPositionInWindow(int win, int* x, int* y)
|
void mouseGetPositionInWindow(int win, int* x, int* y)
|
||||||
{
|
{
|
||||||
mouseGetPosition(x, y);
|
mouseGetPosition(x, y);
|
||||||
|
|
|
@ -636,6 +636,7 @@ bool _vcr_load_record(STRUCT_51E2F0* ptr, File* stream);
|
||||||
|
|
||||||
int screenGetWidth();
|
int screenGetWidth();
|
||||||
int screenGetHeight();
|
int screenGetHeight();
|
||||||
|
int screenGetVisibleHeight();
|
||||||
void mouseGetPositionInWindow(int win, int* x, int* y);
|
void mouseGetPositionInWindow(int win, int* x, int* y);
|
||||||
bool mouseHitTestInWindow(int win, int left, int top, int right, int bottom);
|
bool mouseHitTestInWindow(int win, int left, int top, int right, int bottom);
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
#include "game_mouse.h"
|
#include "game_mouse.h"
|
||||||
#include "game_sound.h"
|
#include "game_sound.h"
|
||||||
|
#include "interface.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "pipboy.h"
|
#include "pipboy.h"
|
||||||
#include "scripts.h"
|
#include "scripts.h"
|
||||||
|
@ -535,7 +536,7 @@ int elevatorWindowInit(int elevator)
|
||||||
}
|
}
|
||||||
|
|
||||||
int elevatorWindowX = (screenGetWidth() - gElevatorBackgroundFrmWidth) / 2;
|
int elevatorWindowX = (screenGetWidth() - gElevatorBackgroundFrmWidth) / 2;
|
||||||
int elevatorWindowY = (screenGetHeight() - 100 - 1 - gElevatorBackgroundFrmHeight) / 2;
|
int elevatorWindowY = (screenGetHeight() - INTERFACE_BAR_HEIGHT - 1 - gElevatorBackgroundFrmHeight) / 2;
|
||||||
gElevatorWindow = windowCreate(
|
gElevatorWindow = windowCreate(
|
||||||
elevatorWindowX,
|
elevatorWindowX,
|
||||||
elevatorWindowY,
|
elevatorWindowY,
|
||||||
|
|
|
@ -852,7 +852,8 @@ void _gmouse_handle_event(int mouseX, int mouseY, int mouseState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_mouse_click_in(0, 0, _scr_size.right - _scr_size.left, _scr_size.bottom - _scr_size.top - 100)) {
|
// TODO: allow clicking to the left and right of the INTERFACE_BAR if gInterfaceBarMode is enabled
|
||||||
|
if (!_mouse_click_in(0, 0, _scr_size.right - _scr_size.left, _scr_size.bottom - _scr_size.top - INTERFACE_BAR_HEIGHT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,12 +29,6 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define INDICATOR_BOX_WIDTH 130
|
|
||||||
#define INDICATOR_BOX_HEIGHT 21
|
|
||||||
|
|
||||||
#define INTERFACE_BAR_WIDTH 640
|
|
||||||
#define INTERFACE_BAR_HEIGHT 100
|
|
||||||
|
|
||||||
// The width of connectors in the indicator box.
|
// The width of connectors in the indicator box.
|
||||||
//
|
//
|
||||||
// There are male connectors on the left, and female connectors on the right.
|
// There are male connectors on the left, and female connectors on the right.
|
||||||
|
@ -337,6 +331,9 @@ unsigned char* gInventoryButtonDownFrmData;
|
||||||
// 0x59D40C
|
// 0x59D40C
|
||||||
unsigned char gInterfaceActionPointsBarBackground[90 * 5];
|
unsigned char gInterfaceActionPointsBarBackground[90 * 5];
|
||||||
|
|
||||||
|
// Should the game window stretch all the way to the bottom or sit at the top of the interface bar (default)
|
||||||
|
bool gInterfaceBarMode = false;
|
||||||
|
|
||||||
// intface_init
|
// intface_init
|
||||||
// 0x45D880
|
// 0x45D880
|
||||||
int interfaceInit()
|
int interfaceInit()
|
||||||
|
@ -352,7 +349,7 @@ int interfaceInit()
|
||||||
gInterfaceBarInitialized = 1;
|
gInterfaceBarInitialized = 1;
|
||||||
|
|
||||||
int interfaceBarWindowX = (screenGetWidth() - INTERFACE_BAR_WIDTH) / 2;
|
int interfaceBarWindowX = (screenGetWidth() - INTERFACE_BAR_WIDTH) / 2;
|
||||||
int interfaceBarWindowY = screenGetHeight() - INTERFACE_BAR_HEIGHT - 1;
|
int interfaceBarWindowY = screenGetHeight() - INTERFACE_BAR_HEIGHT;
|
||||||
|
|
||||||
gInterfaceBarWindow = windowCreate(interfaceBarWindowX, interfaceBarWindowY, INTERFACE_BAR_WIDTH, INTERFACE_BAR_HEIGHT, _colorTable[0], WINDOW_HIDDEN);
|
gInterfaceBarWindow = windowCreate(interfaceBarWindowX, interfaceBarWindowY, INTERFACE_BAR_WIDTH, INTERFACE_BAR_HEIGHT, _colorTable[0], WINDOW_HIDDEN);
|
||||||
if (gInterfaceBarWindow == -1) {
|
if (gInterfaceBarWindow == -1) {
|
||||||
|
|
|
@ -35,6 +35,12 @@ typedef enum InterfaceNumbersColor {
|
||||||
INTERFACE_NUMBERS_COLOR_RED = 240,
|
INTERFACE_NUMBERS_COLOR_RED = 240,
|
||||||
} InterfaceNumbersColor;
|
} InterfaceNumbersColor;
|
||||||
|
|
||||||
|
#define INDICATOR_BOX_WIDTH 130
|
||||||
|
#define INDICATOR_BOX_HEIGHT 21
|
||||||
|
|
||||||
|
#define INTERFACE_BAR_WIDTH 640
|
||||||
|
#define INTERFACE_BAR_HEIGHT 100
|
||||||
|
|
||||||
// The maximum number of indicator boxes the indicator bar can display.
|
// The maximum number of indicator boxes the indicator bar can display.
|
||||||
//
|
//
|
||||||
// For unknown reason this number is 6, even though there are only 5 different
|
// For unknown reason this number is 6, even though there are only 5 different
|
||||||
|
@ -171,6 +177,7 @@ extern unsigned char* gOptionsButtonDownFrmData;
|
||||||
extern unsigned char* gSkilldexButtonUpFrmData;
|
extern unsigned char* gSkilldexButtonUpFrmData;
|
||||||
extern unsigned char* gInventoryButtonDownFrmData;
|
extern unsigned char* gInventoryButtonDownFrmData;
|
||||||
extern unsigned char gInterfaceActionPointsBarBackground[450];
|
extern unsigned char gInterfaceActionPointsBarBackground[450];
|
||||||
|
extern bool gInterfaceBarMode;
|
||||||
|
|
||||||
int interfaceInit();
|
int interfaceInit();
|
||||||
void interfaceReset();
|
void interfaceReset();
|
||||||
|
|
12
src/map.cc
12
src/map.cc
|
@ -143,7 +143,7 @@ int isoInit()
|
||||||
_square[elevation] = &(_square_data[elevation]);
|
_square[elevation] = &(_square_data[elevation]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gIsoWindow = windowCreate(0, 0, _scr_size.right - _scr_size.left + 1, _scr_size.bottom - _scr_size.top - 99, 256, 10);
|
gIsoWindow = windowCreate(0, 0, screenGetWidth(), screenGetVisibleHeight(), 256, 10);
|
||||||
if (gIsoWindow == -1) {
|
if (gIsoWindow == -1) {
|
||||||
debugPrint("win_add failed in iso_init\n");
|
debugPrint("win_add failed in iso_init\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -167,14 +167,14 @@ int isoInit()
|
||||||
|
|
||||||
debugPrint(">art_init\t\t");
|
debugPrint(">art_init\t\t");
|
||||||
|
|
||||||
if (tileInit(_square, SQUARE_GRID_WIDTH, SQUARE_GRID_HEIGHT, HEX_GRID_WIDTH, HEX_GRID_HEIGHT, gIsoWindowBuffer, _scr_size.right - _scr_size.left + 1, _scr_size.bottom - _scr_size.top - 99, _scr_size.right - _scr_size.left + 1, isoWindowRefreshRect) != 0) {
|
if (tileInit(_square, SQUARE_GRID_WIDTH, SQUARE_GRID_HEIGHT, HEX_GRID_WIDTH, HEX_GRID_HEIGHT, gIsoWindowBuffer, screenGetWidth(), screenGetVisibleHeight(), screenGetWidth(), isoWindowRefreshRect) != 0) {
|
||||||
debugPrint("tile_init failed in iso_init\n");
|
debugPrint("tile_init failed in iso_init\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
debugPrint(">tile_init\t\t");
|
debugPrint(">tile_init\t\t");
|
||||||
|
|
||||||
if (objectsInit(gIsoWindowBuffer, _scr_size.right - _scr_size.left + 1, _scr_size.bottom - _scr_size.top - 99, _scr_size.right - _scr_size.left + 1) != 0) {
|
if (objectsInit(gIsoWindowBuffer, screenGetWidth(), screenGetVisibleHeight(), screenGetWidth()) != 0) {
|
||||||
debugPrint("obj_init failed in iso_init\n");
|
debugPrint("obj_init failed in iso_init\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -577,9 +577,9 @@ int mapScroll(int dx, int dy)
|
||||||
Rect r2;
|
Rect r2;
|
||||||
rectCopy(&r2, &r1);
|
rectCopy(&r2, &r1);
|
||||||
|
|
||||||
int width = _scr_size.right - _scr_size.left + 1;
|
int width = screenGetWidth();
|
||||||
int pitch = width;
|
int pitch = width;
|
||||||
int height = _scr_size.bottom - _scr_size.top - 99;
|
int height = screenGetVisibleHeight();
|
||||||
|
|
||||||
if (screenDx != 0) {
|
if (screenDx != 0) {
|
||||||
width -= 32;
|
width -= 32;
|
||||||
|
@ -601,7 +601,7 @@ int mapScroll(int dx, int dy)
|
||||||
if (screenDy < 0) {
|
if (screenDy < 0) {
|
||||||
r1.bottom = r1.top - screenDy;
|
r1.bottom = r1.top - screenDy;
|
||||||
src = gIsoWindowBuffer + pitch * (height - 1);
|
src = gIsoWindowBuffer + pitch * (height - 1);
|
||||||
dest = gIsoWindowBuffer + pitch * (_scr_size.bottom - _scr_size.top - 100);
|
dest = gIsoWindowBuffer + pitch * (screenGetVisibleHeight() - 1);
|
||||||
if (screenDx < 0) {
|
if (screenDx < 0) {
|
||||||
dest -= screenDx;
|
dest -= screenDx;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "game_mouse.h"
|
#include "game_mouse.h"
|
||||||
#include "game_sound.h"
|
#include "game_sound.h"
|
||||||
|
#include "interface.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
@ -187,7 +188,7 @@ int skilldexWindowInit()
|
||||||
|
|
||||||
// Maintain original position relative to centered interface bar.
|
// Maintain original position relative to centered interface bar.
|
||||||
int skilldexWindowX = (screenGetWidth() - 640) / 2 + 640 - gSkilldexFrmSizes[SKILLDEX_FRM_BACKGROUND].width - SKILLDEX_WINDOW_RIGHT_MARGIN;
|
int skilldexWindowX = (screenGetWidth() - 640) / 2 + 640 - gSkilldexFrmSizes[SKILLDEX_FRM_BACKGROUND].width - SKILLDEX_WINDOW_RIGHT_MARGIN;
|
||||||
int skilldexWindowY = screenGetHeight() - 100 - 1 - gSkilldexFrmSizes[SKILLDEX_FRM_BACKGROUND].height - SKILLDEX_WINDOW_BOTTOM_MARGIN;
|
int skilldexWindowY = screenGetHeight() - INTERFACE_BAR_HEIGHT - 1 - gSkilldexFrmSizes[SKILLDEX_FRM_BACKGROUND].height - SKILLDEX_WINDOW_BOTTOM_MARGIN;
|
||||||
gSkilldexWindow = windowCreate(skilldexWindowX,
|
gSkilldexWindow = windowCreate(skilldexWindowX,
|
||||||
skilldexWindowY,
|
skilldexWindowY,
|
||||||
gSkilldexFrmSizes[SKILLDEX_FRM_BACKGROUND].width,
|
gSkilldexFrmSizes[SKILLDEX_FRM_BACKGROUND].width,
|
||||||
|
|
Loading…
Reference in New Issue