renamed XYZ_FRAME to FRAME_XYZ

develop
Taxi Service 2023-05-18 11:22:58 +02:00
parent 5c7d9f228d
commit eb742a603d
3 changed files with 46 additions and 37 deletions

@ -54,11 +54,11 @@ DFHACK_EXPORT long getControlPanelTexposStart();
/** /**
* Get the first texpos for the DFHack borders. Each is a 7x3 grid. * Get the first texpos for the DFHack borders. Each is a 7x3 grid.
*/ */
DFHACK_EXPORT long getThinBordersTexposStart(); DFHACK_EXPORT long getBorderThinTexposStart();
DFHACK_EXPORT long getMediumBordersTexposStart(); DFHACK_EXPORT long getBorderMediumTexposStart();
DFHACK_EXPORT long getBoldBordersTexposStart(); DFHACK_EXPORT long getBorderBoldTexposStart();
DFHACK_EXPORT long getPanelBordersTexposStart(); DFHACK_EXPORT long getBorderPanelTexposStart();
DFHACK_EXPORT long getWindowBordersTexposStart(); DFHACK_EXPORT long getBorderWindowTexposStart();
} }
} }

@ -905,7 +905,7 @@ local BASE_FRAME = {
} }
local function make_frame(name, double_line) local function make_frame(name, double_line)
local texpos = dfhack.textures['get'..name..'BordersTexposStart']() local texpos = dfhack.textures['getBorder'..name..'TexposStart']()
local tp = function(offset) local tp = function(offset)
if texpos == -1 then return nil end if texpos == -1 then return nil end
return texpos + offset return texpos + offset
@ -923,17 +923,26 @@ local function make_frame(name, double_line)
return frame return frame
end end
WINDOW_FRAME = make_frame('Window', true) FRAME_WINDOW = make_frame('Window', true)
PANEL_FRAME = make_frame('Panel', false) FRAME_PANEL = make_frame('Panel', false)
MEDIUM_FRAME = make_frame('Medium', false) FRAME_MEDIUM = make_frame('Medium', false)
BOLD_FRAME = make_frame('Bold', true) FRAME_BOLD = make_frame('Bold', true)
INTERIOR_FRAME = make_frame('Thin', false) FRAME_INTERIOR = make_frame('Thin', false)
INTERIOR_FRAME.signature_pen = false FRAME_INTERIOR.signature_pen = false
INTERIOR_MEDIUM_FRAME = copyall(MEDIUM_FRAME) FRAME_INTERIOR_MEDIUM = copyall(FRAME_MEDIUM)
INTERIOR_MEDIUM_FRAME.signature_pen = false FRAME_INTERIOR_MEDIUM.signature_pen = false
-- for compatibility with pre-steam code -- for compatibility with pre-steam code
GREY_LINE_FRAME = WINDOW_FRAME GREY_LINE_FRAME = FRAME_PANEL
-- for compatibility with deprecated frame naming scheme
WINDOW_FRAME = FRAME_WINDOW
PANEL_FRAME = FRAME_PANEL
MEDIUM_FRAME = FRAME_MEDIUM
BOLD_FRAME = FRAME_BOLD
INTERIOR_FRAME = FRAME_INTERIOR
INTERIOR_MEDIUM_FRAME = FRAME_INTERIOR_MEDIUM
function paint_frame(dc,rect,style,title,inactive,pause_forced,resizable) function paint_frame(dc,rect,style,title,inactive,pause_forced,resizable)
local pen = style.frame_pen local pen = style.frame_pen
@ -942,8 +951,8 @@ function paint_frame(dc,rect,style,title,inactive,pause_forced,resizable)
dscreen.paintTile(style.rt_frame_pen or pen, x2, y1) dscreen.paintTile(style.rt_frame_pen or pen, x2, y1)
dscreen.paintTile(style.lb_frame_pen or pen, x1, y2) dscreen.paintTile(style.lb_frame_pen or pen, x1, y2)
local rb_frame_pen = style.rb_frame_pen local rb_frame_pen = style.rb_frame_pen
if rb_frame_pen == WINDOW_FRAME.rb_frame_pen and not resizable then if rb_frame_pen == FRAME_WINDOW.rb_frame_pen and not resizable then
rb_frame_pen = PANEL_FRAME.rb_frame_pen rb_frame_pen = FRAME_PANEL.rb_frame_pen
end end
dscreen.paintTile(rb_frame_pen or pen, x2, y2) dscreen.paintTile(rb_frame_pen or pen, x2, y2)
dscreen.fillRect(style.t_frame_pen or style.h_frame_pen or pen,x1+1,y1,x2-1,y1) dscreen.fillRect(style.t_frame_pen or style.h_frame_pen or pen,x1+1,y1,x2-1,y1)

