Giter Site home page Giter Site logo

HD: World is not rendered about vangers HOT 15 OPEN

link2xt avatar link2xt commented on June 10, 2024
HD: World is not rendered

from vangers.

Comments (15)

link2xt avatar link2xt commented on June 10, 2024

On stderr there are warnings like this when going to the world:

Layout for view 0x58bb2a1dd450 is already done
Layout for view 0x58bb2a1dd3b0 is already done
Layout for view 0x58bb28143f00 is already done
Layout for view 0x58bb2ae7ab70 is already done
Layout for view 0x58bb2ac2ef70 is already done
Layout for view 0x58bb2ac2f0a0 is already done
Layout for view 0x58bb2a1c0200 is already done
Layout for view 0x58bb28db3690 is already done
Layout for view 0x58bb2ae92b20 is already done
Layout for view 0x58bb2ae929e0 is already done
Layout for view 0x58bb2ae928a0 is already done
Layout for view 0x58bb2ae85020 is already done
Layout for view 0x58bb2ae84ee0 is already done
Layout for view 0x58bb2ae84da0 is already done
Layout for view 0x58bb2ae92160 is already done
Layout for view 0x58bb2a1dd450 is already done
Layout for view 0x58bb2a1dd450 is already done
Layout for view 0x58bb2a1dd3b0 is already done
Layout for view 0x58bb2a1dd3b0 is already done
Layout for view 0x58bb28143f00 is already done
Layout for view 0x58bb28143f00 is already done
Layout for view 0x58bb2ae7ab70 is already done
Layout for view 0x58bb2ae7ab70 is already done

Full stdout log:

Set locale. Result:C
"VANGERS: One For The Road" by K-D Lab (SDL Version)
Release (ENG)
XGR_Screen::init
SDL_CreateWindowAndRenderer
SDL_Window created: 1280x720
Load and set icon
SDL_SetRenderDrawColor
SDL_RenderClear
SDL_RenderPresent
SDL_SetHint
XGR32_ScreenSurface = SDL_CreateRGBSurface
SDL_SetSurfacePalette
SDL_CreateTexture sdlTexture
SDL_ShowCursor
window show
window hidden
window show
window focus gained
Joystick not found
Set locale. Result:C
ScriptFile::load_bscriptresource/iscreen/oftr.scb file.
Start load decomp trees
XGR_Screen::set_resolution: 800, 600
XGR32_ScreenSurface = SDL_CreateRGBSurface
SDL_SetSurfacePalette
SDL_CreateTexture sdlTexture
XGR_Screen::set_resolution: 800, 600
Resolution didn't change
iScreenDispatcher::save_data
iScreenDispatcher::save_data
uniVangPrepare
ScriptFile::load_bscriptresource/actint/aci_hi.scb file.
ScriptFile::load_bscriptresource/actint/acs_low.scb file.
Warning: Bad seek in file.
Warning: XStream::seek applies when the end of the file reached. resource/bml/sign.fnt
DiagenDispatcher::init data/room.lst
Strange deltas clockDelta:7 Timer:1
Start load decomp trees
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
  WARNING: layout is already done
vrtMap::analyzeINI thechain/fostral/world.ini
Compressed format detected...
Get compressed tables for V_SIZE:16384
Start load decomp trees
PrepareLight
PalettePrepare
iGameMap::iGameMap
iGameMap::reset
vrtMap::analyzeINI thechain/fostral/world.ini
Compressed format detected...
Start load decomp trees
Strange deltas clockDelta:7 Timer:1
window focus lost
Exit!

from vangers.

link2xt avatar link2xt commented on June 10, 2024

I also built tag 2.0 (commit 60b4dec) with cherry-picked commit 99ba4e5. Same problem there.

from vangers.

link2xt avatar link2xt commented on June 10, 2024

Looking at the history, I suspect HD (#488) which got merged in a343f9b.
So I checked out da1a916 and avcodec fix:

$ git checkout da1a9162bae3221579b92eb580083e4731ac4215
$ git cherry-pick --no-commit 99ba4e5a1fa6da4ff40af36e2b3eb7b5ec526b65
$ git reset

And it works, map renders before HD PR:
1

Then I tested commit a343f9b, there map is black.

from vangers.

link2xt avatar link2xt commented on June 10, 2024

In fullscreen it is also broken.

from vangers.

link2xt avatar link2xt commented on June 10, 2024

World is rendered on the master branch (commit 22accbb) with this patch:

diff --git a/src/road.cpp b/src/road.cpp
index c0b5722..c12b2b0 100644
--- a/src/road.cpp
+++ b/src/road.cpp
@@ -2055,7 +2055,7 @@ void iGameMap::draw(int self)
                FirstDraw = 0;
 //2D Rendring in game.
 #ifdef ACTINT
-               XGR_Obj.set_2d_render_buffer();
+               XGR_Obj.set_default_render_buffer();
                //XGR_Obj.fill(2);
                if(GeneralSystemSkip) {
                        aScrDisp -> redraw();

But I don't understand what exactly this does, "fixed" it by trying to understand the code and changing random things.

from vangers.

link2xt avatar link2xt commented on June 10, 2024

Another patch that "fixes" the rendering of the world:

diff --git a/lib/xgraph/xgraph.cpp b/lib/xgraph/xgraph.cpp
index 9da17c0..4e0457e 100644
--- a/lib/xgraph/xgraph.cpp
+++ b/lib/xgraph/xgraph.cpp
@@ -865,7 +865,9 @@ void XGR_Screen::blitRgba(uint32_t *dstRgba, uint8_t *screenIndexes, uint32_t *s
 				*dstRgba = XGR32_PaletteCache[*screen2DIndexes];
 			} else if (((uint8_t*)screen2DRgba)[3] != 0) {
 				*dstRgba = *screen2DRgba;
-			} else {
+			}
+
+			if (*screenIndexes != 0) {
 				*dstRgba = XGR32_PaletteCache[*screenIndexes];
 			}

This makes default buffer take precedence over 2d buffer. The result is this:
1
Obviously broken (even cursor is not shown), but it shows that map is actually rendered into default buffer.

So apparently the problem is that 2D buffer is not "tranparent", but is black where the map should be.

from vangers.

link2xt avatar link2xt commented on June 10, 2024

Another change:

diff --git a/src/actint/actint.cpp b/src/actint/actint.cpp
index e984445..917080b 100644
--- a/src/actint/actint.cpp
+++ b/src/actint/actint.cpp
@@ -3300,7 +3300,7 @@ void actIntDispatcher::redraw(void)
 			}
 			break;
 	}
