source: golgotha/src/render/dx5/r1_dx5_texture.hh

Last change on this file was 80, checked in by Sam Hocevar, 13 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 2.3 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef __R1_DX5_TEXTURE_HH__
10#define __R1_DX5_TEXTURE_HH__
11
12#include <ddraw.h>
13#include <d3d.h>
14#include "memory/lalloc.hh"
15#include "tmanage.hh"
16#include "dx5/r1_dx5.hh"
17#include "tex_no_heap.hh"
18
19class r1_dx5_texture_class : public r1_texture_manager_class
20{
21  friend r1_dx5_class;
22
23public: 
24
25  class used_node
26  {   
27  public:
28    R1_TEX_NO_HEAP_USED_NODE_DATA
29    IDirectDrawSurface3 *vram_surface;
30    IDirectDrawSurface3 *system_surface;
31    D3DTEXTUREHANDLE    texture_handle;
32    //used for async loading
33    w8                 *data;
34    i4_file_class      *async_fp;
35  };
36 
37  r1_texture_no_heap_class *tex_no_heap;
38
39  r1_dx5_texture_class(const i4_pal *pal); 
40
41  ~r1_dx5_texture_class()
42  {
43    uninit();   
44  }
45 
46  void init();
47
48  void uninit(); 
49
50  void select_texture(r1_local_texture_handle_type handle, float &smul, float &tmul);
51 
52  used_node *make_surfaces_for_load(IDirectDrawSurface3 *&vram_surface,
53                                    IDirectDrawSurface3 *&system_surface,
54                                    r1_mip_load_info *&load_info,
55                                    sw32 actual_w, sw32 actual_h,
56                                    w8 node_alloc_flags=0);
57
58  r1_miplevel_t *get_texture(r1_texture_handle handle,
59                             w32 frame_counter,
60                             sw32 desired_width,
61                             sw32 &w, sw32 &h);
62
63  i4_bool immediate_mip_load(r1_mip_load_info *load_info);
64  i4_bool async_mip_load(r1_mip_load_info *load_info);
65 
66  i4_critical_section_class array_lock; 
67 
68  i4_array<used_node *> finished_array;
69 
70  void async_load_finished(used_node *u);
71
72  void free_mip(void *vram_handle);
73
74  void next_frame();
75
76  sw32 bytes_loaded;
77  sw32 textures_loaded;
78};
79
80
81#endif
Note: See TracBrowser for help on using the repository browser.