Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in1
-rw-r--r--osirion.kdevelop2
-rw-r--r--osirion.kdevelop.pcsbin758234 -> 675867 bytes
-rw-r--r--osirion.kdevses9
-rw-r--r--src/Makefile.am14
-rw-r--r--src/core/entity.cc5
-rw-r--r--src/render/camera.cc14
-rw-r--r--src/render/draw.cc76
8 files changed, 101 insertions, 20 deletions
diff --git a/configure.in b/configure.in
index 61b94c7..0b42aa7 100644
--- a/configure.in
+++ b/configure.in
@@ -213,6 +213,7 @@ dnl ---------------------------------------------------------------
dnl Write makefiles and config.h
AM_CONDITIONAL(BUILD_CLIENT, test "x$BUILD_CLIENT" = xyes)
+AM_CONDITIONAL(BUILD_DEDICATED, test "x$BUILD_CLIENT" = xno)
AC_OUTPUT(Makefile src/Makefile src/audio/Makefile src/auxiliary/Makefile \
src/client/Makefile src/core/Makefile src/filesystem/Makefile src/game/Makefile \
diff --git a/osirion.kdevelop b/osirion.kdevelop
index 58a8bfc..25d8c79 100644
--- a/osirion.kdevelop
+++ b/osirion.kdevelop
@@ -21,7 +21,7 @@
</general>
<kdevautoproject>
<general>
- <activetarget>src/client/libclient.la</activetarget>
+ <activetarget>src/osirion</activetarget>
<useconfiguration>debug</useconfiguration>
</general>
<run>
diff --git a/osirion.kdevelop.pcs b/osirion.kdevelop.pcs
index 3c3a627..cbac4fc 100644
--- a/osirion.kdevelop.pcs
+++ b/osirion.kdevelop.pcs
Binary files differ
diff --git a/osirion.kdevses b/osirion.kdevses
index e8415d1..b1e7ab1 100644
--- a/osirion.kdevses
+++ b/osirion.kdevses
@@ -1,7 +1,14 @@
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE KDevPrjSession>
<KDevPrjSession>
- <DocsAndViews NumberOfDocuments="0" />
+ <DocsAndViews NumberOfDocuments="2" >
+ <Doc0 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/render/draw.cc" >
+ <View0 Encoding="" line="144" Type="Source" />
+ </Doc0>
+ <Doc1 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/Makefile.am" >
+ <View0 Encoding="" line="24" Type="Source" />
+ </Doc1>
+ </DocsAndViews>
<pluginList>
<kdevdebugger>
<breakpointList/>
diff --git a/src/Makefile.am b/src/Makefile.am
index 9c55179..3f82bdd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,17 +6,16 @@ SUFFIXES = .rc
if BUILD_CLIENT
MAYBE_CLIENT_SUBDIRS = audio render client
- MAYBE_CLIENT_PROGRAMS = osirion
endif
SUBDIRS = sys math auxiliary filesystem model core server $(MAYBE_CLIENT_SUBDIRS) game
noinst_HEADERS = config.h
-if BUILD_CLIENT
-bin_PROGRAMS = osiriond osirion
-else
+if BUILD_DEDICATED
bin_PROGRAMS = osiriond
+else
+bin_PROGRAMS = osiriond osirion
endif
# dedicated server
@@ -36,11 +35,8 @@ osiriond_LDADD = $(top_builddir)/src/auxiliary/libauxiliary.la \
osirion_SOURCES = osirion.cc
EXTRA_osirion_SOURCES = osirion-res.rc
osirion_DEPENDENCIES = $(ICON_CLIENT) \
- $(top_builddir)/src/auxiliary/libauxiliary.la $(top_builddir)/src/client/libclient.la \
- $(top_builddir)/src/core/libcore.la $(top_builddir)/src/filesystem/libfilesystem.la \
- $(top_builddir)/src/game/libgame.la $(top_builddir)/src/math/libmath.la \
- $(top_builddir)/src/model/libmodel.la $(top_builddir)/src/audio/libaudio.la \
- $(top_builddir)/src/render/librender.la $(top_builddir)/src/sys/libsys.la
+ $(top_builddir)/src/audio/libaudio.la $(top_builddir)/src/render/librender.la \
+ $(top_builddir)/src/client/libclient.la
osirion_CFLAGS = $(LIBSDL_CFLAGS) $(GL_CFLAGS) $(GLUT_CFLAGS)
osirion_LDADD = $(top_builddir)/src/game/libgame.la \
$(top_builddir)/src/client/libclient.la $(top_builddir)/src/audio/libaudio.la \
diff --git a/src/core/entity.cc b/src/core/entity.cc
index e9985c3..db40f76 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -114,15 +114,16 @@ Entity::Entity(std::istream & is)
is >> entity_flags;
is >> entity_location;
is >> entity_color;
+
is >> s; // shape
+ entity_shape = (Shape) s;
+
is >> entity_radius;
is >> entity_axis[0];
is >> entity_axis[1];
entity_axis[2] = math::crossproduct(entity_axis.forward(), entity_axis.left());
- entity_shape = (Shape) s ;
-
char c;
// read label
while ( (is.get(c)) && (c != '"'));
diff --git a/src/render/camera.cc b/src/render/camera.cc
index 7f1f307..5a6607f 100644
--- a/src/render/camera.cc
+++ b/src/render/camera.cc
@@ -286,12 +286,18 @@ void Camera::draw(float seconds)
camera_axis.change_pitch(pitch_current);
} else if (mode() == Cockpit) {
+
camera_axis.assign(target_axis);
- if (core::localcontrol()->state() && core::localcontrol()->model())
- camera_target += (core::localcontrol()->model()->maxbbox().x+0.05) *
- core::localcontrol()->state()->axis().forward();
-
+ if (core::localcontrol()->state()) {
+ if (core::localcontrol()->model()) {
+ camera_target += (core::localcontrol()->model()->maxbbox().x+0.05) *
+ core::localcontrol()->state()->axis().forward();
+ } else {
+ camera_target += (core::localcontrol()->radius() + 0.05) *
+ core::localcontrol()->state()->axis().forward();
+ }
+ }
distance = 0.0f;
}
}
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 448b2ce..1091d8c 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -91,7 +91,7 @@ void draw_entity_sphere(core::Entity *entity)
void draw_entity_cube(core::Entity *entity)
{
- float radius = entity->radius()/2;
+ float radius = entity->radius();
gl::scale(radius, radius, radius);
gl::color(entity->color());
@@ -139,6 +139,72 @@ void draw_entity_cube(core::Entity *entity)
gl::end();
}
+void draw_entity_diamond(core::Entity *entity)
+{
+ float radius = entity->radius()/2;
+
+ gl::color(entity->color());
+
+ gl::begin(gl::TriangleFan );
+ gl::normal(0, 0 , 1);
+ gl::vertex(0, 0, radius);
+
+ gl::normal(1, 0 ,0);
+ gl::vertex(radius, 0.0f, 0.0f);
+ gl::normal(0, 1, 0);
+ gl::vertex(0.0f, radius, 0.0f);
+ gl::normal(-1, 0 ,0);
+ gl::vertex(-radius, 0.0f, 0.0f);
+ gl::normal(0, -1, 0);
+ gl::vertex(0.0f, -radius, 0.0f);
+ gl::normal(1, 0 ,0);
+ gl::vertex(radius, 0.0f, 0.0f);
+
+ gl::end();
+
+ gl::begin(gl::TriangleFan);
+ gl::normal(0, 0 , -1);
+ gl::vertex(0, 0, -radius);
+
+ gl::normal(1, 0, 0);
+ gl::vertex(radius, 0.0f, 0.0f);
+
+ gl::normal(0, -1, 0);
+ gl::vertex(0.0f, -radius, 0.0f);
+
+ gl::normal(-1, 0 ,0);
+ gl::vertex(-radius, 0.0f, 0.0f);
+
+ gl::normal(0, 1, 0);
+ gl::vertex(0.0f, radius, 0.0f);
+
+ gl::normal(1, 0 ,0);
+ gl::vertex(radius, 0.0f, 0.0f);
+
+ gl::end();
+
+ gl::begin(gl::Lines);
+
+ gl::vertex(radius, 0, 0);
+ gl::vertex(2* radius, 0, 0);
+
+ gl::vertex(0, radius, 0);
+ gl::vertex(0, 2* radius, 0);
+
+ gl::vertex(0, 0, radius);
+ gl::vertex(0, 0, 2 * radius);
+
+ gl::vertex(-radius, 0, 0);
+ gl::vertex(-2 * radius, 0, 0);
+
+ gl::vertex(0, -radius, 0);
+ gl::vertex(0, -2 * radius, 0);
+
+ gl::vertex(0, 0, -radius);
+ gl::vertex(0, 0, -2 * radius);
+
+ gl::end();
+}
void draw_entity_axis(core::Entity *entity)
{
@@ -225,6 +291,7 @@ void pass_prepare(float seconds)
if (!entity->model()) {
entity->entity_modelname.clear();
+ entity->entity_radius = 0.25;
} else {
// set entity radius to model radius
entity->entity_radius = entity->entity_model->radius();
@@ -343,13 +410,16 @@ void draw_pass_default()
gl::disable(GL_LIGHTING);
}
- switch(entity->shape()) {
+ switch(entity->shape()) {
+
case core::Entity::Sphere:
draw_entity_sphere(entity);
break;
case core::Entity::Diamond:
-
+ draw_entity_diamond(entity);
+ break;
+
case core::Entity::Axis:
draw_entity_axis(entity);
break;