-	if(!(flags & AS_FULL_REDRAW)){
+	if(false && !(flags & AS_FULL_REDRAW)){
 		XGR_MouseObj.flags &= ~XGM_PROMPT_ACTIVE;
 		XGR_Obj.fill(0);
 		for(int i = 0; i < curIbs -> backs.size(); i++) {

With only this patch applied the result is this one:
1

So apparently somewhere within this if something draws non-transparent black background where the map should be.

from vangers.

link2xt avatar link2xt commented on June 10, 2024

I have tracked down the problem to this:

diff --git a/src/actint/actint.cpp b/src/actint/actint.cpp
index e984445..a42b7d3 100644
--- a/src/actint/actint.cpp
+++ b/src/actint/actint.cpp
@@ -3304,7 +3304,7 @@ void actIntDispatcher::redraw(void)
 		XGR_MouseObj.flags &= ~XGM_PROMPT_ACTIVE;
 		XGR_Obj.fill(0);
 		for(int i = 0; i < curIbs -> backs.size(); i++) {
-			curIbs -> backs[i] -> show(0);
+			//curIbs -> backs[i] -> show(0);
 		}
 		if(curMode == AS_INV_MODE && curMatrix && curMatrix -> back){
 			curMatrix -> back -> show();

With this change it looks like this:
1

So the problem is that background rendered into 2D buffer here is rendered without proper transparency.
bmlObject::show uses XGR_HIDDEN_FON flag but maybe it does not work as intended?

from vangers.

link2xt avatar link2xt commented on June 10, 2024

Here is another patch:

diff --git a/lib/xgraph/xgraph.cpp b/lib/xgraph/xgraph.cpp
index 9da17c0..578895c 100644
--- a/lib/xgraph/xgraph.cpp
+++ b/lib/xgraph/xgraph.cpp
@@ -446,7 +446,7 @@ void XGR_Screen::putspr(int x,int y,int sx,int sy,void* p,int mode)
 	} else {//Other
 		for(i = 0; i < _sy; i ++){
 			for(j = 0; j < _sx; j ++){
-				if(memBuf[j]){
+				if(memBuf[j] && memBuf[j] != 72){
 					scrBuf[j] = memBuf[j];
 				}
 			}

With this change it looks like this:
1

So it looks like the problem is that background images have 72 as the background color instead of 0.

I have printed curIbs -> backs[i] -> name and there are two items in curIbs -> backs, both pointing to resource/actint/800x600/screens/b600.bmp. So this is the image in question that has broken background.

chr(72) is the letter H and there are indeed a lot of them there in this file. Maybe it means "HIDDEN".

from vangers.

link2xt avatar link2xt commented on June 10, 2024

I made a fix: #641

from vangers.

caiiiycuk avatar caiiiycuk commented on June 10, 2024

That's strange. We built steam version from master and it works fine, isn't it @stalkerg ?

from vangers.

caiiiycuk avatar caiiiycuk commented on June 10, 2024

Prob, GOG resources is broken

from vangers.

stalkerg avatar stalkerg commented on June 10, 2024

Which exactly?

from vangers.

link2xt avatar link2xt commented on June 10, 2024

I am running version from GOG, vangers_1_45_44317.sh (sha256 a25e70fe7b1ace77d36968da8a5785b5d23ba1c76ec6b5db183e3d8792ad6c46).

Using this script to build and run (warning, it removes save files too):

#!/usr/bin/env bash
set -e
cmake -B build Vangers
cmake --build build -j2
rm -fr safe_place
mkdir safe_place
cp -r "$HOME/GOG Games/Vangers/game/data"/* safe_place
cp -r ./Vangers/data/resource safe_place

cp Vangers/data/actint/* safe_place/resource/actint/

cp build/src/vangers safe_place
cd safe_place
./vangers

Here is the version of the background that is full of H (72) where it should be transparent:

$ sha256sum resource/actint/800x600/screens/b600.bmp
e9e089597e2bb8cd5b65c55f4528d701a0bb545ef9c3c2b28a9bbff59d3555ea  resource/actint/800x600/screens/b600.bmp

Does steam use newer version of b600.bmp?

By the way Windows version on GOG is 1.46 and Linux version is 1.45. But steam version is probably 2.0?

So GOG version is outdated compared to Steam and its resources cannot be used? Is there a plan to upload 2.0 to GOG?

Also would be nice if you publish sha256sum of all game files so it can be checked that the latest versions of resources are used.

from vangers.

stalkerg avatar stalkerg commented on June 10, 2024

@link2xt hello, sorry for the long response, probably we did this changes during HD remastering, in that case we should put all changes into this repo.
We will start discussion.

from vangers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.