refactor: reorganize display/ and render/ into unified render/ module
Browse filesMerge the display/ and render/ sibling modules into a single render/
module with display/, sprite/, and ddraw/ sub-modules. Pure mechanical
refactor β file moves and import rewrites only, zero logic changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- crates/openwa-core/src/address.rs +9 -9
- crates/openwa-core/src/engine/ddgame.rs +3 -3
- crates/openwa-core/src/engine/ddgame_constructor.rs +12 -9
- crates/openwa-core/src/engine/ddgame_load_fonts.rs +1 -1
- crates/openwa-core/src/engine/ddgame_wrapper.rs +1 -1
- crates/openwa-core/src/engine/game_session.rs +1 -1
- crates/openwa-core/src/lib.rs +0 -1
- crates/openwa-core/src/registry.rs +1 -1
- crates/openwa-core/src/{display β render/ddraw}/compat_renderer.rs +0 -0
- crates/openwa-core/src/render/ddraw/mod.rs +3 -0
- crates/openwa-core/src/{display β render/display}/base.rs +0 -0
- crates/openwa-core/src/{display/render_context.rs β render/display/context.rs} +0 -0
- crates/openwa-core/src/{display β render/display}/gfx.rs +1 -1
- crates/openwa-core/src/{display β render/display}/gradient.rs +1 -1
- crates/openwa-core/src/{display β render/display}/line_draw.rs +0 -0
- crates/openwa-core/src/{display β render/display}/mod.rs +4 -8
- crates/openwa-core/src/{display β render/display}/palette.rs +0 -0
- crates/openwa-core/src/{display β render/display}/sprite_blit.rs +0 -0
- crates/openwa-core/src/{display/display_vtable.rs β render/display/vtable.rs} +2 -2
- crates/openwa-core/src/render/mod.rs +10 -5
- crates/openwa-core/src/{display β render}/opengl.rs +0 -0
- crates/openwa-core/src/render/{gfx_dir.rs β sprite/gfx_dir.rs} +0 -0
- crates/openwa-core/src/render/sprite/mod.rs +7 -0
- crates/openwa-core/src/render/{spr.rs β sprite/spr.rs} +0 -0
- crates/openwa-core/src/render/{sprite.rs β sprite/sprite.rs} +0 -0
- crates/openwa-core/src/render/{sprite_id.rs β sprite/sprite_id.rs} +0 -0
crates/openwa-core/src/address.rs
CHANGED
|
@@ -75,23 +75,23 @@ pub mod va {
|
|
| 75 |
BIT_GRID_COLLISION_VTABLE, BIT_GRID_DISPLAY_VTABLE, BIT_GRID_INIT, BLIT_SPRITE_RECT,
|
| 76 |
DRAW_LINE_CLIPPED, DRAW_LINE_TWO_COLOR,
|
| 77 |
};
|
| 78 |
-
pub use crate::display::base::DISPLAY_BASE_VTABLE;
|
| 79 |
-
pub use crate::display::compat_renderer::{
|
| 80 |
-
CompatRendererVtable, COMPAT_RENDERER_VTABLE, DDRAW8_RENDERER_VTABLE,
|
| 81 |
-
};
|
| 82 |
-
pub use crate::display::display_vtable::DISPLAY_GFX_VTABLE;
|
| 83 |
-
pub use crate::display::palette::PALETTE_VTABLE;
|
| 84 |
-
pub use crate::display::render_context::{RenderContextVtable, RENDER_CONTEXT_VTABLE};
|
| 85 |
pub use crate::frontend::map_view::MAP_VIEW_VTABLE;
|
| 86 |
pub use crate::input::controller::INPUT_CTRL_VTABLE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
pub use crate::task::game_task::SOUND_EMITTER_VTABLE;
|
| 88 |
|
| 89 |
// Sprite, SpriteBank, PaletteContext β defined alongside their structs
|
| 90 |
pub use crate::render::palette::{
|
| 91 |
PALETTE_CONTEXT_INIT, PALETTE_CONTEXT_INIT_RANGE, PALETTE_CONTEXT_MAP_COLOR,
|
| 92 |
};
|
| 93 |
-
pub use crate::render::sprite::SPRITE_BANK_VTABLE;
|
| 94 |
-
pub use crate::render::sprite::{
|
| 95 |
CONSTRUCT_SPRITE, DESTROY_SPRITE, LOAD_SPRITE_FROM_VFS, PROCESS_SPRITE,
|
| 96 |
SPRITE_BANK_GET_INFO, SPRITE_GET_INFO, SPRITE_VTABLE,
|
| 97 |
};
|
|
|
|
| 75 |
BIT_GRID_COLLISION_VTABLE, BIT_GRID_DISPLAY_VTABLE, BIT_GRID_INIT, BLIT_SPRITE_RECT,
|
| 76 |
DRAW_LINE_CLIPPED, DRAW_LINE_TWO_COLOR,
|
| 77 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
pub use crate::frontend::map_view::MAP_VIEW_VTABLE;
|
| 79 |
pub use crate::input::controller::INPUT_CTRL_VTABLE;
|
| 80 |
+
pub use crate::render::ddraw::compat_renderer::{
|
| 81 |
+
CompatRendererVtable, COMPAT_RENDERER_VTABLE, DDRAW8_RENDERER_VTABLE,
|
| 82 |
+
};
|
| 83 |
+
pub use crate::render::display::base::DISPLAY_BASE_VTABLE;
|
| 84 |
+
pub use crate::render::display::context::{RenderContextVtable, RENDER_CONTEXT_VTABLE};
|
| 85 |
+
pub use crate::render::display::palette::PALETTE_VTABLE;
|
| 86 |
+
pub use crate::render::display::vtable::DISPLAY_GFX_VTABLE;
|
| 87 |
pub use crate::task::game_task::SOUND_EMITTER_VTABLE;
|
| 88 |
|
| 89 |
// Sprite, SpriteBank, PaletteContext β defined alongside their structs
|
| 90 |
pub use crate::render::palette::{
|
| 91 |
PALETTE_CONTEXT_INIT, PALETTE_CONTEXT_INIT_RANGE, PALETTE_CONTEXT_MAP_COLOR,
|
| 92 |
};
|
| 93 |
+
pub use crate::render::sprite::sprite::SPRITE_BANK_VTABLE;
|
| 94 |
+
pub use crate::render::sprite::sprite::{
|
| 95 |
CONSTRUCT_SPRITE, DESTROY_SPRITE, LOAD_SPRITE_FROM_VFS, PROCESS_SPRITE,
|
| 96 |
SPRITE_BANK_GET_INFO, SPRITE_GET_INFO, SPRITE_VTABLE,
|
| 97 |
};
|
crates/openwa-core/src/engine/ddgame.rs
CHANGED
|
@@ -4,13 +4,13 @@ use crate::audio::music::Music;
|
|
| 4 |
use crate::audio::speech::SpeechSlotTable;
|
| 5 |
use crate::audio::SoundQueueEntry;
|
| 6 |
use crate::bitgrid::{CollisionBitGrid, DisplayBitGrid};
|
| 7 |
-
use crate::display::gfx::DisplayGfx;
|
| 8 |
-
use crate::display::palette::Palette;
|
| 9 |
use crate::engine::game_info::GameInfo;
|
| 10 |
use crate::engine::{CoordEntry, CoordList, TeamArena, TeamIndexMap};
|
| 11 |
use crate::fixed::Fixed;
|
| 12 |
use crate::game::weapon::WeaponTable;
|
| 13 |
use crate::input::keyboard::DDKeyboard;
|
|
|
|
|
|
|
| 14 |
use crate::render::landscape::PCLandscape;
|
| 15 |
use crate::render::queue::RenderQueue;
|
| 16 |
use crate::render::turn_order::TurnOrderWidget;
|
|
@@ -580,7 +580,7 @@ impl DDGame {
|
|
| 580 |
// DDGame constructor code (create_ddgame, init helpers, usercall bridges)
|
| 581 |
// has been moved to ddgame_constructor.rs.
|
| 582 |
|
| 583 |
-
// BitGrid__Init lives in crate::
|
| 584 |
// Re-exported via ddgame_constructor.rs
|
| 585 |
/// Well-known byte offsets into DDGame, for use with raw pointer access.
|
| 586 |
///
|
|
|
|
| 4 |
use crate::audio::speech::SpeechSlotTable;
|
| 5 |
use crate::audio::SoundQueueEntry;
|
| 6 |
use crate::bitgrid::{CollisionBitGrid, DisplayBitGrid};
|
|
|
|
|
|
|
| 7 |
use crate::engine::game_info::GameInfo;
|
| 8 |
use crate::engine::{CoordEntry, CoordList, TeamArena, TeamIndexMap};
|
| 9 |
use crate::fixed::Fixed;
|
| 10 |
use crate::game::weapon::WeaponTable;
|
| 11 |
use crate::input::keyboard::DDKeyboard;
|
| 12 |
+
use crate::render::display::gfx::DisplayGfx;
|
| 13 |
+
use crate::render::display::palette::Palette;
|
| 14 |
use crate::render::landscape::PCLandscape;
|
| 15 |
use crate::render::queue::RenderQueue;
|
| 16 |
use crate::render::turn_order::TurnOrderWidget;
|
|
|
|
| 580 |
// DDGame constructor code (create_ddgame, init helpers, usercall bridges)
|
| 581 |
// has been moved to ddgame_constructor.rs.
|
| 582 |
|
| 583 |
+
// BitGrid__Init lives in crate::bitgrid
|
| 584 |
// Re-exported via ddgame_constructor.rs
|
| 585 |
/// Well-known byte offsets into DDGame, for use with raw pointer access.
|
| 586 |
///
|
crates/openwa-core/src/engine/ddgame_constructor.rs
CHANGED
|
@@ -13,20 +13,20 @@ use crate::audio::active_sound::ActiveSoundTable;
|
|
| 13 |
use crate::audio::dssound::DSSound;
|
| 14 |
use crate::audio::music::Music;
|
| 15 |
use crate::bitgrid::{BitGrid, BitGridBaseVtable, CollisionBitGrid, DisplayBitGrid};
|
| 16 |
-
use crate::display::gfx::DisplayGfx;
|
| 17 |
-
use crate::display::gradient::compute_complex_gradient;
|
| 18 |
-
use crate::display::palette::Palette;
|
| 19 |
use crate::engine::coord::{CoordList, CoordListEntry};
|
| 20 |
use crate::engine::ddgame_wrapper::DDGameWrapper;
|
| 21 |
use crate::engine::game_info::GameInfo;
|
| 22 |
use crate::engine::net_bridge::NetBridge;
|
| 23 |
use crate::input::keyboard::DDKeyboard;
|
| 24 |
use crate::rebase::rb;
|
| 25 |
-
use crate::render::
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
call_gfx_find_and_load, call_gfx_load_and_wrap, call_gfx_load_dir, GfxDir,
|
| 27 |
};
|
| 28 |
-
pub use crate::render::gfx_dir::{gfx_dir_find_entry, gfx_resource_create};
|
| 29 |
-
use crate::render::landscape::PCLandscape;
|
| 30 |
use crate::wa_alloc::{wa_malloc, wa_malloc_zeroed};
|
| 31 |
|
| 32 |
// ============================================================
|
|
@@ -155,7 +155,7 @@ pub fn init_constructor_addrs() {
|
|
| 155 |
LOADING_PROGRESS_TICK_ADDR = rb(va::DDGAME_WRAPPER_LOADING_PROGRESS_TICK);
|
| 156 |
GFX_LOAD_SPRITES_ADDR = rb(va::GFX_DIR_LOAD_SPRITES);
|
| 157 |
}
|
| 158 |
-
crate::render::gfx_dir::init_addrs();
|
| 159 |
}
|
| 160 |
|
| 161 |
// ββ Typed wrappers for WA stdcall functions ββββββββββββββββββββββββββββββββ
|
|
@@ -475,7 +475,10 @@ unsafe fn init_graphics_and_resources(
|
|
| 475 |
let fp = fopen(path.as_ptr(), c"rb".as_ptr());
|
| 476 |
(*gfx1).file_handle = fp;
|
| 477 |
if !fp.is_null()
|
| 478 |
-
&& call_gfx_load_dir(
|
|
|
|
|
|
|
|
|
|
| 479 |
{
|
| 480 |
gfx_loaded_idx = i as u32;
|
| 481 |
break;
|
|
@@ -505,7 +508,7 @@ unsafe fn init_graphics_and_resources(
|
|
| 505 |
|
| 506 |
let fp = fopen(gfx_c_path.as_ptr().cast(), c"rb".as_ptr());
|
| 507 |
(*gfx2).file_handle = fp;
|
| 508 |
-
let load_addr = crate::render::gfx_dir::gfx_load_dir_addr();
|
| 509 |
if fp.is_null() || call_gfx_load_dir(gfx2 as *mut u8, load_addr) == 0 {
|
| 510 |
let fp2 = fopen(c"data\\Gfx\\Gfx.dir".as_ptr(), c"rb".as_ptr());
|
| 511 |
(*gfx2).file_handle = fp2;
|
|
|
|
| 13 |
use crate::audio::dssound::DSSound;
|
| 14 |
use crate::audio::music::Music;
|
| 15 |
use crate::bitgrid::{BitGrid, BitGridBaseVtable, CollisionBitGrid, DisplayBitGrid};
|
|
|
|
|
|
|
|
|
|
| 16 |
use crate::engine::coord::{CoordList, CoordListEntry};
|
| 17 |
use crate::engine::ddgame_wrapper::DDGameWrapper;
|
| 18 |
use crate::engine::game_info::GameInfo;
|
| 19 |
use crate::engine::net_bridge::NetBridge;
|
| 20 |
use crate::input::keyboard::DDKeyboard;
|
| 21 |
use crate::rebase::rb;
|
| 22 |
+
use crate::render::display::gfx::DisplayGfx;
|
| 23 |
+
use crate::render::display::gradient::compute_complex_gradient;
|
| 24 |
+
use crate::render::display::palette::Palette;
|
| 25 |
+
use crate::render::landscape::PCLandscape;
|
| 26 |
+
use crate::render::sprite::gfx_dir::{
|
| 27 |
call_gfx_find_and_load, call_gfx_load_and_wrap, call_gfx_load_dir, GfxDir,
|
| 28 |
};
|
| 29 |
+
pub use crate::render::sprite::gfx_dir::{gfx_dir_find_entry, gfx_resource_create};
|
|
|
|
| 30 |
use crate::wa_alloc::{wa_malloc, wa_malloc_zeroed};
|
| 31 |
|
| 32 |
// ============================================================
|
|
|
|
| 155 |
LOADING_PROGRESS_TICK_ADDR = rb(va::DDGAME_WRAPPER_LOADING_PROGRESS_TICK);
|
| 156 |
GFX_LOAD_SPRITES_ADDR = rb(va::GFX_DIR_LOAD_SPRITES);
|
| 157 |
}
|
| 158 |
+
crate::render::sprite::gfx_dir::init_addrs();
|
| 159 |
}
|
| 160 |
|
| 161 |
// ββ Typed wrappers for WA stdcall functions ββββββββββββββββββββββββββββββββ
|
|
|
|
| 475 |
let fp = fopen(path.as_ptr(), c"rb".as_ptr());
|
| 476 |
(*gfx1).file_handle = fp;
|
| 477 |
if !fp.is_null()
|
| 478 |
+
&& call_gfx_load_dir(
|
| 479 |
+
gfx1 as *mut u8,
|
| 480 |
+
crate::render::sprite::gfx_dir::gfx_load_dir_addr(),
|
| 481 |
+
) != 0
|
| 482 |
{
|
| 483 |
gfx_loaded_idx = i as u32;
|
| 484 |
break;
|
|
|
|
| 508 |
|
| 509 |
let fp = fopen(gfx_c_path.as_ptr().cast(), c"rb".as_ptr());
|
| 510 |
(*gfx2).file_handle = fp;
|
| 511 |
+
let load_addr = crate::render::sprite::gfx_dir::gfx_load_dir_addr();
|
| 512 |
if fp.is_null() || call_gfx_load_dir(gfx2 as *mut u8, load_addr) == 0 {
|
| 513 |
let fp2 = fopen(c"data\\Gfx\\Gfx.dir".as_ptr(), c"rb".as_ptr());
|
| 514 |
(*gfx2).file_handle = fp2;
|
crates/openwa-core/src/engine/ddgame_load_fonts.rs
CHANGED
|
@@ -6,8 +6,8 @@
|
|
| 6 |
use core::ffi::c_char;
|
| 7 |
use heapless::CString;
|
| 8 |
|
| 9 |
-
use crate::display::gfx::DisplayGfx;
|
| 10 |
use crate::engine::ddgame_wrapper::DDGameWrapper;
|
|
|
|
| 11 |
|
| 12 |
/// Total number of font slots loaded (1-based, so slots 1..=28).
|
| 13 |
const FONT_COUNT: u32 = 0x1C;
|
|
|
|
| 6 |
use core::ffi::c_char;
|
| 7 |
use heapless::CString;
|
| 8 |
|
|
|
|
| 9 |
use crate::engine::ddgame_wrapper::DDGameWrapper;
|
| 10 |
+
use crate::render::display::gfx::DisplayGfx;
|
| 11 |
|
| 12 |
/// Total number of font slots loaded (1-based, so slots 1..=28).
|
| 13 |
const FONT_COUNT: u32 = 0x1C;
|
crates/openwa-core/src/engine/ddgame_wrapper.rs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
use crate::audio::dssound::DSSound;
|
| 2 |
-
use crate::display::gfx::DisplayGfx;
|
| 3 |
use crate::engine::ddgame::DDGame;
|
| 4 |
use crate::engine::net_bridge::NetBridge;
|
|
|
|
| 5 |
use crate::render::landscape::PCLandscape;
|
| 6 |
use crate::FieldRegistry;
|
| 7 |
|
|
|
|
| 1 |
use crate::audio::dssound::DSSound;
|
|
|
|
| 2 |
use crate::engine::ddgame::DDGame;
|
| 3 |
use crate::engine::net_bridge::NetBridge;
|
| 4 |
+
use crate::render::display::gfx::DisplayGfx;
|
| 5 |
use crate::render::landscape::PCLandscape;
|
| 6 |
use crate::FieldRegistry;
|
| 7 |
|
crates/openwa-core/src/engine/game_session.rs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
use crate::audio::dssound::DSSound;
|
| 2 |
use crate::audio::music::Music;
|
| 3 |
-
use crate::display::palette::Palette;
|
| 4 |
use crate::engine::ddgame_wrapper::DDGameWrapper;
|
| 5 |
use crate::input::keyboard::DDKeyboard;
|
|
|
|
| 6 |
use crate::FieldRegistry;
|
| 7 |
|
| 8 |
/// Top-level game session context, allocated once per game run.
|
|
|
|
| 1 |
use crate::audio::dssound::DSSound;
|
| 2 |
use crate::audio::music::Music;
|
|
|
|
| 3 |
use crate::engine::ddgame_wrapper::DDGameWrapper;
|
| 4 |
use crate::input::keyboard::DDKeyboard;
|
| 5 |
+
use crate::render::display::palette::Palette;
|
| 6 |
use crate::FieldRegistry;
|
| 7 |
|
| 8 |
/// Top-level game session context, allocated once per game run.
|
crates/openwa-core/src/lib.rs
CHANGED
|
@@ -30,7 +30,6 @@ pub mod macros;
|
|
| 30 |
|
| 31 |
pub mod audio;
|
| 32 |
pub mod bitgrid;
|
| 33 |
-
pub mod display;
|
| 34 |
pub mod engine;
|
| 35 |
pub mod frontend;
|
| 36 |
pub mod game;
|
|
|
|
| 30 |
|
| 31 |
pub mod audio;
|
| 32 |
pub mod bitgrid;
|
|
|
|
| 33 |
pub mod engine;
|
| 34 |
pub mod frontend;
|
| 35 |
pub mod game;
|
crates/openwa-core/src/registry.rs
CHANGED
|
@@ -780,7 +780,7 @@ mod tests {
|
|
| 780 |
fn vtable_size_assertion() {
|
| 781 |
// PaletteVtable should be 5 * 4 = 20 bytes
|
| 782 |
assert_eq!(
|
| 783 |
-
core::mem::size_of::<crate::display::palette::PaletteVtable>(),
|
| 784 |
5 * core::mem::size_of::<usize>()
|
| 785 |
);
|
| 786 |
}
|
|
|
|
| 780 |
fn vtable_size_assertion() {
|
| 781 |
// PaletteVtable should be 5 * 4 = 20 bytes
|
| 782 |
assert_eq!(
|
| 783 |
+
core::mem::size_of::<crate::render::display::palette::PaletteVtable>(),
|
| 784 |
5 * core::mem::size_of::<usize>()
|
| 785 |
);
|
| 786 |
}
|
crates/openwa-core/src/{display β render/ddraw}/compat_renderer.rs
RENAMED
|
File without changes
|
crates/openwa-core/src/render/ddraw/mod.rs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pub mod compat_renderer;
|
| 2 |
+
|
| 3 |
+
pub use compat_renderer::CompatRenderer;
|
crates/openwa-core/src/{display β render/display}/base.rs
RENAMED
|
File without changes
|
crates/openwa-core/src/{display/render_context.rs β render/display/context.rs}
RENAMED
|
File without changes
|
crates/openwa-core/src/{display β render/display}/gfx.rs
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
use super::base::DisplayBase;
|
| 2 |
-
use super::
|
| 3 |
use crate::bitgrid::DisplayBitGrid;
|
| 4 |
use core::ffi::c_void;
|
| 5 |
|
|
|
|
| 1 |
use super::base::DisplayBase;
|
| 2 |
+
use super::vtable::DisplayVtable;
|
| 3 |
use crate::bitgrid::DisplayBitGrid;
|
| 4 |
use core::ffi::c_void;
|
| 5 |
|
crates/openwa-core/src/{display β render/display}/gradient.rs
RENAMED
|
@@ -9,7 +9,7 @@ use crate::address::va;
|
|
| 9 |
use crate::bitgrid::{BitGrid, BitGridBaseVtable};
|
| 10 |
use crate::engine::ddgame::DDGame;
|
| 11 |
use crate::rebase::rb;
|
| 12 |
-
use crate::render::gfx_dir::call_gfx_find_and_load;
|
| 13 |
use crate::wa_alloc::{wa_free, wa_malloc};
|
| 14 |
|
| 15 |
/// Palette context for gradient color mapping.
|
|
|
|
| 9 |
use crate::bitgrid::{BitGrid, BitGridBaseVtable};
|
| 10 |
use crate::engine::ddgame::DDGame;
|
| 11 |
use crate::rebase::rb;
|
| 12 |
+
use crate::render::sprite::gfx_dir::call_gfx_find_and_load;
|
| 13 |
use crate::wa_alloc::{wa_free, wa_malloc};
|
| 14 |
|
| 15 |
/// Palette context for gradient color mapping.
|
crates/openwa-core/src/{display β render/display}/line_draw.rs
RENAMED
|
File without changes
|
crates/openwa-core/src/{display β render/display}/mod.rs
RENAMED
|
@@ -1,18 +1,14 @@
|
|
| 1 |
pub mod base;
|
| 2 |
-
pub mod
|
| 3 |
-
pub mod display_vtable;
|
| 4 |
pub mod gfx;
|
| 5 |
pub mod gradient;
|
| 6 |
pub mod line_draw;
|
| 7 |
-
pub mod opengl;
|
| 8 |
pub mod palette;
|
| 9 |
-
pub mod render_context;
|
| 10 |
pub mod sprite_blit;
|
|
|
|
| 11 |
|
| 12 |
pub use base::{DisplayBase, DisplayBaseVtable, SpriteBufferCtrl, SpriteCache};
|
| 13 |
-
pub use
|
| 14 |
-
pub use display_vtable::{DisplayVtable, DrawScaledSpriteResult};
|
| 15 |
pub use gfx::DisplayGfx;
|
| 16 |
-
pub use opengl::OpenGLState;
|
| 17 |
pub use palette::{Palette, PaletteVtable};
|
| 18 |
-
pub use
|
|
|
|
| 1 |
pub mod base;
|
| 2 |
+
pub mod context;
|
|
|
|
| 3 |
pub mod gfx;
|
| 4 |
pub mod gradient;
|
| 5 |
pub mod line_draw;
|
|
|
|
| 6 |
pub mod palette;
|
|
|
|
| 7 |
pub mod sprite_blit;
|
| 8 |
+
pub mod vtable;
|
| 9 |
|
| 10 |
pub use base::{DisplayBase, DisplayBaseVtable, SpriteBufferCtrl, SpriteCache};
|
| 11 |
+
pub use context::{FastcallResult, RenderContext};
|
|
|
|
| 12 |
pub use gfx::DisplayGfx;
|
|
|
|
| 13 |
pub use palette::{Palette, PaletteVtable};
|
| 14 |
+
pub use vtable::{DisplayVtable, DrawScaledSpriteResult};
|
crates/openwa-core/src/{display β render/display}/palette.rs
RENAMED
|
File without changes
|
crates/openwa-core/src/{display β render/display}/sprite_blit.rs
RENAMED
|
File without changes
|
crates/openwa-core/src/{display/display_vtable.rs β render/display/vtable.rs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
use crate::display::line_draw::Vertex;
|
| 2 |
use crate::fixed::Fixed;
|
|
|
|
| 3 |
|
| 4 |
/// DisplayVtable β vtable for the display/rendering subsystem (DisplayGfx).
|
| 5 |
///
|
|
@@ -310,7 +310,7 @@ pub unsafe extern "thiscall" fn get_dimensions(
|
|
| 310 |
*out_h = (*this).base.display_height;
|
| 311 |
}
|
| 312 |
|
| 313 |
-
use super::
|
| 314 |
use crate::address::va;
|
| 315 |
use crate::rebase::rb;
|
| 316 |
|
|
|
|
|
|
|
| 1 |
use crate::fixed::Fixed;
|
| 2 |
+
use crate::render::display::line_draw::Vertex;
|
| 3 |
|
| 4 |
/// DisplayVtable β vtable for the display/rendering subsystem (DisplayGfx).
|
| 5 |
///
|
|
|
|
| 310 |
*out_h = (*this).base.display_height;
|
| 311 |
}
|
| 312 |
|
| 313 |
+
use super::context::{FastcallResult, RenderContext};
|
| 314 |
use crate::address::va;
|
| 315 |
use crate::rebase::rb;
|
| 316 |
|
crates/openwa-core/src/render/mod.rs
CHANGED
|
@@ -1,19 +1,24 @@
|
|
| 1 |
-
pub mod
|
|
|
|
| 2 |
pub mod landscape;
|
|
|
|
| 3 |
pub mod palette;
|
| 4 |
pub mod queue;
|
| 5 |
-
pub mod spr;
|
| 6 |
pub mod sprite;
|
| 7 |
-
pub mod sprite_id;
|
| 8 |
pub mod turn_order;
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
pub use landscape::{DirtyRect, PCLandscape};
|
|
|
|
| 11 |
pub use queue::{
|
| 12 |
DrawBitmapGlobalCmd, DrawCrosshairCmd, DrawLineStripHeader, DrawPixelCmd, DrawPolygonHeader,
|
| 13 |
DrawRectCmd, DrawSpriteCmd, DrawSpriteOffsetCmd, DrawTextboxLocalCmd, RenderQueue,
|
| 14 |
};
|
| 15 |
-
pub use
|
| 16 |
-
pub use sprite::{Sprite, SpriteFrame, SpriteId};
|
| 17 |
pub use turn_order::{
|
| 18 |
AnimatedItemList, TurnOrderAllianceGroup, TurnOrderTeamEntry, TurnOrderWidget,
|
| 19 |
};
|
|
|
|
| 1 |
+
pub mod ddraw;
|
| 2 |
+
pub mod display;
|
| 3 |
pub mod landscape;
|
| 4 |
+
pub mod opengl;
|
| 5 |
pub mod palette;
|
| 6 |
pub mod queue;
|
|
|
|
| 7 |
pub mod sprite;
|
|
|
|
| 8 |
pub mod turn_order;
|
| 9 |
|
| 10 |
+
pub use ddraw::CompatRenderer;
|
| 11 |
+
pub use display::{
|
| 12 |
+
DisplayBase, DisplayBaseVtable, DisplayGfx, DisplayVtable, DrawScaledSpriteResult,
|
| 13 |
+
FastcallResult, Palette, PaletteVtable, RenderContext, SpriteBufferCtrl, SpriteCache,
|
| 14 |
+
};
|
| 15 |
pub use landscape::{DirtyRect, PCLandscape};
|
| 16 |
+
pub use opengl::OpenGLState;
|
| 17 |
pub use queue::{
|
| 18 |
DrawBitmapGlobalCmd, DrawCrosshairCmd, DrawLineStripHeader, DrawPixelCmd, DrawPolygonHeader,
|
| 19 |
DrawRectCmd, DrawSpriteCmd, DrawSpriteOffsetCmd, DrawTextboxLocalCmd, RenderQueue,
|
| 20 |
};
|
| 21 |
+
pub use sprite::{ParsedSprite, Sprite, SpriteBank, SpriteFrame, SpriteId};
|
|
|
|
| 22 |
pub use turn_order::{
|
| 23 |
AnimatedItemList, TurnOrderAllianceGroup, TurnOrderTeamEntry, TurnOrderWidget,
|
| 24 |
};
|
crates/openwa-core/src/{display β render}/opengl.rs
RENAMED
|
File without changes
|
crates/openwa-core/src/render/{gfx_dir.rs β sprite/gfx_dir.rs}
RENAMED
|
File without changes
|
crates/openwa-core/src/render/sprite/mod.rs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pub mod gfx_dir;
|
| 2 |
+
pub mod spr;
|
| 3 |
+
pub mod sprite;
|
| 4 |
+
pub mod sprite_id;
|
| 5 |
+
|
| 6 |
+
pub use spr::{ParsedSprite, SprError, SprHeader};
|
| 7 |
+
pub use sprite::{Sprite, SpriteBank, SpriteFrame, SpriteId};
|
crates/openwa-core/src/render/{spr.rs β sprite/spr.rs}
RENAMED
|
File without changes
|
crates/openwa-core/src/render/{sprite.rs β sprite/sprite.rs}
RENAMED
|
File without changes
|
crates/openwa-core/src/render/{sprite_id.rs β sprite/sprite_id.rs}
RENAMED
|
File without changes
|