Skip to content

Commit

Permalink
all: make ${@xxx} usage consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
larpon committed Nov 17, 2022
1 parent 1120286 commit 835c811
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions cli/cli.v
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ pub fn string_to_args(input string) ![]string {
args << buf
}
if in_string {
return error(@FN +
': could not parse input, missing closing string delimiter `${delim.ascii_str()}`')
return error('${@FN}: could not parse input, missing closing string delimiter `${delim.ascii_str()}`')
}
return args
}
Expand Down
2 changes: 1 addition & 1 deletion cli/options.v
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub fn args_to_options(arguments []string, defaults Options) !(Options, &flag.Fl
}

opt.additional_args = fp.finalize() or {
return error(@FN + ': flag parser failed finalizing: ${err}')
return error('${@FN}: flag parser failed finalizing: ${err}')
}

mut c_flags := []string{}
Expand Down
2 changes: 1 addition & 1 deletion lib/config.v
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub struct InputConfig {

pub fn config_from_toml_file(path string) !Config {
toml_text := os.read_file(path) or {
return error(@MOD + '.' + @FN + ' Could not read "${path}": "${err.msg()}"')
return error('${@MOD}.${@FN} could not read "${path}": "${err.msg()}"')
}
return config_from_toml_text(toml_text)
}
Expand Down
8 changes: 4 additions & 4 deletions lib/draw2d.image.b.v
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ pub fn (mut di DrawImage) begin() {
win := di.shy.active_window()
w, h := win.drawable_wh()
sgl.defaults()
gl.defaults()
// sgl.set_context(fc.sgl)
sgl.matrix_mode_projection()
sgl.ortho(0.0, f32(w), f32(h), 0.0, -1.0, 1.0)
// gl.set_context(fc.sgl)
gl.matrix_mode_projection()
gl.ortho(0.0, f32(w), f32(h), 0.0, -1.0, 1.0)
*/

win := di.shy.active_window()
Expand Down
10 changes: 5 additions & 5 deletions lib/gfx.b.v
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ pub fn (mut g GFX) init_subsystems() ! {
mut s := g.shy
s.log.gdebug('${@STRUCT}.${@FN}', 'hi')

// sokol_gl is used by the font and image system
// sokol_gl is used by the font system
sample_count := s.config.render.msaa
sgl_desc := &gl.Desc{
gl_desc := &gl.Desc{
context_pool_size: 2 * 512 // TODO default 4, NOTE this number affects the prealloc_contexts in fonts.b.v...
pipeline_pool_size: 2 * 1024 // TODO default 4, NOTE this number affects the prealloc_contexts in fonts.b.v...
sample_count: sample_count
}
gl.setup(sgl_desc)
gl.setup(gl_desc)

// Initialize Sokol GP which is used for shape drawing.
// TODO Adjust the size of command buffers.
sgp_desc := gp.Desc{
gp_desc := gp.Desc{
// max_vertices: 1_000_000
// max_commands: 100_000
}
gp.setup(&sgp_desc)
gp.setup(&gp_desc)
if !gp.is_valid() {
error_msg := unsafe { cstring_to_vstring(gp.get_error_message(gp.get_last_error())) }
panic('Failed to create Sokol GP context:\n${error_msg}')
Expand Down
2 changes: 1 addition & 1 deletion vxt/vxt.v
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn vmodules() !string {
vmodules_path = os.join_path(os.home_dir(), '.vmodules')
}
if !os.is_dir(vmodules_path) {
return error(@MOD + '.' + @FN + ': no valid v modules path found at "${vmodules_path}"')
return error('${@MOD}.${@FN}: No valid v modules path found at "${vmodules_path}"')
}
return vmodules_path
}
Expand Down

0 comments on commit 835c811

Please sign in to comment.