World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию.
2 #pragma comment(lib, "opengl32.lib")
3 #pragma comment(lib, "glu32.lib")
7 #define APIENTRY __stdcall
10 #if !defined(WINGDIAPI)
14 #if !defined(CALLBACK)
15 #define CALLBACK __stdcall
183 signed int uW,
unsigned __int16 uColor) {
184 unsigned int b = (uColor & 0x1F)*8;
185 unsigned int g = ((uColor >> 5) & 0x3F)*4;
186 unsigned int r = ((uColor >> 11) & 0x1F)*8;
211 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
213 render->uNumBillboardsToDraw = 0;
216 extern unsigned int BlendColors(
unsigned int a1,
unsigned int a2);
250 int v28 = dimming_level & 0xFF000000;
251 if (dimming_level & 0xFF000000) {
268 if (pSoftBillboard->
uFlags & 4) {
277 (
unsigned int)((
char *)&
array_77EC08[1852].pEdgeList1[17] + 3) &
278 ((
unsigned int)v12 >> 1);
302 if (pSoftBillboard->
uFlags & 4) {
318 if (pSoftBillboard->
uFlags & 4) {
334 if (pSoftBillboard->
uFlags & 4) {
378 p->screenspace_projection_factor_x;
380 p->screenspace_projection_factor_y;
382 soft_billboard.
uFlags =
p->field_1E;
392 float dstX,
float dstY,
float a7,
float a8,
422 (float)rect.
z, (
float)rect.
y,
depth,
423 (float)rect.
z, (
float)rect.
w,
depth,
424 (float)rect.
x, (
float)rect.
w,
depth };
464 int uOutX = u * this->
window->GetWidth();
465 int uOutY =
v * this->
window->GetHeight();
466 unsigned int imgheight =
img->GetHeight();
467 unsigned int imgwidth =
img->GetWidth();
470 for (
int xs = 0; xs < imgwidth; xs++) {
471 for (
int ys = 0; ys < imgheight; ys++) {
472 if (
pixels[xs + imgwidth * ys] & 0xFF000000) {
483 int start_opacity,
int end_opacity) {
503 int bright = (*(pixelpoint + nudge) & 0xFF) + ((*(pixelpoint + nudge) >> 8) & 0xFF) + ((*(pixelpoint + nudge) >> 16) & 0xFF);
504 if (bright == 0)
continue;
506 if (bright > brightval) {
510 if (bright < darkval) {
518 unsigned int bmax = (*(pixelpoint + brightloc) & 0xFF);
519 unsigned int gmax = ((*(pixelpoint + brightloc) >> 8) & 0xFF);
520 unsigned int rmax = ((*(pixelpoint + brightloc) >> 16) & 0xFF);
523 unsigned int bmin = (*(pixelpoint + darkloc) & 0xFF);
524 unsigned int gmin = ((*(pixelpoint + darkloc) >> 8) & 0xFF);
525 unsigned int rmin = ((*(pixelpoint + darkloc) >> 16) & 0xFF);
528 float bstep = (bmax - bmin) / 128.;
529 float gstep = (gmax - gmin) / 128.;
530 float rstep = (rmax - rmin) / 128.;
532 int timestep = time % 256;
535 for (
int ydraw = 0; ydraw <
height; ++ydraw) {
536 for (
int xdraw = 0; xdraw <
width; ++xdraw) {
538 unsigned int bcur = (*(pixelpoint) & 0xFF);
539 unsigned int gcur = ((*(pixelpoint) >> 8) & 0xFF);
540 unsigned int rcur = ((*(pixelpoint) >> 16) & 0xFF);
541 int pixstepb = (bcur - bmin) / bstep + timestep;
542 if (pixstepb > 255) pixstepb = pixstepb - 256;
543 if (pixstepb >= 0 && pixstepb < 128)
544 bcur = bmin + pixstepb * bstep;
545 if (pixstepb >= 128 && pixstepb < 256) {
546 pixstepb = pixstepb - 128;
547 bcur = bmax - pixstepb * bstep;
549 int pixstepr = (rcur - rmin) / rstep + timestep;
550 if (pixstepr > 255) pixstepr = pixstepr - 256;
551 if (pixstepr >= 0 && pixstepr < 128)
552 rcur = rmin + pixstepr * rstep;
553 if (pixstepr >= 128 && pixstepr < 256) {
554 pixstepr = pixstepr - 128;
555 rcur = rmax - pixstepr * rstep;
557 int pixstepg = (gcur - gmin) / gstep + timestep;
558 if (pixstepg > 255) pixstepg = pixstepg - 256;
559 if (pixstepg >= 0 && pixstepg < 128)
560 gcur = gmin + pixstepg * gstep;
561 if (pixstepg >= 128 && pixstepg < 256) {
562 pixstepg = pixstepg - 128;
563 gcur = gmax - pixstepg * gstep;
588 render->SetUIClipRect(rc.
x, rc.
y, rc.
z, rc.
w);
590 render->ResetUIClipRect();
602 unsigned int num_vertices) {
607 unsigned __int16
mask) {
618 for (
unsigned int dy = 0; dy < pTexture->
GetHeight(); ++dy) {
619 for (
unsigned int dx = 0; dx <
width; ++dx) {
625 (((*
pixels >> 8) & 0xFF) >> color_dimming_level), ((*
pixels & 0xFF) >> color_dimming_level))
638 unsigned int uFaceID) {
673 signed int sDiffuseBegin,
675 signed int sDiffuseEnd,
680 unsigned int num_vertices) {
699 unsigned __int16 *v10;
705 unsigned __int16 *v37;
714 if (!(decor_desc->
uFlags & 0x80)) {
715 if (!(decor_desc->
uFlags & 0x22)) {
723 if (
engine->config->seasons_change) {
747 v37 = (
unsigned __int16 *)v13;
748 if (frame->
uFlags & 2) v38 = 2;
749 if ((256 << v13) & frame->
uFlags) v38 |= 4;
750 if (frame->
uFlags & 0x40000) v38 |= 0x40;
751 if (frame->
uFlags & 0x20000) v38 |= 0x80;
758 if (
render->config->is_using_colored_lights) {
792 if (2 * abs(view_x) >= abs(view_y)) {
804 int screen_space_half_width = 0;
805 screen_space_half_width =
807 frame->
hw_sprites[(int)v37]->uBufferWidth / 2;
809 if (projected_x + screen_space_half_width >=
811 projected_x - screen_space_half_width <=
854 memset(&local_0, 0, 0x68);
949 unsigned int lod_sprite_id) {
972 GLuint texid =
t->GetOpenGlTexture();
1025 auto native_format =
t->GetFormat();
1026 int gl_format = GL_RGB;
1029 unsigned __int8 *
pixels =
nullptr;
1034 gl_format = GL_RGBA;
1042 t->SetOpenGlTexture(texid);
1045 glTexImage2D(GL_TEXTURE_2D, 0, gl_format,
t->GetWidth(),
t->GetHeight(),
1046 0, gl_format, GL_UNSIGNED_BYTE,
pixels);
1074 near_clip, far_clip);
1086 gluLookAt(camera_x, camera_y, camera_z,
1099 if (!gameviewport) {
1143 float Light_tile_dist;
1146 for (
int z = 0;
z < 128 - 1; ++
z) {
1147 for (
int x = 0;
x < 128 - 1; ++
x) {
1149 int xdist = camx -
x;
1150 int zdist = camz -
z;
1152 if (xdist > tilerange || zdist > tilerange)
continue;
1154 int dist = sqrt((xdist)*(xdist) + (zdist)*(zdist));
1155 if (dist > tilerange)
continue;
1160 if (tiledir > 2048) {
1166 if ((tiledir >
left) || (tiledir <
right))
continue;
1168 if (!(tiledir < left || tiledir >
right))
continue;
1174 if (!tile)
continue;
1179 poly->texture = tile->GetTexture();
1180 if (tile->IsWaterTile()) {
1261 poly->uEdgeList1Size =
x;
1262 poly->uEdgeList2Size =
z;
1265 bool water_border_tile =
false;
1266 if (tile->IsWaterBorderTile()) {
1273 GLint thistexw = texturew->GetOpenGlTexture();
1276 if (lasttex != thistexw) {
1282 poly->texture = tile->GetTexture();
1286 water_border_tile =
true;
1293 if (lasttex != thistex) {
1304 bool clampAtTextureBorders) {
1311 float clamp_fix_v = 1.0f /
texture->GetHeight();
1323 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1388 int horizon_height_offset;
1398 double rot_to_rads = ((2 * pi_double) / 2048);
1401 horizon_height_offset =
1421 pSkyPolygon.
texture =
nullptr;
1435 pSkyPolygon.
v_18.x =
1437 pSkyPolygon.
v_18.y = 0;
1438 pSkyPolygon.
v_18.z =
1483 / tan(half_fov_angle_rads) +
1496 v33 * (horizon_height_offset - floor(
VertexRenderList[i].vWorldViewProjY + 0.5)));
1501 v33 * (horizon_height_offset - floor(
VertexRenderList[i].vWorldViewProjY + 0.
f)));
1506 v33 * (horizon_height_offset - floor(
VertexRenderList[i].vWorldViewProjY + 0.5)));
1507 top_y_proj = pSkyPolygon.
v_18.x + v9;
1508 if (top_y_proj > 0) top_y_proj = 0;
1513 v14 = v33 * (horizon_height_offset - v32);
1516 v37 = abs((
int)v34 >> 14);
1517 v15 = abs(top_y_proj);
1520 if (top_y_proj <= 0)
break;
1526 top_y_proj = pSkyPolygon.
v_18.x + v16;
1528 HEXRAYS_LODWORD(v17) = HEXRAYS_LODWORD(v34) << 16;
1529 HEXRAYS_HIDWORD(v17) = v34 >> 16;
1530 v18 = v17 / top_y_proj;
1604 ((diffuse >> 8) & 0xFF) / 255.0
f,
1605 (diffuse & 0xFF) / 255.0
f, 1.0
f);
1619 engine->draw_debug_outlines();
1649 billboard->pQuads[0].texcoord.x += 0.5f /
texture->GetWidth();
1650 billboard->pQuads[0].texcoord.y += 0.5f /
texture->GetHeight();
1651 billboard->pQuads[1].texcoord.x += 0.5f /
texture->GetWidth();
1652 billboard->pQuads[1].texcoord.y -= 0.5f /
texture->GetHeight();
1653 billboard->pQuads[2].texcoord.x -= 0.5f /
texture->GetWidth();
1654 billboard->pQuads[2].texcoord.y -= 0.5f /
texture->GetHeight();
1655 billboard->pQuads[3].texcoord.x -= 0.5f /
texture->GetWidth();
1656 billboard->pQuads[3].texcoord.y += 0.5f /
texture->GetHeight();
1658 for (
unsigned int j = 0; j < billboard->uNumVertices; ++j) {
1660 ((billboard->pQuads[j].diffuse >> 16) & 0xFF) / 255.0f,
1661 ((billboard->pQuads[j].diffuse >> 8) & 0xFF) / 255.0f,
1662 ((billboard->pQuads[j].diffuse >> 0) & 0xFF) / 255.0f,
1666 billboard->pQuads[j].texcoord.y);
1668 float oneoz = 1. / (billboard->screen_space_z);
1673 billboard->pQuads[j].pos.x,
1674 billboard->pQuads[j].pos.y,
1675 (oneoz - oneon)/(oneof - oneon) );
1684 if (
config->is_using_fog) {
1687 glFogi(GL_FOG_MODE, GL_EXP);
1693 glFogfv(GL_FOG_COLOR, fog_color);
1705 if (
config->is_using_fog) {
1708 glFogi(GL_FOG_MODE, GL_EXP);
1714 glFogfv(GL_FOG_COLOR, fog_color);
1717 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1723 if (
config->is_using_specular) {
1724 if (!
config->is_using_fog) {
1735 L
"SetBillboardBlendOptions: invalid opacity type (%u)", a1);
1742 void *out_data,
unsigned int data_size,
1743 unsigned int *screenshot_size) {
1797 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1802 int clipx = this->
clip_x;
1803 int clipy = this->
clip_y;
1804 int clipw = this->
clip_w;
1805 int clipz = this->
clip_z;
1816 if (
x >= 640 ||
x >= clipz ||
y >= 480 ||
y >= clipw)
return;
1818 if ((clipx < z && clipz >
x && clipy >
w && clipw <
y))
return;
1820 int drawx = std::max(
x, clipx);
1821 int drawy = std::max(
y, clipy);
1822 int draww = std::min(
w, clipw);
1823 int drawz = std::min(
z, clipz);
1827 GLfloat Vertices[] = { (float)drawx, (
float)drawy,
depth,
1828 (float)drawz, (
float)drawy,
depth,
1829 (float)drawz, (
float)draww,
depth,
1830 (float)drawx, (
float)draww,
depth };
1832 float texx = (drawx -
x) /
float(
width);
1833 float texy = (drawy -
y) /
float(
height);
1834 float texz = (
width - (
z - drawz)) / float(
width);
1837 GLfloat TexCoord[] = { texx, texy,
1860 while ((err =
glGetError()) != GL_NO_ERROR) {
1865 for (
int ys = drawy; ys < draww; ys++) {
1866 memset(this->
render_target_rgb +(ys * 640 + drawx), 0x00000000, (drawz - drawx) * 4);
1871 int custom_height) {
1872 unsigned __int16 *v6;
1881 unsigned int uOutX = 640 * u;
1882 unsigned int uOutY = 480 *
v;
1885 int height = std::min((
int)
img->GetHeight(), custom_height);
1892 if ((
signed int)uOutX < (
signed int)this->
clip_x) {
1893 v8 = this->clip_x - uOutX;
1894 unsigned int v9 = uOutX - this->
clip_x;
1897 v6 = (
unsigned __int16 *)((
char *)v6 + v8);
1900 if ((
signed int)uOutY < (
signed int)this->
clip_y) {
1901 v11 = this->clip_y - uOutY;
1906 v12 = std::max((
unsigned int)this->clip_x, uOutX);
1907 if ((
signed int)(
width + v12) > (
signed int)this->
clip_z) {
1908 width = this->clip_z - std::max(this->clip_x, (
int)uOutX);
1910 v15 = std::max((
unsigned int)this->clip_y, uOutY);
1911 if ((
signed int)(v15 +
height) > (
signed int)this->
clip_w) {
1912 height = this->clip_w - std::max(this->clip_y, (
int)uOutY);
1929 unsigned int uCharWidth,
unsigned int uCharHeight,
1930 uint8_t *pFontPalette,
unsigned __int16 uFaceColor,
1931 unsigned __int16 uShadowColor) {
1937 for (
uint y = 0;
y < uCharHeight; ++
y) {
1938 for (
uint x = 0;
x < uCharWidth; ++
x) {
1941 if (*pFontPixels != 1) {
1955 int uCharWidth,
unsigned int uFontHeight,
1957 bool present_time_transparency) {
1963 if (present_time_transparency) {
1964 for (
unsigned int dy = 0; dy < uFontHeight; ++dy) {
1965 for (
unsigned int dx = 0; dx < uCharWidth; ++dx) {
1967 ? pPalette[*font_pixels]
1977 for (
unsigned int dy = 0; dy < uFontHeight; ++dy) {
1978 for (
unsigned int dx = 0; dx < uCharWidth; ++dx) {
1998 static Texture *screen_text_overlay = 0;
1999 if (!screen_text_overlay) {
2004 unsigned int num_pixels = screen_text_overlay->
GetWidth() * screen_text_overlay->
GetHeight();
2010 render->Update_Texture(screen_text_overlay);
2012 render->DrawTextureAlphaNew(0, 0, screen_text_overlay);
2014 window->OpenGlSwapBuffers();
2033 if (!model.
pFaces.empty()) {
2035 if (!
face.Invisible()) {
2042 poly->texture =
face.GetTexture();
2044 if (
face.uAttributes & FACE_FLUID) poly->flags |= 2;
2045 if (
face.uAttributes & FACE_INDOOR_SKY)
2046 poly->flags |= 0x400;
2048 if (
face.uAttributes & FACE_FLOW_DIAGONAL)
2049 poly->flags |= 0x400;
2050 else if (
face.uAttributes & FACE_FLOW_VERTICAL)
2051 poly->flags |= 0x800;
2053 if (
face.uAttributes & FACE_FLOW_HORIZONTAL)
2054 poly->flags |= 0x2000;
2055 else if (
face.uAttributes & FACE_DONT_CACHE_TEXTURE)
2056 poly->flags |= 0x1000;
2058 poly->sTextureDeltaU =
face.sTextureDeltaU;
2059 poly->sTextureDeltaV =
face.sTextureDeltaV;
2061 unsigned int flow_anim_timer =
OS_GetTime() >> 4;
2062 unsigned int flow_u_mod = poly->texture->GetWidth() - 1;
2063 unsigned int flow_v_mod =
2064 poly->texture->GetHeight() - 1;
2066 if (
face.pFacePlane.vNormal.z &&
2067 abs(
face.pFacePlane.vNormal.z) >= 59082) {
2068 if (poly->flags & 0x400)
2069 poly->sTextureDeltaV +=
2070 flow_anim_timer & flow_v_mod;
2071 if (poly->flags & 0x800)
2072 poly->sTextureDeltaV -=
2073 flow_anim_timer & flow_v_mod;
2075 if (poly->flags & 0x400)
2076 poly->sTextureDeltaV -=
2077 flow_anim_timer & flow_v_mod;
2078 if (poly->flags & 0x800)
2079 poly->sTextureDeltaV +=
2080 flow_anim_timer & flow_v_mod;
2083 if (poly->flags & 0x1000)
2084 poly->sTextureDeltaU -=
2085 flow_anim_timer & flow_u_mod;
2086 else if (poly->flags & 0x2000)
2087 poly->sTextureDeltaU +=
2088 flow_anim_timer & flow_u_mod;
2093 for (
uint vertex_id = 1; vertex_id <=
face.uNumVertices;
2108 (poly->sTextureDeltaU +
2109 (__int16)
face.pTextureUIDs[vertex_id - 1]) *
2110 (1.0 / (double)poly->texture->GetWidth());
2112 (poly->sTextureDeltaV +
2113 (__int16)
face.pTextureVIDs[vertex_id - 1]) *
2114 (1.0 / (double)poly->texture->GetHeight());
2140 if (v53 ==
face.uNumVertices) {
2141 poly->field_32 |= 1;
2143 poly->pODMFace = &
face;
2144 poly->uNumVertices =
face.uNumVertices;
2147 face.pFacePlane.vNormal.x);
2149 face.pFacePlane.vNormal.y);
2151 face.pFacePlane.vNormal.z);
2152 poly->dimming_level =
2154 if (poly->dimming_level < 0) poly->dimming_level = 0;
2155 if (poly->dimming_level > 31) poly->dimming_level = 31;
2160 poly->uBModelFaceID =
face.index;
2161 poly->uBModelID = model.
index;
2164 for (
int vertex_id = 0;
2165 vertex_id <
face.uNumVertices; ++vertex_id) {
2186 if (poly->uNumVertices) {
2187 if (poly->IsWater()) {
2188 if (poly->IsWaterAnimDisabled())
2190 render->hd_water_tile_anim[0];
2193 render->hd_water_tile_anim
2195 ->hd_water_current_frame];
2198 render->DrawPolygon(poly);
2217 unsigned int a2 = 0xFFFFFFFF;
2218 engine->AlterGamma_ODM(a4, &a2);
2230 outline_color = 0xFFFF2020;
2232 outline_color = 0xFF901010;
2247 if (a4->uAttributes & FACE_OUTLINED) {
2251 if (
config->is_using_specular)
2266 config->is_using_specular
2278 while ((err =
glGetError()) != GL_NO_ERROR) {
2382 int uPackedID,
unsigned int uColor,
2391 unsigned int sCorrectedColor = uColor;
2396 engine->AlterGamma_BLV(pFace, &sCorrectedColor);
2400 uColor = sCorrectedColor = 0xFF20FF20;
2402 uColor = sCorrectedColor = 0xFF109010;
2575 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
2577 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
2588 gluPerspective(45.0
f,
2596 window->OpenGlSwapBuffers();
2619 unsigned int uWidth,
unsigned int uHeight,
2620 unsigned int uColor16) {
2629 unsigned int b = (uColor16 & 0x1F) * 8;
2630 unsigned int g = ((uColor16 >> 5) & 0x3F) * 4;
2631 unsigned int r = ((uColor16 >> 11) & 0x1F) * 8;
2637 (float)(uX+uWidth), (float)uY,
depth,
2638 (
float)(uX + uWidth), (
float)(uY+uHeight),
depth,
2639 (
float)uX, (float)(uY + uHeight),
depth };
2650 while ((err =
glGetError()) != GL_NO_ERROR) {
unsigned __int16 uint16_t
virtual void DrawIndoorSky(unsigned int uNumVertices, unsigned int uFaceID)
SpriteFrame * LevelDecorationChangeSeason(DecorationDesc *desc, int t, int month)
struct BSPVertexBuffer pVertices
GLenum GLuint GLint GLenum face
LOD::WriteableFile * pNew_LOD
GLAPI void GLAPIENTRY glDisableClientState(GLenum cap)
virtual void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, int uPackedID, unsigned int uColor, int a8)
std::array< LevelDecoration, 3000 > pLevelDecorations
int y_rotation_granularity
GLAPI void GLAPIENTRY glEnd(void)
virtual void DrawTerrainPolygon(struct Polygon *a4, bool transparent, bool clampAtTextureBorders)
GLAPI void GLAPIENTRY glDeleteTextures(GLsizei n, const GLuint *textures)
unsigned int uCurrentMonth
const int terrain_block_scale
DecorationDesc * GetDecoration(unsigned int index)
virtual bool DrawLightmap(struct Lightmap *pLightmap, struct Vec3_float_ *pColorMult, float z_bias)
unsigned int uNumBillboards
virtual void SaveScreenshot(const String &filename, unsigned int width, unsigned int height)
GLenum GLint GLint GLint GLint GLuint GLenum GLint GLint dstX
struct SpriteFrameTable * pSpriteFrameTable
LODFile_Sprites * pSprites_LOD
GLAPI void GLAPIENTRY glDepthMask(GLboolean flag)
virtual bool Initialize(OSWindow *window)
uint32_t uNumTerrainNormals
virtual void DrawText(int uOutX, int uOutY, uint8_t *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, uint8_t *pFontPalette, uint16_t uFaceColor, uint16_t uShadowColor)
virtual void DrawTextureAlphaNew(float u, float v, class Image *)
GLAPI void GLAPIENTRY glDepthFunc(GLenum func)
GLAPI GLenum GLAPIENTRY glGetError(void)
void DrawOutdoorSkyPolygon(struct Polygon *pSkyPolygon)
virtual void ScreenFade(unsigned int color, float t)
BLVRenderParams * pBLVRenderParams
EGLSurface EGLint EGLint EGLint EGLint height
GLAPI void GLAPIENTRY glClear(GLbitfield mask)
virtual void DrawProjectile(float srcX, float srcY, float a3, float a4, float dstX, float dstY, float a7, float a8, Texture *texture)
virtual Texture * CreateTexture_Blank(unsigned int width, unsigned int height, IMAGE_FORMAT format, const void *pixels=nullptr)
unsigned int WorldPosToGridCellX(int sWorldPosX)
virtual void TexturePixelRotateDraw(float u, float v, Image *img, int time)
std::shared_ptr< Engine > engine
virtual void DrawTextureCustomHeight(float u, float v, class Image *, int height)
GLAPI void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
void SetBillboardBlendOptions(RenderBillboardD3D::OpacityType a1)
unsigned int game_viewport_width
float screenspace_projection_factor_y
virtual void EndLightmaps()
void _set_ortho_modelview()
unsigned int BlendColors(unsigned int a1, unsigned int a2)
virtual void DrawBillboard_Indoor(SoftwareBillboard *pSoftBillboard, RenderBillboard *)
unsigned int IMAGE_FORMAT_BytesPerPixel(IMAGE_FORMAT format)
RenderBillboard pBillboardRenderList[500]
virtual void BeginDecals()
uint32_t Color32(uint16_t color16)
virtual void ZBuffer_Fill_2(signed int a2, signed int a3, Image *pTexture, int a5)
float screenspace_projection_factor_x
GLAPI void GLAPIENTRY glBindTexture(GLenum target, GLuint texture)
virtual Texture * CreateTexture(const String &name)
GLubyte GLubyte GLubyte GLubyte w
GLenum GLenum GLuint texture
virtual void RasterLine2D(signed int uX, signed int uY, signed int uZ, signed int uW, unsigned __int16 uColor)
unsigned int WorldPosToGridCellZ(int sWorldPosZ)
SpriteFrame * pSpriteFrame
GLAPI void GLAPIENTRY glShadeModel(GLenum mode)
virtual Texture * CreateTexture_PCXFromFile(const String &name)
GLuint GLfloat GLfloat GLfloat x1
unsigned int game_viewport_height
GLAPI void GLAPIENTRY glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
GLAPI void GLAPIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
unsigned int Billboard_ProbablyAddToListAndSortByZOrder(float z)
GLAPI void GLAPIENTRY glDisable(GLenum cap)
GLAPI void GLAPIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param)
virtual void BeginSceneD3D()
TileDesc * DoGetTile(int uX, int uZ)
static fixed FromInt(int value)
void _set_3d_modelview_matrix()
virtual void PackScreenshot(unsigned int width, unsigned int height, void *out_data, unsigned int data_size, unsigned int *screenshot_size)
GLAPI void GLAPIENTRY glFrontFace(GLenum mode)
void _set_ortho_projection(bool gameviewport=false)
Vec3_float_ vWorldViewPosition
EGLSurface EGLint EGLint y
GLAPI void GLAPIENTRY glGenTextures(GLsizei n, GLuint *textures)
GLAPI void GLAPIENTRY glFogfv(GLenum pname, const GLfloat *params)
RenderVertexSoft array_73D150[20]
virtual int GetActorsInViewport(int pDepth)
RenderVertexSoft array_507D30[50]
GLenum GLint GLint GLint srcY
GLAPI void GLAPIENTRY glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
virtual void BeginLightmaps2()
unsigned int uNumVertices
virtual bool SwitchToWindow()
@ LEVEL_DECORATION_INVISIBLE
virtual unsigned int GetActorTintColor(int DimLevel, int tint, float WorldViewX, int a5, RenderBillboard *Billboard)
GLAPI void GLAPIENTRY glFogi(GLenum pname, GLint param)
virtual void DrawTextAlpha(int x, int y, unsigned char *font_pixels, int a5, unsigned int uFontHeight, uint8_t *pPalette, bool present_time_transparency)
virtual void DrawLines(const RenderVertexD3D3 *vertices, unsigned int num_vertices)
const int terrain_height_scale
struct Vec3_float_ * pTerrainNormals
virtual void DrawPolygon(struct Polygon *a3)
__int64 fixpoint_dot(int x1, int x2, int y1, int y2, int z1, int z2)
virtual bool InitializeFullscreen()
GLAPI void GLAPIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
void CalcSkyFrustumVec(int a2, int a3, int a4, int a5, int a6, int a7)
LightmapBuilder * lightmap_builder
SpriteFrame * GetFrame(unsigned int uSpriteID, unsigned int uTime)
GLAPI void GLAPIENTRY glLoadIdentity(void)
unsigned int OS_GetTime()
virtual void DrawOutdoorSkyD3D()
ParticleEngine * particle_engine
void SetUsingFog(bool is_using_fog)
virtual void DrawMonsterPortrait(Rect rc, SpriteFrame *Portrait_Sprite, int Y_Offset)
virtual void DrawTextureOffset(int x, int y, int offset_x, int offset_y, Image *)
void PostInitialization()
unsigned int uCameraFovInDegrees
int uNumSpritesDrawnThisFrame
virtual void ClearTarget(unsigned int uColor)
virtual void ZDrawTextureAlpha(float u, float v, Image *pTexture, int zVal)
virtual void DrawMasked(float u, float v, class Image *img, unsigned int color_dimming_level, unsigned __int16 mask)
virtual void SaveWinnersCertificate(const char *a1)
GLAPI void GLAPIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
bool ViewClip(int x, int y, int z, int *transformed_x, int *transformed_y, int *transformed_z, bool dont_show=false)
virtual void am_Blt_Chroma(Rect *pSrcRect, Point *pTargetPoint, int a3, int blend_mode)
EGLSurface EGLint EGLint EGLint width
void DrawIndoorSkyPolygon(signed int uNumVertices, struct Polygon *pSkyPolygon)
virtual void do_draw_debug_line_d3d(const RenderVertexD3D3 *pLineBegin, signed int sDiffuseBegin, const RenderVertexD3D3 *pLineEnd, signed int sDiffuseEnd, float z_stuff)
void Warning(const wchar_t *pFormat,...)
void DoRenderBillboards_D3D()
LODFile_IconsBitmaps * pIcons_LOD
RenderBillboardD3D pBillboardRenderListD3D[1000]
void Project(int x, int y, int z, int *screenspace_x, int *screenspace_y)
RenderVertexSoft ogl_draw_buildings_vertices[20]
__int64 fixpoint_mul(int a1, int a2)
GLAPI void GLAPIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z)
size_t uNumLevelDecorations
EGLSurface EGLNativeWindowType * window
virtual bool AreRenderSurfacesOk()
virtual void DrawTransparentRedShade(float u, float v, class Image *a4)
virtual void BeginScene()
virtual void DrawFansTransparent(const RenderVertexD3D3 *vertices, unsigned int num_vertices)
GLAPI void GLAPIENTRY glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
virtual unsigned int GetRenderHeight() const
GLAPI void GLAPIENTRY glColor3ub(GLubyte red, GLubyte green, GLubyte blue)
uint32_t * render_target_rgb
unsigned int uNumVertices
static bool IsBackfaceNotCulled(struct RenderVertexSoft *a2, struct Polygon *polygon)
virtual void Update_Texture(Texture *texture)
GLAPI void GLAPIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor)
virtual Texture * CreateTexture_Solid(const String &name)
GLint GLint GLsizei GLsizei GLsizei depth
@ LEVEL_DECORATION_OBELISK_CHEST
GLAPI void GLAPIENTRY glHint(GLenum target, GLenum mode)
RenderVertexD3D3 d3d_vertex_buffer[50]
void AddParticle(Particle_sw *a2)
float screenspace_projection_factor_y
unsigned short object_pid
SkyBillboardStruct SkyBillboard
static Texture * Create(unsigned int width, unsigned int height, IMAGE_FORMAT format, const void *pixels)
virtual void PrepareDecorationsRenderList_ODM()
void memset32(void *ptr, uint32_t value, int count)
virtual void DeleteTexture(Texture *texture)
virtual Texture * CreateTexture_PCXFromIconsLOD(const String &name)
virtual void ClearBlack()
struct Viewport * pViewport
virtual void DrawDecal(struct Decal *pDecal, float z_bias)
GLAPI void GLAPIENTRY glBegin(GLenum mode)
char _4D864C_force_sw_render_rules
virtual void DrawTextureNew(float u, float v, class Image *)
unsigned int GetLevelFogColor()
ODMRenderParams * pODMRenderParams
unsigned int uNumBillboardsToDraw
GLAPI void GLAPIENTRY glColor3f(GLfloat red, GLfloat green, GLfloat blue)
GLAPI void GLAPIENTRY glLineWidth(GLfloat width)
unsigned int uEdgeList2Size
SpellFxRenderer * spell_fx_renderer
GLboolean GLboolean GLboolean b
unsigned int Atan2(int x, int y)
GLenum GLint GLint GLint GLint GLuint GLenum GLint GLint GLint dstY
RenderVertexSoft VertexRenderList[50]
virtual Texture * CreateTexture_ColorKey(const String &name, uint16_t colorkey)
GLAPI void GLAPIENTRY glEnableClientState(GLenum cap)
EGLImageKHR EGLint * name
GLdouble GLdouble GLdouble r
bool IsBModelVisible(BSPModel *model, int *reachable)
int hd_water_current_frame
int uNumDecorationsDrawnThisFrame
GLAPI void GLAPIENTRY glMatrixMode(GLenum mode)
std::array< struct Polygon, 2000+18000 > array_77EC08
virtual unsigned int GetRenderWidth() const
LightsStack_StationaryLight_ * pStationaryLightsStack
void __cdecl __debugbreak(void)
uint16_t uDecorationHeight
struct OutdoorLocationTerrain pTerrain
void _set_3d_projection_matrix()
virtual Texture * CreateTexture_Alpha(const String &name)
std::vector< ODMFace > pFaces
virtual void RenderTerrainD3D()
Vec3_float_ vWorldPosition
virtual void DrawBillboardList_BLV()
virtual void WritePixel16(int x, int y, uint16_t color)
LODFile_IconsBitmaps * pBitmaps_LOD
const void * GetPixels(IMAGE_FORMAT format)
GLfixed GLfixed GLfixed y2
virtual void DrawImage(Image *, const Rect &rect)
struct stru193_math * stru_5C6E00
virtual void DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene()
virtual void _4A4CC9_AddSomeBillboard(struct SpellFX_Billboard *a1, int diffuse)
virtual bool Initialize(OSWindow *window)
Texture * hd_water_tile_anim[7]
virtual void DrawSpecialEffectsQuad(const RenderVertexD3D3 *vertices, Texture *texture)
struct Vec3_short_ * pVertices
virtual bool MoveTextureToDevice(Texture *texture)
int sub_47C3D7_get_fog_specular(int a1, int a2, float a3)
virtual Image * TakeScreenshot(unsigned int width, unsigned int height)
virtual void EndLightmaps2()
GLAPI void GLAPIENTRY glCullFace(GLenum mode)
virtual void BltBackToFontFast(int a2, int a3, Rect *pSrcRect)
std::array< unsigned short, 128 *128 *2 > pTerrainNormalIndices
virtual void BeginLightmaps()
struct SkyBillboardStruct * ptr_38
float screenspace_projection_factor_x
bool AddLight(int16_t x, int16_t y, int16_t z, int16_t a5, unsigned char r, unsigned char g, unsigned char b, char uLightType)
virtual void RestoreFrontBuffer()
float GetNearClip() const
virtual void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16)
virtual Texture * CreateSprite(const String &name, unsigned int palette_id, unsigned int lod_sprite_id)
unsigned int uNumBillboardsToDraw
uint8_t uColoredLightBlue
unsigned int uEdgeList1Size
GLuint GLuint GLsizei GLenum const GLvoid * indices
unsigned int StationaryLightsCount
OutdoorLocation * pOutdoor
GLAPI void GLAPIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
virtual void DrawTextureGrayShade(float u, float v, class Image *a4)
virtual void DrawTransparentGreenShade(float u, float v, class Image *pTexture)
std::shared_ptr< IRender > render
void RenderSpecialEffects()
virtual void SavePCXScreenshot()
virtual void ResetUIClipRect()
RenderVertexD3D3 pQuads[4]
GLAPI void GLAPIENTRY glTexCoord2f(GLfloat s, GLfloat t)
IndoorCameraD3D * pIndoorCameraD3D
virtual void CreateZBuffer()
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
unsigned __int32 uint32_t
unsigned int uTotalGameTimeElapsed
static const unsigned int uIntegerPi
GLAPI void GLAPIENTRY glClearDepth(GLclampd depth)
virtual void ClearZBuffer(int a2, int a3)
uint8_t uColoredLightGreen
virtual Texture * CreateTexture_PCXFromNewLOD(const String &name)
virtual void PresentBlackScreen()
GLAPI void GLAPIENTRY glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
GLAPI void GLAPIENTRY glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val)
virtual void DrawBuildingsD3D()
GLAPI void GLAPIENTRY glEnable(GLenum cap)
unsigned short object_pid
virtual void RestoreBackBuffer()
struct DecorationList * pDecorationList
GLAPI void GLAPIENTRY glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
virtual void RemoveTextureFromDevice(Texture *texture)
virtual void SetUIClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW)
virtual void BlendTextures(int a2, int a3, Image *a4, Image *a5, int t, int start_opacity, int end_opacity)