mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-28 19:30:51 +02:00
Viewport zoom, adjust in redalert.ini(ZoomLevel) F5/F6 to zoom in and out.
This commit is contained in:
+44
-11
@@ -255,6 +255,12 @@ void DisplayClass::One_Time(void)
|
|||||||
TransIconsetHD[2] = Image_LoadImage("ui/trans/trans2.png");
|
TransIconsetHD[2] = Image_LoadImage("ui/trans/trans2.png");
|
||||||
|
|
||||||
ShadowShapes = Image_LoadImage("ui/shroud.png");
|
ShadowShapes = Image_LoadImage("ui/shroud.png");
|
||||||
|
|
||||||
|
Image_t* sceneAlbedoTexture = Image_CreateBlankImage("sceneAlbedoTexture", ScreenWidth, ScreenHeight, true);
|
||||||
|
Image_t* sceneDepthTexture = Image_CreateDepthImage("sceneDepthTexture", ScreenWidth, ScreenHeight);
|
||||||
|
|
||||||
|
sceneRenderTexture = new RenderTexture(sceneAlbedoTexture, sceneDepthTexture);
|
||||||
|
sceneRenderTexture->InitRenderTexture();
|
||||||
// jmarshall end
|
// jmarshall end
|
||||||
|
|
||||||
Set_View_Dimensions(0, 0);
|
Set_View_Dimensions(0, 0);
|
||||||
@@ -285,6 +291,7 @@ void DisplayClass::Init_Clear(void)
|
|||||||
*/
|
*/
|
||||||
PendingObjectPtr = 0;
|
PendingObjectPtr = 0;
|
||||||
PendingObject = 0;
|
PendingObject = 0;
|
||||||
|
zoomLevel = 0;
|
||||||
PendingHouse = HOUSE_NONE;
|
PendingHouse = HOUSE_NONE;
|
||||||
CursorSize = 0;
|
CursorSize = 0;
|
||||||
IsTargettingMode = SPC_NONE;
|
IsTargettingMode = SPC_NONE;
|
||||||
@@ -1098,7 +1105,6 @@ void DisplayClass::AI(KeyNumType & input, int x, int y)
|
|||||||
MapClass::AI(input, x, y);
|
MapClass::AI(input, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************************************
|
/***********************************************************************************************
|
||||||
* DisplayClass::Submit -- Adds a game object to the map rendering system. *
|
* DisplayClass::Submit -- Adds a game object to the map rendering system. *
|
||||||
* *
|
* *
|
||||||
@@ -1183,7 +1189,6 @@ CELL DisplayClass::Click_Cell_Calc(int x, int y) const
|
|||||||
if (!CellClass::ScreenCoordsToIsoTile(x, y, tileX, tileY)) {
|
if (!CellClass::ScreenCoordsToIsoTile(x, y, tileX, tileY)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = tileX * CELL_PIXEL_W;
|
x = tileX * CELL_PIXEL_W;
|
||||||
y = tileY * CELL_PIXEL_H;
|
y = tileY * CELL_PIXEL_H;
|
||||||
|
|
||||||
@@ -1969,7 +1974,8 @@ void DisplayClass::CacheVisibleCells(void) {
|
|||||||
|
|
||||||
MapClass::Draw_It(forced);
|
MapClass::Draw_It(forced);
|
||||||
|
|
||||||
if (IsToRedraw || forced) {
|
GL_SetRenderTexture(sceneRenderTexture);
|
||||||
|
{
|
||||||
BStart(BENCH_TACTICAL);
|
BStart(BENCH_TACTICAL);
|
||||||
IsToRedraw = false;
|
IsToRedraw = false;
|
||||||
|
|
||||||
@@ -2135,14 +2141,6 @@ void DisplayClass::CacheVisibleCells(void) {
|
|||||||
Layer[LAYER_GROUND][index]->IsToDisplay = false;
|
Layer[LAYER_GROUND][index]->IsToDisplay = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
** Draw the rubber band over the top of it all.
|
|
||||||
*/
|
|
||||||
if (IsRubberBand) {
|
|
||||||
LogicPage->Draw_Rect(BandX+TacPixelX, BandY+TacPixelY, NewX+TacPixelX, NewY+TacPixelY, WHITE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Clear the redraw flags so that normal redraw flag setting can resume.
|
** Clear the redraw flags so that normal redraw flag setting can resume.
|
||||||
*/
|
*/
|
||||||
@@ -2166,6 +2164,39 @@ void DisplayClass::CacheVisibleCells(void) {
|
|||||||
#endif
|
#endif
|
||||||
BEnd(BENCH_TACTICAL);
|
BEnd(BENCH_TACTICAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Draw the rubber band over the top of it all.
|
||||||
|
*/
|
||||||
|
if (IsRubberBand) {
|
||||||
|
LogicPage->Draw_Rect(BandX + TacPixelX, BandY + TacPixelY, NewX + TacPixelX, NewY + TacPixelY, WHITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
GL_SetRenderTexture(NULL);
|
||||||
|
|
||||||
|
int renderTargetScale = ZoomLevel;
|
||||||
|
if(Debug_Map) {
|
||||||
|
renderTargetScale = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double scale = ((((float)ScreenWidth / (float)ScreenHeight) * (float)renderTargetScale) * 0.05) + 1;
|
||||||
|
|
||||||
|
GL_RenderImage(sceneRenderTexture->GetColorImage(0), 0, 0, ScreenWidth * scale, ScreenHeight * scale, 0, 0, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DisplayClass::Pixel_To_Zoom(int& x, int& y) const {
|
||||||
|
if(Debug_Map) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int renderTargetScale = ZoomLevel;
|
||||||
|
if (Debug_Map) {
|
||||||
|
renderTargetScale = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double scale = ((((float)ScreenWidth / (float)ScreenHeight) * (float)renderTargetScale) * 0.05) + 1;
|
||||||
|
x = x / scale;
|
||||||
|
y = y / scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************************************
|
/***********************************************************************************************
|
||||||
@@ -2901,6 +2932,8 @@ int DisplayClass::TacticalClass::Action(unsigned flags, KeyNumType & key)
|
|||||||
x = Get_Mouse_X();
|
x = Get_Mouse_X();
|
||||||
y = Get_Mouse_Y();
|
y = Get_Mouse_Y();
|
||||||
|
|
||||||
|
Map.Pixel_To_Zoom(x, y);
|
||||||
|
|
||||||
int screenX, screenY;
|
int screenX, screenY;
|
||||||
screenX = x;
|
screenX = x;
|
||||||
screenY = y;
|
screenY = y;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include "layer.h"
|
#include "layer.h"
|
||||||
#include "tacticalcoord.h"
|
#include "tacticalcoord.h"
|
||||||
|
|
||||||
|
class RenderTexture;
|
||||||
struct Image_t;
|
struct Image_t;
|
||||||
class BigOverlay;
|
class BigOverlay;
|
||||||
|
|
||||||
@@ -103,6 +104,9 @@ class DisplayClass: public MapClass
|
|||||||
short CursorShapeSave[256]; // For save/load
|
short CursorShapeSave[256]; // For save/load
|
||||||
bool ProximityCheck; // Is proximity check ok?
|
bool ProximityCheck; // Is proximity check ok?
|
||||||
|
|
||||||
|
int zoomLevel;
|
||||||
|
RenderTexture* sceneRenderTexture;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** This holds the building type that is about to be placed upon the map.
|
** This holds the building type that is about to be placed upon the map.
|
||||||
** It is only valid during the building placement state. The PendingLegal
|
** It is only valid during the building placement state. The PendingLegal
|
||||||
@@ -187,6 +191,7 @@ class DisplayClass: public MapClass
|
|||||||
void Select_These(COORDINATE coord1, COORDINATE coord2, bool additive = false);
|
void Select_These(COORDINATE coord1, COORDINATE coord2, bool additive = false);
|
||||||
COORDINATE Pixel_To_Coord(int x, int y) const;
|
COORDINATE Pixel_To_Coord(int x, int y) const;
|
||||||
bool Coord_To_Pixel(COORDINATE coord, int & x, int & y) const;
|
bool Coord_To_Pixel(COORDINATE coord, int & x, int & y) const;
|
||||||
|
void Pixel_To_Zoom(int& x, int& y) const;
|
||||||
bool Push_Onto_TacMap(COORDINATE &source, COORDINATE &dest);
|
bool Push_Onto_TacMap(COORDINATE &source, COORDINATE &dest);
|
||||||
void Remove(ObjectClass const * object, LayerType layer);
|
void Remove(ObjectClass const * object, LayerType layer);
|
||||||
void Submit(ObjectClass const * object, LayerType layer);
|
void Submit(ObjectClass const * object, LayerType layer);
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ extern LPDIRECTSOUND SoundObject;
|
|||||||
extern LPDIRECTSOUNDBUFFER PrimaryBufferPtr;
|
extern LPDIRECTSOUNDBUFFER PrimaryBufferPtr;
|
||||||
extern int ScreenWidth;
|
extern int ScreenWidth;
|
||||||
extern int ScreenHeight;
|
extern int ScreenHeight;
|
||||||
|
extern int ZoomLevel;
|
||||||
extern GraphicBufferClass ModeXBuff;
|
extern GraphicBufferClass ModeXBuff;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ GraphicBufferClass SysMemPage(DEFAULT_SCREEN_WIDTH, 200, (void*)NULL);
|
|||||||
WinTimerClass * WindowsTimer=NULL;
|
WinTimerClass * WindowsTimer=NULL;
|
||||||
int ScreenWidth=6072;
|
int ScreenWidth=6072;
|
||||||
int ScreenHeight=6072;
|
int ScreenHeight=6072;
|
||||||
|
int ZoomLevel = 6;
|
||||||
GraphicBufferClass ModeXBuff;
|
GraphicBufferClass ModeXBuff;
|
||||||
bool InMovie = FALSE; //Are we currently playing a VQ movie?
|
bool InMovie = FALSE; //Are we currently playing a VQ movie?
|
||||||
HANDLE hInstance;
|
HANDLE hInstance;
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ bool Image_Add32BitImage(const char* name, Image_t* image, int HouseId, int Shap
|
|||||||
|
|
||||||
Image_t* Image_CreateBlankImage(const char* name, int width, int height, bool hasAlpha);
|
Image_t* Image_CreateBlankImage(const char* name, int width, int height, bool hasAlpha);
|
||||||
void Image_UploadRaw(Image_t* image, uint8_t* data, bool paletteRebuild, uint8_t *palette, bool hasAlpha);
|
void Image_UploadRaw(Image_t* image, uint8_t* data, bool paletteRebuild, uint8_t *palette, bool hasAlpha);
|
||||||
|
Image_t* Image_CreateDepthImage(const char* name, int width, int height);
|
||||||
|
|
||||||
void Sys_SetOverlayImage(Image_t* image);
|
void Sys_SetOverlayImage(Image_t* image);
|
||||||
|
|
||||||
|
|||||||
@@ -124,6 +124,18 @@ void UserInputClass::Process_Input(KeyNumType& key, int& flags)
|
|||||||
KeyB.Control = true;
|
KeyB.Control = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(state[SDL_SCANCODE_F5]) {
|
||||||
|
ZoomLevel--;
|
||||||
|
ZoomLevel = max(ZoomLevel, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state[SDL_SCANCODE_F6]) {
|
||||||
|
ZoomLevel++;
|
||||||
|
ZoomLevel = min(ZoomLevel, 6);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// handle match between SDL and internals (non-text keys)
|
// handle match between SDL and internals (non-text keys)
|
||||||
auto element = sdl_keyMapping.find((SDL_KeyCode)event.key.keysym.sym);
|
auto element = sdl_keyMapping.find((SDL_KeyCode)event.key.keysym.sym);
|
||||||
if (element != sdl_keyMapping.end())
|
if (element != sdl_keyMapping.end())
|
||||||
@@ -140,6 +152,7 @@ void UserInputClass::Process_Input(KeyNumType& key, int& flags)
|
|||||||
{
|
{
|
||||||
KeyB.ASCII = (char)event.text.text[0];
|
KeyB.ASCII = (char)event.text.text[0];
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Debug_Map || renderConsole)
|
if (Debug_Map || renderConsole)
|
||||||
|
|||||||
+40
-34
@@ -37,40 +37,46 @@ void LightManager::Init(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LightManager::RenderLights(void) {
|
void LightManager::RenderLights(void) {
|
||||||
if(Debug_Map) {
|
//if(Debug_Map) {
|
||||||
for (int i = 0; i < MAX_WORLD_LIGHTS; i++) {
|
// for (int i = 0; i < MAX_WORLD_LIGHTS; i++) {
|
||||||
if (!lights[i].active) {
|
// if (!lights[i].active) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (!lights[i].isPending) {
|
// if (!lights[i].isPending) {
|
||||||
int screenx, screeny;
|
// int screenx, screeny;
|
||||||
lights[i].GetRenderPosition(screenx, screeny);
|
// lights[i].GetRenderPosition(screenx, screeny);
|
||||||
GL_RenderImage(lightEditorIcon, screenx, screeny, 30, 30);
|
// GL_RenderImage(lightEditorIcon, screenx, screeny, 30, 30);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
GL_SetRenderTexture(hdrRenderTexture);
|
//GL_SetRenderTexture(hdrRenderTexture);
|
||||||
|
//
|
||||||
for (int i = 0; i < MAX_WORLD_LIGHTS; i++) {
|
//for (int i = 0; i < MAX_WORLD_LIGHTS; i++) {
|
||||||
if (!lights[i].active) {
|
// if (!lights[i].active) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (!lights[i].isPending) {
|
// if (!lights[i].isPending) {
|
||||||
int screenx, screeny;
|
// int screenx, screeny;
|
||||||
lights[i].GetRenderPosition(screenx, screeny);
|
// lights[i].GetRenderPosition(screenx, screeny);
|
||||||
int halfRadius = lights[i].radius / 2;
|
// int halfRadius = lights[i].radius / 2;
|
||||||
GL_RenderImage(pointLightAttenImage0, screenx - halfRadius, ScreenHeight - (screeny + halfRadius), lights[i].radius, lights[i].radius);
|
// GL_RenderImage(pointLightAttenImage0, screenx - halfRadius, ScreenHeight - (screeny + halfRadius), lights[i].radius, lights[i].radius);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
GL_SetRenderTexture(NULL);
|
//GL_SetRenderTexture(NULL);
|
||||||
|
//
|
||||||
GL_EnableBlend(GL_BLEND_ADD);
|
//GL_EnableBlend(GL_BLEND_ADD);
|
||||||
GL_RenderImage(hdrLightBufferTexture, 0, 0, ScreenWidth, ScreenHeight);
|
// int renderTargetScale = ZoomLevel;
|
||||||
GL_EnableBlend(GL_BLEND_NONE);
|
// if (Debug_Map) {
|
||||||
|
// renderTargetScale = 0;
|
||||||
|
// }
|
||||||
|
// double scale = ((((float)ScreenWidth / (float)ScreenHeight) * (float)renderTargetScale) * 0.05) + 1;
|
||||||
|
//
|
||||||
|
// GL_RenderImage(hdrLightBufferTexture, 0, 0, ScreenWidth * scale, ScreenHeight * scale, 0, 0, true, true);
|
||||||
|
//GL_EnableBlend(GL_BLEND_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LightManager::FreeAllLights(void) {
|
void LightManager::FreeAllLights(void) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ static void GL_SetRenderTextureCallback(const ImDrawList* parent_list, const ImD
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
renderTexture->MakeCurrent();
|
renderTexture->MakeCurrent();
|
||||||
glClearColor(0.45, 0.45, 0.45, 1.0);
|
glClearColor(0.0, 0.0, 0.0, 1.0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,9 @@ void GL_ResetClipRect(void) {
|
|||||||
ImGui::GetBackgroundDrawList()->PopClipRect();
|
ImGui::GetBackgroundDrawList()->PopClipRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int colorRemap, int shapeId) {
|
void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int colorRemap, int shapeId, bool ignoreOutOfScreenPixels, bool flipUV) {
|
||||||
|
if (!ignoreOutOfScreenPixels)
|
||||||
|
{
|
||||||
if (x < 0 || y < 0) {
|
if (x < 0 || y < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -75,9 +77,17 @@ void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int col
|
|||||||
if (x >= ScreenWidth || y >= ScreenHeight) {
|
if (x >= ScreenWidth || y >= ScreenHeight) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ImVec2 mi(x, y);
|
ImVec2 mi(x, y);
|
||||||
ImVec2 ma(x + width, y + height);
|
ImVec2 ma(x + width, y + height);
|
||||||
|
ImVec2 uv(0, 0);
|
||||||
|
ImVec2 uv2(1, 1);
|
||||||
|
|
||||||
|
if(flipUV) {
|
||||||
|
uv.y = 1;
|
||||||
|
uv2.y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (forceForgegroundRender) {
|
if (forceForgegroundRender) {
|
||||||
GL_RenderForeGroundImage(image, x, y, width, height, colorRemap, shapeId);
|
GL_RenderForeGroundImage(image, x, y, width, height, colorRemap, shapeId);
|
||||||
@@ -86,12 +96,12 @@ void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int col
|
|||||||
|
|
||||||
if (image->numFrames > 0) {
|
if (image->numFrames > 0) {
|
||||||
if(image->HouseImages[colorRemap].image[shapeId][((int)animFrameNum) % image->numFrames] == 0)
|
if(image->HouseImages[colorRemap].image[shapeId][((int)animFrameNum) % image->numFrames] == 0)
|
||||||
ImGui::GetBackgroundDrawList()->AddImage((ImTextureID)image->HouseImages[colorRemap].image[shapeId][0], mi, ma, ImVec2(0, 0), ImVec2(1, 1), g_currentColor);
|
ImGui::GetBackgroundDrawList()->AddImage((ImTextureID)image->HouseImages[colorRemap].image[shapeId][0], mi, ma, uv, uv2, g_currentColor);
|
||||||
else
|
else
|
||||||
ImGui::GetBackgroundDrawList()->AddImage((ImTextureID)image->HouseImages[colorRemap].image[shapeId][((int)animFrameNum) % image->numFrames], mi, ma, ImVec2(0, 0), ImVec2(1, 1), g_currentColor);
|
ImGui::GetBackgroundDrawList()->AddImage((ImTextureID)image->HouseImages[colorRemap].image[shapeId][((int)animFrameNum) % image->numFrames], mi, ma, uv, uv2, g_currentColor);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ImGui::GetBackgroundDrawList()->AddImage((ImTextureID)image->HouseImages[colorRemap].image[shapeId][0], mi, ma, ImVec2(0, 0), ImVec2(1, 1), g_currentColor);
|
ImGui::GetBackgroundDrawList()->AddImage((ImTextureID)image->HouseImages[colorRemap].image[shapeId][0], mi, ma, uv, uv2, g_currentColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ enum GLBlendType {
|
|||||||
GL_BLEND_ADD
|
GL_BLEND_ADD
|
||||||
};
|
};
|
||||||
|
|
||||||
void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int colorRemap = 0, int shapeId = 0);
|
void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int colorRemap = 0, int shapeId = 0, bool ignoreOutOfScreenPixels = false, bool flipUV = false);
|
||||||
void GL_RenderForeGroundImage(Image_t* image, int x, int y, int width, int height, int colorRemap = 0, int shapeId = 0);
|
void GL_RenderForeGroundImage(Image_t* image, int x, int y, int width, int height, int colorRemap = 0, int shapeId = 0);
|
||||||
void GL_DrawText(int color, int x, int y, char* text);
|
void GL_DrawText(int color, int x, int y, char* text);
|
||||||
void GL_FillRect(int color, int x, int y, int width, int height);
|
void GL_FillRect(int color, int x, int y, int width, int height);
|
||||||
|
|||||||
@@ -932,6 +932,7 @@ void Read_Setup_Options( RawFileClass *config_file )
|
|||||||
|
|
||||||
ScreenWidth = ini.Get_Int("Options", "Width", 1280);
|
ScreenWidth = ini.Get_Int("Options", "Width", 1280);
|
||||||
ScreenHeight = ini.Get_Int("Options", "Height", 720);
|
ScreenHeight = ini.Get_Int("Options", "Height", 720);
|
||||||
|
ZoomLevel = ini.Get_Int("Options", "ZoomLevel", 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** See if an alternative socket number has been specified
|
** See if an alternative socket number has been specified
|
||||||
|
|||||||
@@ -315,8 +315,8 @@ Image_t* Image_CreateBlankImage(const char* name, int width, int height, bool ha
|
|||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
|
|
||||||
strcpy(image->name, name);
|
strcpy(image->name, name);
|
||||||
@@ -330,6 +330,46 @@ Image_t* Image_CreateBlankImage(const char* name, int width, int height, bool ha
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Image_t* Image_CreateDepthImage(const char* name, int width, int height) {
|
||||||
|
int64_t hash = generateHashValue(name, strlen(name));
|
||||||
|
|
||||||
|
int image_table_size = loaded_images.size();
|
||||||
|
if (image_table_size > 0)
|
||||||
|
{
|
||||||
|
Image_t** image_table = &loaded_images[0];
|
||||||
|
|
||||||
|
// Check to see if the image is already loaded.
|
||||||
|
for (int i = 0; i < image_table_size; i++) {
|
||||||
|
if (image_table[i]->namehash == hash) {
|
||||||
|
return image_table[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Image_t* image = new Image_t();
|
||||||
|
|
||||||
|
|
||||||
|
GLuint texture;
|
||||||
|
glGenTextures(1, &texture);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, width, height, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
|
|
||||||
|
|
||||||
|
strcpy(image->name, name);
|
||||||
|
|
||||||
|
image->HouseImages[0].image[0][0] = texture;
|
||||||
|
image->namehash = hash;
|
||||||
|
image->renderwidth[0] = image->width = width;
|
||||||
|
image->renderheight[0] = image->height = height;
|
||||||
|
|
||||||
|
loaded_images.push_back(image);
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Image_UploadRaw(Image_t* image, uint8_t* data, bool paletteRebuild, uint8_t* palette, bool hasAlpha) {
|
void Image_UploadRaw(Image_t* image, uint8_t* data, bool paletteRebuild, uint8_t* palette, bool hasAlpha) {
|
||||||
if (image->ScratchBuffer == NULL && paletteRebuild) {
|
if (image->ScratchBuffer == NULL && paletteRebuild) {
|
||||||
image->ScratchBuffer = new uint8_t[image->width * image->height * 4];
|
image->ScratchBuffer = new uint8_t[image->width * image->height * 4];
|
||||||
|
|||||||
+137
@@ -0,0 +1,137 @@
|
|||||||
|
[Options]
|
||||||
|
ScrollFix=Yes
|
||||||
|
LimitCpuUsage=Yes
|
||||||
|
SlowerScrollrate=No
|
||||||
|
HardwareFills=No
|
||||||
|
VideoBackBuffer=Yes
|
||||||
|
Resolution=400
|
||||||
|
Width=1280
|
||||||
|
Height=720
|
||||||
|
ZoomLevel=6
|
||||||
|
ShowAllMusic=Yes
|
||||||
|
PlayEnglishIntro=Yes
|
||||||
|
VideoInterlaceMode=2
|
||||||
|
SkipScoreScreen=No
|
||||||
|
RandomStartingSong=No
|
||||||
|
GameLanguage=1
|
||||||
|
Show640x480BlackBars=false
|
||||||
|
MouseWheelScrolling=Yes
|
||||||
|
DisplayOriginalMultiplayerMaps=Yes
|
||||||
|
DisplayCounterstrikeMultiplayerMaps=Yes
|
||||||
|
DisplayAftermathMultiplayerMaps=Yes
|
||||||
|
UseSmallInfantry=No
|
||||||
|
NoCD=Yes
|
||||||
|
CounterstrikeEnabled=Yes
|
||||||
|
AftermathEnabled=Yes
|
||||||
|
ScoreVolume=0.5
|
||||||
|
GameSpeed=2
|
||||||
|
ScrollRate=5
|
||||||
|
Brightness=0.5
|
||||||
|
Volume=0.375
|
||||||
|
MultiplayerScoreVolume=0.5
|
||||||
|
Contrast=0.5
|
||||||
|
Color=0.5
|
||||||
|
Tint=0.5
|
||||||
|
AutoScroll=yes
|
||||||
|
IsScoreRepeat=no
|
||||||
|
IsScoreShuffle=no
|
||||||
|
PaletteScroll=yes
|
||||||
|
|
||||||
|
[MultiplayerDefaults]
|
||||||
|
Money=10000
|
||||||
|
ShroudRegrows=No
|
||||||
|
CaptureTheFlag=No
|
||||||
|
Crates=No
|
||||||
|
Bases=Yes
|
||||||
|
OreRegenerates=Yes
|
||||||
|
UnitCount=0
|
||||||
|
TechLevel=10
|
||||||
|
AIDifficulty=1
|
||||||
|
AIPlayers=1
|
||||||
|
|
||||||
|
[Intro]
|
||||||
|
PlayIntro=no
|
||||||
|
|
||||||
|
[WinHotkeys]
|
||||||
|
KeySellOf=0
|
||||||
|
KeySidebarToggle=36
|
||||||
|
KeyQuickSave=80
|
||||||
|
KeyQuickLoad=76
|
||||||
|
KeyDebug=73
|
||||||
|
KeyForceMove1=18
|
||||||
|
KeyForceMove2=18
|
||||||
|
KeyForceAttack1=17
|
||||||
|
KeyForceAttack2=17
|
||||||
|
KeySelect1=16
|
||||||
|
KeySelect2=16
|
||||||
|
KeyScatter=88
|
||||||
|
KeyStop=83
|
||||||
|
KeyGuard=71
|
||||||
|
KeyNext=78
|
||||||
|
KeyPrevious=77
|
||||||
|
KeyFormation=67
|
||||||
|
KeyHome1=36
|
||||||
|
KeyHome2=103
|
||||||
|
KeyBase=72
|
||||||
|
KeyResign=35
|
||||||
|
KeyAlliance=65
|
||||||
|
KeyBookmark1=86
|
||||||
|
KeyBookmark2=32
|
||||||
|
KeyBookmark3=82
|
||||||
|
KeyBookmark4=87
|
||||||
|
KeySelectView=69
|
||||||
|
KeyRepairToggle=84
|
||||||
|
KeyRepairOn=0
|
||||||
|
KeyRepairOff=0
|
||||||
|
KeySellToggle=90
|
||||||
|
KeySellOn=0
|
||||||
|
KeySellOff=0
|
||||||
|
KeyMapToggle=66
|
||||||
|
KeySidebarUp=68
|
||||||
|
KeySidebarDown=70
|
||||||
|
KeyOption1=27
|
||||||
|
KeyOption2=0
|
||||||
|
KeyScrollLeft=37
|
||||||
|
KeyScrollRight=39
|
||||||
|
KeyScrollUp=38
|
||||||
|
KeyScrollDown=40
|
||||||
|
KeyQueueMove1=81
|
||||||
|
KeyQueueMove2=81
|
||||||
|
KeyTeam1=49
|
||||||
|
KeyTeam2=50
|
||||||
|
KeyTeam3=51
|
||||||
|
KeyTeam4=52
|
||||||
|
KeyTeam5=53
|
||||||
|
KeyTeam6=54
|
||||||
|
KeyTeam7=55
|
||||||
|
KeyTeam8=56
|
||||||
|
KeyTeam9=57
|
||||||
|
KeyTeam10=48
|
||||||
|
|
||||||
|
[MultiPlayer]
|
||||||
|
PhoneIndex=-1
|
||||||
|
Color=0
|
||||||
|
Side=2
|
||||||
|
Handle=Red-Alert
|
||||||
|
|
||||||
|
[ConfigTool]
|
||||||
|
UseRAAspectRatio=No
|
||||||
|
ConfigToolTab=0
|
||||||
|
|
||||||
|
[Launcher]
|
||||||
|
ShowThreadingIssuesWarning=Yes
|
||||||
|
|
||||||
|
[SerialDefaults]
|
||||||
|
CallWaitStringIndex=3
|
||||||
|
InitStringIndex=0
|
||||||
|
DialMethod=T
|
||||||
|
Baud=-1
|
||||||
|
IRQ=-1
|
||||||
|
Port=0h
|
||||||
|
Compression=0
|
||||||
|
ErrorCorrection=0
|
||||||
|
HardwareFlowControl=1
|
||||||
|
|
||||||
|
[InitStrings]
|
||||||
|
000=ATZ
|
||||||
|
|
||||||
Reference in New Issue
Block a user