Skip to content

Commit

Permalink
Updated editor_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
twist84 committed Dec 31, 2024
1 parent d57c7f2 commit 32c25d0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 44 deletions.
77 changes: 36 additions & 41 deletions game/source/editor/editor_flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,55 @@
#include "game/player_mapping.hpp"
#include "toolbox/game_helpers.hpp"

bool render_comment_flags = false;
bool enable_controller_flag_drop = false;
bool render_comment_flags = false;
bool render_comment_flags_look_at = false;

void render_debug_scenario_comments()
void editor_flag_new_at_camera()
{
if (render_comment_flags)
{
//long flag_count = 0;
//editor_comment_definition* flags = editor_flags_get(&flag_count);
//for (long flag_index = 0; flag_index < flag_count; flag_index++)
//{
// editor_comment_definition* flag = &flags[flag_index];
// editor_flag_render(flag->name,
// render_comment_flags_text ? flag->description : NULL,
// &flag->position,
// global_real_argb_red,
// global_real_argb_salmon);
//}
}

if (enable_controller_flag_drop || render_comment_flags_look_at)
editor_flag_render_look_at_point();
//if (enable_controller_flag_drop)
//{
// long active_output_user = player_mapping_first_active_output_user();
// if (active_output_user != NONE)
// {
// s_observer_result const* camera = observer_get_camera(active_output_user);
// editor_flag_new_internal(g_default_flag_name.get_string(), g_default_flag_description.get_string(), &camera->position);
// }
//}
}

void editor_flag_new_at_camera()
void editor_flag_new_at_look_at_point()
{
if (enable_controller_flag_drop)
{
long user_index = player_mapping_first_active_output_user();
if (user_index != NONE)
{
s_observer_result const* result = observer_get_camera(user_index);
//editor_flag_new_internal(controller_flag_drop_name, controller_flag_drop_comment, &result->focus_point);
}
}
//if (enable_controller_flag_drop)
// editor_scripted_flag_new_at_look_at_point(g_default_flag_name.get_string(), g_default_flag_description.get_string());
}

void editor_flag_render_look_at_point()
{
// #TODO: implement
//long active_output_user = player_mapping_first_active_output_user();
//real_point3d look_at_point{};
//if (user_get_look_at_point(active_output_user, &look_at_point))
// editor_render_flag_internal(g_default_flag_name.get_string(), g_default_flag_description.get_string(), &look_at_point, global_real_argb_blue, global_real_argb_cyan);
}

void editor_flag_new_at_look_at_point()
void render_debug_scenario_comments()
{
if (enable_controller_flag_drop)
{
long user_index = player_mapping_first_active_output_user();
real_point3d result_point = {};
if (user_get_look_at_point(user_index, &result_point))
{
s_observer_result const* result = observer_get_camera(user_index);
//editor_flag_new_internal(controller_flag_drop_name, controller_flag_drop_comment, &result_point);
}
}
//if (render_comment_flags)
//{
// long flag_count = 0;
// editor_comment_definition* flags = editor_flags_get(&flag_count);
// for (long flag_index = 0; flag_index < flag_count; flag_index++)
// {
// editor_comment_definition* flag = &flags[flag_index];
// editor_flag_render(flag->name,
// render_comment_flags_text ? flag->description : NULL,
// &flag->position,
// global_real_argb_red,
// global_real_argb_salmon);
// }
//}
//
//if (enable_controller_flag_drop || render_comment_flags_look_at)
// editor_flag_render_look_at_point();
}

6 changes: 3 additions & 3 deletions game/source/editor/editor_flags.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

extern bool render_comment_flags;
extern bool enable_controller_flag_drop;
extern bool render_comment_flags;
extern bool render_comment_flags_look_at;

extern void render_debug_scenario_comments();
extern void editor_flag_new_at_camera();
extern void editor_flag_render_look_at_point();
extern void editor_flag_new_at_look_at_point();
extern void editor_flag_render_look_at_point();
extern void render_debug_scenario_comments();

0 comments on commit 32c25d0

Please sign in to comment.