Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile again #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*.o
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
compile
config.h
config.h.in
config.log
config.status
configure
depcomp
install-sh
missing
src/.deps/
src/Makefile
src/Makefile.in
src/bzworkbench
stamp-h1

7 changes: 0 additions & 7 deletions README

This file was deleted.

25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#BZWorkbench

BZWorkbench is a full featured world editor for the game BZFlag.

It was initially written for the Google summer of code program in 2007.
After a few years of activity development stalled.
It is currently under active development again.

The current version's functionality is limited, as the first
goal was to make it compile again against the current versions
of the libraries it depends on. Specifically Open Scene Graph.

In its current state it:

- Compiles under (Arch) Linux,
- Can load and view maps,
- Can Add, Edit and Remove objects.

![Screenshot](bzworkbenchscreenshot.png "Screenshot")

Background information:

1. <https://developers.google.com/open-source/gsoc/2007/#bzflag>
2. <https://www.google-melange.com/gsoc/org2/google/gsoc2009/bzflag>

23 changes: 20 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
Add features.
Fix bugs.
Improve the unix build system.

Bugs:
- Crash on loading specific maps
- When (after resize?) loaidng a map the ground/grass is much smaller than
the map.

Revive Existing currently broken Functionality

Documentation:
- User Manual
- Design/Architecture

Features:
- Button to reset the view
- Undo/Redo
- Shortcut to put an element on ground level
- Show the name of an object
- Improve the unix build system.
- Make it compile under Windows again.

64 changes: 64 additions & 0 deletions UserManual/manual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# User Manual

## Usage Philosophy

The usage model is aimed at having one hand on the keyboard
and one hand on the mouse.

Therefore most operations require only one key-stroke.

## Basic Usage



## Keyboard and Mouse shortcuts

Action Result
------------------------------- ----------------------------------
left mouse button Select an object
shift left mouse button Select an additional object
left mouse button + motion rotate view
ctrl left mouse button + motion shift view
alt left mouse button + motion scale view


Action Result
------------------------------- ----------------------------------
3 Zoom to selected object (TD)
5 Zoom/out into the map (TD)
6 View the map from the top (TD)
7 View the map from the front (TD)

Adding objects

Action Result
------------------------------- ----------------------------------
b Add a box
p Add a pyramid



When on a selected object

Action Result
------------------------------- ----------------------------------
left mouse button Deselect an object
left mouse button + motion rotate view
ctrl left mouse button + motion shift view
alt left mouse button + motion scale view
right mouse button configure an object (TD)
c configure an object (TD)
s switch to scale manipulator
m switch to move/translate manipulator
r switch to rotate manipulator
3 Zoom to selected object(s) (TD)


## Objects

### Box

### Pyramid


vi: spell spl=en
Binary file added bzworkbenchscreenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
175 changes: 89 additions & 86 deletions include/dialogs/ConfigurationMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,92 +30,95 @@ class bz2object;

class ConfigurationMenu : public Fl_Menu_Button {

public:

// constructor and destructor
ConfigurationMenu(MainWindow* parent, int x, int y, int width, int height);
virtual ~ConfigurationMenu() { }

// update the object
void setObject( bz2object* _obj ) {this->obj = _obj; this->buildMenu(); }

// static callbacks
static void translate_x(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->translate_x_real( w );
}

static void translate_y(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->translate_y_real( w );
}

static void translate_z(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->translate_z_real( w );
}

static void rotate_x(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->rotate_x_real( w );
}

static void rotate_y(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->rotate_y_real( w );
}

static void rotate_z(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->rotate_z_real( w );
}

static void scale_x(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->scale_x_real( w );
}

static void scale_y(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->scale_y_real( w );
}

static void scale_z(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->scale_z_real( w );
}

static void tweak(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->tweak_real( w );
}

private:

// instantiated callbacks
void translate_x_real( Fl_Widget* w );
void translate_y_real( Fl_Widget* w );
void translate_z_real( Fl_Widget* w );

void rotate_x_real( Fl_Widget* w );
void rotate_y_real( Fl_Widget* w );
void rotate_z_real( Fl_Widget* w );

void scale_x_real( Fl_Widget* w );
void scale_y_real( Fl_Widget* w );
void scale_z_real( Fl_Widget* w );

void tweak_real( Fl_Widget* w );

// parent
MainWindow* parent;

// the object to configure
bz2object* obj;

// build the menu (helper method)
void buildMenu(void);

public:

// constructor and destructor
ConfigurationMenu(MainWindow* parent, int x, int y, int width, int height);
virtual ~ConfigurationMenu() { }

// update the object
void setObject( bz2object* _obj ) {
this->obj = _obj;
this->buildMenu();
}

// static callbacks
static void translate_x(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->translate_x_real( w );
}

static void translate_y(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->translate_y_real( w );
}

static void translate_z(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->translate_z_real( w );
}

static void rotate_x(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->rotate_x_real( w );
}

static void rotate_y(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->rotate_y_real( w );
}

static void rotate_z(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->rotate_z_real( w );
}

static void scale_x(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->scale_x_real( w );
}

static void scale_y(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->scale_y_real( w );
}

static void scale_z(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->scale_z_real( w );
}

static void tweak(Fl_Widget* w, void* data) {
ConfigurationMenu* cm = (ConfigurationMenu*)(data);
cm->tweak_real( w );
}

private:

// instantiated callbacks
void translate_x_real( Fl_Widget* w );
void translate_y_real( Fl_Widget* w );
void translate_z_real( Fl_Widget* w );

void rotate_x_real( Fl_Widget* w );
void rotate_y_real( Fl_Widget* w );
void rotate_z_real( Fl_Widget* w );

void scale_x_real( Fl_Widget* w );
void scale_y_real( Fl_Widget* w );
void scale_z_real( Fl_Widget* w );

void tweak_real( Fl_Widget* w );

// parent
MainWindow* parent;

// the object to configure
bz2object* obj;

// build the menu (helper method)
void buildMenu(void);

};

#include "../windows/MainWindow.h"
Expand Down
Loading