World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию.
39 if (!
config->IsFullscreen()) {
44 window->SetFullscreenMode();
69 if (
z >
render->pBillboardRenderListD3D[v7].z_order) {
70 if (v7 ==
render->uNumBillboardsToDraw - 1) {
71 v7 =
render->uNumBillboardsToDraw;
73 if (
render->uNumBillboardsToDraw > v7) {
74 for (
unsigned int i = 0; i <
render->uNumBillboardsToDraw - v7;
76 memcpy(&
render->pBillboardRenderListD3D
77 [
render->uNumBillboardsToDraw - i],
78 &
render->pBillboardRenderListD3D
79 [
render->uNumBillboardsToDraw - (i + 1)],
80 sizeof(
render->pBillboardRenderListD3D
81 [
render->uNumBillboardsToDraw - i]));
91 if (
render->uNumBillboardsToDraw > v7) {
92 for (
unsigned int i = 0; i <
render->uNumBillboardsToDraw - v7;
94 memcpy(&
render->pBillboardRenderListD3D
95 [
render->uNumBillboardsToDraw - i],
96 &
render->pBillboardRenderListD3D
97 [
render->uNumBillboardsToDraw - (i + 1)],
98 sizeof(
render->pBillboardRenderListD3D
99 [
render->uNumBillboardsToDraw - i]));
119 if (!
object->uObjectDescID) {
125 if (!
object->HasSprite()) {
140 int x =
object->vPosition.x;
141 int y =
object->vPosition.y;
142 int z =
object->vPosition.z;
150 int a6 = frame->
uGlowRadius *
object->field_22_glow_radius_multiplier;
159 object->uFacing - v6) >> 8) & 7;
166 if (frame->
uFlags & 0x20) {
171 if (frame->
uFlags & 2) v46 = 2;
173 if ((256 << v9) & frame->
uFlags) v46 |= 4;
174 if (frame->
uFlags & 0x40000) v46 |= 0x40;
175 if (frame->
uFlags & 0x20000) v46 |= 0x80;
192 object->uAttributes |= 1;
251 p->screenspace_projection_factor_x;
253 p->screenspace_projection_factor_y;
256 billboard.
uFlags =
p->field_1E;
267 (
uint)floorf(0.5
f + (a1 >> 24) / 255.0f * (a2 >> 24) / 255.0
f * 255.0
f);
268 uint red = (
uint)floorf(0.5
f + ((a1 >> 16) & 0xFF) / 255.0
f *
269 ((a2 >> 16) & 0xFF) / 255.0
f * 255.0
f);
271 ((a2 >> 8) & 0xFF) / 255.0
f * 255.0
f);
273 ((a2 >> 0) & 0xFF) / 255.0
f * 255.0
f);
296 diffuse = 0x007F7F7F & ((
unsigned int)diffuse >> 1);
299 unsigned int specular = 0;
300 if (
config->is_using_specular) {
308 if (a2->
uFlags & 4) v14 *= -1.f;
320 if (a2->
uFlags & 4) v14 = v14 * -1.f;
332 if (a2->
uFlags & 4) v14 *= -1.f;
344 if (a2->
uFlags & 4) v14 *= -1.f;
374 return (((
double)(fix & 0xFFFF) / (
double)0xFFFF) + (
double)(fix >> 16));
379 unsigned int uDiffuse,
398 float acos = (float)cos(
angle);
399 float asin = (float)sin(
angle);
405 billboard->
pQuads[0].
pos.
y = (acos * v17 + asin * v16 - 12.f) * screenspace_projection_factor + (
float)a2->
screen_space_y;
418 billboard->
pQuads[1].
pos.
y = (acos * v32 + asin * v31 - 12.f) * screenspace_projection_factor + (
float)a2->
screen_space_y;
431 billboard->
pQuads[2].
pos.
y = (acos * v24 + asin * v23 - 12.f) * screenspace_projection_factor + (
float)a2->
screen_space_y;
444 billboard->
pQuads[3].
pos.
y = (acos * v40 + asin * v39 - 12.f) * screenspace_projection_factor + (
float)a2->
screen_space_y;
double fix2double(int fix)
unsigned int uNumBillboards
std::array< SpriteObject, MAX_SPRITE_OBJECTS > pSpriteObjects
virtual bool Initialize(OSWindow *window)
void TransformBillboard(SoftwareBillboard *a2, RenderBillboard *pBillboard)
float screenspace_projection_factor_y
float screenspace_projection_factor_x
GLenum GLenum GLuint texture
SpriteFrame * pSpriteFrame
virtual bool InitializeFullscreen()=0
unsigned int Billboard_ProbablyAddToListAndSortByZOrder(float z)
virtual unsigned int GetActorTintColor(int DimLevel, int tint, float WorldViewX, int a5, RenderBillboard *Billboard)=0
HWLTexture * LoadTexture(const String &pName)
GLfloat GLfloat GLfloat alpha
EGLSurface EGLint EGLint y
void PostInitialization()
unsigned int BlendColors(unsigned int a1, unsigned int a2)
bool ViewClip(int x, int y, int z, int *transformed_x, int *transformed_y, int *transformed_z, bool dont_show=false)
RenderBillboardD3D pBillboardRenderListD3D[1000]
void Project(int x, int y, int z, int *screenspace_x, int *screenspace_y)
__int64 fixpoint_mul(int a1, int a2)
EGLSurface EGLNativeWindowType * window
virtual HWLTexture * LoadHwlSprite(const String &name)
unsigned int uNumVertices
virtual HWLTexture * LoadHwlBitmap(const String &name)
bool Open(const String &pFilename)
float screenspace_projection_factor_y
bool RenderAsSprite(struct SpriteObject *a2)
unsigned short object_pid
struct Viewport * pViewport
ODMRenderParams * pODMRenderParams
unsigned int uNumBillboardsToDraw
virtual bool SwitchToWindow()=0
SpellFxRenderer * spell_fx_renderer
unsigned int Atan2(int x, int y)
EGLImageKHR EGLint * name
std::string MakeDataPath(const char *file_rel_path)
void __cdecl __debugbreak(void)
int uNumSpritesDrawnThisFrame
struct stru193_math * stru_5C6E00
int sub_47C3D7_get_fog_specular(int a1, int a2, float a3)
RenderBillboard pBillboardRenderList[500]
virtual void MakeParticleBillboardAndPush(SoftwareBillboard *a2, Texture *texture, unsigned int uDiffuse, int angle)
float screenspace_projection_factor_x
virtual void DrawSpriteObjects_ODM()
LightsStack_MobileLight_ * pMobileLightsStack
virtual void TransformBillboardsAndSetPalettesODM()
RenderVertexD3D3 pQuads[4]
IndoorCameraD3D * pIndoorCameraD3D
static const unsigned int uIntegerPi
bool AddLight(int16_t x, int16_t y, int16_t z, int16_t uSectorID, int uRadius, uint8_t r, uint8_t g, uint8_t b, char a10)
unsigned short object_pid
std::shared_ptr< IRender > render