Browse Source

added a small fix for the hero creation menu

pull/18/head
aperturesecurity 8 years ago
parent
commit
a26c634e79
  1. 62
      Stub/SDL_FontCache.cpp
  2. 413
      Stub/init.cpp
  3. 11
      Stub/miniwin_sdl.h
  4. 439
      Stub/sdlrender.cpp

62
Stub/SDL_FontCache.cpp

@ -417,7 +417,7 @@ static FC_GlyphData* FC_MapFind(FC_Map* map, Uint32 codepoint)
struct FC_Font
{
#ifndef FC_USE_SDL_GPU
SDL_Renderer* renderer;
SDL_Renderer* Frenderer;
#endif
TTF_Font* ttf_source; // TTF_Font source of characters
@ -839,7 +839,7 @@ static void FC_Init(FC_Font* font)
return;
#ifndef FC_USE_SDL_GPU
font->renderer = NULL;
font->Frenderer = NULL;
#endif
font->ttf_source = NULL;
@ -894,7 +894,7 @@ static Uint8 FC_GrowGlyphCache(FC_Font* font)
#ifdef FC_USE_SDL_GPU
GPU_Image* new_level = GPU_CreateImage(font->height * 12, font->height * 12, GPU_FORMAT_RGBA);
#else
SDL_Texture* new_level = SDL_CreateTexture(font->renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, font->height * 12, font->height * 12);
SDL_Texture* new_level = SDL_CreateTexture(font->Frenderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, font->height * 12, font->height * 12);
#endif
if (new_level == NULL || !FC_SetGlyphCacheLevel(font, font->glyph_cache_count, new_level))
{
@ -922,11 +922,11 @@ Uint8 FC_UploadGlyphCache(FC_Font* font, int cache_level, SDL_Surface* data_surf
#else
SDL_Texture* new_level;
if (!fc_has_render_target_support)
new_level = SDL_CreateTextureFromSurface(font->renderer, data_surface);
new_level = SDL_CreateTextureFromSurface(font->Frenderer, data_surface);
else
{
// Must upload with render target enabled so we can put more glyphs on later
SDL_Renderer* renderer = font->renderer;
SDL_Renderer* Frenderer = font->Frenderer;
// Set filter mode for new texture
char old_filter_mode[16]; // Save it so we can change the hint value in the meantime
@ -937,7 +937,7 @@ Uint8 FC_UploadGlyphCache(FC_Font* font, int cache_level, SDL_Surface* data_surf
else
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "0");
new_level = SDL_CreateTexture(renderer, data_surface->format->format, SDL_TEXTUREACCESS_TARGET, data_surface->w, data_surface->h);
new_level = SDL_CreateTexture(Frenderer, data_surface->format->format, SDL_TEXTUREACCESS_TARGET, data_surface->w, data_surface->h);
SDL_SetTextureBlendMode(new_level, SDL_BLENDMODE_BLEND);
// Reset filter mode for the temp texture
@ -945,17 +945,17 @@ Uint8 FC_UploadGlyphCache(FC_Font* font, int cache_level, SDL_Surface* data_surf
{
Uint8 r, g, b, a;
SDL_Texture* temp = SDL_CreateTextureFromSurface(renderer, data_surface);
SDL_Texture* temp = SDL_CreateTextureFromSurface(Frenderer, data_surface);
SDL_SetTextureBlendMode(temp, SDL_BLENDMODE_NONE);
SDL_SetRenderTarget(renderer, new_level);
SDL_SetRenderTarget(Frenderer, new_level);
SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a);
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
SDL_RenderClear(renderer);
SDL_SetRenderDrawColor(renderer, r, g, b, a);
SDL_GetRenderDrawColor(Frenderer, &r, &g, &b, &a);
SDL_SetRenderDrawColor(Frenderer, 0, 0, 0, 0);
SDL_RenderClear(Frenderer);
SDL_SetRenderDrawColor(Frenderer, r, g, b, a);
SDL_RenderCopy(renderer, temp, NULL, NULL);
SDL_SetRenderTarget(renderer, NULL);
SDL_RenderCopy(Frenderer, temp, NULL, NULL);
SDL_SetRenderTarget(Frenderer, NULL);
SDL_DestroyTexture(temp);
}
@ -1074,13 +1074,13 @@ FC_Font* FC_CreateFont(void)
#ifdef FC_USE_SDL_GPU
Uint8 FC_LoadFontFromTTF(FC_Font* font, TTF_Font* ttf, SDL_Color color)
#else
Uint8 FC_LoadFontFromTTF(FC_Font* font, SDL_Renderer* renderer, TTF_Font* ttf, SDL_Color color)
Uint8 FC_LoadFontFromTTF(FC_Font* font, SDL_Renderer* Frenderer, TTF_Font* ttf, SDL_Color color)
#endif
{
if (font == NULL || ttf == NULL)
return 0;
#ifndef FC_USE_SDL_GPU
if (renderer == NULL)
if (Frenderer == NULL)
return 0;
#endif
@ -1092,10 +1092,10 @@ Uint8 FC_LoadFontFromTTF(FC_Font* font, SDL_Renderer* renderer, TTF_Font* ttf, S
fc_has_render_target_support = GPU_IsFeatureEnabled(GPU_FEATURE_RENDER_TARGETS);
#else
SDL_RendererInfo info;
SDL_GetRendererInfo(renderer, &info);
SDL_GetRendererInfo(Frenderer, &info);
fc_has_render_target_support = (info.flags & SDL_RENDERER_TARGETTEXTURE);
font->renderer = renderer;
font->Frenderer = Frenderer;
#endif
font->ttf_source = ttf;
@ -1196,7 +1196,7 @@ Uint8 FC_LoadFontFromTTF(FC_Font* font, SDL_Renderer* renderer, TTF_Font* ttf, S
#ifdef FC_USE_SDL_GPU
Uint8 FC_LoadFont(FC_Font* font, const char* filename_ttf, Uint32 pointSize, SDL_Color color, int style)
#else
Uint8 FC_LoadFont(FC_Font* font, FC_Target* renderer, const char* filename_ttf, Uint32 pointSize, SDL_Color color, int style)
Uint8 FC_LoadFont(FC_Font* font, FC_Target* Frenderer, const char* filename_ttf, Uint32 pointSize, SDL_Color color, int style)
#endif
{
SDL_RWops* rwops;
@ -1215,14 +1215,14 @@ Uint8 FC_LoadFont(FC_Font* font, FC_Target* renderer, const char* filename_ttf,
#ifdef FC_USE_SDL_GPU
return FC_LoadFont_RW(font, rwops, 1, pointSize, color, style);
#else
return FC_LoadFont_RW(font, renderer, rwops, 1, pointSize, color, style);
return FC_LoadFont_RW(font, Frenderer, rwops, 1, pointSize, color, style);
#endif
}
#ifdef FC_USE_SDL_GPU
Uint8 FC_LoadFont_RW(FC_Font* font, SDL_RWops* file_rwops_ttf, Uint8 own_rwops, Uint32 pointSize, SDL_Color color, int style)
#else
Uint8 FC_LoadFont_RW(FC_Font* font, FC_Target* renderer, SDL_RWops* file_rwops_ttf, Uint8 own_rwops, Uint32 pointSize, SDL_Color color, int style)
Uint8 FC_LoadFont_RW(FC_Font* font, FC_Target* Frenderer, SDL_RWops* file_rwops_ttf, Uint8 own_rwops, Uint32 pointSize, SDL_Color color, int style)
#endif
{
Uint8 result;
@ -1261,7 +1261,7 @@ Uint8 FC_LoadFont_RW(FC_Font* font, FC_Target* renderer, SDL_RWops* file_rwops_t
#ifdef FC_USE_SDL_GPU
result = FC_LoadFontFromTTF(font, ttf, color);
#else
result = FC_LoadFontFromTTF(font, renderer, ttf, color);
result = FC_LoadFontFromTTF(font, Frenderer, ttf, color);
#endif
// Can only load new (uncached) glyphs if we can keep the SDL_RWops open.
@ -1371,29 +1371,29 @@ Uint8 FC_AddGlyphToCache(FC_Font* font, SDL_Surface* glyph_surface)
}
#else
{
SDL_Renderer* renderer = font->renderer;
SDL_Renderer* Frenderer = font->Frenderer;
Uint8 use_clip;
FC_Rect clip_rect;
SDL_Texture* img;
SDL_Rect destrect;
use_clip = has_clip(renderer);
use_clip = has_clip(Frenderer);
if (use_clip)
{
clip_rect = get_clip(renderer);
set_clip(renderer, NULL);
clip_rect = get_clip(Frenderer);
set_clip(Frenderer, NULL);
}
img = SDL_CreateTextureFromSurface(renderer, glyph_surface);
img = SDL_CreateTextureFromSurface(Frenderer, glyph_surface);
destrect = font->last_glyph.rect;
SDL_SetRenderTarget(renderer, dest);
SDL_RenderCopy(renderer, img, NULL, &destrect);
SDL_SetRenderTarget(renderer, NULL);
SDL_SetRenderTarget(Frenderer, dest);
SDL_RenderCopy(Frenderer, img, NULL, &destrect);
SDL_SetRenderTarget(Frenderer, NULL);
SDL_DestroyTexture(img);
if (use_clip)
set_clip(renderer, &clip_rect);
set_clip(Frenderer, &clip_rect);
}
#endif

413
Stub/init.cpp

@ -96,15 +96,12 @@ void __cdecl init_get_file_info()
strcpy(gszProductName, "devil-test");
}
void LoadCharNamesintoMemory(int start, int end)
{
PkPlayerStruct pkplr;
int unused;
void *CharFile;
char *p_hero_names = *hero_names;// Not sure if this is correct
char *p_hero_names = *hero_names; // Not sure if this is correct
memset(hero_names, 0, 0x140u);
@ -125,21 +122,18 @@ void LoadCharNamesintoMemory(int start, int end)
// memcpy(shero_names, hero_names, sizeof(hero_names));
}
void HideCursor()
{
Uint8 l_data[1];
Uint8 l_mask[1];
Uint8 l_data[1];
Uint8 l_mask[1];
l_data[0] = 0;
l_mask[0] = 0;
l_data[0] = 0;
l_mask[0] = 0;
SDL_Cursor * g_cursor = SDL_CreateCursor(l_data, l_mask, 1, 1, 0, 0);
SDL_SetCursor(g_cursor);
SDL_Cursor *g_cursor = SDL_CreateCursor(l_data, l_mask, 1, 1, 0, 0);
SDL_SetCursor(g_cursor);
}
void SDL_Diablo_UI() // I anticipate to move this later.
{
snd_init(0);
@ -154,187 +148,258 @@ void SDL_Diablo_UI() // I anticipate to move this later.
int CharsLoaded = 0;
/* Comment out these functions */
printf("Main Menu Init\n");
//SDL_ShowCursor(SDL_DISABLE);//Doesn't really work... Use HideCursor() instead.
// SDL_ShowCursor(SDL_DISABLE);//Doesn't really work... Use HideCursor() instead.
SdlDiabloMainWindow();
SDLCreateDiabloCursor();
HideCursor();
while (1 && quit == false) {
while (1 && quit == false) {
if (menu == 0) {
if (menu == 0) {
CreateMainDiabloMenu();
SDL_RenderDiabloMainPage();
// printf("I am 0\n");
CreateMainDiabloMenu();
SDL_RenderDiabloMainPage();
// printf("I am 0\n");
}
if (menu == 2) {
if (CharsLoaded == 0) {
LoadCharNamesintoMemory(0, 10);
CharsLoaded = 1;
}
if (menu == 2) {
RenderCharNames();
SDL_RenderDiabloSinglePlayerPage();
gbMaxPlayers = 1;
}
if (CharsLoaded == 0) {
LoadCharNamesintoMemory(0, 10);
CharsLoaded = 1;
}
if (menu == 3) {
RenderCharNames();
SDL_RenderDiabloSinglePlayerPage();
gbMaxPlayers = 1;
}
CreateMenuDialogBox();
}
if (SDL_PollEvent(&event)) {
if (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
if (event.type == SDL_QUIT) {
quit = true;
SDL_Quit();
quit = true;
SDL_Quit();
// goto LABEL_16;
}
}
if (event.type == SDL_MOUSEMOTION) {
// Get the mouse offsets
x = event.motion.x;
y = event.motion.y;
}
if (event.type == SDL_MOUSEMOTION) {
// Get the mouse offsets
x = event.motion.x;
y = event.motion.y;
}
// If a key was pressed
if (event.type == SDL_MOUSEBUTTONDOWN) {
if (event.button.button == SDL_BUTTON_LEFT) {
x = event.button.x;
y = event.button.y;
printf("X %d , Y %d\n", x, y);
// If a key was pressed
if (event.type == SDL_MOUSEBUTTONDOWN) {
if (event.button.button == SDL_BUTTON_LEFT) {
x = event.button.x;
y = event.button.y;
printf("X %d , Y %d\n", x, y);
if (menu == 0) {
if ((x > SinglePlrBox.x) && (y > SinglePlrBox.y) && (x < SinglePlrBox.w) &&
(y < SinglePlrBox.h)) { // Single clicked
printf("SinglePlayer Diablo\n");
// effects_play_sound("Sfx\\Items\\Titlslct.wav");
// a2 = 2;
menu = 2;
}
if ((x > MultiPlrBox.x) && (y > MultiPlrBox.y) && (x < MultiPlrBox.w) &&
(y < MultiPlrBox.h)) { // MultiBox clicked
printf("MultiPlayer Diablo\n");
// effects_play_sound("Sfx\\Items\\Titlslct.wav");
// v1 = mainmenu_multi_player();
// goto LABEL_15;
}
if ((x > ReplayIntroBox.x) && (y > ReplayIntroBox.y) && (x < ReplayIntroBox.w) &&
(y < ReplayIntroBox.h)) { // Reply Intro clicked
printf("Replay Intro\n");
// effects_play_sound("Sfx\\Items\\Titlslct.wav");
// goto LABEL_10;
}
if ((x > ShowCreditsBox.x) && (y > ShowCreditsBox.y) && (x < ShowCreditsBox.w) &&
(y < ShowCreditsBox.h)) { // ShowCredits clicked
printf("Show Credits\n");
// effects_play_sound("Sfx\\Items\\Titlslct.wav");
UiCreditsDialog(16);
}
if ((x > ExitBox.x) && (y > ExitBox.y) && (x < ExitBox.w) &&
(y < ExitBox.h)) { // ExitBox clicked
printf("Exiting Diablo\n");
// effects_play_sound("Sfx\\Items\\Titlslct.wav");
quit = true;
SDL_Quit();
exit(0);
//goto LABEL_16;
}
} // End of this Menu0
else if (menu == 2) {
// int x = 364;
// int y = 240;
int ClickListStart = 250;
int sizeOfBox = 30;
int WidthOfBox = 400;
int ClickListEnd = 343;
// Render Clicks
if (TotalPlayers >= 1 && (x > ClickListStart) && (y > ClickListStart) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + sizeOfBox)) { // MultiBox clicked
printf("Player %s\n", hero_names[0]);
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[0]);
printf("Player %s\n", chr_name_str);
break;
}
if (TotalPlayers >= 2 && (x > ClickListStart) && (y > ClickListStart + (sizeOfBox)) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + (sizeOfBox) + sizeOfBox)) { // MultiBox clicked
printf("Player 2 Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[1]);
printf("Player %s\n", chr_name_str);
//XStartGame();
break;
}
if (TotalPlayers >= 3 && (x > ClickListStart) && (y > ClickListStart + (sizeOfBox * 2)) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + (sizeOfBox * 2) + sizeOfBox)) { // MultiBox clicked
printf("Player 3 Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[2]);
printf("Player %s\n", chr_name_str);
break;
//XStartGame();
}
if (TotalPlayers >= 4 && (x > ClickListStart) && (y > ClickListStart + (sizeOfBox * 3)) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + (sizeOfBox * 3) + sizeOfBox)) { // MultiBox clicked
printf("Player 4 Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[3]);
printf("Player %s\n", chr_name_str);
break;
//XStartGame();
}
if (TotalPlayers >= 5 && (x > ClickListStart) && (y > ClickListStart + (sizeOfBox * 4)) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + (sizeOfBox * 4) + sizeOfBox)) { // MultiBox clicked
printf("Player 5 Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[4]);
printf("Player %s\n", chr_name_str);
break;
//XStartGame();
}
if (TotalPlayers >= 6 && (x > ClickListStart) && (y > ClickListStart + (sizeOfBox * 5)) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + (sizeOfBox * 5) + sizeOfBox)) { // MultiBox clicked
printf("Player 6 Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[5]);
printf("Player %s\n", chr_name_str);
break;
//XStartGame();
}
if ((x > SinglePlayerMenuCancelBox.x) && (y > SinglePlayerMenuCancelBox.y) &&
(x < SinglePlayerMenuCancelBox.w) &&
(y < SinglePlayerMenuCancelBox.h)) { // ExitBox clicked
printf("CancelBox Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
// quit = true;
// goto LABEL_16;
menu = 0;
}
if (menu == 0) {
if ((x > SinglePlrBox.x) && (y > SinglePlrBox.y) && (x < SinglePlrBox.w) &&
(y < SinglePlrBox.h)) { // Single clicked
printf("SinglePlayer Diablo\n");
// effects_play_sound("Sfx\\Items\\Titlslct.wav");
// a2 = 2;
menu = 2;
}
if ((x > MultiPlrBox.x) && (y > MultiPlrBox.y) && (x < MultiPlrBox.w) &&
(y < MultiPlrBox.h)) { // MultiBox clicked
printf("MultiPlayer Diablo\n");
// effects_play_sound("Sfx\\Items\\Titlslct.wav");
// v1 = mainmenu_multi_player();
// goto LABEL_15;
}
if ((x > ReplayIntroBox.x) && (y > ReplayIntroBox.y) && (x < ReplayIntroBox.w) &&
(y < ReplayIntroBox.h)) { // Reply Intro clicked
printf("Replay Intro\n");
// effects_play_sound("Sfx\\Items\\Titlslct.wav");
// goto LABEL_10;
}
if ((x > ShowCreditsBox.x) && (y > ShowCreditsBox.y) && (x < ShowCreditsBox.w) &&
(y < ShowCreditsBox.h)) { // ShowCredits clicked
printf("Show Credits\n");
// effects_play_sound("Sfx\\Items\\Titlslct.wav");
UiCreditsDialog(16);
}
if ((x > ExitBox.x) && (y > ExitBox.y) && (x < ExitBox.w) &&
(y < ExitBox.h)) { // ExitBox clicked
printf("Exiting Diablo\n");
// effects_play_sound("Sfx\\Items\\Titlslct.wav");
quit = true;
SDL_Quit();
exit(0);
// goto LABEL_16;
}
} // End of this Menu0
if (menu == 2) {
// int x = 364;
// int y = 240;
int ClickListStart = 250;
int sizeOfBox = 30;
int WidthOfBox = 400;
int ClickListEnd = 343;
// Render Clicks
if (TotalPlayers >= 1 && (x > ClickListStart) && (y > ClickListStart) &&
(x < ClickListStart + WidthOfBox) && (y < ClickListStart + sizeOfBox)) { // MultiBox clicked
printf("Player %s\n", hero_names[0]);
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[0]);
printf("Player %s\n", chr_name_str);
break;
}
if (TotalPlayers >= 2 && (x > ClickListStart) && (y > ClickListStart + (sizeOfBox)) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + (sizeOfBox) + sizeOfBox)) { // MultiBox clicked
printf("Player 2 Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[1]);
printf("Player %s\n", chr_name_str);
// XStartGame();
break;
}
if (TotalPlayers >= 3 && (x > ClickListStart) && (y > ClickListStart + (sizeOfBox * 2)) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + (sizeOfBox * 2) + sizeOfBox)) { // MultiBox clicked
printf("Player 3 Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[2]);
printf("Player %s\n", chr_name_str);
break;
// XStartGame();
}
if (TotalPlayers >= 4 && (x > ClickListStart) && (y > ClickListStart + (sizeOfBox * 3)) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + (sizeOfBox * 3) + sizeOfBox)) { // MultiBox clicked
printf("Player 4 Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[3]);
printf("Player %s\n", chr_name_str);
break;
// XStartGame();
}
if (TotalPlayers >= 5 && (x > ClickListStart) && (y > ClickListStart + (sizeOfBox * 4)) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + (sizeOfBox * 4) + sizeOfBox)) { // MultiBox clicked
printf("Player 5 Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[4]);
printf("Player %s\n", chr_name_str);
break;
// XStartGame();
}
if (TotalPlayers >= 6 && (x > ClickListStart) && (y > ClickListStart + (sizeOfBox * 5)) &&
(x < ClickListStart + WidthOfBox) &&
(y < ClickListStart + (sizeOfBox * 5) + sizeOfBox)) { // MultiBox clicked
printf("Player 6 Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
strcpy(chr_name_str, hero_names[5]);
printf("Player %s\n", chr_name_str);
break;
// XStartGame();
}
if ((x > SinglePlayerMenuCancelBox.x) && (y > SinglePlayerMenuCancelBox.y) &&
(x < SinglePlayerMenuCancelBox.w) && (y < SinglePlayerMenuCancelBox.h)) { // ExitBox clicked
printf("CancelBox Diablo\n");
effects_play_sound("Sfx\\Items\\Titlslct.wav");
// quit = true;
// goto LABEL_16;
menu = 0;
}
if ((x > CreateHeroBox.x) && (y > CreateHeroBox.y) && (x < CreateHeroBox.w) &&
(y < CreateHeroBox.h)) {
printf("Clicked Create Hero Box\n");
menu = 3;
}
}
if (menu == 3) {
// SinglePlayerMenuItemsLoaded = 0;
printf("menu X%d Y%d", x, y);
int WarriorSelectBoxY = 379;
int WarriorSelectBoxW = 100;
int WarriorSelectBoxS = 100;
int RogueSelectBoxX = 360;
int RogueSelectBoxY = 345;
int SorcerorSelectBoxX = 383;
int SorcerorSelectBoxY = 365;
int CreateHeroOkBoxX = 330;
int CreateHeroOkBoxY = 441;
int CreateHeroCanBBoxX = 445;
int CreateHeroCanBBoxY = 473;
SDL_Rect WarriorSelectBox;
WarriorSelectBox.y = 280;
WarriorSelectBox.x = 375;
WarriorSelectBox.w = WarriorSelectBox.x + 100;
WarriorSelectBox.h = WarriorSelectBox.y + 30;
SDL_Rect RogueSelectBox;
RogueSelectBox.y = 320;
RogueSelectBox.x = 400;
RogueSelectBox.w = RogueSelectBox.x + 100;
RogueSelectBox.h = RogueSelectBox.y + 30;
SDL_Rect SorcerorSelectBox;
SorcerorSelectBox.y = 360;
SorcerorSelectBox.x = 380;
SorcerorSelectBox.w = SorcerorSelectBox.x + 100;
SorcerorSelectBox.h = SorcerorSelectBox.y + 30;
// 397 323
if ((x > WarriorSelectBox.x) && (y > WarriorSelectBox.y) && (x < WarriorSelectBox.w) &&
(y < WarriorSelectBox.h)) {
printf("I was hit\n\n\n");
WarriorCreateSelected = 1;
RogueCreateSelected = 0;
SorcerorCreateSelected = 0;
}
if ((x > RogueSelectBox.x) && (y > RogueSelectBox.y) && (x < RogueSelectBox.w) &&
(y < RogueSelectBox.h)) {
printf("I was hit\n\n\n");
WarriorCreateSelected = 0;
RogueCreateSelected = 1;
SorcerorCreateSelected = 0;
}
if ((x > SorcerorSelectBox.x) && (y > SorcerorSelectBox.y) && (x < SorcerorSelectBox.w) &&
(y < SorcerorSelectBox.h)) {
printf("I was hit\n\n\n");
WarriorCreateSelected = 0;
RogueCreateSelected = 0;
SorcerorCreateSelected = 1;
}
// SorcerorCreateSelected;
// WarriorCreateSelected;
// RogueCreateSelected;
}
}
}
}
}
}

11
Stub/miniwin_sdl.h

@ -28,7 +28,9 @@ extern SDL_Texture *texture;
//My SDL inclusions //
extern bool SorcerorCreateSelected;
extern bool WarriorCreateSelected;
extern bool RogueCreateSelected;
extern int totalFrames;
@ -52,10 +54,13 @@ extern SDL_Rect ReplayIntroBox;
extern SDL_Rect ShowCreditsBox;
extern SDL_Rect ExitBox;
//Menu2 // Single player menu rects
extern SDL_Rect SinglePlayerMenuCancelBox;
//Menu2 // Single player menu rects
extern SDL_Rect SinglePlayerMenuCancelBox;
extern SDL_Rect CreateHeroBox;
void CreateMenuDialogBox();
void CreateDiabloMainMenuz();
void SdlDiabloMainWindow();
void SDL_RenderDiabloMainPage();

439
Stub/sdlrender.cpp

@ -1,12 +1,11 @@
#include "../types.h"
#include "stubs.h"
#include "miniwin_sdl.h"
#include "stubs.h"
#include "SDL_FontCache.h"
#include <SDL2/SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
#include "SDL_FontCache.h"
int SCREEN_WIDTH = 640;
int SCREEN_HEIGHT = 480;
@ -14,61 +13,58 @@ int SCREEN_HEIGHT = 480;
int LogoWidth;
int LogoHeight;
SDL_Texture *DiablologoAnimT;
FC_Font* font;
FC_Font *font;
SDL_Rect textureRect;
SDL_Rect windowRect;
SDL_Rect CusorLocation;
SDL_Rect SinglePlrBox;
SDL_Rect MultiPlrBox;
SDL_Rect ReplayIntroBox;
SDL_Rect ShowCreditsBox;
SDL_Rect ExitBox;
SDL_Rect SinglePlayerMenuCancelBox;
SDL_Rect SinglePlrBox;
SDL_Rect MultiPlrBox;
SDL_Rect ReplayIntroBox;
SDL_Rect ShowCreditsBox;
SDL_Rect ExitBox;
SDL_Surface* DiabloTitle;
SDL_Surface *DiabloTitle;
SDL_Event input;
SDL_Texture * CursorTexture;
SDL_Texture *CursorTexture;
bool SinglePlayerMenuItemsLoaded = 0;
bool DiabloImageLoaded = 0;
bool DiabloMainMenuListLoaded = 0;
SDL_Texture * MenuSelectNewHeroTexture;
SDL_Texture *MenuSelectNewHeroTexture;
SDL_Rect SinglePlayerMenuCancelBox;
struct timespec ts;
// DiabloMenu Items
SDL_Surface *MainMenuItemsSurface;
SDL_Texture *MainMenuItemsTexture;
SDL_Rect MainMenuItemsWRect;
SDL_Rect MainMenuItemsTRect;
SDL_Rect CreateHeroBox;
//DiabloMenu Items
SDL_Surface* MainMenuItemsSurface;
SDL_Texture* MainMenuItemsTexture;
SDL_Rect MainMenuItemsWRect;
SDL_Rect MainMenuItemsTRect;
char gLDirectory[FILENAME_MAX];
void GetWorkingLocationOfFile(char *RelativeFile)
{
GetCurrentDir(gLDirectory, FILENAME_MAX);
strcat(gLDirectory, RelativeFile);
}
uint32_t XgetTick() {
//struct timespec ts;
uint32_t XgetTick()
{
// struct timespec ts;
unsigned theTick = 0U;
printf("This is supposed to replace GitTicks()");
// if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
//error
// }
// if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
// error
// }
return theTick;
}
void SDLCreateDiabloCursor() {
void SDLCreateDiabloCursor()
{
int x, y;
SDL_GetMouseState(&x, &y);
@ -77,167 +73,107 @@ void SDLCreateDiabloCursor() {
CusorLocation.h = 29;
CusorLocation.w = 33;
char LDirectory[FILENAME_MAX];
GetCurrentDir(LDirectory, FILENAME_MAX);
char * filename = "/Xresources/cursor.png";
strcat(LDirectory, filename);
SDL_Surface * CursorImg = IMG_Load(LDirectory);
GetWorkingLocationOfFile("/Xresources/cursor.png");
SDL_Surface *CursorImg = IMG_Load(gLDirectory);
CursorTexture = SDL_CreateTextureFromSurface(renderer, CursorImg);
SDL_UpdateWindowSurface(window);
}
void SDL_MAGICAL_RENDER(int x, int y, int w, int h)
{
void SDL_MAGICAL_RENDER(int x, int y, int w, int h) {
printf("SDL_MAGICAL RENDER I Am Not Implemented\n");
printf("SDL_MAGICAL RENDER I Am Not Implemented\n");
// if (window != 0) {
// int depth = 12;
// SDL_Surface * image = SDL_CreateRGBSurfaceFrom(destmemarea, SCREEN_WIDTH / 2, SCREEN_HEIGHT, depth, SCREEN_WIDTH, 0, 0, 0, 0);
// SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, image);
// SDL_Surface * image = SDL_CreateRGBSurfaceFrom(destmemarea, SCREEN_WIDTH / 2, SCREEN_HEIGHT, depth,
// SCREEN_WIDTH, 0, 0, 0, 0); SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, image);
// SDL_RenderCopy(renderer, texture, NULL, NULL);
// SDL_RenderPresent(renderer);
// SDL_UpdateWindowSurface(window);
// }
}
void SdlDiabloMainWindow() {
void SdlDiabloMainWindow()
{
SDL_Init(SDL_INIT_EVERYTHING);
IMG_Init(IMG_INIT_PNG);
window = SDL_CreateWindow("Diablo", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN);
window = SDL_CreateWindow("Diablo", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT,
SDL_WINDOW_SHOWN);
renderer = SDL_CreateRenderer(window, -1, 0);
printf("Window And Renderer Created!\n");
}
char *GetWorkingDirectory() {
char *buff= "wo work";
//printf("Current working dir: ");
return buff;
}
void LoadDiabloMenuLogoImage() {
void LoadDiabloMenuLogoImage()
{
int LogoWidth;
int LogoHeight;
char LDirectory[FILENAME_MAX];
GetCurrentDir(LDirectory, FILENAME_MAX);
char * filename = "/Xresources/Diablo_Logo.png";
strcat(LDirectory, filename);
//spriteSheet = NULL;
DiabloTitle = IMG_Load(LDirectory);
GetWorkingLocationOfFile("/Xresources/Diablo_Logo.png");
DiabloTitle = IMG_Load(gLDirectory);
DiablologoAnimT = SDL_CreateTextureFromSurface(renderer, DiabloTitle);
//SDL_QueryTexture() method gets the width and height of the texture
//Now, LogoWidth and Logo Height are filled
//with respective dimensions of the image/texture
// SDL_QueryTexture() method gets the width and height of the texture
// Now, LogoWidth and Logo Height are filled
// with respective dimensions of the image/texture
SDL_QueryTexture(DiablologoAnimT, NULL, NULL, &LogoWidth, &LogoHeight);
SDL_FreeSurface(DiabloTitle);
}
void DiabloMainMenuItemsLoaded()
{
void DiabloMainMenuItemsLoaded() {
char LRDirectory[FILENAME_MAX];
GetCurrentDir(LRDirectory, FILENAME_MAX);
char * Lfilename = "/Xresources/DiabloMainMenu.png";
strcat(LRDirectory, Lfilename);
SDL_Surface* MainMenuItemsSurface = IMG_Load(LRDirectory);
GetWorkingLocationOfFile("/Xresources/DiabloMainMenu.png");
SDL_Surface *MainMenuItemsSurface = IMG_Load(gLDirectory);
MainMenuItemsTexture = SDL_CreateTextureFromSurface(renderer, MainMenuItemsSurface);
}
void CreateMainDiabloMenu(){
void CreateMainDiabloMenu()
{
int totalFrames = 4;
//'windowRect' defines the dimensions of the rendering sprite on window
//SDL_Rect windowRect;
windowRect.x = 120;// 140 ///(SCREEN_WIDTH - LogoWidth / totalFrames) / 2;
// SDL_Rect windowRect;
windowRect.x = 120; // 140 ///(SCREEN_WIDTH - LogoWidth / totalFrames) / 2;
windowRect.y = 0;
windowRect.w = 450;//320
windowRect.w = 450; // 320
windowRect.h = 150;
//'textureRect' defines the dimensions of the rendering sprite on texture
//SDL_Rect textureRect;
// SDL_Rect textureRect;
textureRect.x = 0;
textureRect.y = 0;
textureRect.w = 868;
textureRect.h = 150;
if (DiabloImageLoaded == 0) {
LoadDiabloMenuLogoImage();
DiabloImageLoaded = 1;
}
// font = FC_CreateFont();
// FC_LoadFont(font, renderer, "C:/Users/Krash/Desktop/devilutionX/fonts/Exocet.ttf", 40, FC_MakeColor(112, 106, 70, 255), TTF_STYLE_NORMAL);
// font = FC_CreateFont();
// FC_LoadFont(font, renderer, "C:/Users/Krash/Desktop/devilutionX/fonts/Exocet.ttf", 40, FC_MakeColor(112, 106,
// 70, 255), TTF_STYLE_NORMAL);
//get the width of a frame by dividing with 4
// get the width of a frame by dividing with 4
textureRect.w /= totalFrames;
//Height for each frame is the same as for the whole sheet/texture
// Height for each frame is the same as for the whole sheet/texture
// Load The Main Menu List Single Player, Multi Player, foo , bar , exit Diablo
int MainMenuItemsW;
int MainMenuItemsH;
if (DiabloMainMenuListLoaded == 0) {
DiabloMainMenuItemsLoaded();
DiabloMainMenuListLoaded = 1;
}
MainMenuItemsWRect.x = 0;
MainMenuItemsWRect.y = 0;
MainMenuItemsWRect.w = 470;
@ -249,29 +185,27 @@ void CreateMainDiabloMenu(){
MainMenuItemsTRect.h = 250;
SDL_QueryTexture(MainMenuItemsTexture, NULL, NULL, &MainMenuItemsW, &MainMenuItemsH);
}
void RenderDiabloLogo() {
void RenderDiabloLogo()
{
int totalFrames = 4;
int delayPerFrame = 100;
int frame = (SDL_GetTicks() / delayPerFrame) % totalFrames;
int frame = (SDL_GetTicks() / delayPerFrame) % totalFrames;
textureRect.x = frame * textureRect.w;
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
int column = (SCREEN_WIDTH / 4);
//SDL_RenderCopy(renderer, MainMenuItemsTexture, &MainMenuItemsWRect, &MainMenuItemsTRect);
// SDL_RenderCopy(renderer, MainMenuItemsTexture, &MainMenuItemsWRect, &MainMenuItemsTRect);
}
int FontLoaded = 0;
FC_Font* Subfont = FC_CreateFont();
FC_Font *Subfont = FC_CreateFont();
void SDL_RenderDiabloMainPage() {
void SDL_RenderDiabloMainPage()
{
SDL_RenderClear(renderer);
SinglePlrBox.x = 169;
@ -279,36 +213,28 @@ void SDL_RenderDiabloMainPage() {
SinglePlrBox.w = 491;
SinglePlrBox.h = 193;
MultiPlrBox.x = 166;
MultiPlrBox.y = 216;
MultiPlrBox.w = 484;
MultiPlrBox.h = 240;
ReplayIntroBox.x = 171;
ReplayIntroBox.y = 264;
ReplayIntroBox.w = 483;
ReplayIntroBox.h = 291;
ShowCreditsBox.x = 161;
ShowCreditsBox.y = 310;
ShowCreditsBox.w = 487;
ShowCreditsBox.h = 348;
ExitBox.x = 187;
ExitBox.y = 363;
ExitBox.w = 460;
ExitBox.h = 399;
RenderDiabloLogo();
int cx, cy;
SDL_GetMouseState(&cx, &cy);
@ -317,66 +243,47 @@ void SDL_RenderDiabloMainPage() {
CusorLocation.h = 29;
CusorLocation.w = 33;
SDL_RenderCopy(renderer, DiablologoAnimT, &textureRect, &windowRect);
SDL_RenderCopy(renderer, MainMenuItemsTexture, &MainMenuItemsWRect, &MainMenuItemsTRect);
SDL_RenderCopy(renderer, CursorTexture, NULL, &CusorLocation);
char LDirectory[FILENAME_MAX];
GetCurrentDir(LDirectory, FILENAME_MAX);
char * filename = "/fonts/Exocet.ttf";
char *filename = "/fonts/Exocet.ttf";
strcat(LDirectory, filename);
if (FontLoaded == 0) {
if (FontLoaded == 0){
FC_LoadFont(Subfont, renderer, LDirectory, 12, FC_MakeColor(112, 106, 70, 255), TTF_STYLE_NORMAL);
FC_LoadFont(Subfont, renderer, LDirectory, 12, FC_MakeColor(112, 106, 70, 255), TTF_STYLE_NORMAL);
printf("LoadFont\n\n");
FontLoaded = 1;
printf("LoadFont\n\n");
FontLoaded = 1;
}
FC_Draw(Subfont, renderer, 10, SCREEN_HEIGHT - 40, "DedicaTed To David Brevik, Erich Schaefer, Max Schaefer, MaTT Uelman and");
FC_Draw(Subfont, renderer, 10, SCREEN_HEIGHT - 40,
"DedicaTed To David Brevik, Erich Schaefer, Max Schaefer, MaTT Uelman and");
FC_Draw(Subfont, renderer, 10, SCREEN_HEIGHT - 25, "The Blizzard North Team ThaT Gave Us A Childhood.");
SDL_RenderPresent(renderer);
}
void CreateNewHeroClickBox() {}
void LoadSinglePlayerMenuItems()
{
void LoadSinglePlayerMenuItems() {
CreateNewHeroClickBox();
char LZDirectory[FILENAME_MAX];
GetCurrentDir(LZDirectory, FILENAME_MAX);
char * filename = "/Xresources/MenuSelectNewHero.png";
strcat(LZDirectory, filename);
SDL_Surface * MenuSelectNewHeroSurface = IMG_Load(LZDirectory);
GetWorkingLocationOfFile("/Xresources/MenuSelectNewHero.png");
SDL_Surface *MenuSelectNewHeroSurface = IMG_Load(gLDirectory);
MenuSelectNewHeroTexture = SDL_CreateTextureFromSurface(renderer, MenuSelectNewHeroSurface);
SinglePlayerMenuItemsLoaded = 1;
}
void SDL_RenderDiabloSinglePlayerPage() {
void SDL_RenderDiabloSinglePlayerPage()
{
RenderDiabloLogo();
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
int cx, cy;
SDL_GetMouseState(&cx, &cy);
@ -385,70 +292,61 @@ void SDL_RenderDiabloSinglePlayerPage() {
CusorLocation.h = 29;
CusorLocation.w = 33;
if (SinglePlayerMenuItemsLoaded == 0)
{
LoadSinglePlayerMenuItems();
if (SinglePlayerMenuItemsLoaded == 0) {
LoadSinglePlayerMenuItems();
}
SinglePlayerMenuCancelBox.x = 520;
SinglePlayerMenuCancelBox.y = 454;
SinglePlayerMenuCancelBox.w = 640;
SinglePlayerMenuCancelBox.h = 480;
/*
X 520 , Y 454
X 615 , Y 471
*/
SinglePlayerMenuCancelBox.x = 520;
SinglePlayerMenuCancelBox.y = 454;
SinglePlayerMenuCancelBox.w = 640;
SinglePlayerMenuCancelBox.h = 480;
CreateHeroBox.x = 55;
CreateHeroBox.y = 444;
CreateHeroBox.w = 163;
CreateHeroBox.h = 476;
int MenuSelectNewHeroW = 907;
int MenuSelectNewHeroH = 469;
//W 907 H 469
int MenuSelectNewHeroW = 907;
int MenuSelectNewHeroH = 469;
// W 907 H 469
SDL_Rect MenuSelectNewHeroWRect;
MenuSelectNewHeroWRect.x = 0;
MenuSelectNewHeroWRect.y = 140;
MenuSelectNewHeroWRect.w = 640;
MenuSelectNewHeroWRect.h = 350;
SDL_Rect MenuSelectNewHeroTRect;
MenuSelectNewHeroTRect.x = 0;
MenuSelectNewHeroTRect.y = 0;
MenuSelectNewHeroTRect.w = 907;
MenuSelectNewHeroTRect.h = 500;
//SDL_QueryTexture(MenuSelectNewHeroTexture, NULL, NULL, &MenuSelectNewHeroW, &MenuSelectNewHeroH);
// printf("W %d H %d \n", MenuSelectNewHeroW, MenuSelectNewHeroH);
SDL_RenderCopy(renderer, MenuSelectNewHeroTexture, &MenuSelectNewHeroTRect, &MenuSelectNewHeroWRect);
SDL_RenderCopy(renderer, DiablologoAnimT, &textureRect, &windowRect);
SDL_RenderCopy(renderer, CursorTexture, NULL, &CusorLocation);
//SDL_RenderPresent(renderer);
// SDL_RenderPresent(renderer);
}
void LoadFont() {
char LDirectory[FILENAME_MAX];
GetCurrentDir(LDirectory, FILENAME_MAX);
char * filename = "/fonts/Exocet.ttf";
strcat(LDirectory, filename);
void LoadFont()
{
GetWorkingLocationOfFile("/fonts/Exocet.ttf");
font = FC_CreateFont();
FC_LoadFont(font, renderer, LDirectory, 30, FC_MakeColor(112, 106, 70, 255), TTF_STYLE_NORMAL);
FC_LoadFont(font, renderer, gLDirectory, 35, FC_MakeColor(112, 106, 70, 255), TTF_STYLE_NORMAL);
}
void LoadClickBoxes(int numberofchars) {
void LoadClickBoxes(int numberofchars)
{
SDL_Rect Charpos1;
Charpos1.x = -1;
Charpos1.y = -1;
@ -485,56 +383,121 @@ void LoadClickBoxes(int numberofchars) {
Charpos6.h = -1;
Charpos6.w = -1;
//The menu doesn't fit past 6 chars.
// The menu doesn't fit past 6 chars.
SDL_Rect Charpos7;
SDL_Rect Charpos8;
SDL_Rect Charpos9;
}
int LoadedFont = 0;
int TotalPlayers = 0;
void RenderCharNames() {
void RenderCharNames()
{
if (LoadedFont == 0) {
LoadFont();
LoadedFont = 1;
}
// SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
//X 355, Y 269
int x = 364;
// SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
// X 355, Y 269
int x = 340;
int y = 240;
TotalPlayers = 0;
TotalPlayers = 0;
for (int i = 0; i < 6; i++) {
if (hero_names[i][0] != 0) {
// Checking if section of array is empty.
//if array has something in this then draw name.
// Checking if section of array is empty.
// if array has something in this then draw name.
for (int j = 0; j < 32; j++) {
hero_names[i][j] = toupper(hero_names[i][j]);// making all the names uppercase...
hero_names[i][j] = toupper(hero_names[i][j]); // making all the names uppercase..
}
const char * name = hero_names[i]; // getting the index of the name and drawing it to screen
const char *name = hero_names[i]; // getting the index of the name and drawing it to screen
FC_Draw(font, renderer, x, y, name);
y += 30;
TotalPlayers++;
}
}
SDL_RenderPresent(renderer);
SDL_RenderPresent(renderer);
}
bool LoadCreateHeroDialogImages = 0;
SDL_Texture * CreateHeroDialogTextureW;
SDL_Texture * CreateHeroDialogTextureR;
SDL_Texture * CreateHeroDialogTextureS;
bool SorcerorCreateSelected = 0;
bool RogueCreateSelected = 0;
bool WarriorCreateSelected = 1;
void LoadCreateHeroDialogMenu(){
GetWorkingLocationOfFile("/Xresources/warriorcreate.bmp");
SDL_Surface *CreateHeroDialogSurface = IMG_Load(gLDirectory);
CreateHeroDialogTextureW = SDL_CreateTextureFromSurface(renderer, CreateHeroDialogSurface);
GetWorkingLocationOfFile("/Xresources/roguecreate.bmp");
CreateHeroDialogSurface = IMG_Load(gLDirectory);
CreateHeroDialogTextureR = SDL_CreateTextureFromSurface(renderer, CreateHeroDialogSurface);
GetWorkingLocationOfFile("/Xresources/sorcerorcreate.bmp");
CreateHeroDialogSurface = IMG_Load(gLDirectory);
CreateHeroDialogTextureS = SDL_CreateTextureFromSurface(renderer, CreateHeroDialogSurface);
LoadCreateHeroDialogImages = 1;
}
//Have this load the function above and then render it in the main menu.
//Cnacel box is also needed.
void CreateMenuDialogBox() {
RenderDiabloLogo();
int cx, cy;
SDL_GetMouseState(&cx, &cy);
CusorLocation.x = cx;
CusorLocation.y = cy;
CusorLocation.h = 29;
CusorLocation.w = 33;
if(LoadCreateHeroDialogImages == 0){
LoadCreateHeroDialogMenu();
}
SDL_Rect MenuSelectNewHeroWRect;
MenuSelectNewHeroWRect.x = 0;
MenuSelectNewHeroWRect.y = 140;
MenuSelectNewHeroWRect.w = 640;
MenuSelectNewHeroWRect.h = 350;
SDL_Rect MenuSelectNewHeroTRect;
MenuSelectNewHeroTRect.x = 0;
MenuSelectNewHeroTRect.y = 0;
MenuSelectNewHeroTRect.w = 907;
MenuSelectNewHeroTRect.h = 500;
if (WarriorCreateSelected){
SDL_RenderCopy(renderer, CreateHeroDialogTextureW, &MenuSelectNewHeroTRect, NULL);
// printf("WarriorCreateSelected\n");
}
if (RogueCreateSelected){
SDL_RenderCopy(renderer, CreateHeroDialogTextureR, &MenuSelectNewHeroTRect, NULL);
// printf("RogueCreateSelected\n");
}
if(SorcerorCreateSelected){
SDL_RenderCopy(renderer, CreateHeroDialogTextureS, &MenuSelectNewHeroTRect, NULL);
//printf("SorcerorCreateSelected\n");
}
SDL_RenderCopy(renderer, DiablologoAnimT, &textureRect, &windowRect);
SDL_RenderCopy(renderer, CursorTexture, NULL, &CusorLocation);
SDL_RenderPresent(renderer);
}
Loading…
Cancel
Save