Permalink
Browse files

moved Games::Construder namespace to Games::VoxEngine

  • Loading branch information...
1 parent de7edd9 commit 3280d7c1aff57d2b5e4a232462015009fb8688ce @zpmorgan committed Jul 16, 2011
Showing with 540 additions and 491 deletions.
  1. +6 −1 .gitignore
  2. +19 −19 MANIFEST
  3. +9 −8 Makefile.PL
  4. +2 −2 README
  5. +6 −6 Construder.xs → VoxEngine.xs
  6. +5 −5 bin/3dnoise
  7. +5 −5 bin/construder_client
  8. +5 −5 bin/construder_server
  9. +43 −0 bin/minecrap_client.pl
  10. +12 −12 lib/Games/{Construder.pm → VoxEngine.pm}
  11. +15 −15 lib/Games/{Construder → VoxEngine}/Client.pm
  12. +32 −32 lib/Games/{Construder → VoxEngine}/Client/Frontend.pm
  13. +8 −8 lib/Games/{Construder → VoxEngine}/Client/Resources.pm
  14. +16 −16 lib/Games/{Construder → VoxEngine}/Client/UI.pm
  15. +9 −9 lib/Games/{Construder → VoxEngine}/Client/World.pm
  16. +3 −3 lib/Games/{Construder → VoxEngine}/Logging.pm
  17. +3 −3 lib/Games/{Construder → VoxEngine}/Protocol.pm
  18. +14 −14 lib/Games/{Construder → VoxEngine}/Server.pm
  19. +26 −26 lib/Games/{Construder → VoxEngine}/Server/Objects.pm
  20. +3 −3 lib/Games/{Construder → VoxEngine}/Server/PCB.pm
  21. +12 −12 lib/Games/{Construder → VoxEngine}/Server/PatStorHandle.pm
  22. +62 −62 lib/Games/{Construder → VoxEngine}/Server/Player.pm
  23. +8 −8 lib/Games/{Construder → VoxEngine}/Server/Resources.pm
  24. +149 −149 lib/Games/{Construder → VoxEngine}/Server/UI.pm
  25. +50 −50 lib/Games/{Construder → VoxEngine}/Server/World.pm
  26. +3 −3 lib/Games/{Construder → VoxEngine}/UI.pm
  27. +3 −3 lib/Games/{Construder → VoxEngine}/Vector.pm
  28. +1 −1 light.c
  29. +1 −1 noise_3d.c
  30. +1 −1 queue.c
  31. +1 −1 render.c
  32. +2 −2 t/00-load.t
  33. +1 −1 test
  34. +1 −1 vectorlib.c
  35. +1 −1 volume_draw.c
  36. +1 −1 world.c
  37. +1 −1 world_data_struct.c
  38. +1 −1 world_drawing.c
