summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/defs.rs16
-rw-r--r--src/fmt.rs21
-rw-r--r--src/game_vars.rs34
-rw-r--r--src/main.rs16
-rw-r--r--src/path.rs16
-rw-r--r--src/renderer.rs47
-rw-r--r--src/timer.rs16
7 files changed, 166 insertions, 0 deletions
diff --git a/src/defs.rs b/src/defs.rs
index 37dd5a1..47000eb 100644
--- a/src/defs.rs
+++ b/src/defs.rs
@@ -1,3 +1,19 @@
+// Copyright (C) 2018 Jakob L. Kreuze, All Rights Reserved.
+//
+// This file is part of rebuild.
+//
+// rebuild is free software: you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your option) any later
+// version.
+//
+// rebuild is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+// A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// rebuild. If not, see <http://www.gnu.org/licenses/>.
+
// Straight ripped from DUKE3D.H
pub struct UserDefs {
diff --git a/src/fmt.rs b/src/fmt.rs
index a838de6..bd34962 100644
--- a/src/fmt.rs
+++ b/src/fmt.rs
@@ -1,3 +1,19 @@
+// Copyright (C) 2018 Jakob L. Kreuze, All Rights Reserved.
+//
+// This file is part of rebuild.
+//
+// rebuild is free software: you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your option) any later
+// version.
+//
+// rebuild is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+// A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// rebuild. If not, see <http://www.gnu.org/licenses/>.
+
extern crate byteorder;
extern crate simple_error;
@@ -298,6 +314,11 @@ mod grp_tests {
// shades. The problem is that my palette conversion program never truncated off
// the end of the file. So the last 8K of Duke3D's PALETTE.DAT is the last 8K of
// a translucent table that was based on an older version of their palette.
+//
+//
+// For canonical parsers, see:
+// - 'paletteLoadFromDisk' in EDuke's 'build/src/palette.cpp'
+// - 'loadpalette' in Build's 'ENGINE.C'
/// Parser for PALETTE.DAT, the file specifying the color format.
pub struct Palette {
diff --git a/src/game_vars.rs b/src/game_vars.rs
new file mode 100644
index 0000000..a4538d7
--- /dev/null
+++ b/src/game_vars.rs
@@ -0,0 +1,34 @@
+// Copyright (C) 2018 Jakob L. Kreuze, All Rights Reserved.
+//
+// This file is part of rebuild.
+//
+// rebuild is free software: you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your option) any later
+// version.
+//
+// rebuild is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+// A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// rebuild. If not, see <http://www.gnu.org/licenses/>.
+
+use std::collections::HashMap;
+
+pub enum GameVar {
+ String(string),
+}
+
+// TODO: Document this.
+// TODO: Rename?
+pub struct GameVarManager {
+ vars: HashMap<String,
+}
+
+impl GameVars {
+ // TODO: Document this.
+ pub fn new() -> GameVars {
+ GameVars { }
+ }
+}
diff --git a/src/main.rs b/src/main.rs
index b60030e..d54bfea 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,19 @@
+// Copyright (C) 2018 Jakob L. Kreuze, All Rights Reserved.
+//
+// This file is part of rebuild.
+//
+// rebuild is free software: you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your option) any later
+// version.
+//
+// rebuild is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+// A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// rebuild. If not, see <http://www.gnu.org/licenses/>.
+
#[macro_use]
extern crate simple_error;
diff --git a/src/path.rs b/src/path.rs
index 5fb5875..e53fe50 100644
--- a/src/path.rs
+++ b/src/path.rs
@@ -1,3 +1,19 @@
+// Copyright (C) 2018 Jakob L. Kreuze, All Rights Reserved.
+//
+// This file is part of rebuild.
+//
+// rebuild is free software: you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your option) any later
+// version.
+//
+// rebuild is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+// A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// rebuild. If not, see <http://www.gnu.org/licenses/>.
+
use std::env;
use std::error::Error;
use std::path::Path;
diff --git a/src/renderer.rs b/src/renderer.rs
new file mode 100644
index 0000000..1f0d09f
--- /dev/null
+++ b/src/renderer.rs
@@ -0,0 +1,47 @@
+// Copyright (C) 2018 Jakob L. Kreuze, All Rights Reserved.
+//
+// This file is part of rebuild.
+//
+// rebuild is free software: you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your option) any later
+// version.
+//
+// rebuild is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+// A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// rebuild. If not, see <http://www.gnu.org/licenses/>.
+
+extern crate sdl2;
+
+pub trait Renderer {
+ pub fn new() -> Self;
+
+ // FIXME: Error handling?
+ pub fn window_title(title: &str);
+
+ pub fn draw_rooms(player_num: i32, smooth_ratio: i32);
+}
+
+// TODO: Document this.
+pub struct ClassicRenderer;
+
+impl Renderer for ClassicRenderer {
+ // TODO: Document this.
+ // FIXME: Proper error handling.
+ pub fn new() -> ClassicRenderer {
+ // let context = sdl2::init().unwrap();
+ // let video_subsystem = context.video().unwrap();
+
+ // let display = video_subsystem.window("SDL2", 800, 600)
+ // // .resizable()
+ // // .build_glium()
+ // .unwrap();
+
+ ClassicRenderer { }
+ }
+
+ pub fn window_title()
+}
diff --git a/src/timer.rs b/src/timer.rs
index f34df8d..1ad1ac5 100644
--- a/src/timer.rs
+++ b/src/timer.rs
@@ -1,3 +1,19 @@
+// Copyright (C) 2018 Jakob L. Kreuze, All Rights Reserved.
+//
+// This file is part of rebuild.
+//
+// rebuild is free software: you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your option) any later
+// version.
+//
+// rebuild is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+// A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// rebuild. If not, see <http://www.gnu.org/licenses/>.
+
extern crate sdl2;
use sdl2::TimerSubsystem;