@ -24,11 +24,11 @@ static long g_red_pin_texpos_start = -1;
static long g_icons_texpos_start = -1; static long g_icons_texpos_start = -1;
static long g_on_off_texpos_start = -1; static long g_on_off_texpos_start = -1;
static long g_control_panel_texpos_start = -1; static long g_control_panel_texpos_start = -1;
static long g_thin_borders_texpos_start = -1; static long g_border_thin_texpos_start = -1;
static long g_medium_borders_texpos_start = -1; static long g_border_medium_texpos_start = -1;
static long g_bold_borders_texpos_start = -1; static long g_border_bold_texpos_start = -1;
static long g_panel_borders_texpos_start = -1; static long g_border_panel_texpos_start = -1;
static long g_window_borders_texpos_start = -1; static long g_border_window_texpos_start = -1;
// Converts an arbitrary Surface to something like the display format // Converts an arbitrary Surface to something like the display format
// (32-bit RGBA), and converts magenta to transparency if convert_magenta is set // (32-bit RGBA), and converts magenta to transparency if convert_magenta is set
@ -132,15 +132,15 @@ void Textures::init(color_ostream &out) {
g_num_dfhack_textures += load_textures(out, "hack/data/art/control-panel.png", g_num_dfhack_textures += load_textures(out, "hack/data/art/control-panel.png",
&g_control_panel_texpos_start); &g_control_panel_texpos_start);
g_num_dfhack_textures += load_textures(out, "hack/data/art/border-thin.png", g_num_dfhack_textures += load_textures(out, "hack/data/art/border-thin.png",
&g_thin_borders_texpos_start); &g_border_thin_texpos_start);
g_num_dfhack_textures += load_textures(out, "hack/data/art/border-medium.png", g_num_dfhack_textures += load_textures(out, "hack/data/art/border-medium.png",
&g_medium_borders_texpos_start); &g_border_medium_texpos_start);
g_num_dfhack_textures += load_textures(out, "hack/data/art/border-bold.png", g_num_dfhack_textures += load_textures(out, "hack/data/art/border-bold.png",
&g_bold_borders_texpos_start); &g_border_bold_texpos_start);
g_num_dfhack_textures += load_textures(out, "hack/data/art/border-panel.png", g_num_dfhack_textures += load_textures(out, "hack/data/art/border-panel.png",
&g_panel_borders_texpos_start); &g_border_panel_texpos_start);
g_num_dfhack_textures += load_textures(out, "hack/data/art/border-window.png", g_num_dfhack_textures += load_textures(out, "hack/data/art/border-window.png",
&g_window_borders_texpos_start); &g_border_window_texpos_start);
DEBUG(textures,out).print("loaded %ld textures\n", g_num_dfhack_textures); DEBUG(textures,out).print("loaded %ld textures\n", g_num_dfhack_textures);
@ -197,22 +197,22 @@ long Textures::getControlPanelTexposStart() {
return g_control_panel_texpos_start; return g_control_panel_texpos_start;
} }
long Textures::getThinBordersTexposStart() { long Textures::getBorderThinTexposStart() {
return g_thin_borders_texpos_start; return g_border_thin_texpos_start;
} }
long Textures::getMediumBordersTexposStart() { long Textures::getBorderMediumTexposStart() {
return g_medium_borders_texpos_start; return g_border_medium_texpos_start;
} }
long Textures::getBoldBordersTexposStart() { long Textures::getBorderBoldTexposStart() {
return g_bold_borders_texpos_start; return g_border_bold_texpos_start;
} }
long Textures::getPanelBordersTexposStart() { long Textures::getBorderPanelTexposStart() {
return g_panel_borders_texpos_start; return g_border_panel_texpos_start;
} }
long Textures::getWindowBordersTexposStart() { long Textures::getBorderWindowTexposStart() {
return g_window_borders_texpos_start; return g_border_window_texpos_start;
} }