View
@@ -16,7 +16,7 @@ Blockminer3D.c
*.bs
_Inline
attic/
-Construder.c
+VoxEngine.c
MYMETA.*
code_resources/
media_res/
@@ -26,3 +26,8 @@ tests
testprof
testsprof
res/music/
+tags
+installed_libs/
+META.yml
+inc/
+
View
@@ -6,26 +6,26 @@ README
t/00-load.t
bin/construder_client
bin/construder_server
-Construder.xs
+VoxEngine.xs
KNOWN_BUGS
-lib/Games/Construder.pm
-lib/Games/Construder/Client.pm
-lib/Games/Construder/UI.pm
-lib/Games/Construder/Client/Frontend.pm
-lib/Games/Construder/Client/Resources.pm
-lib/Games/Construder/Client/UI.pm
-lib/Games/Construder/Client/World.pm
-lib/Games/Construder/Protocol.pm
-lib/Games/Construder/Logging.pm
-lib/Games/Construder/Server.pm
-lib/Games/Construder/Server/Objects.pm
-lib/Games/Construder/Server/PatStorHandle.pm
-lib/Games/Construder/Server/Player.pm
-lib/Games/Construder/Server/Resources.pm
-lib/Games/Construder/Server/UI.pm
-lib/Games/Construder/Server/World.pm
-lib/Games/Construder/Server/PCB.pm
-lib/Games/Construder/Vector.pm
+lib/Games/VoxEngine.pm
+lib/Games/VoxEngine/Client.pm
+lib/Games/VoxEngine/UI.pm
+lib/Games/VoxEngine/Client/Frontend.pm
+lib/Games/VoxEngine/Client/Resources.pm
+lib/Games/VoxEngine/Client/UI.pm
+lib/Games/VoxEngine/Client/World.pm
+lib/Games/VoxEngine/Protocol.pm
+lib/Games/VoxEngine/Logging.pm
+lib/Games/VoxEngine/Server.pm
+lib/Games/VoxEngine/Server/Objects.pm
+lib/Games/VoxEngine/Server/PatStorHandle.pm
+lib/Games/VoxEngine/Server/Player.pm
+lib/Games/VoxEngine/Server/Resources.pm
+lib/Games/VoxEngine/Server/UI.pm
+lib/Games/VoxEngine/Server/World.pm
+lib/Games/VoxEngine/Server/PCB.pm
+lib/Games/VoxEngine/Vector.pm
noise_3d.c
light.c
queue.c
View
@@ -8,11 +8,11 @@ use OpenGL::Config;
install_share 'res';
WriteMakefile(
- NAME => 'Games::Construder',
+ NAME => 'Games::VoxEngine',
AUTHOR => 'Robin Redeker <elmex@ta-sa.org>',
LICENSE => 'agpl_3',
- VERSION_FROM => 'lib/Games/Construder.pm',
- ABSTRACT_FROM => 'lib/Games/Construder.pm',
+ VERSION_FROM => 'lib/Games/VoxEngine.pm',
+ ABSTRACT_FROM => 'lib/Games/VoxEngine.pm',
PL_FILES => {},
EXE_FILES => [qw(bin/construder_server bin/construder_client)],
LIBS => [Alien::SDL->config('libs')],
@@ -51,12 +51,13 @@ WriteMakefile(
'Compress::LZF' => 0,
'File::ShareDir::PAR' => 0,
'Storable' => 0,
+ 'Getopt::Long' => 0,
},
META_MERGE => {
resources => {
repository => {
- web => "http://git.ta-sa.org/git/Games-Construder/",
- url => "http://git.ta-sa.org/Games-Construder.git",
+ web => "http://git.ta-sa.org/git/Games-VoxEngine/",
+ url => "http://git.ta-sa.org/Games-VoxEngine.git",
type => "git",
},
bugtracker => {
@@ -67,15 +68,15 @@ WriteMakefile(
}
},
depend => {
- "Construder.c" => "vectorlib.c world.c world_data_struct.c render.c queue.c "
+ "VoxEngine.c" => "vectorlib.c world.c world_data_struct.c render.c queue.c "
. "world_drawing.c noise_3d.c volume_draw.c light.c"
},
dist => {
COMPRESS => 'gzip -9f',
SUFFIX => 'gz',
- PREOP => 'pod2text lib/Games/Construder.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
+ PREOP => 'pod2text lib/Games/VoxEngine.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
},
- clean => { FILES => 'Games-Construder' },
+ clean => { FILES => 'Games-VoxEngine' },
);
package MY;
View
4 README
@@ -1,5 +1,5 @@
NAME
- Games::Construder - A 3D game written in Perl, which is actually
+ Games::VoxEngine - A 3D game written in Perl, which is actually
playable!
SYNOPSIS
@@ -12,7 +12,7 @@ SYNOPSIS
user@host ~# construder_client
DESCRIPTION
- This is the source code documentation for the game called "Construder".
+ This is the source code documentation for the game called "VoxEngine".
If you search for information on how to actually play it please look at
the official website for introduction videos:
@@ -78,7 +78,7 @@ unsigned int ctr_cone_sphere_intersect (double cam_x, double cam_y, double cam_z
return 0;
}
-MODULE = Games::Construder PACKAGE = Games::Construder::Math PREFIX = ctr_
+MODULE = Games::VoxEngine PACKAGE = Games::VoxEngine::Math PREFIX = ctr_
unsigned int ctr_cone_sphere_intersect (double cam_x, double cam_y, double cam_z, double cam_v_x, double cam_v_y, double cam_v_z, double cam_fov, double sphere_x, double sphere_y, double sphere_z, double sphere_rad);
@@ -196,7 +196,7 @@ ctr_calc_visible_chunks_at (double pt_x, double pt_y, double pt_z, double rad)
OUTPUT:
RETVAL
-MODULE = Games::Construder PACKAGE = Games::Construder::Renderer PREFIX = ctr_render_
+MODULE = Games::VoxEngine PACKAGE = Games::VoxEngine::Renderer PREFIX = ctr_render_
void *ctr_render_new_geom ();
@@ -226,7 +226,7 @@ void ctr_render_set_ambient_light (double l)
CODE:
ctr_ambient_light = l;
-MODULE = Games::Construder PACKAGE = Games::Construder::World PREFIX = ctr_world_
+MODULE = Games::VoxEngine PACKAGE = Games::VoxEngine::World PREFIX = ctr_world_
void ctr_world_init (SV *change_cb, SV *cell_change_cb)
CODE:
@@ -783,7 +783,7 @@ void ctr_world_flow_light_at (int x, int y, int z)
ctr_world_query_reflow_light (x, y, z);
-MODULE = Games::Construder PACKAGE = Games::Construder::VolDraw PREFIX = vol_draw_
+MODULE = Games::VoxEngine PACKAGE = Games::VoxEngine::VolDraw PREFIX = vol_draw_
void vol_draw_init ();
@@ -901,7 +901,7 @@ void vol_draw_dst_to_world (int sector_x, int sector_y, int sector_z, AV *range_
}
}
-MODULE = Games::Construder PACKAGE = Games::Construder::Random PREFIX = random_
+MODULE = Games::VoxEngine PACKAGE = Games::VoxEngine::Random PREFIX = random_
unsigned int rnd_xor (unsigned int x);
@@ -912,7 +912,7 @@ double rnd_float (unsigned int x)
OUTPUT:
RETVAL
-MODULE = Games::Construder PACKAGE = Games::Construder::Region PREFIX = region_
+MODULE = Games::VoxEngine PACKAGE = Games::VoxEngine::Region PREFIX = region_
void *region_new_from_vol_draw_dst ()
CODE:
View
@@ -261,7 +261,7 @@ sub start_loop {
}
package main;
-use Games::Construder;
+use Games::VoxEngine;
use Alien::SDL;
use Inline C =>
Config
@@ -307,7 +307,7 @@ sub load_model {
warn "making 3d noise\n";
my $cube = $ARGV[1] || 30;
-Games::Construder::VolDraw::init ();
+Games::VoxEngine::VolDraw::init ();
renderer::setup;
init_c_renderer ();
renderer::set_save_cb (sub { save_model (@_); });
@@ -355,15 +355,15 @@ renderer::set_recalc_cb ($cube, $ARGV[0], 0, sub {
alloc_model ($cube);
- Games::Construder::VolDraw::alloc ($cube);
+ Games::VoxEngine::VolDraw::alloc ($cube);
my $filter_cmds = "";
if (open my $f, "<", $filter_file) {
$filter_cmds = do { local $/; <$f> };
}
if (open my $f, "<", $edit_file) {
- Games::Construder::VolDraw::draw_commands (
+ Games::VoxEngine::VolDraw::draw_commands (
do { local $/; <$f> }
. "\n$filter_cmds",
{ size => $cube, seed => $seed, param => $param }
@@ -374,7 +374,7 @@ renderer::set_recalc_cb ($cube, $ARGV[0], 0, sub {
}
my $m = get_model_ptr ();
- Games::Construder::VolDraw::copy ($m);
+ Games::VoxEngine::VolDraw::copy ($m);
$cube
});
View
@@ -1,15 +1,15 @@
#!/opt/perl/bin/perl
use common::sense;
-use Games::Construder;
-use Games::Construder::Logging;
-use Games::Construder::Client;
+use Games::VoxEngine;
+use Games::VoxEngine::Logging;
+use Games::VoxEngine::Client;
#ctr_enable_log_categories ('all');
ctr_enable_log_categories ('info', 'error', 'warn', 'chat');
-Games::Construder::Debug::init ("client");
+Games::VoxEngine::Debug::init ("client");
-our $game = eval { Games::Construder::Client->new (auto_login => $ARGV[0]) };
+our $game = eval { Games::VoxEngine::Client->new (auto_login => $ARGV[0]) };
if ($@) {
ctr_log (error => "Couldn't initialized client: %s", $@);
exit 1;
View
@@ -1,18 +1,18 @@
#!/opt/perl/bin/perl
use common::sense;
use AnyEvent;
-use Games::Construder;
-use Games::Construder::Server;
-use Games::Construder::Logging;
+use Games::VoxEngine;
+use Games::VoxEngine::Server;
+use Games::VoxEngine::Logging;
ctr_enable_log_categories ('info', 'error', 'warn');
-Games::Construder::Debug::init ("server");
+Games::VoxEngine::Debug::init ("server");
our $CV = AE::cv;
our $server;
-$server = Games::Construder::Server->new;
+$server = Games::VoxEngine::Server->new;
$server->init;
$server->listen;
View
@@ -0,0 +1,43 @@
+#!/usr/bin/env perl
+use common::sense;
+use Games::VoxEngine;
+use Games::VoxEngine::Logging;
+use Games::VoxEngine::Client;
+use Getopt::Long;
+
+my $spawn_server = 0;
+my $login_name;
+GetOptions ('spawn!' => \$spawn_server,
+ 'name' => \$login_name,
+);
+
+if ($spawn_server){
+ if (fork()==0){
+
+ exec('perl bin/construder_server');
+ }
+ sleep(5);
+}
+
+
+#ctr_enable_log_categories ('all');
+ctr_enable_log_categories ('info', 'error', 'warn', 'chat');
+
+Games::VoxEngine::Debug::init ("client");
+
+our $game = eval { Games::VoxEngine::Client->new (auto_login => $login_name) };
+if ($@) {
+ ctr_log (error => "Couldn't initialized client: %s", $@);
+ exit 1;
+}
+
+our $in_ex; #does $in_ex do anything?
+$game->set_exception_cb (sub {
+ my ($ex, $ev) = @_;
+ return if $in_ex;
+ local $in_ex = 1;
+ ctr_log (error => "exception in client (%s): %s", $ev, $ex);
+ $game->{front}->msg ("Fatal Error: Exception in client caught: $ev: $ex");
+});
+
+$game->start;
@@ -1,4 +1,4 @@
-# Games::Construder - A 3D Game written in Perl with an infinite and modifiable world.
+# Games::VoxEngine - A 3D Game written in Perl with an infinite and modifiable world.
# Copyright (C) 2011 Robin Redeker
#
# This program is free software: you can redistribute it and/or modify
@@ -14,11 +14,11 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-package Games::Construder;
+package Games::VoxEngine;
use JSON;
use common::sense;
use Time::HiRes qw/time/;
-use Games::Construder::Logging;
+use Games::VoxEngine::Logging;
require Exporter;
our @ISA = qw/Exporter/;
@@ -29,11 +29,11 @@ our @EXPORT = qw/
our $VERSION = '0.94';
use XSLoader;
-XSLoader::load "Games::Construder", $Games::Construder::VERSION;
+XSLoader::load "Games::VoxEngine", $Games::VoxEngine::VERSION;
=head1 NAME
-Games::Construder - A 3D game written in Perl, which is actually playable!
+Games::VoxEngine - A 3D game written in Perl, which is actually playable!
=head1 SYNOPSIS
@@ -47,7 +47,7 @@ Games::Construder - A 3D game written in Perl, which is actually playable!
=head1 DESCRIPTION
-This is the source code documentation for the game called "Construder".
+This is the source code documentation for the game called "VoxEngine".
If you search for information on how to actually play it please look at
the official website for introduction videos:
@@ -77,13 +77,13 @@ sub ctr_prof {
}, sub { $sub->() });
}
-package Games::Construder::Util;
+package Games::VoxEngine::Util;
sub visible_chunks_at {
my ($pos, $rad) = @_;
my $chnks =
- Games::Construder::Math::calc_visible_chunks_at (@$pos, $rad);
+ Games::VoxEngine::Math::calc_visible_chunks_at (@$pos, $rad);
my @o;
for (my $i = 0; $i < @$chnks; $i += 3) {
push @o, [$chnks->[$i], $chnks->[$i + 1], $chnks->[$i + 2]];
@@ -92,8 +92,8 @@ sub visible_chunks_at {
return @o
}
-package Games::Construder::VolDraw;
-use Games::Construder::Logging;
+package Games::VoxEngine::VolDraw;
+use Games::VoxEngine::Logging;
sub _get_file {
my ($file) = @_;
@@ -281,8 +281,8 @@ sub draw_commands {
}
}
-package Games::Construder::Debug;
-use Games::Construder::Logging;
+package Games::VoxEngine::Debug;
+use Games::VoxEngine::Logging;
use AnyEvent::Debug;
our $SHELL;
Oops, something went wrong.

0 comments on commit 3280d7c

Please sign in to comment.