mirror of https://git.sr.ht/~kikoodx/kble
45 lines
1.2 KiB
Zig
45 lines
1.2 KiB
Zig
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2021 KikooDX
|
|
// This file is part of [KBLE](https://sr.ht/~kikoodx/kble), which is
|
|
// MIT licensed. The MIT license requires this copyright notice to be
|
|
// included in all copies and substantial portions of the software.
|
|
//! User defined settings.
|
|
const ray = @import("raylib.zig");
|
|
const cell_type = @import("level.zig").cell_type;
|
|
|
|
/// raylib.Color initialisation wrapper.
|
|
fn col(r: u8, g: u8, b: u8) ray.Color {
|
|
return ray.Color{
|
|
.r = r,
|
|
.g = g,
|
|
.b = b,
|
|
.a = 255,
|
|
};
|
|
}
|
|
|
|
// BEGIN USER CONFIG
|
|
pub const mouse_enabled: bool = true;
|
|
pub const mouse_left_btn: c_int = 0;
|
|
pub const mouse_right_btn: c_int = 1;
|
|
|
|
pub const theme = .{
|
|
.background = ray.BLACK,
|
|
.mode = .{
|
|
.normal = ray.GRAY,
|
|
.select = ray.BLUE,
|
|
.select_rect = ray.SKYBLUE,
|
|
.camera = ray.PURPLE,
|
|
},
|
|
};
|
|
|
|
/// Return user defined color for corresponding cell ID.
|
|
pub fn cell_color(cell: cell_type) ray.Color {
|
|
return switch (cell) {
|
|
0 => comptime col(026, 026, 026), // air
|
|
1 => comptime col(144, 144, 144), // solid
|
|
2 => comptime col(240, 010, 050), // red thing
|
|
else => ray.PURPLE, // undefined
|
|
};
|
|
}
|
|
// END USER CONFIG
|