mirror of
https://gitlab.com/hashborgir/d2tweaks-rnd2k.git
synced 2025-10-13 16:34:22 -05:00
Initial commit
This commit is contained in:
30
include/diablo2/utils/mpq_ifstream.h
Normal file
30
include/diablo2/utils/mpq_ifstream.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <istream>
|
||||
|
||||
namespace diablo2 {
|
||||
namespace structures {
|
||||
struct file_handle;
|
||||
}
|
||||
|
||||
namespace utils {
|
||||
class mpq_ifstream : public std::istream {
|
||||
class mpq_streambuf : public std::streambuf {
|
||||
structures::file_handle* m_handle;
|
||||
char m_data;
|
||||
public:
|
||||
explicit mpq_streambuf(const std::string& path);
|
||||
~mpq_streambuf();
|
||||
|
||||
protected:
|
||||
int_type underflow() override;
|
||||
};
|
||||
|
||||
mpq_streambuf m_streambuf;
|
||||
public:
|
||||
explicit mpq_ifstream(const std::string& path);
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
}
|
13
include/diablo2/utils/screen.h
Normal file
13
include/diablo2/utils/screen.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace diablo2 {
|
||||
namespace utils {
|
||||
class screen {
|
||||
public:
|
||||
static void screen_to_world(int32_t sx, int32_t sy, int32_t& wx, int32_t& wy);
|
||||
static void world_to_screen(int32_t wx, int32_t wy, int32_t& sx, int32_t& sy);
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user