source: golgotha/src/render/software/r1_software_texture.hh

Last change on this file was 80, checked in by Sam Hocevar, 12 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: 1.9 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_SOFTWARE_TEXTURE_HH__
10#define __R1_SOFTWARE_TEXTURE_HH__
11
12#include "memory/lalloc.hh"
13#include "tmanage.hh"
14#include "software/r1_software.hh"
15#include "tex_heap.hh"
16
17class r1_mip_load_info;
18
19class r1_software_texture_class : public r1_texture_manager_class
20{
21  friend class r1_software_class;
22  friend void software_async_callback(w32 count, void *context);
23
24  w8 *texture_heap;
25  r1_texture_heap_class *tex_heap_man;
26
27  class free_node
28  {
29  public:
30    R1_TEX_HEAP_FREE_NODE_DATA
31       
32    i4_file_class *async_fp;
33  };
34
35  class used_node
36  {
37  public:
38    R1_TEX_HEAP_USED_NODE_DATA
39    //dont need any new members   
40  };
41 
42public:
43
44  void next_frame();
45
46  void select_texture(r1_local_texture_handle_type handle, float &smul, float &tmul);
47
48  r1_software_texture_class(const i4_pal *pal);
49
50  ~r1_software_texture_class();
51
52  void init();
53
54  void uninit();
55
56  i4_bool immediate_mip_load(r1_mip_load_info *load_info);
57  i4_bool async_mip_load(r1_mip_load_info *load_info);
58 
59  void free_mip(r1_vram_handle_type vram_handle);
60 
61  r1_miplevel_t *get_texture(r1_texture_handle handle,
62                             w32 frame_counter,
63                             sw32 desired_width,
64                             sw32 &w, sw32 &h);
65
66 
67  i4_critical_section_class array_lock; 
68  i4_array<used_node *> finished_array; 
69
70  void async_load_finished(used_node *u);
71
72  sw32 bytes_loaded;
73  sw32 textures_loaded;
74};
75
76
77#endif
Note: See TracBrowser for help on using the repository browser.